Audacity  3.0.3
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AdornedRulerPanel Class Referencefinal

This is an Audacity Specific ruler panel which additionally has border, selection markers, play marker. More...

#include <AdornedRulerPanel.h>

Inheritance diagram for AdornedRulerPanel:
[legend]
Collaboration diagram for AdornedRulerPanel:
[legend]

Classes

class  CommonCell
 
class  CommonRulerHandle
 
struct  MainGroup
 
class  PlayRegionAdjustingHandle
 
class  QPCell
 
struct  Resetter
 
class  ScrubbingCell
 
class  ScrubbingHandle
 
class  ScrubbingRulerOverlay
 
struct  Subgroup
 
class  TrackPanelGuidelineOverlay
 

Public Member Functions

 AdornedRulerPanel (AudacityProject *project, wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, ViewInfo *viewinfo=NULL)
 
 ~AdornedRulerPanel ()
 
void Refresh (bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
 
bool AcceptsFocus () const override
 
bool AcceptsFocusFromKeyboard () const override
 
void SetFocusFromKbd () override
 
int GetRulerHeight ()
 
wxRect GetInnerRect () const
 
void SetLeftOffset (int offset)
 
void DrawSelection ()
 
void SetPlayRegion (double playRegionStart, double playRegionEnd)
 
void ClearPlayRegion ()
 
void TogglePinnedHead ()
 
void GetMaxSize (wxCoord *width, wxCoord *height)
 
void InvalidateRuler ()
 
void UpdatePrefs () override
 
void ReCreateButtons ()
 
void UpdateQuickPlayPos (wxCoord &mousePosX, bool shiftDown)
 
bool ShowingScrubRuler () const
 
bool SetPanelSize ()
 
void DrawBothOverlays ()
 
void DoDrawScrubIndicator (wxDC *dc, wxCoord xx, int width, bool scrub, bool seek)
 
void UpdateButtonStates ()
 
AudacityProjectGetProject () const override
 
- Public Member Functions inherited from CellularPanel
 CellularPanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, ViewInfo *viewInfo, long style=wxTAB_TRAVERSAL|wxNO_BORDER)
 
 ~CellularPanel () override
 
void Visit (Visitor &visitor)
 
void VisitCells (const SimpleCellVisitor &visitor)
 
void VisitPreorder (const SimpleNodeVisitor &visitor)
 
void VisitPostorder (const SimpleNodeVisitor &visitor)
 
FoundCell FindCell (int mouseX, int mouseY)
 
wxRect FindRect (const TrackPanelCell &cell)
 
wxRect FindRect (const std::function< bool(TrackPanelNode &) > &pred)
 
UIHandlePtr Target ()
 
std::shared_ptr< TrackPanelCellLastCell () const
 
bool IsMouseCaptured ()
 Determines if a modal tool is active. More...
 
wxCoord MostRecentXCoord () const
 
void HandleCursorForPresentMouseState (bool doHit=true)
 
void Draw (TrackPanelDrawingContext &context, unsigned nPasses)
 
- Public Member Functions inherited from OverlayPanel
 OverlayPanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style=wxTAB_TRAVERSAL|wxNO_BORDER)
 
void AddOverlay (const std::weak_ptr< Overlay > &pOverlay)
 
void ClearOverlays ()
 
void DrawOverlays (bool repaint_all, wxDC *pDC=nullptr)
 
- Public Member Functions inherited from BackedPanel
 BackedPanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style)
 
 ~BackedPanel ()
 
wxDC & GetBackingDC ()
 
wxDC & GetBackingDCForRepaint ()
 
void ResizeBacking ()
 
void RepairBitmap (wxDC &dc, wxCoord x, wxCoord y, wxCoord width, wxCoord height)
 
void DisplayBitmap (wxDC &dc)
 
void OnSize (wxSizeEvent &event)
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
void SetLabel (const TranslatableString &label)
 
void SetName (const TranslatableString &name)
 
void SetToolTip (const TranslatableString &toolTip)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Static Public Member Functions

static AdornedRulerPanelGet (AudacityProject &project)
 
static const AdornedRulerPanelGet (const AudacityProject &project)
 
static void Destroy (AudacityProject &project)
 
static int GetRulerHeight (bool showScrubBar)
 
static TempAllowFocus TemporarilyAllowFocus ()
 

Private Types

enum  MenuChoice { MenuChoice::QuickPlay, MenuChoice::Scrub }
 
enum  MouseEventState {
  mesNone, mesDraggingPlayRegionStart, mesDraggingPlayRegionEnd, mesSelectingPlayRegionClick,
  mesSelectingPlayRegionRange
}
 
using TempAllowFocus = std::unique_ptr< bool, Resetter >
 

Private Member Functions

void DoIdle ()
 
void OnIdle (wxIdleEvent &evt)
 
void OnAudioStartStop (wxCommandEvent &evt)
 
void OnPaint (wxPaintEvent &evt)
 
void OnSize (wxSizeEvent &evt)
 
void OnThemeChange (wxCommandEvent &evt)
 
void OnSelectionChange (SelectedRegionEvent &evt)
 
void DoSelectionChange (const SelectedRegion &selectedRegion)
 
bool UpdateRects ()
 
void HandleQPClick (wxMouseEvent &event, wxCoord mousePosX)
 
void HandleQPDrag (wxMouseEvent &event, wxCoord mousePosX)
 
void HandleQPRelease (wxMouseEvent &event)
 
void StartQPPlay (bool looped, bool cutPreview)
 
void DoDrawBackground (wxDC *dc)
 
void DoDrawEdge (wxDC *dc)
 
void DoDrawMarks (wxDC *dc, bool)
 
void DoDrawPlayRegion (wxDC *dc)
 
void ShowContextMenu (MenuChoice choice, const wxPoint *pPosition)
 
double Pos2Time (int p, bool ignoreFisheye=false)
 
int Time2Pos (double t, bool ignoreFisheye=false)
 
bool IsWithinMarker (int mousePosX, double markerTime)
 
void ShowMenu (const wxPoint &pos)
 
void ShowScrubMenu (const wxPoint &pos)
 
void DragSelection ()
 
void HandleSnapping ()
 
void OnSyncSelToQuickPlay (wxCommandEvent &evt)
 
void OnAutoScroll (wxCommandEvent &evt)
 
void OnTogglePlayRegion (wxCommandEvent &evt)
 
void OnClearPlayRegion (wxCommandEvent &evt)
 
void OnSetPlayRegionToSelection (wxCommandEvent &evt)
 
void OnPinnedButton (wxCommandEvent &event)
 
void OnTogglePinnedState (wxCommandEvent &event)
 
std::shared_ptr< TrackPanelNodeRoot () override
 
TrackPanelCellGetFocusedCell () override
 
void SetFocusedCell () override
 
void ProcessUIHandleResult (TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell, unsigned refreshResult) override
 
void UpdateStatusMessage (const TranslatableString &) override
 
void CreateOverlays ()
 
- Private Member Functions inherited from PrefsListener
 PrefsListener ()
 
virtual ~PrefsListener ()
 
virtual void UpdateSelectedPrefs (int id)
 

Private Attributes

Ruler mRuler
 
AudacityProject *const mProject
 
TrackListmTracks
 
wxRect mOuter
 
wxRect mScrubZone
 
wxRect mInner
 
int mLeftOffset
 
double mIndTime
 
double mQuickPlayPosUnsnapped
 
double mQuickPlayPos
 
bool mIsSnapped
 
PlayRegion mOldPlayRegion
 
bool mIsRecording
 
bool mPlayRegionDragsSelection
 
bool mTimelineToolTip
 
MouseEventState mMouseEventState
 
double mLeftDownClickUnsnapped
 
double mLeftDownClick
 
bool mIsDragging
 
wxWindow * mButtons [3]
 
bool mNeedButtonUpdate { true }
 
std::shared_ptr< TrackPanelGuidelineOverlaymOverlay
 
std::shared_ptr< QPCellmQPCell
 
std::shared_ptr< ScrubbingCellmScrubbingCell
 
std::pair< double, double > mLastDrawnPlayRegion {}
 
bool mLastPlayRegionActive = false
 
double mLastDrawnH {}
 
double mLastDrawnZoom {}
 
bool mDirtyPlayRegion {}
 

Static Private Attributes

static bool s_AcceptsFocus { false }
 

Additional Inherited Members

- Public Types inherited from CellularPanel
using SimpleCellVisitor = std::function< void(const wxRect &rect, TrackPanelCell &cell) >
 
using SimpleNodeVisitor = std::function< void(const wxRect &rect, TrackPanelNode &node) >
 
- Protected Member Functions inherited from CellularPanel
bool HasEscape ()
 
bool CancelDragging (bool escaping)
 
void DoContextMenu (TrackPanelCell *pCell=nullptr)
 
void ClearTargets ()
 
- Protected Attributes inherited from CellularPanel
ViewInfomViewInfo
 
wxMouseState mLastMouseState
 
- Static Private Member Functions inherited from PrefsListener
static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 

Detailed Description

This is an Audacity Specific ruler panel which additionally has border, selection markers, play marker.

Once TrackPanel uses wxSizers, we will derive it from some wxWindow and the GetSize and SetSize functions will then be wxWidgets functions instead.

Definition at line 24 of file AdornedRulerPanel.h.

Member Typedef Documentation

◆ TempAllowFocus

using AdornedRulerPanel::TempAllowFocus = std::unique_ptr<bool, Resetter>
private

Definition at line 106 of file AdornedRulerPanel.h.

Member Enumeration Documentation

◆ MenuChoice

enum AdornedRulerPanel::MenuChoice
strongprivate
Enumerator
QuickPlay 
Scrub 

Definition at line 112 of file AdornedRulerPanel.h.

112 { QuickPlay, Scrub };

◆ MouseEventState

Enumerator
mesNone 
mesDraggingPlayRegionStart 
mesDraggingPlayRegionEnd 
mesSelectingPlayRegionClick 
mesSelectingPlayRegionRange 

Definition at line 163 of file AdornedRulerPanel.h.

Constructor & Destructor Documentation

◆ AdornedRulerPanel()

AdornedRulerPanel::AdornedRulerPanel ( AudacityProject project,
wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
ViewInfo viewinfo = NULL 
)

Definition at line 919 of file AdornedRulerPanel.cpp.

