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