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 "ImageManipulation.h"
55#include "PlayableTrack.h"
56#include "Prefs.h"
57#include "Project.h"
58#include "ProjectAudioIO.h"
59#include "../ProjectAudioManager.h"
60#include "ProjectStatus.h"
61#include "../ProjectWindow.h"
62#include "../SelectUtilities.h"
63#include "ViewInfo.h"
64#include "../widgets/AButton.h"
65#include "FileNames.h"
66
67#include "../tracks/ui/Scrubbing.h"
68#include "../toolbars/ToolManager.h"
69
71
75
76BEGIN_EVENT_TABLE(ControlToolBar, ToolBar)
78 EVT_BUTTON(ID_PLAY_BUTTON, ControlToolBar::OnPlay)
79 EVT_BUTTON(ID_STOP_BUTTON, ControlToolBar::OnStop)
80 EVT_BUTTON(ID_RECORD_BUTTON, ControlToolBar::OnRecord)
82 EVT_BUTTON(ID_FF_BUTTON, ControlToolBar::OnFF)
83 EVT_BUTTON(ID_PAUSE_BUTTON, ControlToolBar::OnPause)
84 EVT_BUTTON(ID_LOOP_BUTTON, ControlToolBar::OnLoop)
87
88static const TranslatableString
89 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
90 is playing or recording or stopped, and whether it is paused;
91 progressive verb form */
92 sStatePlay = XO("Playing")
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 , sStateStop = XO("Stopped")
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 , sStateRecord = XO("Recording")
101;
102
104{
105 return wxT("Control");
106}
107
108//Standard constructor
109// This was called "Control" toolbar in the GUI before - now it is "Transport".
110// Note that we use the legacy "Control" string as the section because this
111// gets written to prefs and cannot be changed in prefs to maintain backwards
112// compatibility
114: ToolBar(project, XO("Transport"), ID())
115{
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(ID()));
131}
132
134{
135 auto &toolManager = ToolManager::Get( project );
136 return *static_cast<ControlToolBar*>(
137 toolManager.GetToolBar(ID()));
138}
139
141{
142 return Get( const_cast<AudacityProject&>( project )) ;
143}
144
145void ControlToolBar::Create(wxWindow * parent)
146{
147 ToolBar::Create(parent);
148 UpdatePrefs();
149}
150
151// static
153 teBmps eEnabledUp,
154 teBmps eEnabledDown,
155 teBmps eDisabled)
156{
158 bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
159 eEnabledUp, eEnabledDown, eDisabled,
160 theTheme.ImageSize( bmpRecoloredUpLarge ));
161}
162
164{
165 SetBackgroundColour( theTheme.Colour( clrMedium ) );
167
168 mPause = MakeButton(this, bmpPause, bmpPause, bmpPauseDisabled,
169 ID_PAUSE_BUTTON, true, XO("Pause"));
170
171 mPlay = MakeButton(this, bmpPlay, bmpPlay, bmpPlayDisabled,
172 ID_PLAY_BUTTON, true, XO("Play"));
173 // 3.1.0 abandoned distinct images for Shift
174 MakeAlternateImages(*mPlay, 1, bmpPlay, bmpPlay, bmpPlayDisabled);
176 bmpCutPreview, bmpCutPreview, bmpCutPreviewDisabled);
178 bmpScrub, bmpScrub, bmpScrubDisabled);
180 bmpSeek, bmpSeek, bmpSeekDisabled);
182
183 mStop = MakeButton(this, bmpStop, bmpStop, bmpStopDisabled ,
184 ID_STOP_BUTTON, false, XO("Stop"));
185
186 mRewind = MakeButton(this, bmpRewind, bmpRewind, bmpRewindDisabled,
187 ID_REW_BUTTON, false, XO("Skip to Start"));
188
189 mFF = MakeButton(this, bmpFFwd, bmpFFwd, bmpFFwdDisabled,
190 ID_FF_BUTTON, false, XO("Skip to End"));
191
192 mRecord = MakeButton(this, bmpRecord, bmpRecord, bmpRecordDisabled,
193 ID_RECORD_BUTTON, false, XO("Record"));
194
195 bool bPreferNewTrack;
196 gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
197 if( !bPreferNewTrack )
198 MakeAlternateImages(*mRecord, 1, bmpRecordBelow, bmpRecordBelow,
199 bmpRecordBelowDisabled);
200 else
201 MakeAlternateImages(*mRecord, 1, bmpRecordBeside, bmpRecordBeside,
202 bmpRecordBesideDisabled);
203
205
206 mLoop = MakeButton(this, bmpLoop, bmpLoop, bmpLoopDisabled,
208 true, // this makes it a toggle, like the pause button
210
211#if wxUSE_TOOLTIPS
213 wxToolTip::Enable(true);
214 wxToolTip::SetDelay(1000);
215#endif
216
217 // Set default order and mode
219}
220
222{
223#if wxUSE_TOOLTIPS
224 for (long iWinID = ID_PAUSE_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
225 {
226 auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
228 switch (iWinID)
229 {
230 case ID_PLAY_BUTTON:
231 // Without shift
232 name = wxT("DefaultPlayStop");
233 break;
234 case ID_RECORD_BUTTON:
235 // Without shift
236 //name = wxT("Record");
237 name = wxT("Record1stChoice");
238 break;
239 case ID_PAUSE_BUTTON:
240 name = wxT("Pause");
241 break;
242 case ID_STOP_BUTTON:
243 name = wxT("Stop");
244 break;
245 case ID_FF_BUTTON:
246 name = wxT("CursProjectEnd");
247 break;
248 case ID_REW_BUTTON:
249 name = wxT("CursProjectStart");
250 break;
251 case ID_LOOP_BUTTON:
252 name = wxT("TogglePlayRegion");
253 break;
254 }
255 std::vector<ComponentInterfaceSymbol> commands(
256 1u, { name, Verbatim( pCtrl->GetLabel() ) } );
257
258 // Some have a second
259 switch (iWinID)
260 {
261 case ID_PLAY_BUTTON:
262 // With shift
263 commands.push_back( { wxT("OncePlayStop"), XO("Play Once") } );
264 break;
265 case ID_RECORD_BUTTON:
266 // With shift
267 { bool bPreferNewTrack;
268 gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
269 // For the shortcut tooltip.
270 commands.push_back( {
271 wxT("Record2ndChoice"),
272 !bPreferNewTrack
273 ? XO("Record New Track")
274 : XO("Append Record")
275 } );
276 }
277 break;
278 case ID_PAUSE_BUTTON:
279 break;
280 case ID_STOP_BUTTON:
281 break;
282 case ID_FF_BUTTON:
283 // With shift
284 commands.push_back( {
285 wxT("SelEnd"), XO("Select to End") } );
286 break;
287 case ID_REW_BUTTON:
288 // With shift
289 commands.push_back( {
290 wxT("SelStart"), XO("Select to Start") } );
291 break;
292 }
294 mProject, *pCtrl, commands.data(), commands.size());
295 }
296#endif
297}
298
300{
301 bool updated = false;
302 bool active;
303
304 wxString strLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
305 if (mStrLocale != strLocale)
306 {
307 mStrLocale = strLocale;
308 updated = true;
309 }
310
311 if( updated )
312 {
313 ReCreateButtons(); // side effect: calls RegenerateTooltips()
314 Updated();
315 }
316 else
317 // The other reason to regenerate tooltips is if keyboard shortcuts for
318 // transport buttons changed, but that's too much work to check for, so just
319 // always do it. (Much cheaper than calling ReCreateButtons() in all cases.
321
322
323 // Set label to pull in language change
324 SetLabel(XO("Transport"));
325
326 // Give base class a chance
328}
329
331{
332 int flags = wxALIGN_CENTER | wxRIGHT;
333
334 // (Re)allocate the button sizer
335 if( mSizer )
336 {
337 Detach( mSizer );
338 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
339 }
340
341 Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);
342
343 // Start with a little extra space
344 mSizer->Add( 5, 55 );
345
346 // Establish correct tab key sequence with mLoop last
347 mPause->MoveBeforeInTabOrder( mLoop );
348 mPlay->MoveBeforeInTabOrder( mLoop );
349 mStop->MoveBeforeInTabOrder( mLoop );
350 mRewind->MoveBeforeInTabOrder( mLoop );
351 mFF->MoveBeforeInTabOrder( mLoop );
352 mRecord->MoveBeforeInTabOrder( mLoop );
353
354 mSizer->Add( mPause, 0, flags, 2 );
355 mSizer->Add( mPlay, 0, flags, 2 );
356 mSizer->Add( mStop, 0, flags, 2 );
357 mSizer->Add( mRewind, 0, flags, 2 );
358 mSizer->Add( mFF, 0, flags, 10 );
359 mSizer->Add( mRecord, 0, flags, 10 );
360 mSizer->Add( mLoop, 0, flags, 5 );
361
362 // Layout the sizer
363 mSizer->Layout();
364
365 // Layout the toolbar
366 Layout();
367
368 // (Re)Establish the minimum size
369 SetMinSize( GetSizer()->GetMinSize() );
370}
371
373{
374 bool playDown = false;
375 bool playShift = false;
376 bool pauseDown = false;
377 bool recordDown = false;
378 bool recordShift = false;
379 bool loopDown = false;
380
381 // ToolBar::ReCreateButtons() will get rid of its sizer and
382 // since we've attached our sizer to it, ours will get deleted too
383 // so clean ours up first.
384 if( mSizer )
385 {
386 playDown = mPlay->IsDown();
387 playShift = mPlay->WasShiftDown();
388 pauseDown = mPause->IsDown();
389 recordDown = mRecord->IsDown();
390 recordShift = mRecord->WasShiftDown();
391 loopDown = mLoop->IsDown();
392 Detach( mSizer );
393
394 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
395 mSizer = NULL;
396 }
397
399
400 if (playDown)
401 {
405 SetPlay(playDown, appearance);
406 }
407
408 if (pauseDown)
409 {
410 mPause->PushDown();
411 }
412
413 if (recordDown)
414 {
415 mRecord->SetAlternateIdx(recordShift ? 1 : 0);
416 mRecord->PushDown();
417 }
418
419 if (loopDown)
420 mLoop->PushDown();
421
423
425}
426
428{
429#ifndef USE_AQUA_THEME
430 wxSize s = mSizer->GetSize();
431 wxPoint p = mSizer->GetPosition();
432
433 wxRect bevelRect( p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1 );
434 AColor::Bevel( *dc, true, bevelRect );
435#endif
436}
437
439{
441 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
442 bool canStop = projectAudioManager.CanStopAudioStream();
443
444 bool paused = mPause->IsDown();
445 bool playing = mPlay->IsDown();
446 bool recording = mRecord->IsDown();
447 auto gAudioIO = AudioIO::Get();
448 bool busy = gAudioIO->IsBusy();
449
450 // Only interested in audio type tracks
451 bool tracks = p && TrackList::Get(*p).Any<AudioTrack>(); // PRL: PlayableTrack ?
452
453 mPlay->SetEnabled( canStop && tracks && !recording );
455 canStop &&
456 !(busy && !recording && !paused) &&
457 !(playing && !paused)
458 );
459 mStop->SetEnabled(canStop && (playing || recording));
460 mRewind->SetEnabled(paused || (!playing && !recording));
461 mFF->SetEnabled(tracks && (paused || (!playing && !recording)));
462
463 mPause->SetEnabled(canStop);
464
465 mLoop->SetEnabled( !recording );
466}
467
468void ControlToolBar::SetPlay(bool down, PlayAppearance appearance)
469{
470 if (down) {
471 mPlay->SetShift(appearance == PlayAppearance::Looped);
473 mPlay->SetAlternateIdx(static_cast<int>(appearance));
474 mPlay->PushDown();
475 }
476 else {
477 mPlay->PopUp();
479 }
481}
482
484{
485 mStop->PushDown();
487}
488
489void ControlToolBar::OnKeyEvent(wxKeyEvent & event)
490{
491 // PRL: is this handler really ever reached? Is the ControlToolBar ever
492 // focused? Isn't there a global event filter that interprets the spacebar
493 // key (or other key chosen in preferences) and dispatches to DoPlayStop,
494 // according to CommandManager's table, before we come to this redundant
495 // function?
496
497 if (event.ControlDown() || event.AltDown()) {
498 event.Skip();
499 return;
500 }
501
502 auto gAudioIO = AudioIOBase::Get();
503 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
504
505 // Does not appear to be needed on Linux. Perhaps on some other platform?
506 // If so, "!CanStopAudioStream()" should probably apply.
507 if (event.GetKeyCode() == WXK_SPACE) {
508 if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
509 SetStop();
510 projectAudioManager.Stop();
511 }
512 else if (!gAudioIO->IsBusy()) {
513 projectAudioManager.PlayCurrentRegion();
514 }
515 return;
516 }
517 event.Skip();
518}
519
520void ControlToolBar::OnPlay(wxCommandEvent & WXUNUSED(evt))
521{
522 auto p = &mProject;
523 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
524 bool canStop = projectAudioManager.CanStopAudioStream();
525
526 if ( !canStop )
527 return;
528
529 projectAudioManager.Stop();
530
531 PlayDefault();
532}
533
534void ControlToolBar::OnStop(wxCommandEvent & WXUNUSED(evt))
535{
536 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
537 bool canStop = projectAudioManager.CanStopAudioStream();
538
539 if ( canStop ) {
540 projectAudioManager.Stop();
541 }
542}
543
545{
546 // Let control-down have precedence over shift state
547 const bool cutPreview = mPlay->WasControlDown();
548 const bool newDefault = !cutPreview &&
551 .PlayCurrentRegion(newDefault, cutPreview);
552}
553
555void ControlToolBar::OnRecord(wxCommandEvent &evt)
556{
557 // TODO: It would be neater if Menu items and Toolbar buttons used the same code for
558 // enabling/disabling, and all fell into the same action routines.
559 // Here instead we reduplicate some logic (from CommandHandler) because it isn't
560 // normally used for buttons.
561
562 bool altAppearance = mRecord->WasShiftDown();
563 ProjectAudioManager::Get( mProject ).OnRecord( altAppearance );
564}
565
566void ControlToolBar::OnPause(wxCommandEvent & WXUNUSED(evt))
567{
569}
570
571void ControlToolBar::OnLoop(wxCommandEvent & WXUNUSED(evt))
572{
573 // Toggle the state of the play region lock
574 auto &region = ViewInfo::Get(mProject).playRegion;
575 if (region.Active())
577 else
579}
580
581void ControlToolBar::OnIdle(wxIdleEvent & event)
582{
583 event.Skip();
584
585 if (!wxTheApp->IsActive())
586 return;
587
588 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
589 if ( projectAudioManager.Paused() )
590 mPause->PushDown();
591 else
592 mPause->PopUp();
593
594 bool recording = projectAudioManager.Recording();
595 if (!recording) {
596 mRecord->PopUp();
597 mRecord->SetAlternateIdx( wxGetKeyState(WXK_SHIFT) ? 1 : 0 );
598 }
599 else {
600 mRecord->PushDown();
601 mRecord->SetAlternateIdx( projectAudioManager.Appending() ? 0 : 1 );
602 }
603
604 bool playing = projectAudioManager.Playing();
605 if ( !(playing || Scrubber::Get(mProject).HasMark()) ) {
606 mPlay->PopUp();
608 wxGetKeyState(WXK_CONTROL)
609 ? 2
610 : wxGetKeyState(WXK_SHIFT)
611 ? 1
612 : 0
613 );
614 }
615 else {
616 mPlay->PushDown();
617 // Choose among alternative appearances of the play button, although
618 // options 0 and 1 became non-distinct in 3.1.0
620 projectAudioManager.Cutting()
621 ? 2
622 // : projectAudioManager.Looping()
623 // ? 1
624 : 0
625 );
626 }
627
628 if ( recording || playing )
630 else
632
633 if ( projectAudioManager.Stopping() )
634 mStop->PushDown();
635 else
636 // push-downs of the stop button are only momentary and always pop up now
637 mStop->PopUp();
638
639 if (ViewInfo::Get(mProject).playRegion.Active())
640 mLoop->PushDown();
641 else
642 mLoop->PopUp();
643
646}
647
648void ControlToolBar::OnRewind(wxCommandEvent & WXUNUSED(evt))
649{
650 mRewind->PushDown();
651 mRewind->PopUp();
652
654 {
657 }
658}
659
660void ControlToolBar::OnFF(wxCommandEvent & WXUNUSED(evt))
661{
662 mFF->PushDown();
663 mFF->PopUp();
664
666
667 {
670 }
671}
672
673// works out the width of the field in the status bar needed for the state (eg play, record pause)
678 {
679 if ( field == StateStatusBarField() ) {
680 TranslatableStrings strings;
681 for ( auto pString :
683 {
684 strings.push_back(
685 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
686 is playing or recording or stopped, and whether it is paused. */
687 XO("%s Paused.").Format(*pString) );
688 }
689
690 // added constant needed because xMax isn't large enough for some reason, plus some space.
691 return { std::move( strings ), 30 };
692 }
693 return {};
694 }
695};
696
698{
699 TranslatableString state;
700 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
701
702 auto pProject = &mProject;
703 auto scrubState = pProject
706 if (!scrubState.empty())
707 state = scrubState;
708 else if (mPlay->IsDown())
709 state = sStatePlay;
710 else if (projectAudioManager.Recording())
711 state = sStateRecord;
712 else
713 state = sStateStop;
714
715 return ((mPause->IsDown()) ? XO("%s Paused.") : XO("%s."))
716 .Format( state );
717}
718
720{
723 );
724}
725
727{
728 if ( Scrubber::Get( mProject ).IsTransportingPinned() )
730#ifdef __WXMAC__
731 else if (Scrubber::Get( mProject ).HasMark()) {
732 // PRL: cause many "unnecessary" refreshes. For reasons I don't understand,
733 // doing this causes wheel rotation events (mapped from the double finger vertical
734 // swipe) to be delivered more uniformly to the application, so that speed control
735 // works better.
738 }
739#endif
740 else
742}
743
745{
747 const auto project = &mProject;
748 if (project) {
749 auto mode = Mode::Pinned;
750
751#if 0
752 // Enable these lines to pin the playhead right instead of center,
753 // when recording but not overdubbing.
754 auto gAudioIO = AudioIO::Get();
755 if (gAudioIO->GetNumCaptureChannels() > 0) {
756 // recording
757
758 // Display a fixed recording head while scrolling the waves continuously.
759 // If you overdub, you may want to anticipate some context in existing tracks,
760 // so center the head. If not, put it rightmost to display as much wave as we can.
761 bool duplex;
762 gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, true);
763 if (duplex) {
764 // See if there is really anything being overdubbed
765 if (gAudioIO->GetNumPlaybackChannels() == 0)
766 // No.
767 duplex = false;
768 }
769
770 if (!duplex)
771 mode = Mode::Right;
772 }
773#endif
774
776 }
777}
778
780{
781 const auto project = &mProject;
782 if(project)
785}
786
790};
791
792namespace {
794 /* i18n-hint: Clicking this menu item shows the toolbar
795 with the big buttons on it (play record etc) */
796 ControlToolBar::ID(), wxT("ShowTransportTB"), XXO("&Transport Toolbar")
797};
798}
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:76
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
int teBmps
#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.
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:606
void SetControl(bool control)
Definition: AButton.cpp:611
void PushDown()
Definition: AButton.cpp:577
bool IsDown()
Definition: AButton.h:208
void SetAlternateIdx(unsigned idx)
Definition: AButton.cpp:232
bool WasControlDown()
Definition: AButton.cpp:546
void PopUp()
Definition: AButton.cpp:585
bool WasShiftDown()
Definition: AButton.cpp:541
void SetEnabled(bool state)
Definition: AButton.h:182
void FollowModifierKeys()
Definition: AButton.cpp:243
static void Bevel(wxDC &dc, bool up, const wxRect &r)
Definition: AColor.cpp:264
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)
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)
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)
wxSize ImageSize(int iIndex)
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:74
AudacityProject & mProject
Definition: ToolBar.h:248
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:945
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
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:875
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:78
static void SetButtonToolTip(AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
Definition: ToolBar.cpp:970
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:216
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
void ScrollToEnd(bool extend)
Definition: Viewport.cpp:537
void ScrollToStart(bool extend)
Definition: Viewport.cpp:519
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)