925 : CellularPanel(parent, id, pos, size, viewinfo)
926 , mProject(project)
927 {
928  SetLayoutDirection(wxLayout_LeftToRight);
929 
930  mQPCell = std::make_shared<QPCell>( this );
931  mScrubbingCell = std::make_shared<ScrubbingCell>( this );
932 
933  for (auto &button : mButtons)
934  button = nullptr;
935 
936  SetLabel( XO("Timeline") );
937  SetName();
938  SetBackgroundStyle(wxBG_STYLE_PAINT);
939 
940  mLeftOffset = 0;
941  mIndTime = -1;
942 
943  mLeftDownClick = -1;
945  mIsDragging = false;
946 
947  mOuter = GetClientRect();
948 
950  mRuler.SetLabelEdges( false );
952 
953  mTracks = &TrackList::Get( *project );
954 
955  mIsSnapped = false;
956 
957  mIsRecording = false;
958 
959  mTimelineToolTip = !!gPrefs->Read(wxT("/QuickPlay/ToolTips"), 1L);
960  mPlayRegionDragsSelection = (gPrefs->Read(wxT("/QuickPlay/DragSelection"), 0L) == 1)? true : false;
961 
962 #if wxUSE_TOOLTIPS
963  wxToolTip::Enable(true);
964 #endif
965 
966  wxTheApp->Bind(EVT_AUDIOIO_CAPTURE,
968  this);
969  wxTheApp->Bind(EVT_AUDIOIO_PLAYBACK,
971  this);
972 
973  // Delay until after CommandManager has been populated:
975 
976  wxTheApp->Bind(EVT_THEME_CHANGE, &AdornedRulerPanel::OnThemeChange, this);
977 
978  // Bind event that updates the play region
979  mViewInfo->selectedRegion.Bind(EVT_SELECTED_REGION_CHANGE,
981 
982  // And call it once to initialize it
984 }

References BasicUI::CallAfter(), DoSelectionChange(), TrackList::Get(), gPrefs, mButtons, mesNone, mIndTime, mIsDragging, mIsRecording, mIsSnapped, mLeftDownClick, mLeftOffset, mMouseEventState, mOuter, mPlayRegionDragsSelection, mQPCell, mRuler, mScrubbingCell, mTimelineToolTip, mTracks, CellularPanel::mViewInfo, OnAudioStartStop(), OnSelectionChange(), OnThemeChange(), ViewInfo::selectedRegion, Ruler::SetFormat(), wxPanelWrapper::SetLabel(), Ruler::SetLabelEdges(), wxPanelWrapper::SetName(), Ruler::SetUseZoomInfo(), Ruler::TimeFormat, UpdatePrefs(), and XO.

Here is the call graph for this function:

◆ ~AdornedRulerPanel()

AdornedRulerPanel::~AdornedRulerPanel ( )

Definition at line 986 of file AdornedRulerPanel.cpp.

987 {
988 }

Member Function Documentation

◆ AcceptsFocus()

bool AdornedRulerPanel::AcceptsFocus ( ) const
inlineoverride

Definition at line 46 of file AdornedRulerPanel.h.

46 { return s_AcceptsFocus; }

◆ AcceptsFocusFromKeyboard()

bool AdornedRulerPanel::AcceptsFocusFromKeyboard ( ) const
inlineoverride

Definition at line 47 of file AdornedRulerPanel.h.

47 { return true; }

◆ ClearPlayRegion()

void AdornedRulerPanel::ClearPlayRegion ( )

Definition at line 2215 of file AdornedRulerPanel.cpp.

2216 {
2217  ProjectAudioManager::Get( *mProject ).Stop();
2218 
2219  auto &viewInfo = ViewInfo::Get( *GetProject() );
2220  auto &playRegion = viewInfo.playRegion;
2221  playRegion.SetTimes( -1, -1 );
2222 
2223  Refresh();
2224 }

References ViewInfo::Get(), ProjectAudioManager::Get(), GetProject(), Refresh(), and ProjectAudioManager::Stop().

Here is the call graph for this function:

◆ CreateOverlays()

void AdornedRulerPanel::CreateOverlays ( )
private

Definition at line 2320 of file AdornedRulerPanel.cpp.

2321 {
2322  if (!mOverlay) {
2323  mOverlay =
2324  std::make_shared<TrackPanelGuidelineOverlay>( mProject );
2325  auto pCellularPanel =
2326  dynamic_cast<CellularPanel*>( &GetProjectPanel( *GetProject() ) );
2327  if ( !pCellularPanel ) {
2328  wxASSERT( false );
2329  }
2330  else
2331  pCellularPanel->AddOverlay( mOverlay );
2332  this->AddOverlay( mOverlay->mPartner );
2333  }
2334 }

References OverlayPanel::AddOverlay(), GetProject(), GetProjectPanel(), mOverlay, and mProject.

Here is the call graph for this function:

◆ Destroy()

void AdornedRulerPanel::Destroy ( AudacityProject project)
static

Definition at line 910 of file AdornedRulerPanel.cpp.

911 {
912  auto *pPanel = GetAttachedWindows(project).Find( sKey );
913  if (pPanel) {
914  pPanel->wxWindow::Destroy();
915  GetAttachedWindows(project).Assign( sKey, nullptr );
916  }
917 }

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Assign(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Find(), GetAttachedWindows(), and sKey.

Referenced by ProjectManager::OnCloseWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoDrawBackground()

void AdornedRulerPanel::DoDrawBackground ( wxDC *  dc)
private

Definition at line 2023 of file AdornedRulerPanel.cpp.

2024 {
2025  // Draw AdornedRulerPanel border
2026  AColor::UseThemeColour( dc, clrTrackInfo );
2027  dc->DrawRectangle( mInner );
2028 
2029  if (ShowingScrubRuler()) {
2030  // Let's distinguish the scrubbing area by using a themable
2031  // colour and a line to set it off.
2032  AColor::UseThemeColour(dc, clrScrubRuler, clrTrackPanelText );
2033  wxRect ScrubRect = mScrubZone;
2034  ScrubRect.Inflate( 1,0 );
2035  dc->DrawRectangle(ScrubRect);
2036  }
2037 }

References mInner, mScrubZone, ShowingScrubRuler(), and AColor::UseThemeColour().

Referenced by OnPaint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoDrawEdge()

void AdornedRulerPanel::DoDrawEdge ( wxDC *  dc)
private

Definition at line 2039 of file AdornedRulerPanel.cpp.

2040 {
2041  wxRect r = mOuter;
2042  r.width -= RightMargin;
2043  r.height -= BottomMargin;
2044  AColor::BevelTrackInfo( *dc, true, r );
2045 
2046  // Black stroke at bottom
2047  dc->SetPen( *wxBLACK_PEN );
2048  AColor::Line( *dc, mOuter.x,
2049  mOuter.y + mOuter.height - 1,
2050  mOuter.x + mOuter.width - 1 ,
2051  mOuter.y + mOuter.height - 1 );
2052 }

References AColor::BevelTrackInfo(), BottomMargin, AColor::Line(), mOuter, and RightMargin.

Referenced by OnPaint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoDrawMarks()

void AdornedRulerPanel::DoDrawMarks ( wxDC *  dc,
bool   
)
private

Definition at line 2054 of file AdornedRulerPanel.cpp.

2055 {
2056  const double min = Pos2Time(0);
2057  const double hiddenMin = Pos2Time(0, true);
2058  const double max = Pos2Time(mInner.width);
2059  const double hiddenMax = Pos2Time(mInner.width, true);
2060 
2061  mRuler.SetTickColour( theTheme.Colour( clrTrackPanelText ) );
2062  mRuler.SetRange( min, max, hiddenMin, hiddenMax );
2063  mRuler.Draw( *dc );
2064 }

References ThemeBase::Colour(), Ruler::Draw(), min(), mInner, mRuler, Pos2Time(), Ruler::SetRange(), Ruler::SetTickColour(), and theTheme.

Referenced by OnPaint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoDrawPlayRegion()

void AdornedRulerPanel::DoDrawPlayRegion ( wxDC *  dc)
private

Definition at line 2071 of file AdornedRulerPanel.cpp.

2072 {
2073  const auto &viewInfo = ViewInfo::Get(*mProject);
2074  const auto &playRegion = viewInfo.playRegion;
2075  bool isActive = (mLastPlayRegionActive = playRegion.Active());
2076 
2077  const auto t0 = playRegion.GetLastActiveStart(),
2078  t1 = playRegion.GetLastActiveEnd();
2079  if (t0 < 0 || t1 < 0)
2080  // play region is cleared, that is undefined
2081  return;
2082 
2083  const int p0 = max(1, Time2Pos(t0));
2084  const int p1 = min(mInner.width, Time2Pos(t1));
2085 
2086  // Paint the selected region bolder if independently varying, else dim
2087  const auto color =
2088  isActive ? clrRulerBackground : clrClipAffordanceInactiveBrush;
2089  dc->SetBrush( wxBrush( theTheme.Colour( color )) );
2090  dc->SetPen( wxPen( theTheme.Colour( color )) );
2091 
2092  const int left = p0, top = mInner.y, right = p1, bottom = mInner.GetBottom();
2093  dc->DrawRectangle( { wxPoint{left, top}, wxPoint{right, bottom} } );
2094 
2095  {
2096  // Color the edges of the play region like the ticks and numbers
2097  ADCChanger cleanup( dc );
2098  const auto edgeColour = theTheme.Colour(clrTrackPanelText);
2099  dc->SetPen( { edgeColour } );
2100  dc->SetBrush( { edgeColour } );
2101 
2102  constexpr int side = 7;
2103  constexpr int sideLessOne = side - 1;
2104 
2105  // Paint two shapes, each a line plus triangle at bottom
2106  {
2107  wxPoint points[]{
2108  {left, bottom - sideLessOne},
2109  {left - sideLessOne, bottom},
2110  {left, bottom},
2111  {left, top},
2112  };
2113  dc->DrawPolygon( 4, points );
2114  }
2115 
2116  {
2117  wxPoint points[]{
2118  {right, top},
2119  {right, bottom},
2120  {right + sideLessOne, bottom},
2121  {right, bottom - sideLessOne},
2122  };
2123  dc->DrawPolygon( 4, points );
2124  }
2125  }
2126 }

References ThemeBase::Colour(), ViewInfo::Get(), min(), mInner, mLastPlayRegionActive, mProject, theTheme, and Time2Pos().

Referenced by OnPaint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoDrawScrubIndicator()

void AdornedRulerPanel::DoDrawScrubIndicator ( wxDC *  dc,
wxCoord  xx,
int  width,
bool  scrub,
bool  seek 
)

Definition at line 2140 of file AdornedRulerPanel.cpp.

2142 {
2143  ADCChanger changer(dc); // Undo pen and brush changes at function exit
2144 
2145  wxPoint tri[ 3 ];
2146  if (seek) {
2147  auto height = IndicatorHeightForWidth(width);
2148  // Make four triangles
2149  const int TriangleWidth = width * 3 / 8;
2150 
2151  // Double-double headed, left-right
2152  auto yy = ShowingScrubRuler()
2153  ? mScrubZone.y
2154  : (mInner.GetBottom() + 1) - 1 /* bevel */ - height;
2155  tri[ 0 ].x = xx - IndicatorOffset;
2156  tri[ 0 ].y = yy;
2157  tri[ 1 ].x = xx - IndicatorOffset;
2158  tri[ 1 ].y = yy + height;
2159  tri[ 2 ].x = xx - TriangleWidth;
2160  tri[ 2 ].y = yy + height / 2;
2161  dc->DrawPolygon( 3, tri );
2162 
2163  tri[ 0 ].x -= TriangleWidth;
2164  tri[ 1 ].x -= TriangleWidth;
2165  tri[ 2 ].x -= TriangleWidth;
2166  dc->DrawPolygon( 3, tri );
2167 
2168  tri[ 0 ].x = tri[ 1 ].x = xx + IndicatorOffset;
2169  tri[ 2 ].x = xx + TriangleWidth;
2170  dc->DrawPolygon( 3, tri );
2171 
2172 
2173  tri[ 0 ].x += TriangleWidth;
2174  tri[ 1 ].x += TriangleWidth;
2175  tri[ 2 ].x += TriangleWidth;
2176  dc->DrawPolygon( 3, tri );
2177  }
2178  else if (scrub) {
2179  auto height = IndicatorHeightForWidth(width);
2180  const int IndicatorHalfWidth = width / 2;
2181 
2182  // Double headed, left-right
2183  auto yy = ShowingScrubRuler()
2184  ? mScrubZone.y
2185  : (mInner.GetBottom() + 1) - 1 /* bevel */ - height;
2186  tri[ 0 ].x = xx - IndicatorOffset;
2187  tri[ 0 ].y = yy;
2188  tri[ 1 ].x = xx - IndicatorOffset;
2189  tri[ 1 ].y = yy + height;
2190  tri[ 2 ].x = xx - IndicatorHalfWidth;
2191  tri[ 2 ].y = yy + height / 2;
2192  dc->DrawPolygon( 3, tri );
2193  tri[ 0 ].x = tri[ 1 ].x = xx + IndicatorOffset;
2194  tri[ 2 ].x = xx + IndicatorHalfWidth;
2195  dc->DrawPolygon( 3, tri );
2196  }
2197 }

References IndicatorHeightForWidth(), IndicatorOffset, mInner, mScrubZone, and ShowingScrubRuler().

Here is the call graph for this function:

◆ DoIdle()

void AdornedRulerPanel::DoIdle ( )
private

Definition at line 1173 of file AdornedRulerPanel.cpp.

1174 {
1175  bool changed = UpdateRects();
1176  changed = SetPanelSize() || changed;
1177 
1178  auto &project = *mProject;
1179  auto &viewInfo = ViewInfo::Get( project );
1180  const auto &playRegion = viewInfo.playRegion;
1181 
1182  bool dirtyPlayRegion = mDirtyPlayRegion
1183  || ( mLastDrawnPlayRegion != std::pair{
1184  playRegion.GetLastActiveStart(), playRegion.GetLastActiveEnd() } );
1185 
1186  changed = changed
1187  || dirtyPlayRegion
1188  || mLastDrawnH != viewInfo.h
1189  || mLastDrawnZoom != viewInfo.GetZoom()
1190  || mLastPlayRegionActive != viewInfo.playRegion.Active()
1191  ;
1192  if (changed)
1193  // Cause ruler redraw anyway, because we may be zooming or scrolling,
1194  // showing or hiding the scrub bar, etc.
1195  Refresh();
1196 
1197  mDirtyPlayRegion = false;
1198 }

References ViewInfo::Get(), mDirtyPlayRegion, mLastDrawnH, mLastDrawnPlayRegion, mLastDrawnZoom, mLastPlayRegionActive, mProject, Refresh(), SetPanelSize(), and UpdateRects().

Referenced by OnIdle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoSelectionChange()

void AdornedRulerPanel::DoSelectionChange ( const SelectedRegion selectedRegion)
private

Definition at line 1285 of file AdornedRulerPanel.cpp.

1287 {
1288 
1289  auto gAudioIO = AudioIOBase::Get();
1290  if ( !ViewInfo::Get( *mProject ).playRegion.Active() ) {
1291  // "Inactivated" play region follows the selection.
1292  SetPlayRegion( selectedRegion.t0(), selectedRegion.t1() );
1293  }
1294 }

References PlayRegion::Active(), AudioIOBase::Get(), ViewInfo::Get(), ViewInfo::playRegion, SetPlayRegion(), SelectedRegion::t0(), and SelectedRegion::t1().

Referenced by AdornedRulerPanel(), OnAudioStartStop(), and OnSelectionChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DragSelection()

void AdornedRulerPanel::DragSelection ( )
private

Definition at line 1932 of file AdornedRulerPanel.cpp.

1933 {
1934  auto &viewInfo = ViewInfo::Get( *GetProject() );
1935  const auto &playRegion = viewInfo.playRegion;
1936  auto &selectedRegion = viewInfo.selectedRegion;
1937  selectedRegion.setT0(playRegion.GetStart(), false);
1938  selectedRegion.setT1(playRegion.GetEnd(), true);
1939 }

References ViewInfo::Get(), and GetProject().

Here is the call graph for this function:

◆ DrawBothOverlays()

void AdornedRulerPanel::DrawBothOverlays ( )

Definition at line 1797 of file AdornedRulerPanel.cpp.

1798 {
1799  auto pCellularPanel =
1800  dynamic_cast<CellularPanel*>( &GetProjectPanel( *GetProject() ) );
1801  if ( !pCellularPanel ) {
1802  wxASSERT( false );
1803  }
1804  else
1805  pCellularPanel->DrawOverlays( false );
1806  DrawOverlays( false );
1807 }

References OverlayPanel::DrawOverlays(), GetProject(), and GetProjectPanel().

Referenced by ProcessUIHandleResult().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DrawSelection()

void AdornedRulerPanel::DrawSelection ( )

Definition at line 2066 of file AdornedRulerPanel.cpp.

2067 {
2068  Refresh();
2069 }

References Refresh().

Referenced by TrackPanel::UpdateSelectionDisplay().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [1/2]

AdornedRulerPanel & AdornedRulerPanel::Get ( AudacityProject project)
static

◆ Get() [2/2]

const AdornedRulerPanel & AdornedRulerPanel::Get ( const AudacityProject project)
static

Definition at line 904 of file AdornedRulerPanel.cpp.

906 {
907  return Get( const_cast< AudacityProject & >( project ) );
908 }

References Get().

Here is the call graph for this function:

◆ GetFocusedCell()

TrackPanelCell * AdornedRulerPanel::GetFocusedCell ( )
overrideprivatevirtual

Implements CellularPanel.

Definition at line 2296 of file AdornedRulerPanel.cpp.

2297 {
2298  // No switching of focus yet to the other, scrub zone
2299  return mQPCell.get();
2300 }

References mQPCell.

◆ GetInnerRect()

wxRect AdornedRulerPanel::GetInnerRect ( ) const
inline

Definition at line 53 of file AdornedRulerPanel.h.

53 { return mInner; }

Referenced by anonymous_namespace{PlayIndicatorOverlay.cpp}::GetIndicatorBitmap().

Here is the caller graph for this function:

◆ GetMaxSize()

void AdornedRulerPanel::GetMaxSize ( wxCoord *  width,
wxCoord *  height 
)

Definition at line 2226 of file AdornedRulerPanel.cpp.

2227 {
2228  mRuler.GetMaxSize(width, height);
2229 }

References Ruler::GetMaxSize(), and mRuler.

Here is the call graph for this function:

◆ GetProject()

AudacityProject * AdornedRulerPanel::GetProject ( ) const
overridevirtual

Implements CellularPanel.

Definition at line 2290 of file AdornedRulerPanel.cpp.

2291 {
2292  return mProject;
2293 }

References mProject.

Referenced by ClearPlayRegion(), CreateOverlays(), DragSelection(), DrawBothOverlays(), HandleSnapping(), OnPaint(), SetPlayRegion(), ShowingScrubRuler(), ShowMenu(), and UpdateStatusMessage().

Here is the caller graph for this function:

◆ GetRulerHeight() [1/2]

int AdornedRulerPanel::GetRulerHeight ( )
inline

Definition at line 51 of file AdornedRulerPanel.h.

51 { return GetRulerHeight( ShowingScrubRuler() ); }

References GetRulerHeight().

Referenced by ScreenshotCommand::GetPanelRect(), GetRulerHeight(), ReCreateButtons(), and SetPanelSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRulerHeight() [2/2]

int AdornedRulerPanel::GetRulerHeight ( bool  showScrubBar)
static

Definition at line 2128 of file AdornedRulerPanel.cpp.

2129 {
2130  return ProperRulerHeight + (showScrubBar ? ScrubHeight : 0);
2131 }

References ProperRulerHeight, and ScrubHeight.

◆ HandleQPClick()

void AdornedRulerPanel::HandleQPClick ( wxMouseEvent &  event,
wxCoord  mousePosX 
)
private

◆ HandleQPDrag()

void AdornedRulerPanel::HandleQPDrag ( wxMouseEvent &  event,
wxCoord  mousePosX 
)
private

◆ HandleQPRelease()

void AdornedRulerPanel::HandleQPRelease ( wxMouseEvent &  event)
private

◆ HandleSnapping()

void AdornedRulerPanel::HandleSnapping ( )
private

Definition at line 1941 of file AdornedRulerPanel.cpp.

1942 {
1943  // Play region dragging can snap to selection boundaries
1944  const auto &selectedRegion = ViewInfo::Get(*GetProject()).selectedRegion;
1945  SnapManager snapManager{ *mProject, *mTracks, *mViewInfo, {
1946  SnapPoint{ selectedRegion.t0() },
1947  SnapPoint{ selectedRegion.t1() },
1948  } };
1949  auto results = snapManager.Snap(NULL, mQuickPlayPos, false);
1950  mQuickPlayPos = results.outTime;
1951  mIsSnapped = results.Snapped();
1952 }

References ViewInfo::Get(), GetProject(), mIsSnapped, mProject, mQuickPlayPos, mTracks, CellularPanel::mViewInfo, and ViewInfo::selectedRegion.

Referenced by UpdateQuickPlayPos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InvalidateRuler()

void AdornedRulerPanel::InvalidateRuler ( )

Definition at line 1096 of file AdornedRulerPanel.cpp.

1097 {
1098  mRuler.Invalidate();
1099 }

References Ruler::Invalidate(), and mRuler.

Here is the call graph for this function:

◆ IsWithinMarker()

bool AdornedRulerPanel::IsWithinMarker ( int  mousePosX,
double  markerTime 
)
private

Definition at line 1363 of file AdornedRulerPanel.cpp.

1364 {
1365  if (markerTime < 0)
1366  return false;
1367 
1368  int pixelPos = Time2Pos(markerTime);
1369  int boundLeft = pixelPos - SELECT_TOLERANCE_PIXEL;
1370  int boundRight = pixelPos + SELECT_TOLERANCE_PIXEL;
1371 
1372  return mousePosX >= boundLeft && mousePosX < boundRight;
1373 }

References SELECT_TOLERANCE_PIXEL, and Time2Pos().

Here is the call graph for this function:

◆ OnAudioStartStop()

void AdornedRulerPanel::OnAudioStartStop ( wxCommandEvent &  evt)
private

Definition at line 1200 of file AdornedRulerPanel.cpp.

1201 {
1202  evt.Skip();
1203 
1204  if ( evt.GetEventType() == EVT_AUDIOIO_CAPTURE ) {
1205  if (evt.GetInt() != 0)
1206  {
1207  mIsRecording = true;
1208  this->CellularPanel::CancelDragging( false );
1210 
1212  }
1213  else {
1214  mIsRecording = false;
1216  }
1217  }
1218 
1219  if ( evt.GetInt() == 0 )
1220  // So that the play region is updated
1222 }

References CellularPanel::CancelDragging(), CellularPanel::ClearTargets(), DoSelectionChange(), mIsRecording, CellularPanel::mViewInfo, ViewInfo::selectedRegion, and UpdateButtonStates().

Referenced by AdornedRulerPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnAutoScroll()

void AdornedRulerPanel::OnAutoScroll ( wxCommandEvent &  evt)
private

Definition at line 1963 of file AdornedRulerPanel.cpp.

1964 {
1966  gPrefs->Write(wxT("/GUI/AutoScroll"), false);
1967  else
1968  gPrefs->Write(wxT("/GUI/AutoScroll"), true);
1969 
1970  gPrefs->Flush();
1971 
1973 }

References PrefsListener::Broadcast(), ViewInfo::bUpdateTrackIndicator, FileConfig::Flush(), gPrefs, CellularPanel::mViewInfo, and ViewInfo::UpdateScrollPrefsID().

Here is the call graph for this function:

◆ OnClearPlayRegion()

void AdornedRulerPanel::OnClearPlayRegion ( wxCommandEvent &  evt)
private

Definition at line 1981 of file AdornedRulerPanel.cpp.

1982 {
1984 }

References SelectUtilities::ClearPlayRegion(), and mProject.

Here is the call graph for this function:

◆ OnIdle()

void AdornedRulerPanel::OnIdle ( wxIdleEvent &  evt)
private

Definition at line 1167 of file AdornedRulerPanel.cpp.

1168 {
1169  evt.Skip();
1170  DoIdle();
1171 }

References DoIdle().

Here is the call graph for this function:

◆ OnPaint()

void AdornedRulerPanel::OnPaint ( wxPaintEvent &  evt)
private

Definition at line 1224 of file AdornedRulerPanel.cpp.

1225 {
1226  const auto &viewInfo = ViewInfo::Get( *GetProject() );
1227  const auto &playRegion = viewInfo.playRegion;
1228  const auto playRegionBounds = std::pair{
1229  playRegion.GetLastActiveStart(), playRegion.GetLastActiveEnd() };
1230  mLastDrawnH = viewInfo.h;
1231  mLastDrawnZoom = viewInfo.GetZoom();
1232  mDirtyPlayRegion = (mLastDrawnPlayRegion != playRegionBounds);
1233  mLastDrawnPlayRegion = playRegionBounds;
1234  // To do, note other fisheye state when we have that
1235 
1236  wxPaintDC dc(this);
1237 
1238  auto &backDC = GetBackingDCForRepaint();
1239 
1240  DoDrawBackground(&backDC);
1241 
1242  DoDrawPlayRegion(&backDC);
1243 
1244  DoDrawMarks(&backDC, true);
1245 
1246  DoDrawEdge(&backDC);
1247 
1248  DisplayBitmap(dc);
1249 
1250  // Stroke extras direct to the client area,
1251  // maybe outside of the damaged area
1252  // As with TrackPanel, do not make a NEW wxClientDC or else Mac flashes badly!
1253  dc.DestroyClippingRegion();
1254  DrawOverlays(true, &dc);
1255 }

References BackedPanel::DisplayBitmap(), DoDrawBackground(), DoDrawEdge(), DoDrawMarks(), DoDrawPlayRegion(), OverlayPanel::DrawOverlays(), ViewInfo::Get(), BackedPanel::GetBackingDCForRepaint(), GetProject(), mDirtyPlayRegion, mLastDrawnH, mLastDrawnPlayRegion, and mLastDrawnZoom.

Here is the call graph for this function:

◆ OnPinnedButton()

void AdornedRulerPanel::OnPinnedButton ( wxCommandEvent &  event)
private

Definition at line 1839 of file AdornedRulerPanel.cpp.

1840 {
1842 }

References QuickPlay, and ShowContextMenu().

Here is the call graph for this function:

◆ OnSelectionChange()

void AdornedRulerPanel::OnSelectionChange ( SelectedRegionEvent evt)
private

Definition at line 1276 of file AdornedRulerPanel.cpp.

1277 {
1278  evt.Skip();
1279  if (!evt.pRegion)
1280  return;
1281  auto &selectedRegion = *evt.pRegion;
1282  DoSelectionChange( selectedRegion );
1283 }

References DoSelectionChange(), and SelectedRegionEvent::pRegion.

Referenced by AdornedRulerPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnSetPlayRegionToSelection()

void AdornedRulerPanel::OnSetPlayRegionToSelection ( wxCommandEvent &  evt)
private

Definition at line 1986 of file AdornedRulerPanel.cpp.

References mProject, and SelectUtilities::SetPlayRegionToSelection().

Here is the call graph for this function:

◆ OnSize()

void AdornedRulerPanel::OnSize ( wxSizeEvent &  evt)
private

Definition at line 1257 of file AdornedRulerPanel.cpp.

1258 {
1259  mOuter = GetClientRect();
1260  if (mOuter.GetWidth() == 0 || mOuter.GetHeight() == 0)
1261  {
1262  return;
1263  }
1264 
1265  UpdateRects();
1266 
1267  OverlayPanel::OnSize(evt);
1268 }

References mOuter, BackedPanel::OnSize(), and UpdateRects().

Here is the call graph for this function:

◆ OnSyncSelToQuickPlay()

void AdornedRulerPanel::OnSyncSelToQuickPlay ( wxCommandEvent &  evt)
private

Definition at line 1925 of file AdornedRulerPanel.cpp.

1926 {
1928  gPrefs->Write(wxT("/QuickPlay/DragSelection"), mPlayRegionDragsSelection);
1929  gPrefs->Flush();
1930 }

References FileConfig::Flush(), gPrefs, and mPlayRegionDragsSelection.

Here is the call graph for this function:

◆ OnThemeChange()

void AdornedRulerPanel::OnThemeChange ( wxCommandEvent &  evt)
private

Definition at line 1270 of file AdornedRulerPanel.cpp.

1271 {
1272  evt.Skip();
1273  ReCreateButtons();
1274 }

References ReCreateButtons().

Referenced by AdornedRulerPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnTogglePinnedState()

void AdornedRulerPanel::OnTogglePinnedState ( wxCommandEvent &  event)
private

Definition at line 1844 of file AdornedRulerPanel.cpp.

1845 {
1846  TogglePinnedHead();
1848 }

References TogglePinnedHead(), and UpdateButtonStates().

Here is the call graph for this function:

◆ OnTogglePlayRegion()

void AdornedRulerPanel::OnTogglePlayRegion ( wxCommandEvent &  evt)
private

Definition at line 1976 of file AdornedRulerPanel.cpp.

1977 {
1979 }

References mProject, and SelectUtilities::TogglePlayRegion().

Here is the call graph for this function:

◆ Pos2Time()

double AdornedRulerPanel::Pos2Time ( int  p,
bool  ignoreFisheye = false 
)
private

Definition at line 1349 of file AdornedRulerPanel.cpp.

1350 {
1352  , ignoreFisheye
1353  );
1354 }

References mLeftOffset, CellularPanel::mViewInfo, and ZoomInfo::PositionToTime().

Referenced by DoDrawMarks(), and UpdateQuickPlayPos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessUIHandleResult()

void AdornedRulerPanel::ProcessUIHandleResult ( TrackPanelCell pClickedTrack,
TrackPanelCell pLatestCell,
unsigned  refreshResult 
)
overrideprivatevirtual

Implements CellularPanel.

Definition at line 2308 of file AdornedRulerPanel.cpp.

2310 {
2311  if (refreshResult & RefreshCode::DrawOverlays)
2312  DrawBothOverlays();
2313 }

References DrawBothOverlays(), and RefreshCode::DrawOverlays.

Here is the call graph for this function:

◆ ReCreateButtons()

void AdornedRulerPanel::ReCreateButtons ( )

Definition at line 1021 of file AdornedRulerPanel.cpp.

1022 {
1023  // TODO: Should we do this to destroy the grabber??
1024  // Get rid of any children we may have
1025  // DestroyChildren();
1026 
1028  SetBackgroundColour(theTheme.Colour( clrMedium ));
1029 
1030  for (auto & button : mButtons) {
1031  if (button)
1032  button->Destroy();
1033  button = nullptr;
1034  }
1035 
1036  size_t iButton = 0;
1037  // Make the short row of time ruler pushbottons.
1038  // Don't bother with sizers. Their sizes and positions are fixed.
1039  // Add a grabber converted to a spacer.
1040  // This makes it visually clearer that the button is a button.
1041 
1042  wxPoint position( 1, 0 );
1043 
1044  Grabber * pGrabber = safenew Grabber(this, this->GetId());
1045  pGrabber->SetAsSpacer( true );
1046  //pGrabber->SetSize( 10, 27 ); // default is 10,27
1047  pGrabber->SetPosition( position );
1048 
1049  position.x = 12;
1050 
1051  auto size = theTheme.ImageSize( bmpRecoloredUpSmall );
1052  size.y = std::min(size.y, GetRulerHeight(false));
1053 
1054  auto buttonMaker = [&]
1055  (wxWindowID id, teBmps bitmap, bool toggle)
1056  {
1057  const auto button =
1059  this,
1060  bmpRecoloredUpSmall, bmpRecoloredDownSmall,
1061  bmpRecoloredUpHiliteSmall, bmpRecoloredHiliteSmall,
1062  bitmap, bitmap, bitmap,
1063  id, position, toggle, size
1064  );
1065 
1066  position.x += size.GetWidth();
1067  mButtons[iButton++] = button;
1068  return button;
1069  };
1070  auto button = buttonMaker(OnTogglePinnedStateID, bmpPlayPointerPinned, true);
1072  *button, 3,
1073  bmpRecoloredUpSmall, bmpRecoloredDownSmall,
1074  bmpRecoloredUpHiliteSmall, bmpRecoloredHiliteSmall,
1075  //bmpUnpinnedPlayHead, bmpUnpinnedPlayHead, bmpUnpinnedPlayHead,
1076  bmpRecordPointer, bmpRecordPointer, bmpRecordPointer,
1077  size);
1079  *button, 2,
1080  bmpRecoloredUpSmall, bmpRecoloredDownSmall,
1081  bmpRecoloredUpHiliteSmall, bmpRecoloredHiliteSmall,
1082  //bmpUnpinnedPlayHead, bmpUnpinnedPlayHead, bmpUnpinnedPlayHead,
1083  bmpRecordPointerPinned, bmpRecordPointerPinned, bmpRecordPointerPinned,
1084  size);
1086  *button, 1,
1087  bmpRecoloredUpSmall, bmpRecoloredDownSmall,
1088  bmpRecoloredUpHiliteSmall, bmpRecoloredHiliteSmall,
1089  //bmpUnpinnedPlayHead, bmpUnpinnedPlayHead, bmpUnpinnedPlayHead,
1090  bmpPlayPointer, bmpPlayPointer, bmpPlayPointer,
1091  size);
1092 
1094 }

