Audacity  3.0.3
AdornedRulerPanel.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  AdornedRulerPanel.cpp
6 
7  Dominic Mazzoni
8 
9 *******************************************************************//******************************************************************/
20 
21 
22 #include "AdornedRulerPanel.h"
23 
24 #include <wx/app.h>
25 #include <wx/setup.h> // for wxUSE_* macros
26 #include <wx/tooltip.h>
27 
28 #include "AColor.h"
29 #include "AllThemeResources.h"
30 #include "AudioIO.h"
31 #include "widgets/BasicMenu.h"
32 #include "CellularPanel.h"
33 #include "HitTestResult.h"
34 #include "Menus.h"
35 #include "Prefs.h"
36 #include "Project.h"
37 #include "ProjectAudioIO.h"
38 #include "ProjectAudioManager.h"
39 #include "ProjectWindows.h"
40 #include "ProjectStatus.h"
41 #include "ProjectWindow.h"
42 #include "RefreshCode.h"
43 #include "SelectUtilities.h"
44 #include "Snap.h"
45 #include "Track.h"
46 #include "TrackPanelMouseEvent.h"
47 #include "UIHandle.h"
48 #include "ViewInfo.h"
49 #include "prefs/TracksPrefs.h"
50 #include "prefs/ThemePrefs.h"
51 #include "toolbars/ToolBar.h"
52 #include "tracks/ui/Scrubbing.h"
53 #include "tracks/ui/TrackView.h"
54 #include "widgets/AButton.h"
56 #include "widgets/Grabber.h"
58 
59 #include <wx/dcclient.h>
60 #include <wx/menu.h>
61 
62 using std::min;
63 using std::max;
64 
65 //#define SCRUB_ABOVE
66 
67 #define SELECT_TOLERANCE_PIXEL 4
68 
69 #define PLAY_REGION_TRIANGLE_SIZE 6
70 #define PLAY_REGION_RECT_WIDTH 1
71 #define PLAY_REGION_RECT_HEIGHT 3
72 #define PLAY_REGION_GLOBAL_OFFSET_Y 7
73 
74 enum : int {
78 
79  TopMargin = 1,
80  BottomMargin = 2, // for bottom bevel and bottom line
81  LeftMargin = 1,
82 
84 };
85 
86 enum {
89 };
90 
91 inline int IndicatorHeightForWidth(int width)
92 {
93  return ((width / 2) * 3) / 2;
94 }
95 
96 inline int IndicatorWidthForHeight(int height)
97 {
98  // Not an exact inverse of the above, with rounding, but good enough
99  return std::max(static_cast<int>(IndicatorSmallWidth),
100  (((height) * 2) / 3) * 2
101  );
102 }
103 
104 inline int IndicatorBigHeight()
105 {
106  return std::max((int)(ScrubHeight - TopMargin),
107  (int)(IndicatorMediumWidth));
108 }
109 
110 inline int IndicatorBigWidth()
111 {
113 }
114 
116 {
117 public:
118  explicit
120  AdornedRulerPanel *pParent, wxCoord xx, MenuChoice menuChoice )
121  : mParent(pParent)
122  , mX( xx )
123  , mChoice( menuChoice )
124  {}
125 
126  bool Clicked() const { return mClicked != Button::None; }
127 
129  const CommonRulerHandle &oldState, const CommonRulerHandle &newState)
130  {
131  if (oldState.mX != newState.mX)
133  return 0;
134  }
135 
136 protected:
137  bool HandlesRightClick() override { return true; }
138 
140  const TrackPanelMouseEvent &event, AudacityProject *) override
141  {
142  mClicked = event.event.LeftIsDown() ? Button::Left : Button::Right;
144  }
145 
147  const TrackPanelMouseEvent &, AudacityProject *) override
148  {
150  }
151 
153  const TrackPanelMouseEvent &event, AudacityProject *,
154  wxWindow *) override
155  {
156  if ( mParent && mClicked == Button::Right ) {
157  const auto pos = event.event.GetPosition();
158  mParent->ShowContextMenu( mChoice, &pos );
159  }
161  }
162 
164  {
166  }
167 
168  void Enter(bool, AudacityProject *) override
169  {
171  }
172 
173  wxWeakRef<AdornedRulerPanel> mParent;
174 
175  wxCoord mX;
176 
178 
179  enum class Button { None, Left, Right };
181 };
182 
184 public:
186 
188  const TrackPanelMouseState &state, AudacityProject *pProject)
189  override
190  {
191  static wxCursor cursor{ wxCURSOR_DEFAULT };
192  const auto message = XO("Click and drag to define a looping region.");
193  return {
194  message,
195  &cursor,
196  message
197  };
198  }
199 };
200 
201 /**********************************************************************
202 
203 ScrubbingRulerOverlay.
204 Graphical helper for AdornedRulerPanel.
205 
206 **********************************************************************/
207 
208 class TrackPanelGuidelineOverlay;
209 
210 // This is an overlay drawn on the ruler.
212 {
213 public:
215 
216  int mNewQPIndicatorPos { -1 };
217 
218  bool mNewScrub {};
219  bool mNewSeek {};
220 
221  void Update();
222 
223 private:
224  AdornedRulerPanel *GetRuler() const;
225 
226  unsigned SequenceNumber() const override;
227 
228  std::pair<wxRect, bool> DoGetRectangle(wxSize size) override;
229  void Draw(OverlayPanel &panel, wxDC &dc) override;
230 
232 
233  // Used by this only
234  int mOldQPIndicatorPos { -1 };
235  bool mOldScrub {};
236  bool mOldSeek {};
237 };
238 
239 /**********************************************************************
240 
241  TrackPanelGuidelineOverlay.
242  Updated for mouse events in AdornedRulerPanel, but draws on the TrackPanel.
243 
244  **********************************************************************/
245 
246 // This is an overlay drawn on a different window, the track panel.
247 // It draws the pale guide line that follows mouse movement.
249 {
252 
253 public:
255 
256 private:
257  void Update();
258 
259  unsigned SequenceNumber() const override;
260  std::pair<wxRect, bool> DoGetRectangle(wxSize size) override;
261  void Draw(OverlayPanel &panel, wxDC &dc) override;
262 
264 
265  std::shared_ptr<ScrubbingRulerOverlay> mPartner
266  { std::make_shared<ScrubbingRulerOverlay>(*this) };
267 
270 
271  int mOldQPIndicatorPos { -1 };
274 };
275 
276 /**********************************************************************
277 
278  Implementation of ScrubbingRulerOverlay.
279 
280  **********************************************************************/
281 
284 : mPartner(partner)
285 {
286 }
287 
289 {
290  return &Get( *mPartner.mProject );
291 }
292 
294 {
295  const auto project = mPartner.mProject;
296  auto &scrubber = Scrubber::Get( *project );
297  auto ruler = GetRuler();
298 
299  bool scrubbing = (scrubber.IsScrubbing()
300  && !scrubber.IsSpeedPlaying()
301  && !scrubber.IsKeyboardScrubbing());
302 
303  // Hide during transport, or if mouse is not in the ruler, unless scrubbing
304  if ((!ruler->LastCell() || ProjectAudioIO::Get( *project ).IsAudioActive())
305  && !scrubbing)
306  mNewQPIndicatorPos = -1;
307  else {
308  const auto &selectedRegion = ViewInfo::Get( *project ).selectedRegion;
309  double latestEnd =
310  std::max(ruler->mTracks->GetEndTime(), selectedRegion.t1());
311  if (ruler->mQuickPlayPos >= latestEnd)
312  mNewQPIndicatorPos = -1;
313  else {
314  // This will determine the x coordinate of the line and of the
315  // ruler indicator
316  mNewQPIndicatorPos = ruler->Time2Pos(ruler->mQuickPlayPos);
317 
318  // These determine which shape is drawn on the ruler, and whether
319  // in the scrub or the qp zone
320  mNewScrub =
321  !ruler->Target() && // not doing some other drag in the ruler
322  (ruler->LastCell() == ruler->mScrubbingCell ||
323  (scrubber.HasMark()));
324  mNewSeek = mNewScrub &&
325  (scrubber.Seeks() || scrubber.TemporarilySeeks());
326  }
327  }
328 }
329 
330 unsigned
332 {
333  return 30;
334 }
335 
336 std::pair<wxRect, bool>
338 {
339  Update();
340 
341  const auto x = mOldQPIndicatorPos;
342  if (x >= 0) {
343  // These dimensions are always sufficient, even if a little
344  // excessive for the small triangle:
345  const int width = IndicatorBigWidth() * 3 / 2;
346  //const auto height = IndicatorHeightForWidth(width);
347 
348  const int indsize = width / 2;
349 
350  auto xx = x - indsize;
351  auto yy = 0;
352  return {
353  { xx, yy,
354  indsize * 2 + 1,
355  GetRuler()->GetSize().GetHeight() },
356  (x != mNewQPIndicatorPos
357  || (mOldScrub != mNewScrub)
358  || (mOldSeek != mNewSeek) )
359  };
360  }
361  else
362  return { {}, mNewQPIndicatorPos >= 0 };
363 }
364 
366  OverlayPanel & /*panel*/, wxDC &dc)
367 {
368  mOldQPIndicatorPos = mNewQPIndicatorPos;
369  mOldScrub = mNewScrub;
370  mOldSeek = mNewSeek;
371  if (mOldQPIndicatorPos >= 0) {
372  auto ruler = GetRuler();
373  auto width = mOldScrub ? IndicatorBigWidth() : IndicatorSmallWidth;
374  ruler->DoDrawScrubIndicator(
375  &dc, mOldQPIndicatorPos, width, mOldScrub, mOldSeek);
376  }
377 }
378 
379 /**********************************************************************
380 
381  Implementation of TrackPanelGuidelineOverlay.
382 
383  **********************************************************************/
384 
386  AudacityProject *project)
387  : mProject(project)
388 {
389 }
390 
391 unsigned
393 {
394  return 30;
395 }
396 
398 {
399  const auto project = mProject;
400  auto &scrubber = Scrubber::Get( *project );
401  const auto ruler = &Get( *project );
402 
403  // These two will determine the color of the line stroked over
404  // the track panel, green for scrub or yellow for snapped or white
405  mNewPreviewingScrub =
406  ruler->LastCell() == ruler->mScrubbingCell &&
407  !scrubber.IsScrubbing();
408  mNewIndicatorSnapped = ruler->mIsSnapped;
409 }
410 
411 std::pair<wxRect, bool>
413 {
414  Update();
415 
416  wxRect rect(mOldQPIndicatorPos, 0, 1, size.GetHeight());
417  return std::make_pair(
418  rect,
419  (mOldQPIndicatorPos != mPartner->mNewQPIndicatorPos ||
420  mOldIndicatorSnapped != mNewIndicatorSnapped ||
421  mOldPreviewingScrub != mNewPreviewingScrub)
422  );
423 }
424 
426  OverlayPanel &panel, wxDC &dc)
427 {
428  mOldQPIndicatorPos = mPartner->mNewQPIndicatorPos;
429  mOldIndicatorSnapped = mNewIndicatorSnapped;
430  mOldPreviewingScrub = mNewPreviewingScrub;
431 
432  if (mOldQPIndicatorPos >= 0) {
433  mOldPreviewingScrub
434  ? AColor::IndicatorColor(&dc, true) // Draw green line for preview.
435  : mOldIndicatorSnapped
436  ? AColor::SnapGuidePen(&dc)
437  : AColor::Light(&dc, false)
438  ;
439 
440  // Draw indicator in all visible tracks
441  auto pCellularPanel = dynamic_cast<CellularPanel*>( &panel );
442  if ( !pCellularPanel ) {
443  wxASSERT( false );
444  return;
445  }
446  pCellularPanel
447  ->VisitCells( [&]( const wxRect &rect, TrackPanelCell &cell ) {
448  const auto pTrackView = dynamic_cast<TrackView*>(&cell);
449  if (!pTrackView)
450  return;
451 
452  // Draw the NEW indicator in its NEW location
453  AColor::Line(dc,
454  mOldQPIndicatorPos,
455  rect.GetTop(),
456  mOldQPIndicatorPos,
457  rect.GetBottom());
458  } );
459  }
460 }
461 
462 /**********************************************************************
463 
464  Implementation of AdornedRulerPanel.
465  Either we find a way to make this more generic, Or it will move
466  out of the widgets subdirectory into its own source file.
467 
468 **********************************************************************/
469 
470 enum {
477 };
478 
479 BEGIN_EVENT_TABLE(AdornedRulerPanel, CellularPanel)
480  EVT_IDLE( AdornedRulerPanel::OnIdle )
481  EVT_PAINT(AdornedRulerPanel::OnPaint)
482  EVT_SIZE(AdornedRulerPanel::OnSize)
483 
484  // Context menu commands
492 
496 
498 
500 {
501 public:
502  explicit
503  CommonCell( AdornedRulerPanel *parent, MenuChoice menuChoice )
504  : mParent{ parent }
505  , mMenuChoice{ menuChoice }
506  {}
507 
509  const TrackPanelMouseState &, const AudacityProject *)
510  override
511  {
512  // May come here when recording is in progress, so hit tests are turned
513  // off.
514  TranslatableString tooltip;
515  if (mParent->mTimelineToolTip)
516  tooltip = XO("Timeline actions disabled during recording");
517 
518  static wxCursor cursor{ wxCURSOR_DEFAULT };
519  return {
520  {},
521  &cursor,
522  tooltip,
523  };
524  }
525 
526  unsigned DoContextMenu(
527  const wxRect &,
528  wxWindow *, const wxPoint *pPosition, AudacityProject*) final
529  {
530  mParent->ShowContextMenu(mMenuChoice, pPosition);
531  return 0;
532  }
533 
534 protected:
537 };
538 
539 #undef QUICK_PLAY_HANDLE
540 #ifdef QUICK_PLAY_HANDLE
541 class AdornedRulerPanel::QPHandle final : public CommonRulerHandle
542 {
543 public:
544  explicit
545  QPHandle( AdornedRulerPanel *pParent, wxCoord xx )
546  : CommonRulerHandle( pParent, xx, MenuChoice::QuickPlay )
547  {
548  }
549 
550 private:
551  Result Click(
552  const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
553 
554  Result Drag(
555  const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
556 
558  const TrackPanelMouseState &state, AudacityProject *pProject)
559  override;
560 
561  Result Release(
562  const TrackPanelMouseEvent &event, AudacityProject *pProject,
563  wxWindow *pParent) override;
564 
565  Result Cancel(AudacityProject *pProject) override;
566 
567  SelectedRegion mOldSelection;
568 };
569 #endif
570 
571 namespace
572 {
573 
574 wxCoord GetPlayHeadX( const AudacityProject *pProject )
575 {
576  const auto &viewInfo = ViewInfo::Get( *pProject );
577  auto width = viewInfo.GetTracksUsableWidth();
578  return viewInfo.GetLeftOffset()
580 }
581 
582 double GetPlayHeadFraction( const AudacityProject *pProject, wxCoord xx )
583 {
584  const auto &viewInfo = ViewInfo::Get( *pProject );
585  auto width = viewInfo.GetTracksUsableWidth();
586  auto fraction = (xx - viewInfo.GetLeftOffset()) / double(width);
587  return std::max(0.0, std::min(1.0, fraction));
588 }
589 
590 // Handle for dragging the pinned play head, which so far does not need
591 // to be a friend of the AdornedRulerPanel class, so we don't make it nested.
592 class PlayheadHandle : public UIHandle
593 {
594 public:
595  explicit
596  PlayheadHandle( wxCoord xx )
597  : mX( xx )
598  {}
599 
601  const PlayheadHandle &oldState, const PlayheadHandle &newState)
602  {
603  if (oldState.mX != newState.mX)
605  return 0;
606  }
607 
608  static std::shared_ptr<PlayheadHandle>
609  HitTest( const AudacityProject *pProject, wxCoord xx )
610  {
611  if( Scrubber::Get( *pProject )
612  .IsTransportingPinned() &&
613  ProjectAudioIO::Get( *pProject ).IsAudioActive() )
614  {
615  const auto targetX = GetPlayHeadX( pProject );
616  if ( abs( xx - targetX ) <= SELECT_TOLERANCE_PIXEL )
617  return std::make_shared<PlayheadHandle>( xx );
618  }
619  return {};
620  }
621 
622 protected:
624  const TrackPanelMouseEvent &event, AudacityProject *) override
625  {
626  if (event.event.LeftDClick()) {
627  // Restore default position on double click
629 
631  // Do not start a drag
633  }
634  // Fix for Bug 2357
635  if (!event.event.LeftIsDown())
636  return RefreshCode::Cancelled;
637 
639  return 0;
640  }
641 
643  const TrackPanelMouseEvent &event, AudacityProject *pProject) override
644  {
645 
646  auto value = GetPlayHeadFraction(pProject, event.event.m_x );
649  }
650 
653  override
654  {
655  static wxCursor cursor{ wxCURSOR_SIZEWE };
656  return {
657  XO( "Click and drag to adjust, double-click to reset" ),
658  &cursor,
659  /* i18n-hint: This text is a tooltip on the icon (of a pin) representing
660  the temporal position in the audio. */
661  XO( "Record/Play head" )
662  };
663  }
664 
666  const TrackPanelMouseEvent &event, AudacityProject *pProject,
667  wxWindow *) override
668  {
669  auto value = GetPlayHeadFraction(pProject, event.event.m_x );
672  }
673 
675  {
678  }
679 
680  void Enter(bool, AudacityProject *) override
681  {
682  mChangeHighlight = RefreshCode::DrawOverlays;
683  }
684 
685  wxCoord mX;
686  double mOrigPreference {};
687 };
688 
689 }
690 
692 {
693 public:
694  explicit
697  {}
698 
699  std::vector<UIHandlePtr> HitTest(
700  const TrackPanelMouseState &state,
701  const AudacityProject *pProject) override;
702 
703  // Return shared_ptr to self, stored in parent
704  std::shared_ptr<TrackPanelCell> ContextMenuDelegate() override
705  { return mParent->mQPCell; }
706 
707  bool Clicked() const {
708 #ifdef QUICK_PLAY_HANDLE
709  if (auto ptr = mHolder.lock())
710  return ptr->Clicked();
711 #endif
712  return false;
713  }
714 
715 #ifdef QUICK_PLAY_HANDLE
716  std::weak_ptr<QPHandle> mHolder;
717 #endif
718 
719  std::weak_ptr<PlayheadHandle> mPlayheadHolder;
720 };
721 
722 std::vector<UIHandlePtr> AdornedRulerPanel::QPCell::HitTest(
723  const TrackPanelMouseState &state,
724  const AudacityProject *pProject)
725 {
726  // Creation of overlays on demand here -- constructor of AdornedRulerPanel
727  // is too early to do it
728  mParent->CreateOverlays();
729 
730  std::vector<UIHandlePtr> results;
731  auto xx = state.state.m_x;
732 
733 #ifdef EXPERIMENTAL_DRAGGABLE_PLAY_HEAD
734  {
735  // Allow click and drag on the play head even while recording
736  // Make this handle more prominent then the quick play handle
737  auto result = PlayheadHandle::HitTest( pProject, xx );
738  if (result) {
739  result = AssignUIHandlePtr( mPlayheadHolder, result );
740  results.push_back( result );
741  }
742  }
743 #endif
744 
745  // Disable mouse actions on Timeline while recording.
746  if (!mParent->mIsRecording) {
747  mParent->UpdateQuickPlayPos( xx, state.state.ShiftDown() );
748 
749  #if 0
750  auto result = std::make_shared<QPHandle>( mParent, xx );
751  result = AssignUIHandlePtr( mHolder, result );
752  results.push_back( result );
753  #endif
754  }
755 
756  return results;
757 }
758 
760 {
761 public:
762  explicit
763  ScrubbingHandle( AdornedRulerPanel *pParent, wxCoord xx )
764  : CommonRulerHandle( pParent, xx, MenuChoice::Scrub )
765  {
766  }
767 
768 private:
770  const TrackPanelMouseEvent &event, AudacityProject *pProject) override
771  {
772  auto result = CommonRulerHandle::Click(event, pProject);
773  if (!( result & RefreshCode::Cancelled )) {
774  if (mClicked == Button::Left) {
775  auto &scrubber = Scrubber::Get( *pProject );
776  // only if scrubbing is allowed now
777  bool canScrub =
778  scrubber.CanScrub() &&
779  mParent &&
780  mParent->ShowingScrubRuler();
781 
782  if (!canScrub)
783  return RefreshCode::Cancelled;
784  if (!scrubber.HasMark()) {
785  // Asynchronous scrub poller gets activated here
786  scrubber.MarkScrubStart(
787  event.event.m_x, Scrubber::ShouldScrubPinned(), false);
788  }
789  }
790  }
791  return result;
792  }
793 
795  const TrackPanelMouseEvent &event, AudacityProject *pProject) override
796  {
797  auto result = CommonRulerHandle::Drag(event, pProject);
798  if (!( result & RefreshCode::Cancelled )) {
799  // Nothing needed here. The scrubber works by polling mouse state
800  // after the start has been marked.
801  }
802  return result;
803  }
804 
806  const TrackPanelMouseState &state, AudacityProject *pProject)
807  override;
808 
810  const TrackPanelMouseEvent &event, AudacityProject *pProject,
811  wxWindow *pParent) override {
812  auto result = CommonRulerHandle::Release(event, pProject, pParent);
813  if (!( result & RefreshCode::Cancelled )) {
814  // Nothing needed here either. The scrub poller may have decided to
815  // seek because a drag happened before button up, or it may decide
816  // to start a scrub, as it watches mouse movement after the button up.
817  }
818  return result;
819  }
820 
821  Result Cancel(AudacityProject *pProject) override
822  {
823  auto result = CommonRulerHandle::Cancel(pProject);
824 
825  if (mClicked == Button::Left) {
826  auto &scrubber = Scrubber::Get( *pProject );
827  scrubber.Cancel();
828 
829  ProjectAudioManager::Get( *pProject ).Stop();
830  }
831 
832  return result;
833  }
834 };
835 
837 {
838 public:
839  explicit
842  {}
843 
844  std::vector<UIHandlePtr> HitTest(
845  const TrackPanelMouseState &state,
846  const AudacityProject *pProject) override;
847 
848  // Return shared_ptr to self, stored in parent
849  std::shared_ptr<TrackPanelCell> ContextMenuDelegate() override
850  { return mParent->mScrubbingCell; }
851 
852  bool Hit() const { return !mHolder.expired(); }
853  bool Clicked() const {
854  if (auto ptr = mHolder.lock())
855  return ptr->Clicked();
856  return false;
857  }
858 
859 private:
860  std::weak_ptr<ScrubbingHandle> mHolder;
861 };
862 
864  const TrackPanelMouseState &state, const AudacityProject *)
865 {
866  // Creation of overlays on demand here -- constructor of AdornedRulerPanel
867  // is too early to do it
868  mParent->CreateOverlays();
869 
870  std::vector<UIHandlePtr> results;
871 
872  // Disable mouse actions on Timeline while recording.
873  if (!mParent->mIsRecording) {
874  auto xx = state.state.m_x;
875  mParent->UpdateQuickPlayPos( xx, state.state.ShiftDown() );
876  auto result = std::make_shared<ScrubbingHandle>( mParent, xx );
877  result = AssignUIHandlePtr( mHolder, result );
878  results.push_back( result );
879  }
880 
881  return results;
882 }
883 
884 namespace{
885 AttachedWindows::RegisteredFactory sKey{
886 []( AudacityProject &project ) -> wxWeakRef< wxWindow > {
887  auto &viewInfo = ViewInfo::Get( project );
888  auto &window = ProjectWindow::Get( project );
889 
890  return safenew AdornedRulerPanel( &project, window.GetTopPanel(),
891  wxID_ANY,
892  wxDefaultPosition,
893  wxSize( -1, AdornedRulerPanel::GetRulerHeight(false) ),
894  &viewInfo );
895 }
896 };
897 }
898 
900 {
901  return GetAttachedWindows(project).Get< AdornedRulerPanel >( sKey );
902 }
903 
905  const AudacityProject &project )
906 {
907  return Get( const_cast< AudacityProject & >( project ) );
908 }
909 
911 {
912  auto *pPanel = GetAttachedWindows(project).Find( sKey );
913  if (pPanel) {
914  pPanel->wxWindow::Destroy();
915  GetAttachedWindows(project).Assign( sKey, nullptr );
916  }
917 }
918 
920  wxWindow *parent,
921  wxWindowID id,
922  const wxPoint& pos,
923  const wxSize& size,
924  ViewInfo *viewinfo)
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 }
985 
987 {
988 }
989 
990 void AdornedRulerPanel::Refresh( bool eraseBackground, const wxRect *rect )
991 {
992  CellularPanel::Refresh( eraseBackground, rect );
994 }
995 
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 }
1020 
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 }
1095 
1097 {
1098  mRuler.Invalidate();
1099 }
1100 
1101 namespace {
1103  {
1104 #if 0
1105  if(scrubber.Seeks())
1106  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1107  "Scrubbing" is variable-speed playback, ...
1108  "Seeking" is normal speed playback but with skips
1109  */
1110  return XO("Click or drag to begin Seek");
1111  else
1112  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1113  "Scrubbing" is variable-speed playback, ...
1114  "Seeking" is normal speed playback but with skips
1115  */
1116  return XO("Click or drag to begin Scrub");
1117 #else
1118  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1119  "Scrubbing" is variable-speed playback, ...
1120  "Seeking" is normal speed playback but with skips
1121  */
1122  return XO("Click & move to Scrub. Click & drag to Seek.");
1123 #endif
1124  }
1125 
1127  const Scrubber &scrubber, bool clicked)
1128  {
1129 #if 0
1130  if(scrubber.Seeks())
1131  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1132  "Scrubbing" is variable-speed playback, ...
1133  "Seeking" is normal speed playback but with skips
1134  */
1135  return XO("Move to Seek");
1136  else
1137  /* i18n-hint: These commands assist the user in finding a sound by ear. ...
1138  "Scrubbing" is variable-speed playback, ...
1139  "Seeking" is normal speed playback but with skips
1140  */
1141  return XO("Move to Scrub");
1142 #else
1143  if( clicked ) {
1144  // Since mouse is down, mention dragging first.
1145  // IsScrubbing is true if Scrubbing OR seeking.
1146  if( scrubber.IsScrubbing() )
1147  // User is dragging already, explain.
1148  return XO("Drag to Seek. Release to stop seeking.");
1149  else
1150  // User has clicked but not yet moved or released.
1151  return XO("Drag to Seek. Release and move to Scrub.");
1152  }
1153  // Since mouse is up, mention moving first.
1154  return XO("Move to Scrub. Drag to Seek.");
1155 #endif
1156  }
1157 
1158  const TranslatableString ScrubbingMessage(const Scrubber &scrubber, bool clicked)
1159  {
1160  if (scrubber.HasMark())
1161  return ContinueScrubbingMessage(scrubber, clicked);
1162  else
1163  return StartScrubbingMessage(scrubber);
1164  }
1165 }
1166 
1167 void AdornedRulerPanel::OnIdle( wxIdleEvent &evt )
1168 {
1169  evt.Skip();
1170  DoIdle();
1171 }
1172 
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 }
1199 
1200 void AdornedRulerPanel::OnAudioStartStop(wxCommandEvent & evt)
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 }
1223 
1224 void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
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 }
1256 
1257 void AdornedRulerPanel::OnSize(wxSizeEvent &evt)
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 }
1269 
1270 void AdornedRulerPanel::OnThemeChange(wxCommandEvent& evt)
1271 {
1272  evt.Skip();
1273  ReCreateButtons();
1274 }
1275 
1277 {
1278  evt.Skip();
1279  if (!evt.pRegion)
1280  return;
1281  auto &selectedRegion = *evt.pRegion;
1282  DoSelectionChange( selectedRegion );
1283 }
1284 
1286  const SelectedRegion &selectedRegion )
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 }
1295 
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 }
1348 
1349 double AdornedRulerPanel::Pos2Time(int p, bool ignoreFisheye)
1350 {
1352  , ignoreFisheye
1353  );
1354 }
1355 
1356 int AdornedRulerPanel::Time2Pos(double t, bool ignoreFisheye)
1357 {
1359  , ignoreFisheye
1360  );
1361 }
1362 
1363 bool AdornedRulerPanel::IsWithinMarker(int mousePosX, double markerTime)
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 }
1374 
1375 #ifdef QUICK_PLAY_HANDLE
1376 auto AdornedRulerPanel::QPHandle::Click(
1377  const TrackPanelMouseEvent &event, AudacityProject *pProject) -> Result
1378 {
1379  auto result = CommonRulerHandle::Click(event, pProject);
1380  if (!( result & RefreshCode::Cancelled )) {
1381  if (mClicked == Button::Left) {
1382  if (!mParent)
1383  return RefreshCode::Cancelled;
1384 
1385  auto &scrubber = Scrubber::Get( *pProject );
1386  if(scrubber.HasMark()) {
1387  // We can't stop scrubbing yet (see comments in Bug 1391),
1388  // but we can pause it.
1389  ProjectAudioManager::Get( *pProject ).OnPause();
1390  }
1391 
1392  // Store the initial play region state
1393  const auto &viewInfo = ViewInfo::Get( *pProject );
1394  const auto &playRegion = viewInfo.playRegion;
1395  mParent->mOldPlayRegion = playRegion;
1396 
1397  // Save old selection, in case drag of selection is cancelled
1398  mOldSelection = ViewInfo::Get( *pProject ).selectedRegion;
1399 
1400  mParent->HandleQPClick( event.event, mX );
1401  mParent->HandleQPDrag( event.event, mX );
1402  }
1403  }
1404 
1405  return result;
1406 }
1407 
1408 void AdornedRulerPanel::HandleQPClick(wxMouseEvent &evt, wxCoord mousePosX)
1409 {
1410  // Temporarily inactivate play region
1411  if (mOldPlayRegion.Active() && evt.LeftDown()) {
1412  //mPlayRegionLock = true;
1414  }
1415 
1418  bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegion.GetStart());
1419  bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegion.GetEnd());
1420 
1421  if (isWithinStart || isWithinEnd) {
1422  // If Quick-Play is playing from a point, we need to treat it as a click
1423  // not as dragging.
1424  if (mOldPlayRegion.Empty())
1426  // otherwise check which marker is nearer
1427  else {
1428  // Don't compare times, compare positions.
1429  //if (fabs(mQuickPlayPos - mPlayRegionStart) < fabs(mQuickPlayPos - mPlayRegionEnd))
1430  auto start = mOldPlayRegion.GetStart();
1431  auto end = mOldPlayRegion.GetEnd();
1432  if (abs(Time2Pos(mQuickPlayPos) - Time2Pos(start)) <
1433  abs(Time2Pos(mQuickPlayPos) - Time2Pos(end)))
1435  else
1437  }
1438  }
1439  else {
1440  // Clicked but not yet dragging
1442  }
1443 }
1444 
1445 auto AdornedRulerPanel::QPHandle::Drag(
1446  const TrackPanelMouseEvent &event, AudacityProject *pProject) -> Result
1447 {
1448  auto result = CommonRulerHandle::Drag(event, pProject);
1449  if (!( result & RefreshCode::Cancelled )) {
1450  if (mClicked == Button::Left) {
1451  if ( mParent ) {
1452  mX = event.event.m_x;
1453  mParent->UpdateQuickPlayPos( mX, event.event.ShiftDown() );
1454  mParent->HandleQPDrag( event.event, mX );
1455  }
1456  }
1457  }
1458  return result;
1459 }
1460 
1461 void AdornedRulerPanel::HandleQPDrag(wxMouseEvent &/*event*/, wxCoord mousePosX)
1462 {
1463  bool isWithinClick =
1464  (mLeftDownClickUnsnapped >= 0) &&
1466  bool isWithinStart = IsWithinMarker(mousePosX, mOldPlayRegion.GetStart());
1467  bool isWithinEnd = IsWithinMarker(mousePosX, mOldPlayRegion.GetEnd());
1468  bool canDragSel = !mOldPlayRegion.Active() && mPlayRegionDragsSelection;
1469  auto &viewInfo = ViewInfo::Get( *GetProject() );
1470  auto &playRegion = viewInfo.playRegion;
1471 
1472  switch (mMouseEventState)
1473  {
1474  case mesNone:
1475  // If close to either end of play region, snap to closest
1476  if (isWithinStart || isWithinEnd) {
1479  else
1481  }
1482  break;
1484  // Don't start dragging until beyond tolerance initial playback start
1485  if (!mIsDragging && isWithinStart)
1487  else
1488  mIsDragging = true;
1489  // avoid accidental tiny selection
1490  if (isWithinEnd)
1492  playRegion.SetStart( mQuickPlayPos );
1493  if (canDragSel) {
1494  DragSelection();
1495  }
1496  break;
1498  if (!mIsDragging && isWithinEnd) {
1500  }
1501  else
1502  mIsDragging = true;
1503  if (isWithinStart) {
1505  }
1506  playRegion.SetEnd( mQuickPlayPos );
1507  if (canDragSel) {
1508  DragSelection();
1509  }
1510  break;
1512 
1513  // Don't start dragging until mouse is beyond tolerance of initial click.
1514  if (isWithinClick || mLeftDownClick == -1) {
1516  playRegion.SetTimes(mLeftDownClick, mLeftDownClick);
1517  }
1518  else {
1520  }
1521  break;
1523  if (isWithinClick) {
1525  }
1526 
1528  playRegion.SetTimes( mQuickPlayPos, mLeftDownClick );
1529  else
1530  playRegion.SetTimes( mLeftDownClick, mQuickPlayPos );
1531  if (canDragSel) {
1532  DragSelection();
1533  }
1534  break;
1535  }
1536  Refresh();
1537  Update();
1538 }
1539 #endif
1540 
1542  const TrackPanelMouseState &, AudacityProject *pProject)
1543  -> HitTestPreview
1544 {
1545  auto &scrubber = Scrubber::Get( *pProject );
1546  auto message = ScrubbingMessage(scrubber, mClicked == Button::Left);
1547 
1548  return {
1549  message,
1550  {},
1551  // Tooltip is same as status message, or blank
1552  ((mParent && mParent->mTimelineToolTip) ? message : TranslatableString{}),
1553  };
1554 }
1555 
1556 #ifdef QUICK_PLAY_HANDLE
1557 auto AdornedRulerPanel::QPHandle::Preview(
1558  const TrackPanelMouseState &state, AudacityProject *pProject)
1559  -> HitTestPreview
1560 {
1561  TranslatableString tooltip;
1562  #if 0
1563  if (mParent && mParent->mTimelineToolTip) {
1564  if (!mParent->mQuickPlayEnabled)
1565  tooltip = XO("Quick-Play disabled");
1566  else
1567  tooltip = XO("Quick-Play enabled");
1568  }
1569  #endif
1570 
1571  TranslatableString message;
1572  auto &scrubber = Scrubber::Get( *pProject );
1573  const bool scrubbing = scrubber.HasMark();
1574  if (scrubbing)
1575  // Don't distinguish zones
1576  message = ScrubbingMessage(scrubber, false);
1577  else
1578  // message = Insert timeline status bar message here
1579  ;
1580 
1581  static wxCursor cursorHand{ wxCURSOR_HAND };
1582  static wxCursor cursorSizeWE{ wxCURSOR_SIZEWE };
1583 
1584  bool showArrows = false;
1585  if (mParent)
1586  showArrows =
1587  (mClicked == Button::Left)
1588  || mParent->IsWithinMarker(
1589  state.state.m_x, mParent->mOldPlayRegion.GetStart())
1590  || mParent->IsWithinMarker(
1591  state.state.m_x, mParent->mOldPlayRegion.GetEnd());
1592 
1593  return {
1594  message,
1595  showArrows ? &cursorSizeWE : &cursorHand,
1596  tooltip,
1597  };
1598 }
1599 
1601  const TrackPanelMouseEvent &event, AudacityProject *pProject,
1602  wxWindow *pParent)
1603  -> Result
1604 {
1605  // Keep a shared pointer to self. Otherwise *this might get deleted
1606  // in HandleQPRelease on Windows! Because there is an event-loop yield
1607  // stopping playback, which caused OnCaptureLost to be called, which caused
1608  // clearing of CellularPanel targets!
1609  auto saveMe = mParent->mQPCell->mHolder.lock();
1610 
1611  auto result = CommonRulerHandle::Release(event, pProject, pParent);
1612  if (!( result & RefreshCode::Cancelled )) {
1613  if (mClicked == Button::Left) {
1614  if ( mParent ) {
1615  mParent->HandleQPRelease( event.event );
1616  // Update the hot zones for cursor changes
1617  const auto &viewInfo = ViewInfo::Get( *pProject );
1618  const auto &playRegion = viewInfo.playRegion;
1619  mParent->mOldPlayRegion = playRegion;
1620  }
1621  }
1622  }
1623  return result;
1624 }
1625 
1626 void AdornedRulerPanel::HandleQPRelease(wxMouseEvent &evt)
1627 {
1628  auto &viewInfo = ViewInfo::Get( *GetProject() );
1629  auto &playRegion = viewInfo.playRegion;
1630  playRegion.Order();
1631 
1632  const double t0 = mTracks->GetStartTime();
1633  const double t1 = mTracks->GetEndTime();
1634  const auto &selectedRegion = viewInfo.selectedRegion;
1635  const double sel0 = selectedRegion.t0();
1636  const double sel1 = selectedRegion.t1();
1637 
1638  // We want some audio in the selection, but we allow a dragged
1639  // region to include selected white-space and space before audio start.
1640  if (evt.ShiftDown() && playRegion.Empty()) {
1641  // Looping the selection or project.
1642  // Disable if track selection is in white-space beyond end of tracks and
1643  // play position is outside of track contents.
1644  if (((sel1 < t0) || (sel0 > t1)) &&
1645  ((playRegion.GetStart() < t0) || (playRegion.GetStart() > t1))) {
1646  ClearPlayRegion();
1647  }
1648  }
1649  // Disable if beyond end.
1650  else if (playRegion.GetStart() >= t1) {
1651  ClearPlayRegion();
1652  }
1653  // Disable if empty selection before start.
1654  // (allow Quick-Play region to include 'pre-roll' white space)
1655  else if (
1656  playRegion.GetEnd() - playRegion.GetStart() > 0.0 &&
1657  playRegion.GetEnd() < t0
1658  ) {
1659  ClearPlayRegion();
1660  }
1661 
1663  mIsDragging = false;
1664  mLeftDownClick = -1;
1665 
1666  auto cleanup = finally( [&] {
1667  if (mOldPlayRegion.Active()) {
1668  // Restore Locked Play region
1669  SetPlayRegion(mOldPlayRegion.GetStart(), mOldPlayRegion.GetEnd());
1670  SelectUtilities::ActivatePlayRegion(*mProject);
1671  // and release local lock
1672  mOldPlayRegion.SetActive( false );
1673  }
1674  } );
1675 
1676  StartQPPlay(evt.ShiftDown(), evt.ControlDown());
1677 }
1678 
1679 auto AdornedRulerPanel::QPHandle::Cancel(AudacityProject *pProject) -> Result
1680 {
1681  auto result = CommonRulerHandle::Cancel(pProject);
1682 
1683  if (mClicked == Button::Left) {
1684  if( mParent ) {
1685  ViewInfo::Get( *pProject ).selectedRegion = mOldSelection;
1686  mParent->mMouseEventState = mesNone;
1687  mParent->SetPlayRegion(
1688  mParent->mOldPlayRegion.GetStart(), mParent->mOldPlayRegion.GetEnd());
1689  if (mParent->mOldPlayRegion.Active()) {
1690  // Restore Locked Play region
1692  // and release local lock
1693  mParent->mOldPlayRegion.SetActive( false );
1694  }
1695  }
1696  }
1697 
1698  return result;
1699 }
1700 #endif
1701 
1702 void AdornedRulerPanel::StartQPPlay(bool looped, bool cutPreview)
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 }
1770 
1771 #if 0
1772 // This version toggles ruler state indirectly via the scrubber
1773 // to ensure that all the places where the state is shown update.
1774 // For example buttons and menus must update.
1775 void AdornedRulerPanel::OnToggleScrubRulerFromMenu(wxCommandEvent&)
1776 {
1777  auto &scrubber = Scrubber::Get( *mProject );
1778  scrubber.OnToggleScrubRuler(*mProject);
1779 }
1780 #endif
1781 
1782 
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 }
1796 
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 }
1808 
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 }
1838 
1839 void AdornedRulerPanel::OnPinnedButton(wxCommandEvent & /*event*/)
1840 {
1842 }
1843 
1844 void AdornedRulerPanel::OnTogglePinnedState(wxCommandEvent & /*event*/)
1845 {
1846  TogglePinnedHead();
1848 }
1849 
1850 void AdornedRulerPanel::UpdateQuickPlayPos(wxCoord &mousePosX, bool shiftDown)
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 }
1868 
1869 // Pop-up menus
1870 
1871 void AdornedRulerPanel::ShowMenu(const wxPoint & pos)
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 }
1910 
1911 void AdornedRulerPanel::ShowScrubMenu(const wxPoint & pos)
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 }
1924 
1926 {
1928  gPrefs->Write(wxT("/QuickPlay/DragSelection"), mPlayRegionDragsSelection);
1929  gPrefs->Flush();
1930 }
1931 
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 }
1940 
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 }
1953 
1954 #if 0
1955 void AdornedRulerPanel::OnTimelineToolTips(wxCommandEvent&)
1956 {
1957  mTimelineToolTip = (mTimelineToolTip)? false : true;
1958  gPrefs->Write(wxT("/QuickPlay/ToolTips"), mTimelineToolTip);
1959  gPrefs->Flush();
1960 }
1961 #endif
1962 
1963 void AdornedRulerPanel::OnAutoScroll(wxCommandEvent&)
1964 {
1966  gPrefs->Write(wxT("/GUI/AutoScroll"), false);
1967  else
1968  gPrefs->Write(wxT("/GUI/AutoScroll"), true);
1969 
1970  gPrefs->Flush();
1971 
1973 }
1974 
1975 
1977 {
1979 }
1980 
1982 {
1984 }
1985 
1987 {
1989 }
1990 
1991 
1993  MenuChoice choice, const wxPoint *pPosition)
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 }
2022 
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 }
2038 
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 }
2053 
2054 void AdornedRulerPanel::DoDrawMarks(wxDC * dc, bool /*text */ )
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 }
2065 
2067 {
2068  Refresh();
2069 }
2070 
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 }
2127 
2129 {
2130  return ProperRulerHeight + (showScrubBar ? ScrubHeight : 0);
2131 }
2132 
2134 {
2135  mLeftOffset = offset;
2136  mRuler.SetUseZoomInfo(offset, mViewInfo);
2137 }
2138 
2139 // Draws the scrubbing/seeking indicator.
2141  wxDC * dc, wxCoord xx, int width, bool scrub, bool seek)
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 }
2198 
2200  double playRegionStart, double playRegionEnd)
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 }
2214 
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 }
2225 
2226 void AdornedRulerPanel::GetMaxSize(wxCoord *width, wxCoord *height)
2227 {
2228  mRuler.GetMaxSize(width, height);
2229 }
2230 
2231 bool AdornedRulerPanel::s_AcceptsFocus{ false };
2232 
2234  s_AcceptsFocus = true;
2235  return TempAllowFocus{ &s_AcceptsFocus };
2236 }
2237 
2239 {
2240  auto temp = TemporarilyAllowFocus();
2241  SetFocus();
2242 }
2243 
2244 // Second-level subdivision includes quick-play region and maybe the scrub bar
2245 // and also shaves little margins above and below
2247  explicit Subgroup( const AdornedRulerPanel &ruler ) : mRuler{ ruler } {}
2248  Subdivision Children( const wxRect & ) override
2249  {
2250  return { Axis::Y, ( mRuler.ShowingScrubRuler() )
2251  ? Refinement{
2252  { mRuler.mInner.GetTop(), mRuler.mQPCell },
2253  { mRuler.mScrubZone.GetTop(), mRuler.mScrubbingCell },
2254  { mRuler.mScrubZone.GetBottom() + 1, nullptr }
2255  }
2256  : Refinement{
2257  { mRuler.mInner.GetTop(), mRuler.mQPCell },
2258  { mRuler.mInner.GetBottom() + 1, nullptr }
2259  }
2260  };
2261  }
2263 };
2264 
2265 // Top-level subdivision shaves little margins off left and right
2267  explicit MainGroup( const AdornedRulerPanel &ruler ) : mRuler{ ruler } {}
2268  Subdivision Children( const wxRect & ) override
2269  { return { Axis::X, Refinement{
2270  // Subgroup is a throwaway object
2271  { mRuler.mInner.GetLeft(), std::make_shared< Subgroup >( mRuler ) },
2272  { mRuler.mInner.GetRight() + 1, nullptr }
2273  } }; }
2275 };
2276 
2278 {
2279  auto &scrubber = Scrubber::Get( *GetProject() );
2280  return scrubber.ShowsBar();
2281 }
2282 
2283 // CellularPanel implementation
2284 std::shared_ptr<TrackPanelNode> AdornedRulerPanel::Root()
2285 {
2286  // Root is a throwaway object
2287  return std::make_shared< MainGroup >( *this );
2288 }
2289 
2291 {
2292  return mProject;
2293 }
2294 
2295 
2297 {
2298  // No switching of focus yet to the other, scrub zone
2299  return mQPCell.get();
2300 }
2301 
2302 
2304 {
2305 }
2306 
2307 
2309  TrackPanelCell *, TrackPanelCell *, unsigned refreshResult)
2310 {
2311  if (refreshResult & RefreshCode::DrawOverlays)
2312  DrawBothOverlays();
2313 }
2314 
2316 {
2317  ProjectStatus::Get( *GetProject() ).Set(message);
2318 }
2319 
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 }
2335 
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 }
AdornedRulerPanel::Destroy
static void Destroy(AudacityProject &project)
Definition: AdornedRulerPanel.cpp:910
size
size_t size
Definition: ffmpeg-2.3.6-single-header.h:412
AdornedRulerPanel::ReCreateButtons
void ReCreateButtons()
Definition: AdornedRulerPanel.cpp:1021
AButton.h
AdornedRulerPanel::ScrubbingHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: AdornedRulerPanel.cpp:769
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
SelectedRegionEvent
Definition: ViewInfo.h:28
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
AdornedRulerPanel::HandleQPRelease
void HandleQPRelease(wxMouseEvent &event)
SelectUtilities::ClearPlayRegion
void ClearPlayRegion(AudacityProject &project)
Definition: SelectUtilities.cpp:211
ToolBar.h
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
TrackPanelGroup::Refinement
std::vector< Child > Refinement
Definition: TrackPanelCell.h:64
teBmps
int teBmps
Definition: ImageManipulation.h:48
TrackPanelMouseEvent.h
TrackPanelGroup::Subdivision
std::pair< Axis, Refinement > Subdivision
Definition: TrackPanelCell.h:65
AdornedRulerPanel::TrackPanelGuidelineOverlay::mOldPreviewingScrub
bool mOldPreviewingScrub
Definition: AdornedRulerPanel.cpp:273
AdornedRulerPanel::Refresh
void Refresh(bool eraseBackground=true, const wxRect *rect=(const wxRect *) NULL) override
Definition: AdornedRulerPanel.cpp:990
ProjectStatus.h
Scrubber::Get
static Scrubber & Get(AudacityProject &project)
Definition: Scrubbing.cpp:201
PlayRegion::GetEnd
double GetEnd() const
Definition: ViewInfo.h:156
AdornedRulerPanel::OnAutoScroll
void OnAutoScroll(wxCommandEvent &evt)
Definition: AdornedRulerPanel.cpp:1963
CellularPanel::HandleCursorForPresentMouseState
void HandleCursorForPresentMouseState(bool doHit=true)
Definition: CellularPanel.cpp:231
UIHandle::Preview
virtual HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject)=0
Grabber.h
ScrubHeight
@ ScrubHeight
Definition: AdornedRulerPanel.cpp:87
AdornedRulerPanel::TrackPanelGuidelineOverlay::ScrubbingRulerOverlay
friend ScrubbingRulerOverlay
Definition: AdornedRulerPanel.cpp:250
AdornedRulerPanel
This is an Audacity Specific ruler panel which additionally has border, selection markers,...
Definition: AdornedRulerPanel.h:27
AdornedRulerPanel::CommonRulerHandle::mChoice
MenuChoice mChoice
Definition: AdornedRulerPanel.cpp:177
ProjectAudioManager::Get
static ProjectAudioManager & Get(AudacityProject &project)
Definition: ProjectAudioManager.cpp:55
AdornedRulerPanel::CommonRulerHandle::mParent
wxWeakRef< AdornedRulerPanel > mParent
Definition: AdornedRulerPanel.cpp:173
CellularPanel::LastCell
std::shared_ptr< TrackPanelCell > LastCell() const
Definition: CellularPanel.cpp:1196
AdornedRulerPanel::IsWithinMarker
bool IsWithinMarker(int mousePosX, double markerTime)
Definition: AdornedRulerPanel.cpp:1363
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle
Definition: AdornedRulerPanel.cpp:593
AdornedRulerPanel::ScrubbingCell::HitTest
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *pProject) override
Definition: AdornedRulerPanel.cpp:863
AdornedRulerPanel::CommonCell
Definition: AdornedRulerPanel.cpp:500
AdornedRulerPanel::TrackPanelGuidelineOverlay::Draw
void Draw(OverlayPanel &panel, wxDC &dc) override
Definition: AdornedRulerPanel.cpp:425
AdornedRulerPanel::OnThemeChange
void OnThemeChange(wxCommandEvent &evt)
Definition: AdornedRulerPanel.cpp:1270
AdornedRulerPanel::TrackPanelGuidelineOverlay::Update
void Update()
Definition: AdornedRulerPanel.cpp:397
IndicatorOffset
@ IndicatorOffset
Definition: AdornedRulerPanel.cpp:77
AdornedRulerPanel::mTracks
TrackList * mTracks
Definition: AdornedRulerPanel.h:124
ViewInfo::bUpdateTrackIndicator
bool bUpdateTrackIndicator
Definition: ViewInfo.h:252
Scrubber::ShouldScrubPinned
static bool ShouldScrubPinned()
Definition: Scrubbing.cpp:164
BackedPanel::DisplayBitmap
void DisplayBitmap(wxDC &dc)
Definition: BackedPanel.cpp:65
AdornedRulerPanel::StartQPPlay
void StartQPPlay(bool looped, bool cutPreview)
Definition: AdornedRulerPanel.cpp:1702
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
KeyboardCapture::Release
void Release(wxWindow *handler)
Definition: KeyboardCapture.cpp:75
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::MainGroup::mRuler
const AdornedRulerPanel & mRuler
Definition: AdornedRulerPanel.cpp:2274
AllThemeResources.h
AdornedRulerPanel::HandleSnapping
void HandleSnapping()
Definition: AdornedRulerPanel.cpp:1941
AdornedRulerPanel::TemporarilyAllowFocus
static TempAllowFocus TemporarilyAllowFocus()
Definition: AdornedRulerPanel.cpp:2233
TrackView.h
EVT_COMMAND
EVT_COMMAND(wxID_ANY, EVT_FREQUENCYTEXTCTRL_UPDATED, LabelDialog::OnFreqUpdate) LabelDialog
Definition: LabelDialog.cpp:92
AdornedRulerPanel::CommonRulerHandle::Cancel
Result Cancel(AudacityProject *) override
Definition: AdornedRulerPanel.cpp:163
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
Project.h
AButton
A wxButton with mouse-over behaviour.
Definition: AButton.h:25
AdornedRulerPanel::ScrubbingHandle::Release
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
Definition: AdornedRulerPanel.cpp:809
ViewInfo::playRegion
PlayRegion playRegion
Definition: ViewInfo.h:230
AdornedRulerPanel::OnPinnedButton
void OnPinnedButton(wxCommandEvent &event)
Definition: AdornedRulerPanel.cpp:1839
AdornedRulerPanel::CommonCell::mParent
AdornedRulerPanel * mParent
Definition: AdornedRulerPanel.cpp:535
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
AColor::IndicatorColor
static void IndicatorColor(wxDC *dc, bool bIsNotRecording)
Definition: AColor.cpp:380
AdornedRulerPanel::ProcessUIHandleResult
void ProcessUIHandleResult(TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell, unsigned refreshResult) override
Definition: AdornedRulerPanel.cpp:2308
AButton::PopUp
void PopUp()
Definition: AButton.cpp:605
TracksPrefs.h
AColor::Line
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:109
ViewInfo
Definition: ViewInfo.h:202
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::Drag
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: AdornedRulerPanel.cpp:642
PlayRegion::GetStart
double GetStart() const
Definition: ViewInfo.h:149
AdornedRulerPanel::ScrubbingRulerOverlay::mNewScrub
bool mNewScrub
Definition: AdornedRulerPanel.cpp:218
AdornedRulerPanel::ScrubbingHandle
Definition: AdornedRulerPanel.cpp:760
wxWidgetsWindowPlacement.h
AdornedRulerPanel::mOldPlayRegion
PlayRegion mOldPlayRegion
Definition: AdornedRulerPanel.h:139
AdornedRulerPanel::mLastDrawnH
double mLastDrawnH
Definition: AdornedRulerPanel.h:227
Overlay
Definition: Overlay.h:94
OnSetPlayRegionToSelectionID
@ OnSetPlayRegionToSelectionID
Definition: AdornedRulerPanel.cpp:475
AdornedRulerPanel::ScrubbingRulerOverlay::mOldScrub
bool mOldScrub
Definition: AdornedRulerPanel.cpp:235
AdornedRulerPanel::QPCell::ContextMenuDelegate
std::shared_ptr< TrackPanelCell > ContextMenuDelegate() override
Definition: AdornedRulerPanel.cpp:704
AdornedRulerPanel::DoDrawScrubIndicator
void DoDrawScrubIndicator(wxDC *dc, wxCoord xx, int width, bool scrub, bool seek)
Definition: AdornedRulerPanel.cpp:2140
RefreshCode::Cancelled
@ Cancelled
Definition: RefreshCode.h:23
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
AdornedRulerPanel::GetMaxSize
void GetMaxSize(wxCoord *width, wxCoord *height)
Definition: AdornedRulerPanel.cpp:2226
AdornedRulerPanel::ScrubbingRulerOverlay::GetRuler
AdornedRulerPanel * GetRuler() const
Definition: AdornedRulerPanel.cpp:288
Ruler::SetFormat
void SetFormat(RulerFormat format)
Definition: Ruler.cpp:131
ThemeBase::ImageSize
wxSize ImageSize(int iIndex)
Definition: Theme.cpp:1224
Scrubber::Seeks
bool Seeks() const
SelectUtilities::SetPlayRegionToSelection
void SetPlayRegionToSelection(AudacityProject &project)
Definition: SelectUtilities.cpp:218
Ruler::Draw
void Draw(wxDC &dc) const
Definition: Ruler.cpp:1428
AdornedRulerPanel::QPCell
Definition: AdornedRulerPanel.cpp:692
CellularPanel::ClearTargets
void ClearTargets()
Definition: CellularPanel.cpp:1185
AdornedRulerPanel::OnClearPlayRegion
void OnClearPlayRegion(wxCommandEvent &evt)
Definition: AdornedRulerPanel.cpp:1981
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:535
AdornedRulerPanel::Subgroup::Subgroup
Subgroup(const AdornedRulerPanel &ruler)
Definition: AdornedRulerPanel.cpp:2247
AdornedRulerPanel::QPCell::QPCell
QPCell(AdornedRulerPanel *parent)
Definition: AdornedRulerPanel.cpp:695
BasicUI::CallAfter
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:38
HitTestResult.h
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::Preview
HitTestPreview Preview(const TrackPanelMouseState &, AudacityProject *) override
Definition: AdornedRulerPanel.cpp:651
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
ProjectAudioManager.h
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:22
AdornedRulerPanel::CommonRulerHandle::HandlesRightClick
bool HandlesRightClick() override
Whether the handle has any special right-button handling.
Definition: AdornedRulerPanel.cpp:137
AdornedRulerPanel::mLastDrawnPlayRegion
std::pair< double, double > mLastDrawnPlayRegion
Definition: AdornedRulerPanel.h:225
Scrubber
Definition: Scrubbing.h:45
Scrubber::HasMark
bool HasMark() const
Definition: Scrubbing.h:91
BackedPanel::OnSize
void OnSize(wxSizeEvent &event)
Definition: BackedPanel.cpp:71
AdornedRulerPanel::ScrubbingRulerOverlay::mPartner
TrackPanelGuidelineOverlay & mPartner
Definition: AdornedRulerPanel.cpp:231
anonymous_namespace{TimeTrackVRulerControls.cpp}::ruler
Ruler & ruler()
Definition: TimeTrackVRulerControls.cpp:34
Ruler::SetUseZoomInfo
void SetUseZoomInfo(int leftOffset, const ZoomInfo *zoomInfo)
Definition: Ruler.cpp:1680
AdornedRulerPanel::ScrubbingRulerOverlay::Draw
void Draw(OverlayPanel &panel, wxDC &dc) override
Definition: AdornedRulerPanel.cpp:365
AdornedRulerPanel::AdornedRulerPanel
AdornedRulerPanel(AudacityProject *project, wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, ViewInfo *viewinfo=NULL)
Definition: AdornedRulerPanel.cpp:919
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
TracksPrefs::SetPinnedHeadPositionPreference
static void SetPinnedHeadPositionPreference(double value, bool flush=false)
Definition: TracksPrefs.cpp:414
AdornedRulerPanel::CommonRulerHandle::Button::None
@ None
AdornedRulerPanel::UpdateButtonStates
void UpdateButtonStates()
Definition: AdornedRulerPanel.cpp:1809
AdornedRulerPanel::CommonRulerHandle::Enter
void Enter(bool, AudacityProject *) override
Definition: AdornedRulerPanel.cpp:168
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
ProjectAudioIO::IsAudioActive
bool IsAudioActive() const
Definition: ProjectAudioIO.cpp:51
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::ScrubbingRulerOverlay::DoGetRectangle
std::pair< wxRect, bool > DoGetRectangle(wxSize size) override
Definition: AdornedRulerPanel.cpp:337
AdornedRulerPanel::CreateOverlays
void CreateOverlays()
Definition: AdornedRulerPanel.cpp:2320
AdornedRulerPanel::mesDraggingPlayRegionEnd
@ mesDraggingPlayRegionEnd
Definition: AdornedRulerPanel.h:166
AdornedRulerPanel::CommonRulerHandle::Button::Left
@ Left
wxWidgetsWindowPlacement
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.
Definition: wxWidgetsWindowPlacement.h:22
AdornedRulerPanel::CommonRulerHandle::NeedChangeHighlight
static UIHandle::Result NeedChangeHighlight(const CommonRulerHandle &oldState, const CommonRulerHandle &newState)
Definition: AdornedRulerPanel.cpp:128
AdornedRulerPanel::HandleQPClick
void HandleQPClick(wxMouseEvent &event, wxCoord mousePosX)
ScrollingPreference
BoolSetting ScrollingPreference
Definition: ViewInfo.cpp:346
UIHandle
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:35
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
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::Cancel
Result Cancel(AudacityProject *) override
Definition: AdornedRulerPanel.cpp:674
AdornedRulerPanel::DrawBothOverlays
void DrawBothOverlays()
Definition: AdornedRulerPanel.cpp:1797
Ruler::TimeFormat
@ TimeFormat
Definition: Ruler.h:33
AdornedRulerPanel::SetFocusedCell
void SetFocusedCell() override
Definition: AdornedRulerPanel.cpp:2303
Ruler::GetMaxSize
void GetMaxSize(wxCoord *width, wxCoord *height)
Definition: Ruler.cpp:1603
TrackPanelGroup::Axis::X
@ X
TrackList::GetEndTime
double GetEndTime() const
Definition: Track.cpp:1038
TopMargin
@ TopMargin
Definition: AdornedRulerPanel.cpp:79
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *) override
Definition: AdornedRulerPanel.cpp:623
wxEVT_COMMAND_BUTTON_CLICKED
wxEVT_COMMAND_BUTTON_CLICKED
Definition: AdornedRulerPanel.cpp:494
ThemePrefs.h
AdornedRulerPanel::Subgroup::mRuler
const AdornedRulerPanel & mRuler
Definition: AdornedRulerPanel.cpp:2262
AdornedRulerPanel::TrackPanelGuidelineOverlay::mPartner
std::shared_ptr< ScrubbingRulerOverlay > mPartner
Definition: AdornedRulerPanel.cpp:266
CellularPanel::CancelDragging
bool CancelDragging(bool escaping)
Definition: CellularPanel.cpp:158
AdornedRulerPanel::OnSize
void OnSize(wxSizeEvent &evt)
Definition: AdornedRulerPanel.cpp:1257
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
IndicatorMediumWidth
@ IndicatorMediumWidth
Definition: AdornedRulerPanel.cpp:76
AdornedRulerPanel::mScrubbingCell
std::shared_ptr< ScrubbingCell > mScrubbingCell
Definition: AdornedRulerPanel.h:218
AdornedRulerPanel::OnTogglePlayRegion
void OnTogglePlayRegion(wxCommandEvent &evt)
Definition: AdornedRulerPanel.cpp:1976
AdornedRulerPanel::TogglePinnedHead
void TogglePinnedHead()
Definition: AdornedRulerPanel.cpp:2336
AdornedRulerPanel::ScrubbingRulerOverlay::mNewQPIndicatorPos
int mNewQPIndicatorPos
Definition: AdornedRulerPanel.cpp:216
AdornedRulerPanel::OnSyncSelToQuickPlay
void OnSyncSelToQuickPlay(wxCommandEvent &evt)
Definition: AdornedRulerPanel.cpp:1925
ProjectStatus::Set
void Set(const TranslatableString &msg, StatusBarField field=mainStatusBarField)
Definition: ProjectStatus.cpp:77
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:229
AdornedRulerPanel::OnTogglePinnedState
void OnTogglePinnedState(wxCommandEvent &event)
Definition: AdornedRulerPanel.cpp:1844
AdornedRulerPanel::CommonRulerHandle::Release
Result Release(const TrackPanelMouseEvent &event, AudacityProject *, wxWindow *) override
Definition: AdornedRulerPanel.cpp:152
AdornedRulerPanel::MenuChoice::QuickPlay
@ QuickPlay
AdornedRulerPanel::ScrubbingRulerOverlay::mOldQPIndicatorPos
int mOldQPIndicatorPos
Definition: AdornedRulerPanel.cpp:234
UIHandle::mChangeHighlight
Result mChangeHighlight
Definition: UIHandle.h:139
OnAutoScrollID
@ OnAutoScrollID
Definition: AdornedRulerPanel.cpp:472
AdornedRulerPanel::mLeftDownClick
double mLeftDownClick
Definition: AdornedRulerPanel.h:173
AdornedRulerPanel::mInner
wxRect mInner
Definition: AdornedRulerPanel.h:128
anonymous_namespace{AdornedRulerPanel.cpp}::GetPlayHeadX
wxCoord GetPlayHeadX(const AudacityProject *pProject)
Definition: AdornedRulerPanel.cpp:574
AdornedRulerPanel::UpdatePrefs
void UpdatePrefs() override
Definition: AdornedRulerPanel.cpp:996
AdornedRulerPanel::Pos2Time
double Pos2Time(int p, bool ignoreFisheye=false)
Definition: AdornedRulerPanel.cpp:1349
IndicatorWidthForHeight
int IndicatorWidthForHeight(int height)
Definition: AdornedRulerPanel.cpp:96
AdornedRulerPanel::OnIdle
void OnIdle(wxIdleEvent &evt)
Definition: AdornedRulerPanel.cpp:1167
AdornedRulerPanel::Root
std::shared_ptr< TrackPanelNode > Root() override
Definition: AdornedRulerPanel.cpp:2284
label
TranslatableString label
Definition: Tags.cpp:756
AdornedRulerPanel::mLastDrawnZoom
double mLastDrawnZoom
Definition: AdornedRulerPanel.h:228
TracksPrefs::GetPinnedHeadPositionPreference
static double GetPinnedHeadPositionPreference()
Definition: TracksPrefs.cpp:406
AdornedRulerPanel::ShowContextMenu
void ShowContextMenu(MenuChoice choice, const wxPoint *pPosition)
Definition: AdornedRulerPanel.cpp:1992
AdornedRulerPanel::DoDrawPlayRegion
void DoDrawPlayRegion(wxDC *dc)
Definition: AdornedRulerPanel.cpp:2071
Snap.h
ToolBar::SetButtonToolTip
static void SetButtonToolTip(AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
Definition: ToolBar.cpp:898
AdornedRulerPanel::MainGroup::MainGroup
MainGroup(const AdornedRulerPanel &ruler)
Definition: AdornedRulerPanel.cpp:2267
AdornedRulerPanel::mQPCell
std::shared_ptr< QPCell > mQPCell
Definition: AdornedRulerPanel.h:215
AColor::Light
static void Light(wxDC *dc, bool selected, bool highlight=false)
Definition: AColor.cpp:321
SelectUtilities::InactivatePlayRegion
void InactivatePlayRegion(AudacityProject &project)
Definition: SelectUtilities.cpp:190
GetAttachedWindows
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
Definition: ProjectWindows.cpp:114
AdornedRulerPanel::TrackPanelGuidelineOverlay::mNewIndicatorSnapped
bool mNewIndicatorSnapped
Definition: AdornedRulerPanel.cpp:268
UIHandle::Result
unsigned Result
Definition: UIHandle.h:38
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::DrawSelection
void DrawSelection()
Definition: AdornedRulerPanel.cpp:2066
AdornedRulerPanel::TrackPanelGuidelineOverlay::SequenceNumber
unsigned SequenceNumber() const override
This number determines an ordering of overlays, so that those with higher numbers overpaint those wit...
Definition: AdornedRulerPanel.cpp:392
AdornedRulerPanel::OnPaint
void OnPaint(wxPaintEvent &evt)
Definition: AdornedRulerPanel.cpp:1224
AdornedRulerPanel::CommonRulerHandle::mX
wxCoord mX
Definition: AdornedRulerPanel.cpp:175
AdornedRulerPanel::OnSelectionChange
void OnSelectionChange(SelectedRegionEvent &evt)
Definition: AdornedRulerPanel.cpp:1276
AColor::SnapGuidePen
static void SnapGuidePen(wxDC *dc)
Definition: AColor.cpp:396
AdornedRulerPanel::mDirtyPlayRegion
bool mDirtyPlayRegion
Definition: AdornedRulerPanel.h:229
anonymous_namespace{AdornedRulerPanel.cpp}::ScrubbingMessage
const TranslatableString ScrubbingMessage(const Scrubber &scrubber, bool clicked)
Definition: AdornedRulerPanel.cpp:1158
LeftMargin
@ LeftMargin
Definition: AdornedRulerPanel.cpp:81
AdornedRulerPanel::Subgroup
Definition: AdornedRulerPanel.cpp:2246
AdornedRulerPanel::CommonRulerHandle::CommonRulerHandle
CommonRulerHandle(AdornedRulerPanel *pParent, wxCoord xx, MenuChoice menuChoice)
Definition: AdornedRulerPanel.cpp:119
EVT_MENU
EVT_MENU(OnSetPlayRegionToSelectionID, AdornedRulerPanel::OnSetPlayRegionToSelection) EVT_COMMAND(OnTogglePinnedStateID
AdornedRulerPanel::ScrubbingHandle::Cancel
Result Cancel(AudacityProject *pProject) override
Definition: AdornedRulerPanel.cpp:821
AdornedRulerPanel::OnAudioStartStop
void OnAudioStartStop(wxCommandEvent &evt)
Definition: AdornedRulerPanel.cpp:1200
AdornedRulerPanel::PlayRegionAdjustingHandle::Preview
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Definition: AdornedRulerPanel.cpp:187
IndicatorBigWidth
int IndicatorBigWidth()
Definition: AdornedRulerPanel.cpp:110
SelectUtilities::ActivatePlayRegion
void ActivatePlayRegion(AudacityProject &project)
Definition: SelectUtilities.cpp:166
TrackPanelCell
Definition: TrackPanelCell.h:74
Scrubbing.h
AdornedRulerPanel::TrackPanelGuidelineOverlay::mOldQPIndicatorPos
int mOldQPIndicatorPos
Definition: AdornedRulerPanel.cpp:271
AudioIOBase::Get
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:89
AdornedRulerPanel::QPCell::mPlayheadHolder
std::weak_ptr< PlayheadHandle > mPlayheadHolder
Definition: AdornedRulerPanel.cpp:719
HitTestPreview
Definition: HitTestResult.h:20
AdornedRulerPanel::CommonRulerHandle::Click
Result Click(const TrackPanelMouseEvent &event, AudacityProject *) override
Definition: AdornedRulerPanel.cpp:139
AdornedRulerPanel::CommonCell::CommonCell
CommonCell(AdornedRulerPanel *parent, MenuChoice menuChoice)
Definition: AdornedRulerPanel.cpp:503
IndicatorSmallWidth
@ IndicatorSmallWidth
Definition: AdornedRulerPanel.cpp:75
AdornedRulerPanel::MenuChoice
MenuChoice
Definition: AdornedRulerPanel.h:112
AdornedRulerPanel::SetLeftOffset
void SetLeftOffset(int offset)
Definition: AdornedRulerPanel.cpp:2133
AdornedRulerPanel::PlayRegionAdjustingHandle
Definition: AdornedRulerPanel.cpp:183
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::ScrubbingCell::ContextMenuDelegate
std::shared_ptr< TrackPanelCell > ContextMenuDelegate() override
Definition: AdornedRulerPanel.cpp:849
AdornedRulerPanel::s_AcceptsFocus
static bool s_AcceptsFocus
Definition: AdornedRulerPanel.h:104
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::PlayheadHandle
PlayheadHandle(wxCoord xx)
Definition: AdornedRulerPanel.cpp:596
AdornedRulerPanel::Time2Pos
int Time2Pos(double t, bool ignoreFisheye=false)
Definition: AdornedRulerPanel.cpp:1356
AdornedRulerPanel::ScrubbingRulerOverlay::Update
void Update()
Definition: AdornedRulerPanel.cpp:293
DefaultPlayOptions
AudioIOStartStreamOptions DefaultPlayOptions(AudacityProject &project, bool looped)
Definition: ProjectAudioManager.cpp:1162
AdornedRulerPanel::ScrubbingHandle::Drag
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: AdornedRulerPanel.cpp:794
AdornedRulerPanel::mLeftDownClickUnsnapped
double mLeftDownClickUnsnapped
Definition: AdornedRulerPanel.h:172
AdornedRulerPanel::ScrubbingRulerOverlay
Definition: AdornedRulerPanel.cpp:212
Grabber::SetAsSpacer
void SetAsSpacer(bool bIsSpacer)
Definition: Grabber.cpp:100
TrackPanelGroup
Definition: TrackPanelCell.h:47
ProjectAudioManager::Stop
void Stop(bool stopStream=true)
Definition: ProjectAudioManager.cpp:495
AdornedRulerPanel::GetFocusedCell
TrackPanelCell * GetFocusedCell() override
Definition: AdornedRulerPanel.cpp:2296
AdornedRulerPanel::UpdateStatusMessage
void UpdateStatusMessage(const TranslatableString &) override
Definition: AdornedRulerPanel.cpp:2315
ViewInfo.h
AdornedRulerPanel::DragSelection
void DragSelection()
Definition: AdornedRulerPanel.cpp:1932
TrackList::GetStartTime
double GetStartTime() const
Definition: Track.cpp:1033
AdornedRulerPanel::mButtons
wxWindow * mButtons[3]
Definition: AdornedRulerPanel.h:178
Menus.h
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::mX
wxCoord mX
Definition: AdornedRulerPanel.cpp:685
theTheme
THEME_API Theme theTheme
Definition: Theme.cpp:79
AdornedRulerPanel::HandleQPDrag
void HandleQPDrag(wxMouseEvent &event, wxCoord mousePosX)
AdornedRulerPanel::TrackPanelGuidelineOverlay::DoGetRectangle
std::pair< wxRect, bool > DoGetRectangle(wxSize size) override
Definition: AdornedRulerPanel.cpp:412
ProjectWindows.h
accessors for certain important windows associated with each project
AdornedRulerPanel::CommonCell::DefaultPreview
HitTestPreview DefaultPreview(const TrackPanelMouseState &, const AudacityProject *) override
Definition: AdornedRulerPanel.cpp:508
AdornedRulerPanel::mNeedButtonUpdate
bool mNeedButtonUpdate
Definition: AdornedRulerPanel.h:179
TrackPanelGroup::Axis::Y
@ Y
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
AdornedRulerPanel::ScrubbingCell::mHolder
std::weak_ptr< ScrubbingHandle > mHolder
Definition: AdornedRulerPanel.cpp:860
wxPanelWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:61
SelectedRegion::t0
double t0() const
Definition: SelectedRegion.h:91
CellularPanel.h
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::Release
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *) override
Definition: AdornedRulerPanel.cpp:665
AdornedRulerPanel::Subgroup::Children
Subdivision Children(const wxRect &) override
Definition: AdornedRulerPanel.cpp:2248
AdornedRulerPanel::CommonRulerHandle::Button
Button
Definition: AdornedRulerPanel.cpp:179
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::ScrubbingRulerOverlay::SequenceNumber
unsigned SequenceNumber() const override
This number determines an ordering of overlays, so that those with higher numbers overpaint those wit...
Definition: AdornedRulerPanel.cpp:331
UIHandle.h
AdornedRulerPanel::ScrubbingHandle::ScrubbingHandle
ScrubbingHandle(AdornedRulerPanel *pParent, wxCoord xx)
Definition: AdornedRulerPanel.cpp:763
AdornedRulerPanel::mesSelectingPlayRegionClick
@ mesSelectingPlayRegionClick
Definition: AdornedRulerPanel.h:167
TaggedIdentifier< CommandIdTag, false >
TrackView
Definition: TrackView.h:24
_
#define _(s)
Definition: Internat.h:75
AudioIO.h
anonymous_namespace{AdornedRulerPanel.cpp}::StartScrubbingMessage
const TranslatableString StartScrubbingMessage(const Scrubber &)
Definition: AdornedRulerPanel.cpp:1102
ProjectStatus::Get
static ProjectStatus & Get(AudacityProject &project)
Definition: ProjectStatus.cpp:35
AdornedRulerPanel::UpdateQuickPlayPos
void UpdateQuickPlayPos(wxCoord &mousePosX, bool shiftDown)
Definition: AdornedRulerPanel.cpp:1850
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::CommonRulerHandle::Drag
Result Drag(const TrackPanelMouseEvent &, AudacityProject *) override
Definition: AdornedRulerPanel.cpp:146
anonymous_namespace{AdornedRulerPanel.cpp}::ContinueScrubbingMessage
const TranslatableString ContinueScrubbingMessage(const Scrubber &scrubber, bool clicked)
Definition: AdornedRulerPanel.cpp:1126
AdornedRulerPanel::SetPlayRegion
void SetPlayRegion(double playRegionStart, double playRegionEnd)
Definition: AdornedRulerPanel.cpp:2199
Scrubber::IsScrubbing
bool IsScrubbing() const
CellularPanel
Formerly part of TrackPanel, this abstract base class has no special knowledge of Track objects and i...
Definition: CellularPanel.h:34
AdornedRulerPanel::~AdornedRulerPanel
~AdornedRulerPanel()
Definition: AdornedRulerPanel.cpp:986
AudacityMessageBox.h
ToolBar::MakeButtonBackgroundsSmall
static void MakeButtonBackgroundsSmall()
Definition: ToolBar.cpp:802
AdornedRulerPanel::SetFocusFromKbd
void SetFocusFromKbd() override
Definition: AdornedRulerPanel.cpp:2238
AdornedRulerPanel.h
TrackPanelMouseEvent
Definition: TrackPanelMouseEvent.h:46
SnapManager
Definition: Snap.h:56
AdornedRulerPanel::TrackPanelGuidelineOverlay::mNewPreviewingScrub
bool mNewPreviewingScrub
Definition: AdornedRulerPanel.cpp:269
Ruler::SetBounds
void SetBounds(int left, int top, int right, int bottom)
Definition: Ruler.cpp:332
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::HitTest
static std::shared_ptr< PlayheadHandle > HitTest(const AudacityProject *pProject, wxCoord xx)
Definition: AdornedRulerPanel.cpp:609
AdornedRulerPanel::mPlayRegionDragsSelection
bool mPlayRegionDragsSelection
Definition: AdornedRulerPanel.h:160
AdornedRulerPanel::TrackPanelGuidelineOverlay::AdornedRulerPanel
friend AdornedRulerPanel
Definition: AdornedRulerPanel.cpp:251
TrackPanelMouseState
Definition: TrackPanelMouseEvent.h:28
AdornedRulerPanel::UpdateRects
bool UpdateRects()
Definition: AdornedRulerPanel.cpp:1296
AdornedRulerPanel::CommonRulerHandle
Definition: AdornedRulerPanel.cpp:116
OverlayPanel
Definition: OverlayPanel.h:18
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
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::NeedChangeHighlight
static UIHandle::Result NeedChangeHighlight(const PlayheadHandle &oldState, const PlayheadHandle &newState)
Definition: AdornedRulerPanel.cpp:600
PlayRegion::Empty
bool Empty() const
Definition: ViewInfo.h:148
BasicMenu.h
Abstractions of menus and their items.
AdornedRulerPanel::MenuChoice::Scrub
@ Scrub
AdornedRulerPanel::CommonCell::DoContextMenu
unsigned DoContextMenu(const wxRect &, wxWindow *, const wxPoint *pPosition, AudacityProject *) final
Definition: AdornedRulerPanel.cpp:526
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
Track.h
declares abstract base class Track, TrackList, and iterators over TrackList
SelectUtilities::TogglePlayRegion
void TogglePlayRegion(AudacityProject &project)
Definition: SelectUtilities.cpp:201
AdornedRulerPanel::CommonCell::mMenuChoice
const MenuChoice mMenuChoice
Definition: AdornedRulerPanel.cpp:536
RefreshCode.h
OverlayPanel::DrawOverlays
void DrawOverlays(bool repaint_all, wxDC *pDC=nullptr)
Definition: OverlayPanel.cpp:43
AdornedRulerPanel::ScrubbingCell
Definition: AdornedRulerPanel.cpp:837
AdornedRulerPanel::ScrubbingRulerOverlay::mNewSeek
bool mNewSeek
Definition: AdornedRulerPanel.cpp:219
AdornedRulerPanel::mRuler
Ruler mRuler
Definition: AdornedRulerPanel.h:122
AdornedRulerPanel::ScrubbingCell::Hit
bool Hit() const
Definition: AdornedRulerPanel.cpp:852
AdornedRulerPanel::mesDraggingPlayRegionStart
@ mesDraggingPlayRegionStart
Definition: AdornedRulerPanel.h:165
Prefs.h
ProjectWindow.h
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::CommonRulerHandle::Button::Right
@ Right
WaveTrackVZoomHandle::Result
unsigned Result
Definition: WaveTrackVZoomHandle.h:24
AdornedRulerPanel::DoDrawEdge
void DoDrawEdge(wxDC *dc)
Definition: AdornedRulerPanel.cpp:2039
AssignUIHandlePtr
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:151
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
RightMargin
@ RightMargin
Definition: AdornedRulerPanel.cpp:83
AdornedRulerPanel::GetRulerHeight
int GetRulerHeight()
Definition: AdornedRulerPanel.h:51
AdornedRulerPanel::ScrubbingHandle::Preview
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Definition: AdornedRulerPanel.cpp:1541
AdornedRulerPanel::QPCell::Clicked
bool Clicked() const
Definition: AdornedRulerPanel.cpp:707
AdornedRulerPanel::ClearPlayRegion
void ClearPlayRegion()
Definition: AdornedRulerPanel.cpp:2215
TranslatableString::Stripped
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object
Definition: TranslatableString.h:198
AdornedRulerPanel::OnSetPlayRegionToSelection
void OnSetPlayRegionToSelection(wxCommandEvent &evt)
Definition: AdornedRulerPanel.cpp:1986
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:141
anonymous_namespace{AdornedRulerPanel.cpp}::GetPlayHeadFraction
double GetPlayHeadFraction(const AudacityProject *pProject, wxCoord xx)
Definition: AdornedRulerPanel.cpp:582
AdornedRulerPanel::ScrubbingCell::Clicked
bool Clicked() const
Definition: AdornedRulerPanel.cpp:853
AdornedRulerPanel::CommonRulerHandle::mClicked
Button mClicked
Definition: AdornedRulerPanel.cpp:180
AdornedRulerPanel::TrackPanelGuidelineOverlay::mProject
AudacityProject * mProject
Definition: AdornedRulerPanel.cpp:263
PlayMode::loopedPlay
@ loopedPlay
safenew
#define safenew
Definition: MemoryX.h:10
AdornedRulerPanel::CommonRulerHandle::Clicked
bool Clicked() const
Definition: AdornedRulerPanel.cpp:126
BottomMargin
@ BottomMargin
Definition: AdornedRulerPanel.cpp:80
AColor.h
AdornedRulerPanel::mLastPlayRegionActive
bool mLastPlayRegionActive
Definition: AdornedRulerPanel.h:226
AdornedRulerPanel::ScrubbingRulerOverlay::mOldSeek
bool mOldSeek
Definition: AdornedRulerPanel.cpp:236
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
SelectUtilities.h
AdornedRulerPanel::mesSelectingPlayRegionRange
@ mesSelectingPlayRegionRange
Definition: AdornedRulerPanel.h:168
END_EVENT_TABLE
END_EVENT_TABLE()
AdornedRulerPanel::QPCell::HitTest
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *pProject) override
Definition: AdornedRulerPanel.cpp:722
ProjectAudioIO.h
OnTogglePinnedStateID
@ OnTogglePinnedStateID
Definition: AdornedRulerPanel.cpp:476
Ruler::SetTwoTone
void SetTwoTone(bool twoTone)
Definition: Ruler.cpp:126
TrackPanelMouseEvent::event
wxMouseEvent & event
Definition: TrackPanelMouseEvent.h:58
TrackPanelMouseState::state
wxMouseState & state
Definition: TrackPanelMouseEvent.h:38
AdornedRulerPanel::ScrubbingRulerOverlay::ScrubbingRulerOverlay
ScrubbingRulerOverlay(TrackPanelGuidelineOverlay &partner)
Definition: AdornedRulerPanel.cpp:282
AdornedRulerPanel::ScrubbingCell::ScrubbingCell
ScrubbingCell(AdornedRulerPanel *parent)
Definition: AdornedRulerPanel.cpp:840
AdornedRulerPanel::MainGroup::Children
Subdivision Children(const wxRect &) override
Definition: AdornedRulerPanel.cpp:2268
AdornedRulerPanel::TrackPanelGuidelineOverlay::TrackPanelGuidelineOverlay
TrackPanelGuidelineOverlay(AudacityProject *project)
Definition: AdornedRulerPanel.cpp:385
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::TrackPanelGuidelineOverlay::mOldIndicatorSnapped
bool mOldIndicatorSnapped
Definition: AdornedRulerPanel.cpp:272
IndicatorBigHeight
int IndicatorBigHeight()
Definition: AdornedRulerPanel.cpp:104
AdornedRulerPanel::GetProject
AudacityProject * GetProject() const override
Definition: AdornedRulerPanel.cpp:2290
AdornedRulerPanel::MainGroup
Definition: AdornedRulerPanel.cpp:2266
AdornedRulerPanel::InvalidateRuler
void InvalidateRuler()
Definition: AdornedRulerPanel.cpp:1096
AdornedRulerPanel::mIsDragging
bool mIsDragging
Definition: AdornedRulerPanel.h:174
SelectedRegionEvent::pRegion
wxWeakRef< NotifyingSelectedRegion > pRegion
Definition: ViewInfo.h:34
AdornedRulerPanel::TrackPanelGuidelineOverlay
Definition: AdornedRulerPanel.cpp:249
OnTogglePlayRegionID
@ OnTogglePlayRegionID
Definition: AdornedRulerPanel.cpp:473
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:35
ProjectAudioManager::OnPause
void OnPause()
Definition: ProjectAudioManager.cpp:960
anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::Enter
void Enter(bool, AudacityProject *) override
Definition: AdornedRulerPanel.cpp:680