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#include "ControlToolBar.h"
33
34#include <algorithm>
35#include <cfloat>
36
37// For compilers that support precompilation, includes "wx/wx.h".
38#include <wx/wxprec.h>
39
40#include <wx/setup.h> // for wxUSE_* macros
41
42#ifndef WX_PRECOMP
43#include <wx/app.h>
44#include <wx/dc.h>
45#include <wx/sizer.h>
46#include <wx/statusbr.h>
47#endif
48#include <wx/tooltip.h>
49#include <wx/datetime.h>
50
51#include "AColor.h"
52#include "AllThemeResources.h"
53#include "AudioIO.h"
54#include "PlayableTrack.h"
55#include "Prefs.h"
56#include "Project.h"
57#include "ProjectAudioIO.h"
58#include "../ProjectAudioManager.h"
59#include "ProjectStatus.h"
60#include "../ProjectWindow.h"
61#include "../SelectUtilities.h"
62#include "ViewInfo.h"
63#include "../widgets/AButton.h"
64#include "FileNames.h"
65
66#include "../tracks/ui/Scrubbing.h"
67#include "../toolbars/ToolManager.h"
68
70
74
75BEGIN_EVENT_TABLE(ControlToolBar, ToolBar)
77 EVT_BUTTON(ID_PLAY_BUTTON, ControlToolBar::OnPlay)
78 EVT_BUTTON(ID_STOP_BUTTON, ControlToolBar::OnStop)
79 EVT_BUTTON(ID_RECORD_BUTTON, ControlToolBar::OnRecord)
81 EVT_BUTTON(ID_FF_BUTTON, ControlToolBar::OnFF)
82 EVT_BUTTON(ID_PAUSE_BUTTON, ControlToolBar::OnPause)
83 EVT_BUTTON(ID_LOOP_BUTTON, ControlToolBar::OnLoop)
86
87namespace
88{
89
91 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
92 is playing or recording or stopped, and whether it is paused;
93 progressive verb form */
94 sStatePlay = XO("Playing")
95 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
96 is playing or recording or stopped, and whether it is paused;
97 progressive verb form */
98 , sStateStop = XO("Stopped")
99 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
100 is playing or recording or stopped, and whether it is paused;
101 progressive verb form */
102 , sStateRecord = XO("Recording")
103;
104
106 wxWindowID id,
108 const wxImage& iconUp,
109 const wxImage& iconDown,
110 const wxImage& iconDisabled)
111{
112 auto button = safenew AButton(parent, id);
113 button->SetButtonType(AButton::FrameButton);
114 button->SetImages(
115 theTheme.Image(bmpRecoloredUpLarge),
116 theTheme.Image(bmpRecoloredUpHiliteLarge),
117 theTheme.Image(bmpRecoloredDownLarge),
118 theTheme.Image(bmpRecoloredHiliteLarge),
119 theTheme.Image(bmpRecoloredUpLarge));
120 button->SetIcons(iconUp, iconDown, iconDisabled);
121 button->SetLabel(label);
122 button->SetMinSize(wxSize { 52, 52 });
123 button->SetFrameMid(2);
124 return button;
125}
126
127}
128
130{
131 return wxT("Control");
132}
133
134//Standard constructor
135// This was called "Control" toolbar in the GUI before - now it is "Transport".
136// Note that we use the legacy "Control" string as the section because this
137// gets written to prefs and cannot be changed in prefs to maintain backwards
138// compatibility
140: ToolBar(project, XO("Transport"), ID())
141{
142 mStrLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
143
144 mSizer = NULL;
145}
146
148{
149}
150
151
153{
154 auto &toolManager = ToolManager::Get( project );
155 return static_cast<ControlToolBar*>(
156 toolManager.GetToolBar(ID()));
157}
158
160{
161 auto &toolManager = ToolManager::Get( project );
162 return *static_cast<ControlToolBar*>(
163 toolManager.GetToolBar(ID()));
164}
165
167{
168 return Get( const_cast<AudacityProject&>( project )) ;
169}
170
171void ControlToolBar::Create(wxWindow * parent)
172{
173 ToolBar::Create(parent);
174 UpdatePrefs();
175}
176
178{
179 SetBackgroundColour( theTheme.Colour( clrMedium ) );
181
183 this,
185 XO("Pause"),
186 theTheme.Image(bmpPause),
187 wxNullImage,
188 theTheme.Image(bmpPauseDisabled));
190
192 this,
194 XO("Play"),
195 theTheme.Image(bmpPlay),
196 wxNullImage,
197 theTheme.Image(bmpPlayDisabled));
198 mPlay->SetButtonToggles(true);
200 // 3.1.0 abandoned distinct images for Shift
202 theTheme.Image(bmpCutPreview),
203 wxNullImage,
204 theTheme.Image(bmpCutPreviewDisabled));
206 theTheme.Image(bmpScrub),
207 wxNullImage,
208 theTheme.Image(bmpScrubDisabled));
210 theTheme.Image(bmpSeek),
211 wxNullImage,
212 theTheme.Image(bmpSeekDisabled));
213
214
217 XO("Stop"),
218 theTheme.Image(bmpStop),
219 wxNullImage,
220 theTheme.Image(bmpStopDisabled));
221
224 XO("Skip to Start"),
225 theTheme.Image(bmpRewind),
226 wxNullImage,
227 theTheme.Image(bmpRewindDisabled));
228
231 XO("Skip to End"),
232 theTheme.Image(bmpFFwd),
233 wxNullImage,
234 theTheme.Image(bmpFFwdDisabled));
235
238 XO("Record"),
239 theTheme.Image(bmpRecord),
240 wxNullImage,
241 theTheme.Image(bmpRecordDisabled));
243
244 bool bPreferNewTrack;
245 gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
246 if( !bPreferNewTrack )
247 {
249 theTheme.Image(bmpRecordBelow),
250 wxNullImage,
251 theTheme.Image(bmpRecordBelowDisabled));
252 }
253 else
254 {
256 theTheme.Image(bmpRecordBeside),
257 wxNullImage,
258 theTheme.Image(bmpRecordBesideDisabled));
259 }
260
264 theTheme.Image(bmpLoop),
265 wxNullImage,
266 theTheme.Image(bmpLoopDisabled));
267 mLoop->SetButtonToggles(true);// this makes it a toggle, like the pause button
268
269#if wxUSE_TOOLTIPS
271 wxToolTip::Enable(true);
272 wxToolTip::SetDelay(1000);
273#endif
274
275 // Set default order and mode
277}
278
280{
281#if wxUSE_TOOLTIPS
282 for (long iWinID = ID_PAUSE_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
283 {
284 auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
286 switch (iWinID)
287 {
288 case ID_PLAY_BUTTON:
289 // Without shift
290 name = wxT("DefaultPlayStop");
291 break;
292 case ID_RECORD_BUTTON:
293 // Without shift
294 //name = wxT("Record");
295 name = wxT("Record1stChoice");
296 break;
297 case ID_PAUSE_BUTTON:
298 name = wxT("Pause");
299 break;
300 case ID_STOP_BUTTON:
301 name = wxT("Stop");
302 break;
303 case ID_FF_BUTTON:
304 name = wxT("CursProjectEnd");
305 break;
306 case ID_REW_BUTTON:
307 name = wxT("CursProjectStart");
308 break;
309 case ID_LOOP_BUTTON:
310 name = wxT("TogglePlayRegion");
311 break;
312 }
313 std::vector<ComponentInterfaceSymbol> commands(
314 1u, { name, Verbatim( pCtrl->GetLabel() ) } );
315
316 // Some have a second
317 switch (iWinID)
318 {
319 case ID_PLAY_BUTTON:
320 // With shift
321 commands.push_back( { wxT("OncePlayStop"), XO("Play Once") } );
322 break;
323 case ID_RECORD_BUTTON:
324 // With shift
325 { bool bPreferNewTrack;
326 gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
327 // For the shortcut tooltip.
328 commands.push_back( {
329 wxT("Record2ndChoice"),
330 !bPreferNewTrack
331 ? XO("Record New Track")
332 : XO("Append Record")
333 } );
334 }
335 break;
336 case ID_PAUSE_BUTTON:
337 break;
338 case ID_STOP_BUTTON:
339 break;
340 case ID_FF_BUTTON:
341 // With shift
342 commands.push_back( {
343 wxT("SelEnd"), XO("Select to End") } );
344 break;
345 case ID_REW_BUTTON:
346 // With shift
347 commands.push_back( {
348 wxT("SelStart"), XO("Select to Start") } );
349 break;
350 }
352 mProject, *pCtrl, commands.data(), commands.size());
353 }
354#endif
355}
356
358{
359 bool updated = false;
360 bool active;
361
362 wxString strLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
363 if (mStrLocale != strLocale)
364 {
365 mStrLocale = strLocale;
366 updated = true;
367 }
368
369 if( updated )
370 {
371 ReCreateButtons(); // side effect: calls RegenerateTooltips()
372 Updated();
373 }
374 else
375 // The other reason to regenerate tooltips is if keyboard shortcuts for
376 // transport buttons changed, but that's too much work to check for, so just
377 // always do it. (Much cheaper than calling ReCreateButtons() in all cases.
379
380
381 // Set label to pull in language change
382 SetLabel(XO("Transport"));
383
384 // Give base class a chance
386}
387
389{
390 // (Re)allocate the button sizer
391 if( mSizer )
392 {
393 Detach( mSizer );
394 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
395 }
396
397 Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND | wxALL, 5);
398
399 // Establish correct tab key sequence with mLoop last
400 mPause->MoveBeforeInTabOrder( mLoop );
401 mPlay->MoveBeforeInTabOrder( mLoop );
402 mStop->MoveBeforeInTabOrder( mLoop );
403 mRewind->MoveBeforeInTabOrder( mLoop );
404 mFF->MoveBeforeInTabOrder( mLoop );
405 mRecord->MoveBeforeInTabOrder( mLoop );
406
407 mSizer->Add( mPause, 0, wxRIGHT, 4 );
408 mSizer->Add( mPlay, 0, wxRIGHT, 4 );
409 mSizer->Add( mStop, 0, wxRIGHT, 4 );
410 mSizer->Add( mRewind, 0, wxRIGHT, 4 );
411 mSizer->Add( mFF, 0, wxRIGHT, 8 );
412 mSizer->Add( mRecord, 0, wxRIGHT, 8 );
413 mSizer->Add( mLoop );
414
415 // Layout the sizer
416 mSizer->Layout();
417
418 // Layout the toolbar
419 Layout();
420
421 // (Re)Establish the minimum size
422 SetMinSize( GetSizer()->GetMinSize() );
423}
424
426{
427 bool playDown = false;
428 bool playShift = false;
429 bool pauseDown = false;
430 bool recordDown = false;
431 bool recordShift = false;
432 bool loopDown = false;
433
434 // ToolBar::ReCreateButtons() will get rid of its sizer and
435 // since we've attached our sizer to it, ours will get deleted too
436 // so clean ours up first.
437 if( mSizer )
438 {
439 playDown = mPlay->IsDown();
440 playShift = mPlay->WasShiftDown();
441 pauseDown = mPause->IsDown();
442 recordDown = mRecord->IsDown();
443 recordShift = mRecord->WasShiftDown();
444 loopDown = mLoop->IsDown();
445 Detach( mSizer );
446
447 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
448 mSizer = NULL;
449 }
450
452
453 if (playDown)
454 {
458 SetPlay(playDown, appearance);
459 }
460
461 if (pauseDown)
462 {
463 mPause->PushDown();
464 }
465
466 if (recordDown)
467 {
468 mRecord->SetAlternateIdx(recordShift ? 1 : 0);
469 mRecord->PushDown();
470 }
471
472 if (loopDown)
473 mLoop->PushDown();
474
476
478}
479
481{
482 // this was used to draw a bevel and can be removed.
483}
484
486{
488 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
489 bool canStop = projectAudioManager.CanStopAudioStream();
490
491 bool paused = mPause->IsDown();
492 bool playing = mPlay->IsDown();
493 bool recording = mRecord->IsDown();
494 auto gAudioIO = AudioIO::Get();
495 bool busy = gAudioIO->IsBusy();
496
497 // Only interested in audio type tracks
498 bool tracks = p && TrackList::Get(*p).Any<AudioTrack>(); // PRL: PlayableTrack ?
499
500 mPlay->SetEnabled( canStop && tracks && !recording );
502 canStop &&
503 !(busy && !recording && !paused) &&
504 !(playing && !paused)
505 );
506 mStop->SetEnabled(canStop && (playing || recording));
507 mRewind->SetEnabled(paused || (!playing && !recording));
508 mFF->SetEnabled(tracks && (paused || (!playing && !recording)));
509
510 mPause->SetEnabled(canStop);
511
512 mLoop->SetEnabled( !recording );
513}
514
515void ControlToolBar::SetPlay(bool down, PlayAppearance appearance)
516{
517 if (down) {
518 mPlay->SetShift(appearance == PlayAppearance::Looped);
520 mPlay->SetAlternateIdx(static_cast<int>(appearance));
521 mPlay->PushDown();
522 }
523 else {
524 mPlay->PopUp();
526 }
528}
529
531{
532 mStop->PushDown();
534}
535
536void ControlToolBar::OnKeyEvent(wxKeyEvent & event)
537{
538 // PRL: is this handler really ever reached? Is the ControlToolBar ever
539 // focused? Isn't there a global event filter that interprets the spacebar
540 // key (or other key chosen in preferences) and dispatches to DoPlayStop,
541 // according to CommandManager's table, before we come to this redundant
542 // function?
543
544 if (event.ControlDown() || event.AltDown()) {
545 event.Skip();
546 return;
547 }
548
549 auto gAudioIO = AudioIOBase::Get();
550 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
551
552 // Does not appear to be needed on Linux. Perhaps on some other platform?
553 // If so, "!CanStopAudioStream()" should probably apply.
554 if (event.GetKeyCode() == WXK_SPACE) {
555 if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
556 SetStop();
557 projectAudioManager.Stop();
558 }
559 else if (!gAudioIO->IsBusy()) {
560 projectAudioManager.PlayCurrentRegion();
561 }
562 return;
563 }
564 event.Skip();
565}
566
567void ControlToolBar::OnPlay(wxCommandEvent & WXUNUSED(evt))
568{
569 auto p = &mProject;
570 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
571 bool canStop = projectAudioManager.CanStopAudioStream();
572
573 if ( !canStop )
574 return;
575
576 projectAudioManager.Stop();
577
578 PlayDefault();
579}
580
581void ControlToolBar::OnStop(wxCommandEvent & WXUNUSED(evt))
582{
583 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
584 bool canStop = projectAudioManager.CanStopAudioStream();
585
586 if ( canStop ) {
587 projectAudioManager.Stop();
588 }
589}
590
592{
593 // Let control-down have precedence over shift state
594 const bool cutPreview = mPlay->WasControlDown();
595 const bool newDefault = !cutPreview &&
598 .PlayCurrentRegion(newDefault, cutPreview);
599}
600
602void ControlToolBar::OnRecord(wxCommandEvent &evt)
603{
604 // TODO: It would be neater if Menu items and Toolbar buttons used the same code for
605 // enabling/disabling, and all fell into the same action routines.
606 // Here instead we reduplicate some logic (from CommandHandler) because it isn't
607 // normally used for buttons.
608
609 bool altAppearance = mRecord->WasShiftDown();
610 ProjectAudioManager::Get( mProject ).OnRecord( altAppearance );
611}
612
613void ControlToolBar::OnPause(wxCommandEvent & WXUNUSED(evt))
614{
616}
617
618void ControlToolBar::OnLoop(wxCommandEvent & WXUNUSED(evt))
619{
620 // Toggle the state of the play region lock
621 auto &region = ViewInfo::Get(mProject).playRegion;
622 if (region.Active())
624 else
626}
627
628void ControlToolBar::OnIdle(wxIdleEvent & event)
629{
630 event.Skip();
631
632 if (!wxTheApp->IsActive())
633 return;
634
635 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
636 if ( projectAudioManager.Paused() )
637 mPause->PushDown();
638 else
639 mPause->PopUp();
640
641 bool recording = projectAudioManager.Recording();
642 if (!recording) {
643 mRecord->PopUp();
644 mRecord->SetAlternateIdx( wxGetKeyState(WXK_SHIFT) ? 1 : 0 );
645 }
646 else {
647 mRecord->PushDown();
648 mRecord->SetAlternateIdx( projectAudioManager.Appending() ? 0 : 1 );
649 }
650
651 bool playing = projectAudioManager.Playing();
652 if ( !(playing || Scrubber::Get(mProject).HasMark()) ) {
653 mPlay->PopUp();
655 wxGetKeyState(WXK_CONTROL)
656 ? 2
657 : wxGetKeyState(WXK_SHIFT)
658 ? 1
659 : 0
660 );
661 }
662 else {
663 mPlay->PushDown();
664 // Choose among alternative appearances of the play button, although
665 // options 0 and 1 became non-distinct in 3.1.0
667 projectAudioManager.Cutting()
668 ? 2
669 // : projectAudioManager.Looping()
670 // ? 1
671 : 0
672 );
673 }
674
675 if ( recording || playing )
677 else
679
680 if ( projectAudioManager.Stopping() )
681 mStop->PushDown();
682 else
683 // push-downs of the stop button are only momentary and always pop up now
684 mStop->PopUp();
685
686 if (ViewInfo::Get(mProject).playRegion.Active())
687 mLoop->PushDown();
688 else
689 mLoop->PopUp();
690
693}
694
695void ControlToolBar::OnRewind(wxCommandEvent & WXUNUSED(evt))
696{
697 mRewind->PushDown();
698 mRewind->PopUp();
699
701 {
704 }
705}
706
707void ControlToolBar::OnFF(wxCommandEvent & WXUNUSED(evt))
708{
709 mFF->PushDown();
710 mFF->PopUp();
711
713
714 {
717 }
718}
719
720// works out the width of the field in the status bar needed for the state (eg play, record pause)
725 {
726 if ( field == StateStatusBarField() ) {
727 TranslatableStrings strings;
728 for ( auto pString :
730 {
731 strings.push_back(
732 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
733 is playing or recording or stopped, and whether it is paused. */
734 XO("%s Paused.").Format(*pString) );
735 }
736
737 // added constant needed because xMax isn't large enough for some reason, plus some space.
738 return { std::move( strings ), 30 };
739 }
740 return {};
741 }
742};
743
745{
746 TranslatableString state;
747 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
748
749 auto pProject = &mProject;
750 auto scrubState = pProject
753 if (!scrubState.empty())
754 state = scrubState;
755 else if (mPlay->IsDown())
756 state = sStatePlay;
757 else if (projectAudioManager.Recording())
758 state = sStateRecord;
759 else
760 state = sStateStop;
761
762 return ((mPause->IsDown()) ? XO("%s Paused.") : XO("%s."))
763 .Format( state );
764}
765
767{
770 );
771}
772
774{
775 if ( Scrubber::Get( mProject ).IsTransportingPinned() )
777#ifdef __WXMAC__
778 else if (Scrubber::Get( mProject ).HasMark()) {
779 // PRL: cause many "unnecessary" refreshes. For reasons I don't understand,
780 // doing this causes wheel rotation events (mapped from the double finger vertical
781 // swipe) to be delivered more uniformly to the application, so that speed control
782 // works better.
785 }
786#endif
787 else
789}
790
792{
794 const auto project = &mProject;
795 if (project) {
796 auto mode = Mode::Pinned;
797
798#if 0
799 // Enable these lines to pin the playhead right instead of center,
800 // when recording but not overdubbing.
801 auto gAudioIO = AudioIO::Get();
802 if (gAudioIO->GetNumCaptureChannels() > 0) {
803 // recording
804
805 // Display a fixed recording head while scrolling the waves continuously.
806 // If you overdub, you may want to anticipate some context in existing tracks,
807 // so center the head. If not, put it rightmost to display as much wave as we can.
808 bool duplex;
809 gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, true);
810 if (duplex) {
811 // See if there is really anything being overdubbed
812 if (gAudioIO->GetNumPlaybackChannels() == 0)
813 // No.
814 duplex = false;
815 }
816
817 if (!duplex)
818 mode = Mode::Right;
819 }
820#endif
821
823 }
824}
825
827{
828 const auto project = &mProject;
829 if(project)
832}
833
837};
838
839namespace {
841 /* i18n-hint: Clicking this menu item shows the toolbar
842 with the big buttons on it (play record etc) */
843 ControlToolBar::ID(), wxT("ShowTransportTB"), XXO("&Transport Toolbar")
844};
845}
wxImage(22, 22)
wxT("CloseDown"))
END_EVENT_TABLE()
IMPLEMENT_CLASS(ControlToolBar, ToolBar)
static RegisteredToolbarFactory factory
static ProjectStatus::RegisteredStatusWidthFunction registeredStatusWidthFunction
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define field(n, t)
Definition: ImportAUP.cpp:165
#define safenew
Definition: MemoryX.h:10
Extends Track with notions of mute and solo setting.
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
StatusBarField StateStatusBarField()
ID of the first field in the status bar. This filed is used to display playback state.
wxString name
Definition: TagsEditor.cpp:166
TranslatableString label
Definition: TagsEditor.cpp:165
const auto tracks
const auto project
THEME_API Theme theTheme
Definition: Theme.cpp:82
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:693
void SetControl(bool control)
Definition: AButton.cpp:698
void PushDown()
Definition: AButton.cpp:664
bool IsDown()
Definition: AButton.h:227
void SetButtonToggles(bool toggler)
Definition: AButton.h:233
void SetAlternateIdx(unsigned idx)
Definition: AButton.cpp:287
bool WasControlDown()
Definition: AButton.cpp:633
void PopUp()
Definition: AButton.cpp:672
@ FrameButton
Definition: AButton.h:114
void SetAlternateIcons(unsigned idx, const wxImage &up, const wxImage &down, const wxImage &disabled)
Definition: AButton.cpp:275
bool WasShiftDown()
Definition: AButton.cpp:628
void SetEnabled(bool state)
Definition: AButton.h:201
void FollowModifierKeys()
Definition: AButton.cpp:298
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:94
static AudioIO * Get()
Definition: AudioIO.cpp:126
Track subclass holding data representing sound (as notes, or samples, or ...)
Definition: PlayableTrack.h:21
size_t size() const
How many attachment pointers are in the Site.
Definition: ClientData.h:260
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)
ControlToolBar(AudacityProject &project)
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)
static Identifier ID()
void OnFF(wxCommandEvent &evt)
wxBoxSizer * mSizer
An explicitly nonlocalized string, not meant for the user to see.
Definition: Identifier.h:22
static ProjectAudioManager & Get(AudacityProject &project)
void PlayCurrentRegion(bool newDefault=false, bool cutpreview=false)
void OnRecord(bool altAppearance)
std::pair< std::vector< TranslatableString >, unsigned > StatusWidthResult
static ProjectStatus & Get(AudacityProject &project)
void Set(const TranslatableString &msg, StatusBarField field=MainStatusBarField())
PlaybackScroller & GetPlaybackScroller()
static ProjectWindow & Get(AudacityProject &project)
static Scrubber & Get(AudacityProject &project)
Definition: Scrubbing.cpp:186
const TranslatableString & GetUntranslatedStateString() const
Definition: Scrubbing.cpp:987
wxColour & Colour(int iIndex)
wxImage & Image(int iIndex)
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:73
AudacityProject & mProject
Definition: ToolBar.h:247
void Add(wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
Definition: ToolBar.cpp:709
virtual void ReCreateButtons()
Definition: ToolBar.cpp:533
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:408
static void MakeButtonBackgroundsLarge()
Definition: ToolBar.cpp:811
wxBoxSizer * GetSizer()
Definition: ToolBar.cpp:701
void UpdatePrefs() override
Definition: ToolBar.cpp:622
void Updated()
Definition: ToolBar.cpp:684
virtual void Create(wxWindow *parent)
Definition: ToolBar.cpp:492
void Detach(wxWindow *window)
Definition: ToolBar.cpp:775
wxWindowPtr< ToolBar > Holder
Definition: ToolBar.h:77
static void SetButtonToolTip(AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
Definition: ToolBar.cpp:934
static ToolManager & Get(AudacityProject &project)
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:950
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:314
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 ScrollToEnd(bool extend)
Definition: Viewport.cpp:541
void ScrollToStart(bool extend)
Definition: Viewport.cpp:523
static Viewport & Get(AudacityProject &project)
Definition: Viewport.cpp:33
virtual bool Read(const wxString &key, bool *value) const =0
void ActivatePlayRegion(AudacityProject &project)
void InactivatePlayRegion(AudacityProject &project)
AButton * MakeControlToolBarButton(wxWindow *parent, wxWindowID id, const TranslatableString &label, const wxImage &iconUp, const wxImage &iconDown, const wxImage &iconDisabled)