References ThemeBase::Colour(), GetRulerHeight(), id, ThemeBase::ImageSize(), ToolBar::MakeAlternateImages(), ToolBar::MakeButton(), ToolBar::MakeButtonBackgroundsSmall(), mButtons, min(), OnTogglePinnedStateID, safenew, Grabber::SetAsSpacer(), size, theTheme, and UpdateButtonStates().

Referenced by OnThemeChange(), and UpdatePrefs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Refresh()

void AdornedRulerPanel::Refresh ( bool  eraseBackground = true,
const wxRect *  rect = (const wxRect *) NULL 
)
override

Definition at line 990 of file AdornedRulerPanel.cpp.

991 {
992  CellularPanel::Refresh( eraseBackground, rect );
994 }

References BasicUI::CallAfter(), and CellularPanel::HandleCursorForPresentMouseState().

Referenced by ClearPlayRegion(), DoIdle(), DrawSelection(), SetPlayRegion(), StartQPPlay(), and TrackPanel::UpdateVRulerSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Root()

std::shared_ptr< TrackPanelNode > AdornedRulerPanel::Root ( )
overrideprivatevirtual

Implements CellularPanel.

Definition at line 2284 of file AdornedRulerPanel.cpp.

2285 {
2286  // Root is a throwaway object
2287  return std::make_shared< MainGroup >( *this );
2288 }

