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