Audacity 3.2.0
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
83BEGIN_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)
89 EVT_BUTTON(ID_FF_BUTTON, ControlToolBar::OnFF)
90 EVT_BUTTON(ID_PAUSE_BUTTON, ControlToolBar::OnPause)
91 EVT_BUTTON(ID_LOOP_BUTTON, ControlToolBar::OnLoop)
94
95static 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
147void ControlToolBar::Create(wxWindow * parent)
148{
149 ToolBar::Create(parent);
150 UpdatePrefs();
151}
152
153// static
155 teBmps eEnabledUp,
156 teBmps eEnabledDown,
157 teBmps eDisabled)
158{
160 bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
161 eEnabledUp, eEnabledDown, eDisabled,
162 theTheme.ImageSize( bmpRecoloredUpLarge ));
163}
164
166{
167 SetBackgroundColour( theTheme.Colour( clrMedium ) );
169
170 mPause = MakeButton(this, bmpPause, bmpPause, bmpPauseDisabled,
171 ID_PAUSE_BUTTON, true, XO("Pause"));
172
173 mPlay = MakeButton(this, bmpPlay, bmpPlay, bmpPlayDisabled,
174 ID_PLAY_BUTTON, true, XO("Play"));
175 // 3.1.0 abandoned distinct images for Shift
176 MakeAlternateImages(*mPlay, 1, bmpPlay, bmpPlay, bmpPlayDisabled);
178 bmpCutPreview, bmpCutPreview, bmpCutPreviewDisabled);
180 bmpScrub, bmpScrub, bmpScrubDisabled);
182 bmpSeek, bmpSeek, bmpSeekDisabled);
184
185 mStop = MakeButton(this, bmpStop, bmpStop, bmpStopDisabled ,
186 ID_STOP_BUTTON, false, XO("Stop"));
187
188 mRewind = MakeButton(this, bmpRewind, bmpRewind, bmpRewindDisabled,
189 ID_REW_BUTTON, false, XO("Skip to Start"));
190
191 mFF = MakeButton(this, bmpFFwd, bmpFFwd, bmpFFwdDisabled,
192 ID_FF_BUTTON, false, XO("Skip to End"));
193
194 mRecord = MakeButton(this, bmpRecord, bmpRecord, bmpRecordDisabled,
195 ID_RECORD_BUTTON, false, XO("Record"));
196
197 bool bPreferNewTrack;
198 gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
199 if( !bPreferNewTrack )
200 MakeAlternateImages(*mRecord, 1, bmpRecordBelow, bmpRecordBelow,
201 bmpRecordBelowDisabled);
202 else
203 MakeAlternateImages(*mRecord, 1, bmpRecordBeside, bmpRecordBeside,
204 bmpRecordBesideDisabled);
205
207
208 mLoop = MakeButton(this, bmpLoop, bmpLoop, bmpLoopDisabled,
210 true, // this makes it a toggle, like the pause button
212
213#if wxUSE_TOOLTIPS
215 wxToolTip::Enable(true);
216 wxToolTip::SetDelay(1000);
217#endif
218
219 // Set default order and mode
221}
222
224{
225#if wxUSE_TOOLTIPS
226 for (long iWinID = ID_PAUSE_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
227 {
228 auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
230 switch (iWinID)
231 {
232 case ID_PLAY_BUTTON:
233 // Without shift
234 name = wxT("DefaultPlayStop");
235 break;
236 case ID_RECORD_BUTTON:
237 // Without shift
238 //name = wxT("Record");
239 name = wxT("Record1stChoice");
240 break;
241 case ID_PAUSE_BUTTON:
242 name = wxT("Pause");
243 break;
244 case ID_STOP_BUTTON:
245 name = wxT("Stop");
246 break;
247 case ID_FF_BUTTON:
248 name = wxT("CursProjectEnd");
249 break;
250 case ID_REW_BUTTON:
251 name = wxT("CursProjectStart");
252 break;
253 case ID_LOOP_BUTTON:
254 name = wxT("TogglePlayRegion");
255 break;
256 }
257 std::vector<ComponentInterfaceSymbol> commands(
258 1u, { name, Verbatim( pCtrl->GetLabel() ) } );
259
260 // Some have a second
261 switch (iWinID)
262 {
263 case ID_PLAY_BUTTON:
264 // With shift
265 commands.push_back( { wxT("OncePlayStop"), XO("Play Once") } );
266 break;
267 case ID_RECORD_BUTTON:
268 // With shift
269 { bool bPreferNewTrack;
270 gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
271 // For the shortcut tooltip.
272 commands.push_back( {
273 wxT("Record2ndChoice"),
274 !bPreferNewTrack
275 ? XO("Record New Track")
276 : XO("Append Record")
277 } );
278 }
279 break;
280 case ID_PAUSE_BUTTON:
281 break;
282 case ID_STOP_BUTTON:
283 break;
284 case ID_FF_BUTTON:
285 // With shift
286 commands.push_back( {
287 wxT("SelEnd"), XO("Select to End") } );
288 break;
289 case ID_REW_BUTTON:
290 // With shift
291 commands.push_back( {
292 wxT("SelStart"), XO("Select to Start") } );
293 break;
294 }
296 mProject, *pCtrl, commands.data(), commands.size());
297 }
298#endif
299}
300
302{
303 bool updated = false;
304 bool active;
305
306 wxString strLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
307 if (mStrLocale != strLocale)
308 {
309 mStrLocale = strLocale;
310 updated = true;
311 }
312
313 if( updated )
314 {
315 ReCreateButtons(); // side effect: calls RegenerateTooltips()
316 Updated();
317 }
318 else
319 // The other reason to regenerate tooltips is if keyboard shortcuts for
320 // transport buttons changed, but that's too much work to check for, so just
321 // always do it. (Much cheaper than calling ReCreateButtons() in all cases.
323
324
325 // Set label to pull in language change
326 SetLabel(XO("Transport"));
327
328 // Give base class a chance
330}
331
333{
334 int flags = wxALIGN_CENTER | wxRIGHT;
335
336 // (Re)allocate the button sizer
337 if( mSizer )
338 {
339 Detach( mSizer );
340 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
341 }
342
343 Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);
344
345 // Start with a little extra space
346 mSizer->Add( 5, 55 );
347
348 // Establish correct tab key sequence with mLoop last
349 mPause->MoveBeforeInTabOrder( mLoop );
350 mPlay->MoveBeforeInTabOrder( mLoop );
351 mStop->MoveBeforeInTabOrder( mLoop );
352 mRewind->MoveBeforeInTabOrder( mLoop );
353 mFF->MoveBeforeInTabOrder( mLoop );
354 mRecord->MoveBeforeInTabOrder( mLoop );
355
356 mSizer->Add( mPause, 0, flags, 2 );
357 mSizer->Add( mPlay, 0, flags, 2 );
358 mSizer->Add( mStop, 0, flags, 2 );
359 mSizer->Add( mRewind, 0, flags, 2 );
360 mSizer->Add( mFF, 0, flags, 10 );
361 mSizer->Add( mRecord, 0, flags, 10 );
362 mSizer->Add( mLoop, 0, flags, 5 );
363
364 // Layout the sizer
365 mSizer->Layout();
366
367 // Layout the toolbar
368 Layout();
369
370 // (Re)Establish the minimum size
371 SetMinSize( GetSizer()->GetMinSize() );
372}
373
375{
376 bool playDown = false;
377 bool playShift = false;
378 bool pauseDown = false;
379 bool recordDown = false;
380 bool recordShift = false;
381 bool loopDown = false;
382
383 // ToolBar::ReCreateButtons() will get rid of its sizer and
384 // since we've attached our sizer to it, ours will get deleted too
385 // so clean ours up first.
386 if( mSizer )
387 {
388 playDown = mPlay->IsDown();
389 playShift = mPlay->WasShiftDown();
390 pauseDown = mPause->IsDown();
391 recordDown = mRecord->IsDown();
392 recordShift = mRecord->WasShiftDown();
393 loopDown = mLoop->IsDown();
394 Detach( mSizer );
395
396 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
397 mSizer = NULL;
398 }
399
401
402 if (playDown)
403 {
407 SetPlay(playDown, appearance);
408 }
409
410 if (pauseDown)
411 {
412 mPause->PushDown();
413 }
414
415 if (recordDown)
416 {
417 mRecord->SetAlternateIdx(recordShift ? 1 : 0);
418 mRecord->PushDown();
419 }
420
421 if (loopDown)
422 mLoop->PushDown();
423
425
427}
428
430{
431#ifndef USE_AQUA_THEME
432 wxSize s = mSizer->GetSize();
433 wxPoint p = mSizer->GetPosition();
434
435 wxRect bevelRect( p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1 );
436 AColor::Bevel( *dc, true, bevelRect );
437#endif
438}
439
441{
443 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
444 bool canStop = projectAudioManager.CanStopAudioStream();
445
446 bool paused = mPause->IsDown();
447 bool playing = mPlay->IsDown();
448 bool recording = mRecord->IsDown();
449 auto gAudioIO = AudioIO::Get();
450 bool busy = gAudioIO->IsBusy();
451
452 // Only interested in audio type tracks
453 bool tracks = p && TrackList::Get( *p ).Any<AudioTrack>(); // PRL: PlayableTrack ?
454
455 mPlay->SetEnabled( canStop && tracks && !recording );
457 canStop &&
458 !(busy && !recording && !paused) &&
459 !(playing && !paused)
460 );
461 mStop->SetEnabled(canStop && (playing || recording));
462 mRewind->SetEnabled(paused || (!playing && !recording));
463 mFF->SetEnabled(tracks && (paused || (!playing && !recording)));
464
465 mPause->SetEnabled(canStop);
466
467 mLoop->SetEnabled( !recording );
468}
469
470void ControlToolBar::SetPlay(bool down, PlayAppearance appearance)
471{
472 if (down) {
473 mPlay->SetShift(appearance == PlayAppearance::Looped);
475 mPlay->SetAlternateIdx(static_cast<int>(appearance));
476 mPlay->PushDown();
477 }
478 else {
479 mPlay->PopUp();
481 }
483}
484
486{
487 mStop->PushDown();
489}
490
491void ControlToolBar::OnKeyEvent(wxKeyEvent & event)
492{
493 // PRL: is this handler really ever reached? Is the ControlToolBar ever
494 // focused? Isn't there a global event filter that interprets the spacebar
495 // key (or other key chosen in preferences) and dispatches to DoPlayStop,
496 // according to CommandManager's table, before we come to this redundant
497 // function?
498
499 if (event.ControlDown() || event.AltDown()) {
500 event.Skip();
501 return;
502 }
503
504 auto gAudioIO = AudioIOBase::Get();
505 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
506
507 // Does not appear to be needed on Linux. Perhaps on some other platform?
508 // If so, "!CanStopAudioStream()" should probably apply.
509 if (event.GetKeyCode() == WXK_SPACE) {
510 if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
511 SetStop();
512 projectAudioManager.Stop();
513 }
514 else if (!gAudioIO->IsBusy()) {
515 projectAudioManager.PlayCurrentRegion();
516 }
517 return;
518 }
519 event.Skip();
520}
521
522void ControlToolBar::OnPlay(wxCommandEvent & WXUNUSED(evt))
523{
524 auto p = &mProject;
525 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
526 bool canStop = projectAudioManager.CanStopAudioStream();
527
528 if ( !canStop )
529 return;
530
531 projectAudioManager.Stop();
532
533 PlayDefault();
534}
535
536void ControlToolBar::OnStop(wxCommandEvent & WXUNUSED(evt))
537{
538 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
539 bool canStop = projectAudioManager.CanStopAudioStream();
540
541 if ( canStop ) {
542 projectAudioManager.Stop();
543 }
544}
545
547{
548 // Let control-down have precedence over shift state
549 const bool cutPreview = mPlay->WasControlDown();
550 const bool newDefault = !cutPreview &&
553 .PlayCurrentRegion(newDefault, cutPreview);
554}
555
557void ControlToolBar::OnRecord(wxCommandEvent &evt)
558{
559 // TODO: It would be neater if Menu items and Toolbar buttons used the same code for
560 // enabling/disabling, and all fell into the same action routines.
561 // Here instead we reduplicate some logic (from CommandHandler) because it isn't
562 // normally used for buttons.
563
564 bool altAppearance = mRecord->WasShiftDown();
565 ProjectAudioManager::Get( mProject ).OnRecord( altAppearance );
566}
567
568void ControlToolBar::OnPause(wxCommandEvent & WXUNUSED(evt))
569{
571}
572
573void ControlToolBar::OnLoop(wxCommandEvent & WXUNUSED(evt))
574{
575 // Toggle the state of the play region lock
576 auto &region = ViewInfo::Get(mProject).playRegion;
577 if (region.Active())
579 else
581}
582
583void ControlToolBar::OnIdle(wxIdleEvent & event)
584{
585 event.Skip();
586
587 if (!wxTheApp->IsActive())
588 return;
589
590 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
591 if ( projectAudioManager.Paused() )
592 mPause->PushDown();
593 else
594 mPause->PopUp();
595
596 bool recording = projectAudioManager.Recording();
597 if (!recording) {
598 mRecord->PopUp();
599 mRecord->SetAlternateIdx( wxGetKeyState(WXK_SHIFT) ? 1 : 0 );
600 }
601 else {
602 mRecord->PushDown();
603 mRecord->SetAlternateIdx( projectAudioManager.Appending() ? 0 : 1 );
604 }
605
606 bool playing = projectAudioManager.Playing();
607 if ( !(playing || Scrubber::Get(mProject).HasMark()) ) {
608 mPlay->PopUp();
610 wxGetKeyState(WXK_CONTROL)
611 ? 2
612 : wxGetKeyState(WXK_SHIFT)
613 ? 1
614 : 0
615 );
616 }
617 else {
618 mPlay->PushDown();
619 // Choose among alternative appearances of the play button, although
620 // options 0 and 1 became non-distinct in 3.1.0
622 projectAudioManager.Cutting()
623 ? 2
624 // : projectAudioManager.Looping()
625 // ? 1
626 : 0
627 );
628 }
629
630 if ( recording || playing )
632 else
634
635 if ( projectAudioManager.Stopping() )
636 mStop->PushDown();
637 else
638 // push-downs of the stop button are only momentary and always pop up now
639 mStop->PopUp();
640
641 if (ViewInfo::Get(mProject).playRegion.Active())
642 mLoop->PushDown();
643 else
644 mLoop->PopUp();
645
648}
649
650void ControlToolBar::OnRewind(wxCommandEvent & WXUNUSED(evt))
651{
652 mRewind->PushDown();
653 mRewind->PopUp();
654
656 {
659 }
660}
661
662void ControlToolBar::OnFF(wxCommandEvent & WXUNUSED(evt))
663{
664 mFF->PushDown();
665 mFF->PopUp();
666
668
669 {
672 }
673}
674
675// works out the width of the field in the status bar needed for the state (eg play, record pause)
680 {
681 if ( field == stateStatusBarField ) {
682 TranslatableStrings strings;
683 for ( auto pString :
685 {
686 strings.push_back(
687 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
688 is playing or recording or stopped, and whether it is paused. */
689 XO("%s Paused.").Format(*pString) );
690 }
691
692 // added constant needed because xMax isn't large enough for some reason, plus some space.
693 return { std::move( strings ), 30 };
694 }
695 return {};
696 }
697};
698
700{
701 TranslatableString state;
702 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
703
704 auto pProject = &mProject;
705 auto scrubState = pProject
708 if (!scrubState.empty())
709 state = scrubState;
710 else if (mPlay->IsDown())
711 state = sStatePlay;
712 else if (projectAudioManager.Recording())
713 state = sStateRecord;
714 else
715 state = sStateStop;
716
717 return ((mPause->IsDown()) ? XO("%s Paused.") : XO("%s."))
718 .Format( state );
719}
720
722{
725 );
726}
727
729{
730 if ( Scrubber::Get( mProject ).IsTransportingPinned() )
732#ifdef __WXMAC__
733 else if (Scrubber::Get( mProject ).HasMark()) {
734 // PRL: cause many "unnecessary" refreshes. For reasons I don't understand,
735 // doing this causes wheel rotation events (mapped from the double finger vertical
736 // swipe) to be delivered more uniformly to the application, so that speed control
737 // works better.
740 }
741#endif
742 else
744}
745
747{
749 const auto project = &mProject;
750 if (project) {
751 auto mode = Mode::Pinned;
752
753#if 0
754 // Enable these lines to pin the playhead right instead of center,
755 // when recording but not overdubbing.
756 auto gAudioIO = AudioIO::Get();
757 if (gAudioIO->GetNumCaptureChannels() > 0) {
758 // recording
759
760 // Display a fixed recording head while scrolling the waves continuously.
761 // If you overdub, you may want to anticipate some context in existing tracks,
762 // so center the head. If not, put it rightmost to display as much wave as we can.
763 bool duplex;
764#ifdef EXPERIMENTAL_DA
765 gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, false);
766#else
767 gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, true);
768#endif
769 if (duplex) {
770 // See if there is really anything being overdubbed
771 if (gAudioIO->GetNumPlaybackChannels() == 0)
772 // No.
773 duplex = false;
774 }
775
776 if (!duplex)
777 mode = Mode::Right;
778 }
779#endif
780
782 }
783}
784
786{
787 const auto project = &mProject;
788 if(project)
791}
792
794 []( AudacityProject &project ){
795 return ToolBar::Holder{ safenew ControlToolBar{ project } }; }
796};
797
798namespace {
800 /* i18n-hint: Clicking this menu item shows the toolbar
801 with the big buttons on it (play record etc) */
802 TransportBarID, wxT("ShowTransportTB"), XXO("&Transport Toolbar")
803};
804}
wxT("CloseDown"))
END_EVENT_TABLE()
static const TranslatableString sStatePlay
Methods for ControlToolBar.
IMPLEMENT_CLASS(ControlToolBar, ToolBar)
static RegisteredToolbarFactory factory
static ProjectStatus::RegisteredStatusWidthFunction registeredStatusWidthFunction
static const TranslatableString sStateRecord
static const TranslatableString sStateStop
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
const TranslatableString name
Definition: Distortion.cpp:82
int teBmps
#define field(n, t)
Definition: ImportAUP.cpp:167
#define XXO(s)
Definition: Internat.h:44
#define XO(s)
Definition: Internat.h:31
#define safenew
Definition: MemoryX.h:10
FileConfig * gPrefs
Definition: Prefs.cpp:71
StatusBarField
Definition: ProjectStatus.h:24
@ stateStatusBarField
Definition: ProjectStatus.h:25
THEME_API Theme theTheme
Definition: Theme.cpp:82
@ TransportBarID
Definition: ToolBar.h:72
declares abstract base class Track, TrackList, and iterators over TrackList
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
std::vector< TranslatableString > TranslatableStrings
const TranslatableString LoopToggleText
Definition: ViewInfo.cpp:227
A wxButton with mouse-over behaviour.
Definition: AButton.h:104
void SetShift(bool shift)
Definition: AButton.cpp:609
void SetControl(bool control)
Definition: AButton.cpp:614
void PushDown()
Definition: AButton.cpp:580
bool IsDown()
Definition: AButton.h:208
void SetAlternateIdx(unsigned idx)
Definition: AButton.cpp:235
bool WasControlDown()
Definition: AButton.cpp:549
void PopUp()
Definition: AButton.cpp:588
bool WasShiftDown()
Definition: AButton.cpp:544
void SetEnabled(bool state)
Definition: AButton.h:182
void FollowModifierKeys()
Definition: AButton.cpp:246
static void Bevel(wxDC &dc, bool up, const wxRect &r)
Definition: AColor.cpp:266
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:91
static AudioIO * Get()
Definition: AudioIO.cpp:133
Track subclass holding data representing sound (as notes, or samples, or ...)
Definition: Track.h:897
size_t size() const
How many attachment pointers are in the Site.
Definition: ClientData.h:251
A ToolBar that has the main Transport buttons.
void OnPlay(wxCommandEvent &evt)
void OnLoop(wxCommandEvent &evt)
void SetPlay(bool down, PlayAppearance appearance=PlayAppearance::Straight)
void Populate() override
void EnableDisableButtons() override
static ControlToolBar * Find(AudacityProject &project)
static void MakeAlternateImages(AButton &button, int idx, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled)
AButton * mRecord
void StartScrollingIfPreferred()
virtual ~ControlToolBar()
void ReCreateButtons() override
void OnRecord(wxCommandEvent &evt)
wxString mStrLocale
TranslatableString StateForStatusBar()
void Repaint(wxDC *dc) override
AButton * mPause
AButton * mRewind
void RegenerateTooltips() override
void Create(wxWindow *parent) override
static ControlToolBar & Get(AudacityProject &project)
void UpdatePrefs() override
void OnIdle(wxIdleEvent &event)
void OnKeyEvent(wxKeyEvent &event)
void OnStop(wxCommandEvent &evt)
void OnPause(wxCommandEvent &evt)
void OnRewind(wxCommandEvent &evt)
void OnFF(wxCommandEvent &evt)
wxBoxSizer * mSizer
static ProjectAudioManager & Get(AudacityProject &project)
void PlayCurrentRegion(bool newDefault=false, bool cutpreview=false)
void OnRecord(bool altAppearance)
std::pair< std::vector< TranslatableString >, unsigned > StatusWidthResult
Definition: ProjectStatus.h:49
static ProjectStatus & Get(AudacityProject &project)
void Set(const TranslatableString &msg, StatusBarField field=mainStatusBarField)
void Rewind(bool shift)
PlaybackScroller & GetPlaybackScroller()
static ProjectWindow & Get(AudacityProject &project)
void SkipEnd(bool shift)
static Scrubber & Get(AudacityProject &project)
Definition: Scrubbing.cpp:187
const TranslatableString & GetUntranslatedStateString() const
wxColour & Colour(int iIndex)
wxSize ImageSize(int iIndex)
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:101
AudacityProject & mProject
Definition: ToolBar.h:251
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:931
void Add(wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
Definition: ToolBar.cpp:695
virtual void ReCreateButtons()
Definition: ToolBar.cpp:525
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:861
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:407
static void MakeButtonBackgroundsLarge()
Definition: ToolBar.cpp:797
wxBoxSizer * GetSizer()
Definition: ToolBar.cpp:687
void UpdatePrefs() override
Definition: ToolBar.cpp:614
void Updated()
Definition: ToolBar.cpp:670
virtual void Create(wxWindow *parent)
Definition: ToolBar.cpp:484
void Detach(wxWindow *window)
Definition: ToolBar.cpp:761
wxWindowPtr< ToolBar > Holder
Definition: ToolBar.h:105
static void SetButtonToolTip(AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
Definition: ToolBar.cpp:956
static ToolManager & Get(AudacityProject &project)
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1437
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:486
Holds a msgid for the translation catalog; may also bind format arguments.
TranslatableString & Format(Args &&...args) &
Capture variadic format arguments (by copy) when there is no plural.
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object
PlayRegion playRegion
Definition: ViewInfo.h:217
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
void ActivatePlayRegion(AudacityProject &project)
void InactivatePlayRegion(AudacityProject &project)