◆ SetFocusedCell()

void AdornedRulerPanel::SetFocusedCell ( )
overrideprivatevirtual

Implements CellularPanel.

Definition at line 2303 of file AdornedRulerPanel.cpp.

2304 {
2305 }

◆ SetFocusFromKbd()

void AdornedRulerPanel::SetFocusFromKbd ( )
override

Definition at line 2238 of file AdornedRulerPanel.cpp.

2239 {
2240  auto temp = TemporarilyAllowFocus();
2241  SetFocus();
2242 }

References TemporarilyAllowFocus().

Here is the call graph for this function:

◆ SetLeftOffset()

void AdornedRulerPanel::SetLeftOffset ( int  offset)

Definition at line 2133 of file AdornedRulerPanel.cpp.

2134 {
2135  mLeftOffset = offset;
2136  mRuler.SetUseZoomInfo(offset, mViewInfo);
2137 }

References mLeftOffset, mRuler, CellularPanel::mViewInfo, and Ruler::SetUseZoomInfo().

Referenced by TrackPanel::UpdateVRulerSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPanelSize()

bool AdornedRulerPanel::SetPanelSize ( )

Definition at line 1783 of file AdornedRulerPanel.cpp.

1784 {
1785  const auto oldSize = GetSize();
1786  wxSize size { oldSize.GetWidth(), GetRulerHeight(ShowingScrubRuler()) };
1787  if ( size != oldSize ) {
1788  SetSize(size);
1789  SetMinSize(size);
1790  GetParent()->PostSizeEventToParent();
1791  return true;
1792  }
1793  else
1794  return false;
1795 }

