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