Audacity  3.0.3
ControlToolBar.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  ControlToolBar.cpp
6 
7  Dominic Mazzoni
8  Shane T. Mueller
9  James Crook
10  Leland Lucius
11 
12 *******************************************************************//*******************************************************************/
32 
33 
34 #include "ControlToolBar.h"
35 
36 #include <algorithm>
37 #include <cfloat>
38 
39 // For compilers that support precompilation, includes "wx/wx.h".
40 #include <wx/wxprec.h>
41 
42 #include <wx/setup.h> // for wxUSE_* macros
43 
44 #ifndef WX_PRECOMP
45 #include <wx/app.h>
46 #include <wx/dc.h>
47 #include <wx/event.h>
48 #include <wx/image.h>
49 #include <wx/intl.h>
50 #include <wx/sizer.h>
51 #include <wx/statusbr.h>
52 #include <wx/timer.h>
53 #endif
54 #include <wx/tooltip.h>
55 #include <wx/datetime.h>
56 
57 #include "../AColor.h"
58 #include "../AllThemeResources.h"
59 #include "../AudioIO.h"
60 #include "../ImageManipulation.h"
61 #include "../Prefs.h"
62 #include "../Project.h"
63 #include "../ProjectAudioIO.h"
64 #include "../ProjectAudioManager.h"
65 #include "../ProjectSettings.h"
66 #include "../ProjectStatus.h"
67 #include "../ProjectWindow.h"
68 #include "../Track.h"
69 #include "../widgets/AButton.h"
70 #include "../widgets/ErrorDialog.h"
71 #include "../FileNames.h"
72 
73 #include "../tracks/ui/Scrubbing.h"
74 #include "../toolbars/ToolManager.h"
75 
77 
81 
82 BEGIN_EVENT_TABLE(ControlToolBar, ToolBar)
84  EVT_BUTTON(ID_PLAY_BUTTON, ControlToolBar::OnPlay)
85  EVT_BUTTON(ID_STOP_BUTTON, ControlToolBar::OnStop)
86  EVT_BUTTON(ID_RECORD_BUTTON, ControlToolBar::OnRecord)
87  EVT_BUTTON(ID_REW_BUTTON, ControlToolBar::OnRewind)
88  EVT_BUTTON(ID_FF_BUTTON, ControlToolBar::OnFF)
89  EVT_BUTTON(ID_PAUSE_BUTTON, ControlToolBar::OnPause)
90  EVT_IDLE(ControlToolBar::OnIdle)
92 
93 static const TranslatableString
94  /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
95  is playing or recording or stopped, and whether it is paused. */
96  sStatePlay = XO("Playing")
97  /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
98  is playing or recording or stopped, and whether it is paused. */
99  , sStateStop = XO("Stopped")
100  /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
101  is playing or recording or stopped, and whether it is paused. */
102  , sStateRecord = XO("Recording")
103 ;
104 
105 //Standard constructor
106 // This was called "Control" toolbar in the GUI before - now it is "Transport".
107 // Note that we use the legacy "Control" string as the section because this
108 // gets written to prefs and cannot be changed in prefs to maintain backwards
109 // compatibility
111 : ToolBar(project, TransportBarID, XO("Transport"), wxT("Control"))
112 {
113  gPrefs->Read(wxT("/GUI/ErgonomicTransportButtons"), &mErgonomicTransportButtons, true);
114  mStrLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
115 
116  mSizer = NULL;
117 }
118 
120 {
121 }
122 
123 
125 {
126  auto &toolManager = ToolManager::Get( project );
127  return static_cast<ControlToolBar*>(
128  toolManager.GetToolBar(TransportBarID) );
129 }
130 
132 {
133  auto &toolManager = ToolManager::Get( project );
134  return *static_cast<ControlToolBar*>(
135  toolManager.GetToolBar(TransportBarID) );
136 }
137 
139 {
140  return Get( const_cast<AudacityProject&>( project )) ;
141 }
142 
143 void ControlToolBar::Create(wxWindow * parent)
144 {
145  ToolBar::Create(parent);
146  UpdatePrefs();
147 }
148 
149 // This is a convenience function that allows for button creation in
150 // MakeButtons() with fewer arguments
152  teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
153  int id,
154  bool processdownevents,
155  const TranslatableString &label)
156 {
157  AButton *r = ToolBar::MakeButton(pBar,
158  bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
159  eEnabledUp, eEnabledDown, eDisabled,
160  wxWindowID(id),
161  wxDefaultPosition, processdownevents,
162  theTheme.ImageSize( bmpRecoloredUpLarge ));
163  r->SetLabel(label);
164  enum { deflation =
165 #ifdef __WXMAC__
166  6
167 #else
168  12
169 #endif
170  };
171  r->SetFocusRect( r->GetClientRect().Deflate( deflation, deflation ) );
172 
173  return r;
174 }
175 
176 // static
178  teBmps eEnabledUp,
179  teBmps eEnabledDown,
180  teBmps eDisabled)
181 {
182  ToolBar::MakeAlternateImages(button, idx,
183  bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
184  eEnabledUp, eEnabledDown, eDisabled,
185  theTheme.ImageSize( bmpRecoloredUpLarge ));
186 }
187 
189 {
190  SetBackgroundColour( theTheme.Colour( clrMedium ) );
192 
193  mPause = MakeButton(this, bmpPause, bmpPause, bmpPauseDisabled,
194  ID_PAUSE_BUTTON, true, XO("Pause"));
195 
196  mPlay = MakeButton(this, bmpPlay, bmpPlay, bmpPlayDisabled,
197  ID_PLAY_BUTTON, true, XO("Play"));
198  MakeAlternateImages(*mPlay, 1, bmpLoop, bmpLoop, bmpLoopDisabled);
200  bmpCutPreview, bmpCutPreview, bmpCutPreviewDisabled);
202  bmpScrub, bmpScrub, bmpScrubDisabled);
204  bmpSeek, bmpSeek, bmpSeekDisabled);
206 
207  mStop = MakeButton(this, bmpStop, bmpStop, bmpStopDisabled ,
208  ID_STOP_BUTTON, false, XO("Stop"));
209 
210  mRewind = MakeButton(this, bmpRewind, bmpRewind, bmpRewindDisabled,
211  ID_REW_BUTTON, false, XO("Skip to Start"));
212 
213  mFF = MakeButton(this, bmpFFwd, bmpFFwd, bmpFFwdDisabled,
214  ID_FF_BUTTON, false, XO("Skip to End"));
215 
216  mRecord = MakeButton(this, bmpRecord, bmpRecord, bmpRecordDisabled,
217  ID_RECORD_BUTTON, false, XO("Record"));
218 
219  bool bPreferNewTrack;
220  gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
221  if( !bPreferNewTrack )
222  MakeAlternateImages(*mRecord, 1, bmpRecordBelow, bmpRecordBelow,
223  bmpRecordBelowDisabled);
224  else
225  MakeAlternateImages(*mRecord, 1, bmpRecordBeside, bmpRecordBeside,
226  bmpRecordBesideDisabled);
227 
229 
230 #if wxUSE_TOOLTIPS
232  wxToolTip::Enable(true);
233  wxToolTip::SetDelay(1000);
234 #endif
235 
236  // Set default order and mode
237  ArrangeButtons();
238 }
239 
241 {
242 #if wxUSE_TOOLTIPS
243  for (long iWinID = ID_PAUSE_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
244  {
245  auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
246  CommandID name;
247  switch (iWinID)
248  {
249  case ID_PLAY_BUTTON:
250  // Without shift
251  name = wxT("PlayStop");
252  break;
253  case ID_RECORD_BUTTON:
254  // Without shift
255  //name = wxT("Record");
256  name = wxT("Record1stChoice");
257  break;
258  case ID_PAUSE_BUTTON:
259  name = wxT("Pause");
260  break;
261  case ID_STOP_BUTTON:
262  name = wxT("Stop");
263  break;
264  case ID_FF_BUTTON:
265  name = wxT("CursProjectEnd");
266  break;
267  case ID_REW_BUTTON:
268  name = wxT("CursProjectStart");
269  break;
270  }
271  std::vector<ComponentInterfaceSymbol> commands(
272  1u, { name, Verbatim( pCtrl->GetLabel() ) } );
273 
274  // Some have a second
275  switch (iWinID)
276  {
277  case ID_PLAY_BUTTON:
278  // With shift
279  commands.push_back( { wxT("PlayLooped"), XO("Loop Play") } );
280  break;
281  case ID_RECORD_BUTTON:
282  // With shift
283  { bool bPreferNewTrack;
284  gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
285  // For the shortcut tooltip.
286  commands.push_back( {
287  wxT("Record2ndChoice"),
288  !bPreferNewTrack
289  ? XO("Record New Track")
290  : XO("Append Record")
291  } );
292  }
293  break;
294  case ID_PAUSE_BUTTON:
295  break;
296  case ID_STOP_BUTTON:
297  break;
298  case ID_FF_BUTTON:
299  // With shift
300  commands.push_back( {
301  wxT("SelEnd"), XO("Select to End") } );
302  break;
303  case ID_REW_BUTTON:
304  // With shift
305  commands.push_back( {
306  wxT("SelStart"), XO("Select to Start") } );
307  break;
308  }
310  mProject, *pCtrl, commands.data(), commands.size());
311  }
312 #endif
313 }
314 
316 {
317  bool updated = false;
318  bool active;
319 
320  gPrefs->Read( wxT("/GUI/ErgonomicTransportButtons"), &active, true );
321  if( mErgonomicTransportButtons != active )
322  {
324  updated = true;
325  }
326  wxString strLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
327  if (mStrLocale != strLocale)
328  {
329  mStrLocale = strLocale;
330  updated = true;
331  }
332 
333  if( updated )
334  {
335  ReCreateButtons(); // side effect: calls RegenerateTooltips()
336  Updated();
337  }
338  else
339  // The other reason to regenerate tooltips is if keyboard shortcuts for
340  // transport buttons changed, but that's too much work to check for, so just
341  // always do it. (Much cheaper than calling ReCreateButtons() in all cases.
343 
344 
345  // Set label to pull in language change
346  SetLabel(XO("Transport"));
347 
348  // Give base class a chance
350 }
351 
353 {
354  int flags = wxALIGN_CENTER | wxRIGHT;
355 
356  // (Re)allocate the button sizer
357  if( mSizer )
358  {
359  Detach( mSizer );
360  std::unique_ptr < wxSizer > {mSizer}; // DELETE it
361  }
362 
363  Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);
364 
365  // Start with a little extra space
366  mSizer->Add( 5, 55 );
367 
368  // Add the buttons in order based on ergonomic setting
370  {
371  mPause->MoveBeforeInTabOrder( mRecord );
372  mPlay->MoveBeforeInTabOrder( mRecord );
373  mStop->MoveBeforeInTabOrder( mRecord );
374  mRewind->MoveBeforeInTabOrder( mRecord );
375  mFF->MoveBeforeInTabOrder( mRecord );
376 
377  mSizer->Add( mPause, 0, flags, 2 );
378  mSizer->Add( mPlay, 0, flags, 2 );
379  mSizer->Add( mStop, 0, flags, 2 );
380  mSizer->Add( mRewind, 0, flags, 2 );
381  mSizer->Add( mFF, 0, flags, 10 );
382  mSizer->Add( mRecord, 0, flags, 5 );
383  }
384  else
385  {
386  mRewind->MoveBeforeInTabOrder( mFF );
387  mPlay->MoveBeforeInTabOrder( mFF );
388  mRecord->MoveBeforeInTabOrder( mFF );
389  mPause->MoveBeforeInTabOrder( mFF );
390  mStop->MoveBeforeInTabOrder( mFF );
391 
392  mSizer->Add( mRewind, 0, flags, 2 );
393  mSizer->Add( mPlay, 0, flags, 2 );
394  mSizer->Add( mRecord, 0, flags, 2 );
395  mSizer->Add( mPause, 0, flags, 2 );
396  mSizer->Add( mStop, 0, flags, 2 );
397  mSizer->Add( mFF, 0, flags, 5 );
398  }
399 
400  // Layout the sizer
401  mSizer->Layout();
402 
403  // Layout the toolbar
404  Layout();
405 
406  // (Re)Establish the minimum size
407  SetMinSize( GetSizer()->GetMinSize() );
408 }
409 
411 {
412  bool playDown = false;
413  bool playShift = false;
414  bool pauseDown = false;
415  bool recordDown = false;
416  bool recordShift = false;
417 
418  // ToolBar::ReCreateButtons() will get rid of its sizer and
419  // since we've attached our sizer to it, ours will get deleted too
420  // so clean ours up first.
421  if( mSizer )
422  {
423  playDown = mPlay->IsDown();
424  playShift = mPlay->WasShiftDown();
425  pauseDown = mPause->IsDown();
426  recordDown = mRecord->IsDown();
427  recordShift = mRecord->WasShiftDown();
428  Detach( mSizer );
429 
430  std::unique_ptr < wxSizer > {mSizer}; // DELETE it
431  mSizer = NULL;
432  }
433 
435 
436  if (playDown)
437  {
438  ControlToolBar::PlayAppearance appearance =
441  SetPlay(playDown, appearance);
442  }
443 
444  if (pauseDown)
445  {
446  mPause->PushDown();
447  }
448 
449  if (recordDown)
450  {
451  mRecord->SetAlternateIdx(recordShift ? 1 : 0);
452  mRecord->PushDown();
453  }
454 
456 
458 }
459 
460 void ControlToolBar::Repaint( wxDC *dc )
461 {
462 #ifndef USE_AQUA_THEME
463  wxSize s = mSizer->GetSize();
464  wxPoint p = mSizer->GetPosition();
465 
466  wxRect bevelRect( p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1 );
467  AColor::Bevel( *dc, true, bevelRect );
468 #endif
469 }
470 
472 {
474  auto &projectAudioManager = ProjectAudioManager::Get( mProject );
475  bool canStop = projectAudioManager.CanStopAudioStream();
476 
477  bool paused = mPause->IsDown();
478  bool playing = mPlay->IsDown();
479  bool recording = mRecord->IsDown();
480  auto gAudioIO = AudioIO::Get();
481  bool busy = gAudioIO->IsBusy();
482 
483  // Only interested in audio type tracks
484  bool tracks = p && TrackList::Get( *p ).Any<AudioTrack>(); // PRL: PlayableTrack ?
485 
486  mPlay->SetEnabled( canStop && tracks && !recording );
488  canStop &&
489  !(busy && !recording && !paused) &&
490  !(playing && !paused)
491  );
492  mStop->SetEnabled(canStop && (playing || recording));
493  mRewind->SetEnabled(paused || (!playing && !recording));
494  mFF->SetEnabled(tracks && (paused || (!playing && !recording)));
495 
496  mPause->SetEnabled(canStop);
497 }
498 
499 void ControlToolBar::SetPlay(bool down, PlayAppearance appearance)
500 {
501  if (down) {
502  mPlay->SetShift(appearance == PlayAppearance::Looped);
504  mPlay->SetAlternateIdx(static_cast<int>(appearance));
505  mPlay->PushDown();
506  }
507  else {
508  mPlay->PopUp();
510  }
512 }
513 
515 {
516  mStop->PushDown();
518 }
519 
520 void ControlToolBar::OnKeyEvent(wxKeyEvent & event)
521 {
522  // PRL: is this handler really ever reached? Is the ControlToolBar ever
523  // focused? Isn't there a global event filter that interprets the spacebar
524  // key (or other key chosen in preferences) and dispatches to DoPlayStop,
525  // according to CommandManager's table, before we come to this redundant
526  // function?
527 
528  if (event.ControlDown() || event.AltDown()) {
529  event.Skip();
530  return;
531  }
532 
533  auto gAudioIO = AudioIOBase::Get();
534  auto &projectAudioManager = ProjectAudioManager::Get( mProject );
535 
536  // Does not appear to be needed on Linux. Perhaps on some other platform?
537  // If so, "!CanStopAudioStream()" should probably apply.
538  if (event.GetKeyCode() == WXK_SPACE) {
539  if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
540  SetStop();
541  projectAudioManager.Stop();
542  }
543  else if (!gAudioIO->IsBusy()) {
544  projectAudioManager.PlayCurrentRegion();
545  }
546  return;
547  }
548  event.Skip();
549 }
550 
551 void ControlToolBar::OnPlay(wxCommandEvent & WXUNUSED(evt))
552 {
553  auto p = &mProject;
554  auto &projectAudioManager = ProjectAudioManager::Get( mProject );
555  bool canStop = projectAudioManager.CanStopAudioStream();
556 
557  if ( !canStop )
558  return;
559 
560  projectAudioManager.Stop();
561 
562  PlayDefault();
563 }
564 
565 void ControlToolBar::OnStop(wxCommandEvent & WXUNUSED(evt))
566 {
567  auto &projectAudioManager = ProjectAudioManager::Get( mProject );
568  bool canStop = projectAudioManager.CanStopAudioStream();
569 
570  if ( canStop ) {
571  projectAudioManager.Stop();
572  }
573 }
574 
576 {
577  // Let control have precedence over shift
578  const bool cutPreview = mPlay->WasControlDown();
579  const bool looped = !cutPreview &&
580  mPlay->WasShiftDown();
581  ProjectAudioManager::Get( mProject ).PlayCurrentRegion(looped, cutPreview);
582 }
583 
585 void ControlToolBar::OnRecord(wxCommandEvent &evt)
586 {
587  // TODO: It would be neater if Menu items and Toolbar buttons used the same code for
588  // enabling/disabling, and all fell into the same action routines.
589  // Here instead we reduplicate some logic (from CommandHandler) because it isn't
590  // normally used for buttons.
591 
592  bool altAppearance = mRecord->WasShiftDown();
593  ProjectAudioManager::Get( mProject ).OnRecord( altAppearance );
594 }
595 
596 void ControlToolBar::OnPause(wxCommandEvent & WXUNUSED(evt))
597 {
599 }
600 
601 void ControlToolBar::OnIdle(wxIdleEvent & event)
602 {
603  event.Skip();
604 
605  if (!wxTheApp->IsActive())
606  return;
607 
608  auto &projectAudioManager = ProjectAudioManager::Get( mProject );
609  if ( projectAudioManager.Paused() )
610  mPause->PushDown();
611  else
612  mPause->PopUp();
613 
614  bool recording = projectAudioManager.Recording();
615  if (!recording) {
616  mRecord->PopUp();
617  mRecord->SetAlternateIdx( wxGetKeyState(WXK_SHIFT) ? 1 : 0 );
618  }
619  else {
620  mRecord->PushDown();
621  mRecord->SetAlternateIdx( projectAudioManager.Appending() ? 0 : 1 );
622  }
623 
624  bool playing = projectAudioManager.Playing();
625  if ( !(playing || Scrubber::Get(mProject).HasMark()) ) {
626  mPlay->PopUp();
628  wxGetKeyState(WXK_CONTROL)
629  ? 2
630  : wxGetKeyState(WXK_SHIFT)
631  ? 1
632  : 0
633  );
634  }
635  else {
636  mPlay->PushDown();
638  projectAudioManager.Cutting()
639  ? 2
640  : projectAudioManager.Looping()
641  ? 1
642  : 0
643  );
644  }
645 
646  if ( recording || playing )
648  else
649  StopScrolling();
650 
651  if ( projectAudioManager.Stopping() )
652  mStop->PushDown();
653  else
654  // push-downs of the stop button are only momentary and always pop up now
655  mStop->PopUp();
656 
657  UpdateStatusBar();
659 }
660 
661 void ControlToolBar::OnRewind(wxCommandEvent & WXUNUSED(evt))
662 {
663  mRewind->PushDown();
664  mRewind->PopUp();
665 
667  {
670  }
671 }
672 
673 void ControlToolBar::OnFF(wxCommandEvent & WXUNUSED(evt))
674 {
675  mFF->PushDown();
676  mFF->PopUp();
677 
679 
680  {
683  }
684 }
685 
686 // works out the width of the field in the status bar needed for the state (eg play, record pause)
689  []( const AudacityProject &, StatusBarField field )
691  {
692  if ( field == stateStatusBarField ) {
693  TranslatableStrings strings;
694  for ( auto pString :
696  {
697  strings.push_back(
698  /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
699  is playing or recording or stopped, and whether it is paused. */
700  XO("%s Paused.").Format(*pString) );
701  }
702 
703  // added constant needed because xMax isn't large enough for some reason, plus some space.
704  return { std::move( strings ), 30 };
705  }
706  return {};
707  }
708 };
709 
711 {
712  TranslatableString state;
713  auto &projectAudioManager = ProjectAudioManager::Get( mProject );
714 
715  auto pProject = &mProject;
716  auto scrubState = pProject
718  : TranslatableString{};
719  if (!scrubState.empty())
720  state = scrubState;
721  else if (mPlay->IsDown())
722  state = sStatePlay;
723  else if (projectAudioManager.Recording())
724  state = sStateRecord;
725  else
726  state = sStateStop;
727 
728  return ((mPause->IsDown()) ? XO("%s Paused.") : XO("%s."))
729  .Format( state );
730 }
731 
733 {
736  );
737 }
738 
740 {
741  if ( Scrubber::Get( mProject ).IsTransportingPinned() )
742  StartScrolling();
743 #ifdef __WXMAC__
744  else if (Scrubber::Get( mProject ).HasMark()) {
745  // PRL: cause many "unnecessary" refreshes. For reasons I don't understand,
746  // doing this causes wheel rotation events (mapped from the double finger vertical
747  // swipe) to be delivered more uniformly to the application, so that speed control
748  // works better.
751  }
752 #endif
753  else
754  StopScrolling();
755 }
756 
758 {
760  const auto project = &mProject;
761  if (project) {
762  auto mode = Mode::Pinned;
763 
764 #if 0
765  // Enable these lines to pin the playhead right instead of center,
766  // when recording but not overdubbing.
767  auto gAudioIO = AudioIO::Get();
768  if (gAudioIO->GetNumCaptureChannels() > 0) {
769  // recording
770 
771  // Display a fixed recording head while scrolling the waves continuously.
772  // If you overdub, you may want to anticipate some context in existing tracks,
773  // so center the head. If not, put it rightmost to display as much wave as we can.
774  bool duplex;
775 #ifdef EXPERIMENTAL_DA
776  gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, false);
777 #else
778  gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, true);
779 #endif
780  if (duplex) {
781  // See if there is really anything being overdubbed
782  if (gAudioIO->GetNumPlaybackChannels() == 0)
783  // No.
784  duplex = false;
785  }
786 
787  if (!duplex)
788  mode = Mode::Right;
789  }
790 #endif
791 
792  ProjectWindow::Get( *project ).GetPlaybackScroller().Activate(mode);
793  }
794 }
795 
797 {
798  const auto project = &mProject;
799  if(project)
802 }
803 
805  []( AudacityProject &project ){
806  return ToolBar::Holder{ safenew ControlToolBar{ project } }; }
807 };
808 
809 namespace {
811  /* i18n-hint: Clicking this menu item shows the toolbar
812  with the big buttons on it (play record etc) */
813  TransportBarID, wxT("ShowTransportTB"), XXO("&Transport Toolbar")
814 };
815 }
EVT_BUTTON
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
ControlToolBar::mPlay
AButton * mPlay
Definition: ControlToolBar.h:114
ControlToolBar::StartScrolling
void StartScrolling()
Definition: ControlToolBar.cpp:757
TranslatableString
Definition: Types.h:290
field
#define field(n, t)
Definition: ImportAUP.cpp:165
ControlToolBar::PlayDefault
void PlayDefault()
Definition: ControlToolBar.cpp:575
AButton::SetLabel
void SetLabel(const TranslatableString &label)
Definition: AButton.cpp:274
teBmps
int teBmps
Definition: ImageManipulation.h:44
ControlToolBar::PlayAppearance::CutPreview
@ CutPreview
ControlToolBar::Create
void Create(wxWindow *parent) override
Definition: ControlToolBar.cpp:143
ProjectWindow::Rewind
void Rewind(bool shift)
Definition: ProjectWindow.cpp:1602
Scrubber::Get
static Scrubber & Get(AudacityProject &project)
Definition: Scrubbing.cpp:198
ControlToolBar::EnableDisableButtons
void EnableDisableButtons() override
Definition: ControlToolBar.cpp:471
ProjectAudioManager::Get
static ProjectAudioManager & Get(AudacityProject &project)
Definition: ProjectAudioManager.cpp:51
ProjectAudioManager::OnRecord
void OnRecord(bool altAppearance)
Definition: ProjectAudioManager.cpp:465
sStateStop
static const TranslatableString sStateStop
Definition: ControlToolBar.cpp:99
ControlToolBar::ID_FF_BUTTON
@ ID_FF_BUTTON
Definition: ControlToolBar.h:107
registeredStatusWidthFunction
static ProjectStatus::RegisteredStatusWidthFunction registeredStatusWidthFunction
Definition: ControlToolBar.cpp:688
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
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:67
ControlToolBar::OnKeyEvent
void OnKeyEvent(wxKeyEvent &event)
Definition: ControlToolBar.cpp:520
ProjectWindow::PlaybackScroller::Mode::Off
@ Off
ControlToolBar::mPause
AButton * mPause
Definition: ControlToolBar.h:116
ControlToolBar::PlayAppearance
PlayAppearance
Definition: ControlToolBar.h:59
sStateRecord
static const TranslatableString sStateRecord
Definition: ControlToolBar.cpp:102
ProjectAudioManager::PlayCurrentRegion
void PlayCurrentRegion(bool looped=false, bool cutpreview=false)
Definition: ProjectAudioManager.cpp:280
AButton
A wxButton with mouse-over behaviour.
Definition: AButton.h:25
ProjectWindow::PlaybackScroller::Activate
void Activate(Mode mode)
Definition: ProjectWindow.h:73
ToolBar::mProject
AudacityProject & mProject
Definition: ToolBar.h:231
ControlToolBar::SetPlay
void SetPlay(bool down, PlayAppearance appearance=PlayAppearance::Straight)
Definition: ControlToolBar.cpp:499
ToolBar::SetLabel
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:398
ControlToolBar::mRecord
AButton * mRecord
Definition: ControlToolBar.h:115
AButton::PopUp
void PopUp()
Definition: AButton.cpp:605
StatusBarField
StatusBarField
Definition: ProjectStatus.h:24
ControlToolBar::Populate
void Populate() override
Definition: ControlToolBar.cpp:188
ToolManager::Get
static ToolManager & Get(AudacityProject &project)
Definition: ToolManager.cpp:355
stateStatusBarField
@ stateStatusBarField
Definition: ProjectStatus.h:25
ControlToolBar::~ControlToolBar
virtual ~ControlToolBar()
Definition: ControlToolBar.cpp:119
AButton::WasShiftDown
bool WasShiftDown()
Definition: AButton.cpp:561
ControlToolBar::RegenerateTooltips
void RegenerateTooltips() override
Definition: ControlToolBar.cpp:240
ProjectWindow::GetPlaybackScroller
PlaybackScroller & GetPlaybackScroller()
Definition: ProjectWindow.h:84
ControlToolBar::ID_PAUSE_BUTTON
@ ID_PAUSE_BUTTON
Definition: ControlToolBar.h:104
XO
#define XO(s)
Definition: Internat.h:32
ToolBar::GetSizer
wxBoxSizer * GetSizer()
Definition: ToolBar.cpp:678
ClientData::Site::size
size_t size() const
How many attachment pointers are in the Site.
Definition: ClientData.h:251
ThemeBase::ImageSize
wxSize ImageSize(int iIndex)
Definition: Theme.cpp:1224
ToolBar::Holder
wxWindowPtr< ToolBar > Holder
Definition: ToolBar.h:98
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:531
ToolBar::ReCreateButtons
virtual void ReCreateButtons()
Definition: ToolBar.cpp:516
ControlToolBar::Get
static ControlToolBar & Get(AudacityProject &project)
Definition: ControlToolBar.cpp:131
ControlToolBar::ReCreateButtons
void ReCreateButtons() override
Definition: ControlToolBar.cpp:410
AButton::WasControlDown
bool WasControlDown()
Definition: AButton.cpp:566
TransportBarID
@ TransportBarID
Definition: ToolBar.h:68
ControlToolBar::ArrangeButtons
void ArrangeButtons()
Definition: ControlToolBar.cpp:352
Scrubber::GetUntranslatedStateString
const TranslatableString & GetUntranslatedStateString() const
sStatePlay
static const TranslatableString sStatePlay
Methods for ControlToolBar.
Definition: ControlToolBar.cpp:96
AttachedToolBarMenuItem
Definition: ToolManager.h:224
ControlToolBar::MakeButton
static AButton * MakeButton(ControlToolBar *pBar, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, bool processdownevents, const TranslatableString &label)
Definition: ControlToolBar.cpp:151
ControlToolBar::OnIdle
void OnIdle(wxIdleEvent &event)
Definition: ControlToolBar.cpp:601
AButton::FollowModifierKeys
void FollowModifierKeys()
Definition: AButton.cpp:330
ControlToolBar::mStrLocale
wxString mStrLocale
Definition: ControlToolBar.h:123
ControlToolBar::Find
static ControlToolBar * Find(AudacityProject &project)
Definition: ControlToolBar.cpp:124
ControlToolBar::PlayAppearance::Looped
@ Looped
ControlToolBar::OnPause
void OnPause(wxCommandEvent &evt)
Definition: ControlToolBar.cpp:596
TranslatableStrings
std::vector< TranslatableString > TranslatableStrings
Definition: Types.h:547
ProjectStatus::Set
void Set(const TranslatableString &msg, StatusBarField field=mainStatusBarField)
Definition: ProjectStatus.cpp:65
XXO
#define XXO(s)
Definition: Internat.h:45
AButton::SetEnabled
void SetEnabled(bool state)
Definition: AButton.h:88
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:804
ControlToolBar::ID_PLAY_BUTTON
@ ID_PLAY_BUTTON
Definition: ControlToolBar.h:105
ControlToolBar::ID_STOP_BUTTON
@ ID_STOP_BUTTON
Definition: ControlToolBar.h:106
label
TranslatableString label
Definition: Tags.cpp:755
ToolBar::MakeButtonBackgroundsLarge
static void MakeButtonBackgroundsLarge()
Definition: ToolBar.cpp:776
AButton::SetFocusRect
void SetFocusRect(wxRect &r)
Definition: AButton.cpp:336
ToolBar::SetButtonToolTip
static void SetButtonToolTip(AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
Definition: ToolBar.cpp:898
anonymous_namespace{ControlToolBar.cpp}::sAttachment
AttachedToolBarMenuItem sAttachment
Definition: ControlToolBar.cpp:810
ProjectWindow::PlaybackScroller::Mode
Mode
Definition: ProjectWindow.h:65
ControlToolBar::SetStop
void SetStop()
Definition: ControlToolBar.cpp:514
ToolBar::UpdatePrefs
void UpdatePrefs() override
Definition: ToolBar.cpp:605
AudioTrack
Track subclass holding data representing sound (as notes, or samples, or ...)
Definition: Track.h:821
name
const TranslatableString name
Definition: Distortion.cpp:98
ControlToolBar::UpdateStatusBar
void UpdateStatusBar()
Definition: ControlToolBar.cpp:732
AButton::SetAlternateIdx
void SetAlternateIdx(unsigned idx)
Definition: AButton.cpp:320
AButton::PushDown
void PushDown()
Definition: AButton.cpp:597
ControlToolBar::OnFF
void OnFF(wxCommandEvent &evt)
Definition: ControlToolBar.cpp:673
ControlToolBar::Repaint
void Repaint(wxDC *dc) override
Definition: ControlToolBar.cpp:460
AudioIOBase::Get
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:94
ControlToolBar::ID_REW_BUTTON
@ ID_REW_BUTTON
Definition: ControlToolBar.h:108
ToolBar::Create
virtual void Create(wxWindow *parent)
Definition: ToolBar.cpp:475
AButton::SetControl
void SetControl(bool control)
Definition: AButton.cpp:631
AButton::SetShift
void SetShift(bool shift)
Definition: AButton.cpp:626
ControlToolBar::StopScrolling
void StopScrolling()
Definition: ControlToolBar.cpp:796
ProjectStatus::StatusWidthResult
std::pair< std::vector< TranslatableString >, unsigned > StatusWidthResult
Definition: ProjectStatus.h:53
ControlToolBar::OnStop
void OnStop(wxCommandEvent &evt)
Definition: ControlToolBar.cpp:565
ControlToolBar::MakeAlternateImages
static void MakeAlternateImages(AButton &button, int idx, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled)
Definition: ControlToolBar.cpp:177
ToolBar::Detach
void Detach(wxWindow *window)
Definition: ToolBar.cpp:752
ControlToolBar::StateForStatusBar
TranslatableString StateForStatusBar()
Definition: ControlToolBar.cpp:710
ControlToolBar::mRewind
AButton * mRewind
Definition: ControlToolBar.h:113
RegisteredToolbarFactory
Definition: ToolBar.h:257
AColor::Bevel
static void Bevel(wxDC &dc, bool up, const wxRect &r)
Definition: AColor.cpp:191
ControlToolBar::UpdatePrefs
void UpdatePrefs() override
Definition: ControlToolBar.cpp:315
ProjectWindow::SkipEnd
void SkipEnd(bool shift)
Definition: ProjectWindow.cpp:1622
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:495
ControlToolBar
A ToolBar that has the main Transport buttons.
Definition: ControlToolBar.h:32
ControlToolBar::mSizer
wxBoxSizer * mSizer
Definition: ControlToolBar.h:125
ControlToolBar::mFF
AButton * mFF
Definition: ControlToolBar.h:118
ControlToolBar::BUTTON_COUNT
@ BUTTON_COUNT
Definition: ControlToolBar.h:110
TaggedIdentifier< CommandIdTag, false >
ProjectStatus::Get
static ProjectStatus & Get(AudacityProject &project)
Definition: ProjectStatus.cpp:23
ControlToolBar::mErgonomicTransportButtons
bool mErgonomicTransportButtons
Definition: ControlToolBar.h:121
ProjectStatus::RegisteredStatusWidthFunction
Definition: ProjectStatus.h:61
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:112
ControlToolBar::mStop
AButton * mStop
Definition: ControlToolBar.h:117
Verbatim
TranslatableString Verbatim(wxString str)
Definition: Types.h:573
ControlToolBar::OnPlay
void OnPlay(wxCommandEvent &evt)
Definition: ControlToolBar.cpp:551
ControlToolBar.h
AButton::IsDown
bool IsDown()
Definition: AButton.h:113
ToolBar
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:94
IMPLEMENT_CLASS
IMPLEMENT_CLASS(ControlToolBar, ToolBar)
ControlToolBar::ID_RECORD_BUTTON
@ ID_RECORD_BUTTON
Definition: ControlToolBar.h:109
ThemeBase::Colour
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1192
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
ControlToolBar::StartScrollingIfPreferred
void StartScrollingIfPreferred()
Definition: ControlToolBar.cpp:739
ControlToolBar::PlayAppearance::Straight
@ Straight
theTheme
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:201
ProjectAudioManager::StopIfPaused
void StopIfPaused()
Definition: ProjectAudioManager.cpp:1065
ProjectWindow::PlaybackScroller::Mode::Refresh
@ Refresh
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1354
TranslatableString::Format
TranslatableString & Format(Args &&...args) &
Definition: Types.h:363
ToolBar::Updated
void Updated()
Definition: ToolBar.cpp:661
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:505
ControlToolBar::OnRecord
void OnRecord(wxCommandEvent &evt)
Definition: ControlToolBar.cpp:585
safenew
#define safenew
Definition: MemoryX.h:8
ControlToolBar::OnRewind
void OnRewind(wxCommandEvent &evt)
Definition: ControlToolBar.cpp:661
END_EVENT_TABLE
END_EVENT_TABLE()
ToolBar::Add
void Add(wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
Definition: ToolBar.cpp:686
ProjectAudioManager::OnPause
void OnPause()
Definition: ProjectAudioManager.cpp:769