References GetRulerHeight(), ShowingScrubRuler(), and size.

Referenced by DoIdle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPlayRegion()

void AdornedRulerPanel::SetPlayRegion ( double  playRegionStart,
double  playRegionEnd 
)

Definition at line 2199 of file AdornedRulerPanel.cpp.

2201 {
2202  // This is called by AudacityProject to make the play region follow
2203  // the current selection. But while the user is selecting a play region
2204  // with the mouse directly in the ruler, changes from outside are blocked.
2205  if (mMouseEventState != mesNone)
2206  return;
2207 
2208  auto &viewInfo = ViewInfo::Get( *GetProject() );
2209  auto &playRegion = viewInfo.playRegion;
2210  playRegion.SetTimes( playRegionStart, playRegionEnd );
2211 
2212  Refresh();
2213 }

References ViewInfo::Get(), GetProject(), mesNone, mMouseEventState, and Refresh().

Referenced by DoSelectionChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowContextMenu()

void AdornedRulerPanel::ShowContextMenu ( MenuChoice  choice,
const wxPoint *  pPosition 
)
private

Definition at line 1992 of file AdornedRulerPanel.cpp.

1994 {
1995  wxPoint position;
1996  if(pPosition)
1997  position = *pPosition;
1998  else
1999  {
2000  auto rect = GetRect();
2001  //Old code put menu too low down. y position applied twice.
2002  //position = { rect.GetLeft() + 1, rect.GetBottom() + 1 };
2003 
2004  // The cell does not pass in the mouse or button position.
2005  // We happen to know this is the pin/unpin button
2006  // so these magic values 'fix a bug' - but really the cell should
2007  // pass more information to work with in.
2008  position = { rect.GetLeft() + 38, rect.GetHeight()/2 + 1 };
2009  }
2010 
2011  switch (choice) {
2012  case MenuChoice::QuickPlay:
2013  ShowMenu(position);
2015  break;
2016  case MenuChoice::Scrub:
2017  ShowScrubMenu(position); break;
2018  default:
2019  return;
2020  }
2021 }

References QuickPlay, Scrub, ShowMenu(), ShowScrubMenu(), and UpdateButtonStates().

Referenced by OnPinnedButton().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowingScrubRuler()

bool AdornedRulerPanel::ShowingScrubRuler ( ) const

Definition at line 2277 of file AdornedRulerPanel.cpp.

2278 {
2279  auto &scrubber = Scrubber::Get( *GetProject() );
2280  return scrubber.ShowsBar();
2281 }

References Scrubber::Get(), and GetProject().

Referenced by AdornedRulerPanel::Subgroup::Children(), DoDrawBackground(), DoDrawScrubIndicator(), ScrubbingToolBar::DoRegenerateTooltips(), ScrubbingToolBar::EnableDisableButtons(), SetPanelSize(), and UpdateRects().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowMenu()

void AdornedRulerPanel::ShowMenu ( const wxPoint &  pos)
private

Definition at line 1871 of file AdornedRulerPanel.cpp.

1872 {
1873  const auto &viewInfo = ViewInfo::Get( *GetProject() );
1874  const auto &playRegion = viewInfo.playRegion;
1875  wxMenu rulerMenu;
1876 
1877  auto pDrag = rulerMenu.AppendCheckItem(OnSyncQuickPlaySelID, _("Enable dragging selection"));
1878  pDrag->Check(mPlayRegionDragsSelection && !playRegion.Active());
1879  pDrag->Enable(!playRegion.Active());
1880 
1881  rulerMenu.AppendCheckItem(OnAutoScrollID, _("Update display while playing"))->
1883 
1884  {
1885  auto item = rulerMenu.AppendCheckItem(OnTogglePlayRegionID,
1887  item->Check(playRegion.Active());
1888  }
1889 
1890  {
1891  auto item = rulerMenu.Append(OnClearPlayRegionID,
1892  /* i18n-hint Clear is a verb */
1893  _("Clear Looping Region"));
1894  }
1895 
1896  {
1897  auto item = rulerMenu.Append(OnSetPlayRegionToSelectionID,
1898  _("Set Loop To Selection"));
1899  }
1900 
1901  rulerMenu.AppendSeparator();
1902  rulerMenu.AppendCheckItem(OnTogglePinnedStateID, _("Pinned Play Head"))->
1904 
1905  BasicMenu::Handle{ &rulerMenu }.Popup(
1906  wxWidgetsWindowPlacement{ this },
1907  { pos.x, pos.y }
1908  );
1909 }

References _, ViewInfo::bUpdateTrackIndicator, ViewInfo::Get(), TracksPrefs::GetPinnedHeadPreference(), GetProject(), LoopToggleText, mPlayRegionDragsSelection, CellularPanel::mViewInfo, OnAutoScrollID, OnClearPlayRegionID, OnSetPlayRegionToSelectionID, OnSyncQuickPlaySelID, OnTogglePinnedStateID, OnTogglePlayRegionID, BasicMenu::Handle::Popup(), TranslatableString::Stripped(), and TranslatableString::Translation().

Referenced by ShowContextMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowScrubMenu()

void AdornedRulerPanel::ShowScrubMenu ( const wxPoint &  pos)
private

Definition at line 1911 of file AdornedRulerPanel.cpp.

1912 {
1913  auto &scrubber = Scrubber::Get( *mProject );
1914  PushEventHandler(&scrubber);
1915  auto cleanup = finally([this]{ PopEventHandler(); });
1916 
1917  wxMenu rulerMenu;
1918  scrubber.PopulatePopupMenu(rulerMenu);
1919  BasicMenu::Handle{ &rulerMenu }.Popup(
1920  wxWidgetsWindowPlacement{ this },
1921  { pos.x, pos.y }
1922  );
1923 }

References Scrubber::Get(), mProject, and BasicMenu::Handle::Popup().

Referenced by ShowContextMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartQPPlay()

void AdornedRulerPanel::StartQPPlay ( bool  looped,
bool  cutPreview 
)
private

Definition at line 1702 of file AdornedRulerPanel.cpp.

1703 {
1704  const double t0 = mTracks->GetStartTime();
1705  const double t1 = mTracks->GetEndTime();
1706  auto &viewInfo = ViewInfo::Get( *mProject );
1707  auto &playRegion = viewInfo.playRegion;
1708  const auto &selectedRegion = viewInfo.selectedRegion;
1709  const double sel0 = selectedRegion.t0();
1710  const double sel1 = selectedRegion.t1();
1711 
1712  // Start / Restart playback on left click.
1713  bool startPlaying = (playRegion.GetStart() >= 0);
1714 
1715  if (startPlaying) {
1716  bool loopEnabled = true;
1717  double start, end;
1718 
1719  if (playRegion.Empty() && looped) {
1720  // Loop play a point will loop either a selection or the project.
1721  if ((playRegion.GetStart() > sel0) && (playRegion.GetStart() < sel1)) {
1722  // we are in a selection, so use the selection
1723  start = sel0;
1724  end = sel1;
1725  } // not in a selection, so use the project
1726  else {
1727  start = t0;
1728  end = t1;
1729  }
1730  }
1731  else {
1732  start = playRegion.GetStart();
1733  end = playRegion.GetEnd();
1734  }
1735  // Looping a tiny selection may freeze, so just play it once.
1736  loopEnabled = ((end - start) > 0.001)? true : false;
1737 
1738  bool looped = (loopEnabled && looped);
1739  if (looped)
1740  cutPreview = false;
1741  auto options = DefaultPlayOptions( *mProject, looped );
1742 
1743  auto oldStart = playRegion.GetStart();
1744  if (!cutPreview)
1745  options.pStartTime = &oldStart;
1746  else
1747  options.envelope = nullptr;
1748 
1749  auto mode =
1750  cutPreview ? PlayMode::cutPreviewPlay
1751  : looped ? PlayMode::loopedPlay
1753 
1754  // Stop only after deciding where to start again, because an event
1755  // callback may change the play region back to the selection
1756  auto &projectAudioManager = ProjectAudioManager::Get( *mProject );
1757  projectAudioManager.Stop();
1758 
1759  // Change play region display while playing
1760  playRegion.SetTimes( start, end );
1761  Refresh();
1762 
1763  projectAudioManager.PlayPlayRegion((SelectedRegion(start, end)),
1764  options, mode,
1765  false,
1766  true);
1767 
1768  }
1769 }

References cutPreviewPlay, DefaultPlayOptions(), ViewInfo::Get(), ProjectAudioManager::Get(), TrackList::GetEndTime(), TrackList::GetStartTime(), loopedPlay, mProject, mTracks, normalPlay, and Refresh().

Here is the call graph for this function:

◆ TemporarilyAllowFocus()

auto AdornedRulerPanel::TemporarilyAllowFocus ( )
static

Definition at line 2233 of file AdornedRulerPanel.cpp.

2233  {
2234  s_AcceptsFocus = true;
2235  return TempAllowFocus{ &s_AcceptsFocus };
2236 }

Referenced by SetFocusFromKbd().

Here is the caller graph for this function:

◆ Time2Pos()

int AdornedRulerPanel::Time2Pos ( double  t,
bool  ignoreFisheye = false 
)
private

Definition at line 1356 of file AdornedRulerPanel.cpp.

1357 {
1359  , ignoreFisheye
1360  );
1361 }

References mLeftOffset, CellularPanel::mViewInfo, and ZoomInfo::TimeToPosition().

