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