Referenced by DoDrawPlayRegion(), and IsWithinMarker().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TogglePinnedHead()

void AdornedRulerPanel::TogglePinnedHead ( )

Definition at line 2336 of file AdornedRulerPanel.cpp.

2337 {
2338  bool value = !TracksPrefs::GetPinnedHeadPreference();
2341 
2342  auto &project = *mProject;
2343  // Update button image
2345 
2346  auto &scrubber = Scrubber::Get( project );
2347  if (scrubber.HasMark())
2348  scrubber.SetScrollScrubbing(value);
2349 }

References Scrubber::Get(), TracksPrefs::GetPinnedHeadPreference(), MenuManager::ModifyAllProjectToolbarMenus(), mProject, TracksPrefs::SetPinnedHeadPreference(), and UpdateButtonStates().

Referenced by TransportActions::Handler::OnTogglePinnedHead(), and OnTogglePinnedState().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateButtonStates()

void AdornedRulerPanel::UpdateButtonStates ( )

Definition at line 1809 of file AdornedRulerPanel.cpp.

1810 {
1811  auto common = [this](
1812  AButton &button, const CommandID &commandName, const TranslatableString &label) {
1813  ComponentInterfaceSymbol command{ commandName, label };
1814  ToolBar::SetButtonToolTip( *mProject, button, &command, 1u );
1815  button.SetLabel( Verbatim( button.GetToolTipText() ) );
1816 
1817  button.UpdateStatus();
1818  };
1819 
1820  {
1821  // The button always reflects the pinned head preference, even though
1822  // there is also a Playback preference that may overrule it for scrubbing
1823  bool state = TracksPrefs::GetPinnedHeadPreference();
1824  auto pinButton = static_cast<AButton*>(FindWindow(OnTogglePinnedStateID));
1825  if( !state )
1826  pinButton->PopUp();
1827  else
1828  pinButton->PushDown();
1829  auto gAudioIO = AudioIO::Get();
1830  pinButton->SetAlternateIdx(
1831  (gAudioIO->IsCapturing() ? 2 : 0) + (state ? 0 : 1));
1832  // Bug 1584: Tooltip now shows what clicking will do.
1833  // Bug 2357: Action of button (and hence tooltip wording) updated.
1834  const auto label = XO("Timeline Options");
1835  common(*pinButton, wxT("PinnedHead"), label);
1836  }
1837 }

References AudioIO::Get(), TracksPrefs::GetPinnedHeadPreference(), label, mProject, OnTogglePinnedStateID, AButton::PopUp(), ToolBar::SetButtonToolTip(), AButton::SetLabel(), AButton::UpdateStatus(), Verbatim(), and XO.

Referenced by OnAudioStartStop(), OnTogglePinnedState(), ReCreateButtons(), ShowContextMenu(), TogglePinnedHead(), and UpdatePrefs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdatePrefs()

void AdornedRulerPanel::UpdatePrefs ( )
overridevirtual

Implements PrefsListener.

Definition at line 996 of file AdornedRulerPanel.cpp.

997 {
998  if (mNeedButtonUpdate) {
999  // Visit this block once only in the lifetime of this panel
1000  mNeedButtonUpdate = false;
1001  // Do this first time setting of button status texts
1002  // when we are sure the CommandManager is initialized.
1003  ReCreateButtons();
1004  }
1005 
1006  // Update button texts for language change
1008 
1009  mTimelineToolTip = !!gPrefs->Read(wxT("/QuickPlay/ToolTips"), 1L);
1010 
1011 #ifdef EXPERIMENTAL_SCROLLING_LIMITS
1012 #ifdef EXPERIMENTAL_TWO_TONE_TIME_RULER
1013  {
1014  auto scrollBeyondZero = ScrollingPreference.Read();
1015  mRuler.SetTwoTone(scrollBeyondZero);
1016  }
1017 #endif
1018 #endif
1019 }

References gPrefs, mNeedButtonUpdate, mRuler, mTimelineToolTip, Setting< T >::Read(), ReCreateButtons(), ScrollingPreference, Ruler::SetTwoTone(), and UpdateButtonStates().

Referenced by AdornedRulerPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateQuickPlayPos()

void AdornedRulerPanel::UpdateQuickPlayPos ( wxCoord &  mousePosX,
bool  shiftDown 
)

Definition at line 1850 of file AdornedRulerPanel.cpp.

1851 {
1852  // Keep Quick-Play within usable track area.
1853  const auto &viewInfo = ViewInfo::Get( *mProject );
1854  auto width = viewInfo.GetTracksUsableWidth();
1855  mousePosX = std::max(mousePosX, viewInfo.GetLeftOffset());
1856  mousePosX = std::min(mousePosX, viewInfo.GetLeftOffset() + width - 1);
1857 
1859 
1860  HandleSnapping();
1861 
1862  // If not looping, restrict selection to end of project
1863  if ((LastCell() == mQPCell || mQPCell->Clicked()) && !shiftDown) {
1864  const double t1 = mTracks->GetEndTime();
1866  }
1867 }

References ViewInfo::Get(), TrackList::GetEndTime(), HandleSnapping(), CellularPanel::LastCell(), min(), mProject, mQPCell, mQuickPlayPos, mQuickPlayPosUnsnapped, mTracks, and Pos2Time().

Here is the call graph for this function:

◆ UpdateRects()

bool AdornedRulerPanel::UpdateRects ( )
private

Definition at line 1296 of file AdornedRulerPanel.cpp.

1297 {
1298  auto inner = mOuter;
1299  wxRect scrubZone;
1300  inner.x += LeftMargin;
1301  inner.width -= (LeftMargin + RightMargin);
1302 
1303  auto top = &inner;
1304  auto bottom = &inner;
1305 
1306  if (ShowingScrubRuler()) {
1307  scrubZone = inner;
1308  auto scrubHeight = std::min(scrubZone.height, (int)(ScrubHeight));
1309 
1310  int topHeight;
1311 #ifdef SCRUB_ABOVE
1312  top = &scrubZone, topHeight = scrubHeight;
1313 #else
1314  auto qpHeight = scrubZone.height - scrubHeight;
1315  bottom = &scrubZone, topHeight = qpHeight;
1316  // Increase scrub zone height so that hit testing finds it and
1317  // not QP region, when on bottom 'edge'.
1318  scrubZone.height+=BottomMargin;
1319 #endif
1320 
1321  top->height = topHeight;
1322  bottom->height -= topHeight;
1323  bottom->y += topHeight;
1324  }
1325 
1326  top->y += TopMargin;
1327  top->height -= TopMargin;
1328 
1329  bottom->height -= BottomMargin;
1330 
1331  if (!ShowingScrubRuler())
1332  scrubZone = inner;
1333 
1334  if ( inner == mInner && scrubZone == mScrubZone )
1335  // no changes
1336  return false;
1337 
1338  mInner = inner;
1339  mScrubZone = scrubZone;
1340 
1341  mRuler.SetBounds(mInner.GetLeft(),
1342  mInner.GetTop(),
1343  mInner.GetRight(),
1344  mInner.GetBottom());
1345 
1346  return true;
1347 }

References BottomMargin, LeftMargin, min(), mInner, mOuter, mRuler, mScrubZone, RightMargin, ScrubHeight, Ruler::SetBounds(), ShowingScrubRuler(), and TopMargin.

Referenced by DoIdle(), and OnSize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateStatusMessage()

void AdornedRulerPanel::UpdateStatusMessage ( const TranslatableString message)
overrideprivatevirtual

Implements CellularPanel.

Definition at line 2315 of file AdornedRulerPanel.cpp.

2316 {
2317  ProjectStatus::Get( *GetProject() ).Set(message);
2318 }

References ProjectStatus::Get(), GetProject(), and ProjectStatus::Set().

Here is the call graph for this function:

Member Data Documentation

◆ mButtons

wxWindow* AdornedRulerPanel::mButtons[3]
private

Definition at line 178 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel(), and ReCreateButtons().

◆ mDirtyPlayRegion

bool AdornedRulerPanel::mDirtyPlayRegion {}
private

Definition at line 229 of file AdornedRulerPanel.h.

Referenced by DoIdle(), and OnPaint().

◆ mIndTime

double AdornedRulerPanel::mIndTime
private

Definition at line 133 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel().

◆ mInner

wxRect AdornedRulerPanel::mInner
private

◆ mIsDragging

bool AdornedRulerPanel::mIsDragging
private

Definition at line 174 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel().

◆ mIsRecording

bool AdornedRulerPanel::mIsRecording
private

Definition at line 141 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel(), and OnAudioStartStop().

◆ mIsSnapped

bool AdornedRulerPanel::mIsSnapped
private

Definition at line 137 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel(), and HandleSnapping().

◆ mLastDrawnH

double AdornedRulerPanel::mLastDrawnH {}
private

Definition at line 227 of file AdornedRulerPanel.h.

Referenced by DoIdle(), and OnPaint().

◆ mLastDrawnPlayRegion

std::pair<double, double> AdornedRulerPanel::mLastDrawnPlayRegion {}
private

Definition at line 225 of file AdornedRulerPanel.h.

Referenced by DoIdle(), and OnPaint().

◆ mLastDrawnZoom

double AdornedRulerPanel::mLastDrawnZoom {}
private

Definition at line 228 of file AdornedRulerPanel.h.

Referenced by DoIdle(), and OnPaint().

◆ mLastPlayRegionActive

bool AdornedRulerPanel::mLastPlayRegionActive = false
private

Definition at line 226 of file AdornedRulerPanel.h.

Referenced by DoDrawPlayRegion(), and DoIdle().

◆ mLeftDownClick

double AdornedRulerPanel::mLeftDownClick
private

Definition at line 173 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel().

◆ mLeftDownClickUnsnapped

double AdornedRulerPanel::mLeftDownClickUnsnapped
private

Definition at line 172 of file AdornedRulerPanel.h.

◆ mLeftOffset

int AdornedRulerPanel::mLeftOffset
private

Definition at line 130 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel(), Pos2Time(), SetLeftOffset(), and Time2Pos().

◆ mMouseEventState

MouseEventState AdornedRulerPanel::mMouseEventState
private

Definition at line 171 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel(), and SetPlayRegion().

◆ mNeedButtonUpdate

bool AdornedRulerPanel::mNeedButtonUpdate { true }
private

Definition at line 179 of file AdornedRulerPanel.h.

Referenced by UpdatePrefs().

◆ mOldPlayRegion

PlayRegion AdornedRulerPanel::mOldPlayRegion
private

Definition at line 139 of file AdornedRulerPanel.h.

◆ mOuter

wxRect AdornedRulerPanel::mOuter
private

Definition at line 126 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel(), DoDrawEdge(), OnSize(), and UpdateRects().

◆ mOverlay

std::shared_ptr<TrackPanelGuidelineOverlay> AdornedRulerPanel::mOverlay
private

Definition at line 203 of file AdornedRulerPanel.h.

Referenced by CreateOverlays().

◆ mPlayRegionDragsSelection

bool AdornedRulerPanel::mPlayRegionDragsSelection
private

Definition at line 160 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel(), OnSyncSelToQuickPlay(), and ShowMenu().

◆ mProject

AudacityProject* const AdornedRulerPanel::mProject
private

◆ mQPCell

std::shared_ptr<QPCell> AdornedRulerPanel::mQPCell
private

◆ mQuickPlayPos

double AdornedRulerPanel::mQuickPlayPos
private

Definition at line 135 of file AdornedRulerPanel.h.

Referenced by HandleSnapping(), and UpdateQuickPlayPos().

◆ mQuickPlayPosUnsnapped

double AdornedRulerPanel::mQuickPlayPosUnsnapped
private

Definition at line 134 of file AdornedRulerPanel.h.

Referenced by UpdateQuickPlayPos().

◆ mRuler

Ruler AdornedRulerPanel::mRuler
private

◆ mScrubbingCell

std::shared_ptr<ScrubbingCell> AdornedRulerPanel::mScrubbingCell
private

◆ mScrubZone

wxRect AdornedRulerPanel::mScrubZone
private

◆ mTimelineToolTip

bool AdornedRulerPanel::mTimelineToolTip
private

Definition at line 161 of file AdornedRulerPanel.h.

Referenced by AdornedRulerPanel(), and UpdatePrefs().

◆ mTracks

TrackList* AdornedRulerPanel::mTracks
private

◆ s_AcceptsFocus

bool AdornedRulerPanel::s_AcceptsFocus { false }
staticprivate

Definition at line 104 of file AdornedRulerPanel.h.


The documentation for this class was generated from the following files:
size
size_t size
Definition: ffmpeg-2.3.6-single-header.h:412
AdornedRulerPanel::ReCreateButtons
void ReCreateButtons()
Definition: AdornedRulerPanel.cpp:1021
Ruler::SetLabelEdges
void SetLabelEdges(bool labelEdges)
Definition: Ruler.cpp:226
PlayMode::cutPreviewPlay
@ cutPreviewPlay
AdornedRulerPanel::DoSelectionChange
void DoSelectionChange(const SelectedRegion &selectedRegion)
Definition: AdornedRulerPanel.cpp:1285
AdornedRulerPanel::mLeftOffset
int mLeftOffset
Definition: AdornedRulerPanel.h:130
AdornedRulerPanel::mTimelineToolTip
bool mTimelineToolTip
Definition: AdornedRulerPanel.h:161
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
RefreshCode::DrawOverlays
@ DrawOverlays
Definition: RefreshCode.h:32
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:241
LoopToggleText
const TranslatableString LoopToggleText
Definition: ViewInfo.cpp:233
SelectUtilities::ClearPlayRegion
void ClearPlayRegion(AudacityProject &project)
Definition: SelectUtilities.cpp:211
AColor::UseThemeColour
static void UseThemeColour(wxDC *dc, int iBrush, int iPen=-1, int alpha=255)
Definition: AColor.cpp:280
AButton::SetLabel
void SetLabel(const TranslatableString &label)
Definition: AButton.cpp:274
AdornedRulerPanel::mIsRecording
bool mIsRecording
Definition: AdornedRulerPanel.h:141
AdornedRulerPanel::mScrubZone
wxRect mScrubZone
Definition: AdornedRulerPanel.h:127
teBmps
int teBmps
Definition: ImageManipulation.h:48
AdornedRulerPanel::Refresh
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
Definition: AdornedRulerPanel.cpp:990
Scrubber::Get
static Scrubber & Get(AudacityProject &project)
Definition: Scrubbing.cpp:201
CellularPanel::HandleCursorForPresentMouseState
void HandleCursorForPresentMouseState(bool doHit=true)
Definition: CellularPanel.cpp:231
ScrubHeight
@ ScrubHeight
Definition: AdornedRulerPanel.cpp:87
AdornedRulerPanel
This is an Audacity Specific ruler panel which additionally has border, selection markers,...
Definition: AdornedRulerPanel.h:27
ProjectAudioManager::Get
static ProjectAudioManager & Get(AudacityProject &project)
Definition: ProjectAudioManager.cpp:55
CellularPanel::LastCell
std::shared_ptr< TrackPanelCell > LastCell() const
Definition: CellularPanel.cpp:1196
AdornedRulerPanel::OnThemeChange
void OnThemeChange(wxCommandEvent &evt)
Definition: AdornedRulerPanel.cpp:1270
IndicatorOffset
@ IndicatorOffset
Definition: AdornedRulerPanel.cpp:77
AdornedRulerPanel::mTracks
TrackList * mTracks
Definition: AdornedRulerPanel.h:124
ViewInfo::bUpdateTrackIndicator
bool bUpdateTrackIndicator
Definition: ViewInfo.h:252
BackedPanel::DisplayBitmap
void DisplayBitmap(wxDC &dc)
Definition: BackedPanel.cpp:65
ToolBar::MakeAlternateImages
static void MakeAlternateImages(AButton &button, int idx, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size)
Definition: ToolBar.cpp:873
AdornedRulerPanel::TempAllowFocus
std::unique_ptr< bool, Resetter > TempAllowFocus
Definition: AdornedRulerPanel.h:106
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
ClientData::Site::Find
Subclass * Find(const RegisteredFactory &key)
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand...
Definition: ClientData.h:333
AdornedRulerPanel::HandleSnapping
void HandleSnapping()
Definition: AdornedRulerPanel.cpp:1941
AdornedRulerPanel::TemporarilyAllowFocus
static TempAllowFocus TemporarilyAllowFocus()
Definition: AdornedRulerPanel.cpp:2233
SelectedRegion::t1
double t1() const
Definition: SelectedRegion.h:92
SELECT_TOLERANCE_PIXEL
#define SELECT_TOLERANCE_PIXEL
Definition: AdornedRulerPanel.cpp:67
AdornedRulerPanel::mQuickPlayPos
double mQuickPlayPos
Definition: AdornedRulerPanel.h:135
AButton
A wxButton with mouse-over behaviour.
Definition: AButton.h:25
ViewInfo::playRegion
PlayRegion playRegion
Definition: ViewInfo.h:230
AdornedRulerPanel::mesNone
@ mesNone
Definition: AdornedRulerPanel.h:164
wxPanelWrapper::SetLabel
void SetLabel(const TranslatableString &label)
Definition: wxPanelWrapper.cpp:46
CellularPanel::mViewInfo
ViewInfo * mViewInfo
Definition: CellularPanel.h:161
ClientData::Site::Get
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:309
AButton::PopUp
void PopUp()
Definition: AButton.cpp:605
AColor::Line
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:109
AdornedRulerPanel::mLastDrawnH
double mLastDrawnH
Definition: AdornedRulerPanel.h:227
OnSetPlayRegionToSelectionID
@ OnSetPlayRegionToSelectionID
Definition: AdornedRulerPanel.cpp:475
AdornedRulerPanel::mIndTime
double mIndTime
Definition: AdornedRulerPanel.h:133
XO
#define XO(s)
Definition: Internat.h:31
Ruler::SetTickColour
void SetTickColour(const wxColour &colour)
Definition: Ruler.h:148
Ruler::SetFormat
void SetFormat(RulerFormat format)
Definition: Ruler.cpp:131
ThemeBase::ImageSize
wxSize ImageSize(int iIndex)
Definition: Theme.cpp:1224
SelectUtilities::SetPlayRegionToSelection
void SetPlayRegionToSelection(AudacityProject &project)
Definition: SelectUtilities.cpp:218
Ruler::Draw
void Draw(wxDC &dc) const
Definition: Ruler.cpp:1428
CellularPanel::ClearTargets
void ClearTargets()
Definition: CellularPanel.cpp:1185
BasicUI::CallAfter
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:38
MenuManager::ModifyAllProjectToolbarMenus
static void ModifyAllProjectToolbarMenus()
Definition: Menus.cpp:584
Grabber
The widget to the left of a ToolBar that allows it to be dragged around to NEW positions.
Definition: Grabber.h:103
AdornedRulerPanel::DoDrawBackground
void DoDrawBackground(wxDC *dc)
Definition: AdornedRulerPanel.cpp:2023
AColor::BevelTrackInfo
static void BevelTrackInfo(wxDC &dc, bool up, const wxRect &r, bool highlight=false)
Definition: AColor.cpp:248
AdornedRulerPanel::mLastDrawnPlayRegion
std::pair< double, double > mLastDrawnPlayRegion
Definition: AdornedRulerPanel.h:225
BackedPanel::OnSize
void OnSize(wxSizeEvent &event)
Definition: BackedPanel.cpp:71
Ruler::SetUseZoomInfo
void SetUseZoomInfo(int leftOffset, const ZoomInfo *zoomInfo)
Definition: Ruler.cpp:1680
PrefsListener::Broadcast
static void Broadcast(int id=0)
Call this static function to notify all PrefsListener objects.
Definition: Prefs.cpp:100
OnClearPlayRegionID
@ OnClearPlayRegionID
Definition: AdornedRulerPanel.cpp:474
AdornedRulerPanel::UpdateButtonStates
void UpdateButtonStates()
Definition: AdornedRulerPanel.cpp:1809
ZoomInfo::TimeToPosition
wxInt64 TimeToPosition(double time, wxInt64 origin=0, bool ignoreFisheye=false) const
STM: Converts a project time to screen x position.
Definition: ZoomInfo.cpp:49
AdornedRulerPanel::mQuickPlayPosUnsnapped
double mQuickPlayPosUnsnapped
Definition: AdornedRulerPanel.h:134
AdornedRulerPanel::mMouseEventState
MouseEventState mMouseEventState
Definition: AdornedRulerPanel.h:171
sKey
static const AudacityProject::AttachedObjects::RegisteredFactory sKey
Definition: ProjectRate.cpp:35
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
AdornedRulerPanel::DoDrawMarks
void DoDrawMarks(wxDC *dc, bool)
Definition: AdornedRulerPanel.cpp:2054
AdornedRulerPanel::mesDraggingPlayRegionEnd
@ mesDraggingPlayRegionEnd
Definition: AdornedRulerPanel.h:166
wxWidgetsWindowPlacement
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.
Definition: wxWidgetsWindowPlacement.h:22
CellularPanel::CellularPanel
CellularPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, ViewInfo *viewInfo, long style=wxTAB_TRAVERSAL|wxNO_BORDER)
Definition: CellularPanel.cpp:108
ScrollingPreference
BoolSetting ScrollingPreference
Definition: ViewInfo.cpp:346
Setting::Read
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:128
PlayMode::normalPlay
@ normalPlay
ProperRulerHeight
@ ProperRulerHeight
Definition: AdornedRulerPanel.cpp:88
AdornedRulerPanel::DrawBothOverlays
void DrawBothOverlays()
Definition: AdornedRulerPanel.cpp:1797
Ruler::TimeFormat
@ TimeFormat
Definition: Ruler.h:33
Ruler::GetMaxSize
void GetMaxSize(wxCoord *width, wxCoord *height)
Definition: Ruler.cpp:1603
TrackList::GetEndTime
double GetEndTime() const
Definition: Track.cpp:1038
TopMargin
@ TopMargin
Definition: AdornedRulerPanel.cpp:79
CellularPanel::CancelDragging
bool CancelDragging(bool escaping)
Definition: CellularPanel.cpp:158
ClientData::Site::Assign
void Assign(const RegisteredFactory &key, ReplacementPointer &&replacement)
Reassign Site's pointer to ClientData.
Definition: ClientData.h:355
BackedPanel::GetBackingDCForRepaint
wxDC & GetBackingDCForRepaint()
Definition: BackedPanel.cpp:35
AdornedRulerPanel::Get
static AdornedRulerPanel & Get(AudacityProject &project)
Definition: AdornedRulerPanel.cpp:899
AdornedRulerPanel::SetPanelSize
bool SetPanelSize()
Definition: AdornedRulerPanel.cpp:1783
AdornedRulerPanel::mOuter
wxRect mOuter
Definition: AdornedRulerPanel.h:126
AdornedRulerPanel::mScrubbingCell
std::shared_ptr< ScrubbingCell > mScrubbingCell
Definition: AdornedRulerPanel.h:218
AdornedRulerPanel::TogglePinnedHead
void TogglePinnedHead()
Definition: AdornedRulerPanel.cpp:2336
ProjectStatus::Set
void Set(const TranslatableString &msg, StatusBarField field=mainStatusBarField)
Definition: ProjectStatus.cpp:77
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:229
AdornedRulerPanel::MenuChoice::QuickPlay
@ QuickPlay
OnAutoScrollID
@ OnAutoScrollID
Definition: AdornedRulerPanel.cpp:472
AdornedRulerPanel::mLeftDownClick
double mLeftDownClick
Definition: AdornedRulerPanel.h:173
AdornedRulerPanel::mInner
wxRect mInner
Definition: AdornedRulerPanel.h:128
AdornedRulerPanel::UpdatePrefs
void UpdatePrefs() override
Definition: AdornedRulerPanel.cpp:996
AdornedRulerPanel::Pos2Time
double Pos2Time(int p, bool ignoreFisheye=false)
Definition: AdornedRulerPanel.cpp:1349
label
TranslatableString label
Definition: Tags.cpp:756
AdornedRulerPanel::mLastDrawnZoom
double mLastDrawnZoom
Definition: AdornedRulerPanel.h:228
AdornedRulerPanel::ShowContextMenu
void ShowContextMenu(MenuChoice choice, const wxPoint *pPosition)
Definition: AdornedRulerPanel.cpp:1992
AdornedRulerPanel::DoDrawPlayRegion
void DoDrawPlayRegion(wxDC *dc)
Definition: AdornedRulerPanel.cpp:2071
ToolBar::SetButtonToolTip
static void SetButtonToolTip(AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
Definition: ToolBar.cpp:898
AdornedRulerPanel::mQPCell
std::shared_ptr< QPCell > mQPCell
Definition: AdornedRulerPanel.h:215
GetAttachedWindows
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
Definition: ProjectWindows.cpp:114
AButton::UpdateStatus
void UpdateStatus()
Definition: AButton.cpp:495
ADCChanger
Makes temporary drawing context changes that you back out of, RAII style.
Definition: OverlayPanel.h:72
AdornedRulerPanel::ShowingScrubRuler
bool ShowingScrubRuler() const
Definition: AdornedRulerPanel.cpp:2277
AdornedRulerPanel::OnSelectionChange
void OnSelectionChange(SelectedRegionEvent &evt)
Definition: AdornedRulerPanel.cpp:1276
AdornedRulerPanel::mDirtyPlayRegion
bool mDirtyPlayRegion
Definition: AdornedRulerPanel.h:229
LeftMargin
@ LeftMargin
Definition: AdornedRulerPanel.cpp:81
AdornedRulerPanel::OnAudioStartStop
void OnAudioStartStop(wxCommandEvent &evt)
Definition: AdornedRulerPanel.cpp:1200
AudioIOBase::Get
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:89
ViewInfo::UpdateScrollPrefsID
static int UpdateScrollPrefsID()
Definition: ViewInfo.cpp:335
Ruler::Invalidate
void Invalidate()
Definition: Ruler.cpp:345
Ruler::SetRange
void SetRange(double min, double max)
Definition: Ruler.cpp:188
AdornedRulerPanel::s_AcceptsFocus
static bool s_AcceptsFocus
Definition: AdornedRulerPanel.h:104
AdornedRulerPanel::Time2Pos
int Time2Pos(double t, bool ignoreFisheye=false)
Definition: AdornedRulerPanel.cpp:1356
DefaultPlayOptions
AudioIOStartStreamOptions DefaultPlayOptions(AudacityProject &project, bool looped)
Definition: ProjectAudioManager.cpp:1162
Grabber::SetAsSpacer
void SetAsSpacer(bool bIsSpacer)
Definition: Grabber.cpp:100
ProjectAudioManager::Stop
void Stop(bool stopStream=true)
Definition: ProjectAudioManager.cpp:495
TrackList::GetStartTime
double GetStartTime() const
Definition: Track.cpp:1033
AdornedRulerPanel::mButtons
wxWindow * mButtons[3]
Definition: AdornedRulerPanel.h:178
theTheme
THEME_API Theme theTheme
Definition: Theme.cpp:79
AdornedRulerPanel::mNeedButtonUpdate
bool mNeedButtonUpdate
Definition: AdornedRulerPanel.h:179
id
int id
Definition: WaveTrackControls.cpp:577
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
TracksPrefs::GetPinnedHeadPreference
static bool GetPinnedHeadPreference()
Definition: TracksPrefs.cpp:387
AdornedRulerPanel::ShowScrubMenu
void ShowScrubMenu(const wxPoint &pos)
Definition: AdornedRulerPanel.cpp:1911
wxPanelWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:61
SelectedRegion::t0
double t0() const
Definition: SelectedRegion.h:91
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
AdornedRulerPanel::DoIdle
void DoIdle()
Definition: AdornedRulerPanel.cpp:1173
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
AdornedRulerPanel::mesSelectingPlayRegionClick
@ mesSelectingPlayRegionClick
Definition: AdornedRulerPanel.h:167
TaggedIdentifier< CommandIdTag, false >
_
#define _(s)
Definition: Internat.h:75
ProjectStatus::Get
static ProjectStatus & Get(AudacityProject &project)
Definition: ProjectStatus.cpp:35
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
AdornedRulerPanel::SetPlayRegion
void SetPlayRegion(double playRegionStart, double playRegionEnd)
Definition: AdornedRulerPanel.cpp:2199
CellularPanel
Formerly part of TrackPanel, this abstract base class has no special knowledge of Track objects and i...
Definition: CellularPanel.h:34
ToolBar::MakeButtonBackgroundsSmall
static void MakeButtonBackgroundsSmall()
Definition: ToolBar.cpp:802
SnapManager
Definition: Snap.h:56
Ruler::SetBounds
void SetBounds(int left, int top, int right, int bottom)
Definition: Ruler.cpp:332
AdornedRulerPanel::mPlayRegionDragsSelection
bool mPlayRegionDragsSelection
Definition: AdornedRulerPanel.h:160
AdornedRulerPanel::UpdateRects
bool UpdateRects()
Definition: AdornedRulerPanel.cpp:1296
AdornedRulerPanel::ShowMenu
void ShowMenu(const wxPoint &pos)
Definition: AdornedRulerPanel.cpp:1871
Verbatim
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
Definition: TranslatableString.h:321
AdornedRulerPanel::MenuChoice::Scrub
@ Scrub
ThemeBase::Colour
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1189
OnSyncQuickPlaySelID
@ OnSyncQuickPlaySelID
Definition: AdornedRulerPanel.cpp:471
AdornedRulerPanel::mProject
AudacityProject *const mProject
Definition: AdornedRulerPanel.h:123
AdornedRulerPanel::mIsSnapped
bool mIsSnapped
Definition: AdornedRulerPanel.h:137
AdornedRulerPanel::mOverlay
std::shared_ptr< TrackPanelGuidelineOverlay > mOverlay
Definition: AdornedRulerPanel.h:202
OverlayPanel::AddOverlay
void AddOverlay(const std::weak_ptr< Overlay > &pOverlay)
Definition: OverlayPanel.cpp:24
SnapPoint
Definition: Snap.h:31
ToolBar::MakeButton
static AButton * MakeButton(wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxWindowID id, wxPoint placement, bool processdownevents, wxSize size)
Definition: ToolBar.cpp:840
SelectUtilities::TogglePlayRegion
void TogglePlayRegion(AudacityProject &project)
Definition: SelectUtilities.cpp:201
OverlayPanel::DrawOverlays
void DrawOverlays(bool repaint_all, wxDC *pDC=nullptr)
Definition: OverlayPanel.cpp:43
AdornedRulerPanel::mRuler
Ruler mRuler
Definition: AdornedRulerPanel.h:122
AdornedRulerPanel::mesDraggingPlayRegionStart
@ mesDraggingPlayRegionStart
Definition: AdornedRulerPanel.h:165
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
IndicatorHeightForWidth
int IndicatorHeightForWidth(int width)
Definition: AdornedRulerPanel.cpp:91
PlayRegion::Active
bool Active() const
Definition: ViewInfo.h:145
AdornedRulerPanel::DoDrawEdge
void DoDrawEdge(wxDC *dc)
Definition: AdornedRulerPanel.cpp:2039
RightMargin
@ RightMargin
Definition: AdornedRulerPanel.cpp:83
GetProjectPanel
AUDACITY_DLL_API wxWindow & GetProjectPanel(AudacityProject &project)
Get the main sub-window of the project frame that displays track data.
Definition: ProjectWindows.cpp:49
AdornedRulerPanel::GetRulerHeight
int GetRulerHeight()
Definition: AdornedRulerPanel.h:51
TranslatableString::Stripped
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object
Definition: TranslatableString.h:198
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:141
PlayMode::loopedPlay
@ loopedPlay
safenew
#define safenew
Definition: MemoryX.h:10
BottomMargin
@ BottomMargin
Definition: AdornedRulerPanel.cpp:80
AdornedRulerPanel::mLastPlayRegionActive
bool mLastPlayRegionActive
Definition: AdornedRulerPanel.h:226
BasicMenu::Handle::Popup
void Popup(const BasicUI::WindowPlacement &window, const Point &pos={})
Display the menu at pos, invoke at most one action, then hide it.
Definition: BasicMenu.cpp:207
AdornedRulerPanel::mesSelectingPlayRegionRange
@ mesSelectingPlayRegionRange
Definition: AdornedRulerPanel.h:168
OnTogglePinnedStateID
@ OnTogglePinnedStateID
Definition: AdornedRulerPanel.cpp:476
Ruler::SetTwoTone
void SetTwoTone(bool twoTone)
Definition: Ruler.cpp:126
TracksPrefs::SetPinnedHeadPreference
static void SetPinnedHeadPreference(bool value, bool flush=false)
Definition: TracksPrefs.cpp:398
ZoomInfo::PositionToTime
double PositionToTime(wxInt64 position, wxInt64 origin=0, bool ignoreFisheye=false) const
Definition: ZoomInfo.cpp:39
BasicMenu::Handle
Definition: BasicMenu.h:26
AdornedRulerPanel::GetProject
AudacityProject * GetProject() const override
Definition: AdornedRulerPanel.cpp:2290
AdornedRulerPanel::mIsDragging
bool mIsDragging
Definition: AdornedRulerPanel.h:174
SelectedRegionEvent::pRegion
wxWeakRef< NotifyingSelectedRegion > pRegion
Definition: ViewInfo.h:34
OnTogglePlayRegionID
@ OnTogglePlayRegionID
Definition: AdornedRulerPanel.cpp:473
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:35