Audacity 3.2.0
ControlToolBar.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ControlToolBar.cpp
6
7 Dominic Mazzoni
8 Shane T. Mueller
9 James Crook
10 Leland Lucius
11
12*******************************************************************//*******************************************************************/
32
33
34#include "ControlToolBar.h"
35
36#include <algorithm>
37#include <cfloat>
38
39// For compilers that support precompilation, includes "wx/wx.h".
40#include <wx/wxprec.h>
41
42#include <wx/setup.h> // for wxUSE_* macros
43
44#ifndef WX_PRECOMP
45#include <wx/app.h>
46#include <wx/dc.h>
47#include <wx/event.h>
48#include <wx/image.h>
49#include <wx/intl.h>
50#include <wx/sizer.h>
51#include <wx/statusbr.h>
52#include <wx/timer.h>
53#endif
54#include <wx/tooltip.h>
55#include <wx/datetime.h>
56
57#include "AColor.h"
58#include "AllThemeResources.h"
59#include "../AudioIO.h"
60#include "ImageManipulation.h"
61#include "Prefs.h"
62#include "Project.h"
63#include "../ProjectAudioIO.h"
64#include "../ProjectAudioManager.h"
65#include "../ProjectSettings.h"
66#include "ProjectStatus.h"
67#include "../ProjectWindow.h"
68#include "../SelectUtilities.h"
69#include "Track.h"
70#include "ViewInfo.h"
71#include "../widgets/AButton.h"
72#include "FileNames.h"
73
74#include "../tracks/ui/Scrubbing.h"
75#include "../toolbars/ToolManager.h"
76
78
82
83BEGIN_EVENT_TABLE(ControlToolBar, ToolBar)
85 EVT_BUTTON(ID_PLAY_BUTTON, ControlToolBar::OnPlay)
86 EVT_BUTTON(ID_STOP_BUTTON, ControlToolBar::OnStop)
87 EVT_BUTTON(ID_RECORD_BUTTON, ControlToolBar::OnRecord)
89 EVT_BUTTON(ID_FF_BUTTON, ControlToolBar::OnFF)
90 EVT_BUTTON(ID_PAUSE_BUTTON, ControlToolBar::OnPause)
91 EVT_BUTTON(ID_LOOP_BUTTON, ControlToolBar::OnLoop)
94
95static const TranslatableString
96 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
97 is playing or recording or stopped, and whether it is paused;
98 progressive verb form */
99 sStatePlay = XO("Playing")
100 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
101 is playing or recording or stopped, and whether it is paused;
102 progressive verb form */
103 , sStateStop = XO("Stopped")
104 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
105 is playing or recording or stopped, and whether it is paused;
106 progressive verb form */
107 , sStateRecord = XO("Recording")
108;
109
110//Standard constructor
111// This was called "Control" toolbar in the GUI before - now it is "Transport".
112// Note that we use the legacy "Control" string as the section because this
113// gets written to prefs and cannot be changed in prefs to maintain backwards
114// compatibility
116: ToolBar(project, TransportBarID, XO("Transport"), wxT("Control"))
117{
118 mStrLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
119
120 mSizer = NULL;
121}
122
124{
125}
126
127
129{
130 auto &toolManager = ToolManager::Get( project );
131 return static_cast<ControlToolBar*>(
132 toolManager.GetToolBar(TransportBarID) );
133}
134
136{
137 auto &toolManager = ToolManager::Get( project );
138 return *static_cast<ControlToolBar*>(
139 toolManager.GetToolBar(TransportBarID) );
140}
141
143{
144 return Get( const_cast<AudacityProject&>( project )) ;
145}
146
147void ControlToolBar::Create(wxWindow * parent)
148{
149 ToolBar::Create(parent);
150 UpdatePrefs();
151}
152
153// This is a convenience function that allows for button creation in
154// MakeButtons() with fewer arguments
156 teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
157 int id,
158 bool processdownevents,
160{
162 bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
163 eEnabledUp, eEnabledDown, eDisabled,
164 wxWindowID(id),
165 wxDefaultPosition, processdownevents,
166 theTheme.ImageSize( bmpRecoloredUpLarge ));
167 r->SetLabel(label);
168 enum { deflation =
169#ifdef __WXMAC__
170 6
171#else
172 12
173#endif
174 };
175 r->SetFocusRect( r->GetClientRect().Deflate( deflation, deflation ) );
176
177 return r;
178}
179
180// static
182 teBmps eEnabledUp,
183 teBmps eEnabledDown,
184 teBmps eDisabled)
185{
187 bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
188 eEnabledUp, eEnabledDown, eDisabled,
189 theTheme.ImageSize( bmpRecoloredUpLarge ));
190}
191
193{
194 SetBackgroundColour( theTheme.Colour( clrMedium ) );
196
197 mPause = MakeButton(this, bmpPause, bmpPause, bmpPauseDisabled,
198 ID_PAUSE_BUTTON, true, XO("Pause"));
199
200 mPlay = MakeButton(this, bmpPlay, bmpPlay, bmpPlayDisabled,
201 ID_PLAY_BUTTON, true, XO("Play"));
202 // 3.1.0 abandoned distinct images for Shift
203 MakeAlternateImages(*mPlay, 1, bmpPlay, bmpPlay, bmpPlayDisabled);
205 bmpCutPreview, bmpCutPreview, bmpCutPreviewDisabled);
207 bmpScrub, bmpScrub, bmpScrubDisabled);
209 bmpSeek, bmpSeek, bmpSeekDisabled);
211
212 mStop = MakeButton(this, bmpStop, bmpStop, bmpStopDisabled ,
213 ID_STOP_BUTTON, false, XO("Stop"));
214
215 mRewind = MakeButton(this, bmpRewind, bmpRewind, bmpRewindDisabled,
216 ID_REW_BUTTON, false, XO("Skip to Start"));
217
218 mFF = MakeButton(this, bmpFFwd, bmpFFwd, bmpFFwdDisabled,
219 ID_FF_BUTTON, false, XO("Skip to End"));
220
221 mRecord = MakeButton(this, bmpRecord, bmpRecord, bmpRecordDisabled,
222 ID_RECORD_BUTTON, false, XO("Record"));
223
224 bool bPreferNewTrack;
225 gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
226 if( !bPreferNewTrack )
227 MakeAlternateImages(*mRecord, 1, bmpRecordBelow, bmpRecordBelow,
228 bmpRecordBelowDisabled);
229 else
230 MakeAlternateImages(*mRecord, 1, bmpRecordBeside, bmpRecordBeside,
231 bmpRecordBesideDisabled);
232
234
235 mLoop = MakeButton(this, bmpLoop, bmpLoop, bmpLoopDisabled,
237 true, // this makes it a toggle, like the pause button
239
240#if wxUSE_TOOLTIPS
242 wxToolTip::Enable(true);
243 wxToolTip::SetDelay(1000);
244#endif
245
246 // Set default order and mode
248}
249
251{
252#if wxUSE_TOOLTIPS
253 for (long iWinID = ID_PAUSE_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
254 {
255 auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
257 switch (iWinID)
258 {
259 case ID_PLAY_BUTTON:
260 // Without shift
261 name = wxT("DefaultPlayStop");
262 break;
263 case ID_RECORD_BUTTON:
264 // Without shift
265 //name = wxT("Record");
266 name = wxT("Record1stChoice");
267 break;
268 case ID_PAUSE_BUTTON:
269 name = wxT("Pause");
270 break;
271 case ID_STOP_BUTTON:
272 name = wxT("Stop");
273 break;
274 case ID_FF_BUTTON:
275 name = wxT("CursProjectEnd");
276 break;
277 case ID_REW_BUTTON:
278 name = wxT("CursProjectStart");
279 break;
280 case ID_LOOP_BUTTON:
281 name = wxT("TogglePlayRegion");
282 break;
283 }
284 std::vector<ComponentInterfaceSymbol> commands(
285 1u, { name, Verbatim( pCtrl->GetLabel() ) } );
286
287 // Some have a second
288 switch (iWinID)
289 {
290 case ID_PLAY_BUTTON:
291 // With shift
292 commands.push_back( { wxT("OncePlayStop"), XO("Play Once") } );
293 break;
294 case ID_RECORD_BUTTON:
295 // With shift
296 { bool bPreferNewTrack;
297 gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
298 // For the shortcut tooltip.
299 commands.push_back( {
300 wxT("Record2ndChoice"),
301 !bPreferNewTrack
302 ? XO("Record New Track")
303 : XO("Append Record")
304 } );
305 }
306 break;
307 case ID_PAUSE_BUTTON:
308 break;
309 case ID_STOP_BUTTON:
310 break;
311 case ID_FF_BUTTON:
312 // With shift
313 commands.push_back( {
314 wxT("SelEnd"), XO("Select to End") } );
315 break;
316 case ID_REW_BUTTON:
317 // With shift
318 commands.push_back( {
319 wxT("SelStart"), XO("Select to Start") } );
320 break;
321 }
323 mProject, *pCtrl, commands.data(), commands.size());
324 }
325#endif
326}
327
329{
330 bool updated = false;
331 bool active;
332
333 wxString strLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
334 if (mStrLocale != strLocale)
335 {
336 mStrLocale = strLocale;
337 updated = true;
338 }
339
340 if( updated )
341 {
342 ReCreateButtons(); // side effect: calls RegenerateTooltips()
343 Updated();
344 }
345 else
346 // The other reason to regenerate tooltips is if keyboard shortcuts for
347 // transport buttons changed, but that's too much work to check for, so just
348 // always do it. (Much cheaper than calling ReCreateButtons() in all cases.
350
351
352 // Set label to pull in language change
353 SetLabel(XO("Transport"));
354
355 // Give base class a chance
357}
358
360{
361 int flags = wxALIGN_CENTER | wxRIGHT;
362
363 // (Re)allocate the button sizer
364 if( mSizer )
365 {
366 Detach( mSizer );
367 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
368 }
369
370 Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);
371
372 // Start with a little extra space
373 mSizer->Add( 5, 55 );
374
375 // Establish correct tab key sequence with mLoop last
376 mPause->MoveBeforeInTabOrder( mLoop );
377 mPlay->MoveBeforeInTabOrder( mLoop );
378 mStop->MoveBeforeInTabOrder( mLoop );
379 mRewind->MoveBeforeInTabOrder( mLoop );
380 mFF->MoveBeforeInTabOrder( mLoop );
381 mRecord->MoveBeforeInTabOrder( mLoop );
382
383 mSizer->Add( mPause, 0, flags, 2 );
384 mSizer->Add( mPlay, 0, flags, 2 );
385 mSizer->Add( mStop, 0, flags, 2 );
386 mSizer->Add( mRewind, 0, flags, 2 );
387 mSizer->Add( mFF, 0, flags, 10 );
388 mSizer->Add( mRecord, 0, flags, 10 );
389 mSizer->Add( mLoop, 0, flags, 5 );
390
391 // Layout the sizer
392 mSizer->Layout();
393
394 // Layout the toolbar
395 Layout();
396
397 // (Re)Establish the minimum size
398 SetMinSize( GetSizer()->GetMinSize() );
399}
400
402{
403 bool playDown = false;
404 bool playShift = false;
405 bool pauseDown = false;
406 bool recordDown = false;
407 bool recordShift = false;
408 bool loopDown = false;
409
410 // ToolBar::ReCreateButtons() will get rid of its sizer and
411 // since we've attached our sizer to it, ours will get deleted too
412 // so clean ours up first.
413 if( mSizer )
414 {
415 playDown = mPlay->IsDown();
416 playShift = mPlay->WasShiftDown();
417 pauseDown = mPause->IsDown();
418 recordDown = mRecord->IsDown();
419 recordShift = mRecord->WasShiftDown();
420 loopDown = mLoop->IsDown();
421 Detach( mSizer );
422
423 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
424 mSizer = NULL;
425 }
426
428
429 if (playDown)
430 {
434 SetPlay(playDown, appearance);
435 }
436
437 if (pauseDown)
438 {
439 mPause->PushDown();
440 }
441
442 if (recordDown)
443 {
444 mRecord->SetAlternateIdx(recordShift ? 1 : 0);
445 mRecord->PushDown();
446 }
447
448 if (loopDown)
449 mLoop->PushDown();
450
452
454}
455
457{
458#ifndef USE_AQUA_THEME
459 wxSize s = mSizer->GetSize();
460 wxPoint p = mSizer->GetPosition();
461
462 wxRect bevelRect( p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1 );
463 AColor::Bevel( *dc, true, bevelRect );
464#endif
465}
466
468{
470 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
471 bool canStop = projectAudioManager.CanStopAudioStream();
472
473 bool paused = mPause->IsDown();
474 bool playing = mPlay->IsDown();
475 bool recording = mRecord->IsDown();
476 auto gAudioIO = AudioIO::Get();
477 bool busy = gAudioIO->IsBusy();
478
479 // Only interested in audio type tracks
480 bool tracks = p && TrackList::Get( *p ).Any<AudioTrack>(); // PRL: PlayableTrack ?
481
482 mPlay->SetEnabled( canStop && tracks && !recording );
484 canStop &&
485 !(busy && !recording && !paused) &&
486 !(playing && !paused)
487 );
488 mStop->SetEnabled(canStop && (playing || recording));
489 mRewind->SetEnabled(paused || (!playing && !recording));
490 mFF->SetEnabled(tracks && (paused || (!playing && !recording)));
491
492 mPause->SetEnabled(canStop);
493
494 mLoop->SetEnabled( !recording );
495}
496
497void ControlToolBar::SetPlay(bool down, PlayAppearance appearance)
498{
499 if (down) {
500 mPlay->SetShift(appearance == PlayAppearance::Looped);
502 mPlay->SetAlternateIdx(static_cast<int>(appearance));
503 mPlay->PushDown();
504 }
505 else {
506 mPlay->PopUp();
508 }
510}
511
513{
514 mStop->PushDown();
516}
517
518void ControlToolBar::OnKeyEvent(wxKeyEvent & event)
519{
520 // PRL: is this handler really ever reached? Is the ControlToolBar ever
521 // focused? Isn't there a global event filter that interprets the spacebar
522 // key (or other key chosen in preferences) and dispatches to DoPlayStop,
523 // according to CommandManager's table, before we come to this redundant
524 // function?
525
526 if (event.ControlDown() || event.AltDown()) {
527 event.Skip();
528 return;
529 }
530
531 auto gAudioIO = AudioIOBase::Get();
532 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
533
534 // Does not appear to be needed on Linux. Perhaps on some other platform?
535 // If so, "!CanStopAudioStream()" should probably apply.
536 if (event.GetKeyCode() == WXK_SPACE) {
537 if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
538 SetStop();
539 projectAudioManager.Stop();
540 }
541 else if (!gAudioIO->IsBusy()) {
542 projectAudioManager.PlayCurrentRegion();
543 }
544 return;
545 }
546 event.Skip();
547}
548
549void ControlToolBar::OnPlay(wxCommandEvent & WXUNUSED(evt))
550{
551 auto p = &mProject;
552 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
553 bool canStop = projectAudioManager.CanStopAudioStream();
554
555 if ( !canStop )
556 return;
557
558 projectAudioManager.Stop();
559
560 PlayDefault();
561}
562
563void ControlToolBar::OnStop(wxCommandEvent & WXUNUSED(evt))
564{
565 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
566 bool canStop = projectAudioManager.CanStopAudioStream();
567
568 if ( canStop ) {
569 projectAudioManager.Stop();
570 }
571}
572
574{
575 // Let control-down have precedence over shift state
576 const bool cutPreview = mPlay->WasControlDown();
577 const bool newDefault = !cutPreview &&
580 .PlayCurrentRegion(newDefault, cutPreview);
581}
582
584void ControlToolBar::OnRecord(wxCommandEvent &evt)
585{
586 // TODO: It would be neater if Menu items and Toolbar buttons used the same code for
587 // enabling/disabling, and all fell into the same action routines.
588 // Here instead we reduplicate some logic (from CommandHandler) because it isn't
589 // normally used for buttons.
590
591 bool altAppearance = mRecord->WasShiftDown();
592 ProjectAudioManager::Get( mProject ).OnRecord( altAppearance );
593}
594
595void ControlToolBar::OnPause(wxCommandEvent & WXUNUSED(evt))
596{
598}
599
600void ControlToolBar::OnLoop(wxCommandEvent & WXUNUSED(evt))
601{
602 // Toggle the state of the play region lock
603 auto &region = ViewInfo::Get(mProject).playRegion;
604 if (region.Active())
606 else
608}
609
610void ControlToolBar::OnIdle(wxIdleEvent & event)
611{
612 event.Skip();
613
614 if (!wxTheApp->IsActive())
615 return;
616
617 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
618 if ( projectAudioManager.Paused() )
619 mPause->PushDown();
620 else
621 mPause->PopUp();
622
623 bool recording = projectAudioManager.Recording();
624 if (!recording) {
625 mRecord->PopUp();
626 mRecord->SetAlternateIdx( wxGetKeyState(WXK_SHIFT) ? 1 : 0 );
627 }
628 else {
629 mRecord->PushDown();
630 mRecord->SetAlternateIdx( projectAudioManager.Appending() ? 0 : 1 );
631 }
632
633 bool playing = projectAudioManager.Playing();
634 if ( !(playing || Scrubber::Get(mProject).HasMark()) ) {
635 mPlay->PopUp();
637 wxGetKeyState(WXK_CONTROL)
638 ? 2
639 : wxGetKeyState(WXK_SHIFT)
640 ? 1
641 : 0
642 );
643 }
644 else {
645 mPlay->PushDown();
646 // Choose among alternative appearances of the play button, although
647 // options 0 and 1 became non-distinct in 3.1.0
649 projectAudioManager.Cutting()
650 ? 2
651 // : projectAudioManager.Looping()
652 // ? 1
653 : 0
654 );
655 }
656
657 if ( recording || playing )
659 else
661
662 if ( projectAudioManager.Stopping() )
663 mStop->PushDown();
664 else
665 // push-downs of the stop button are only momentary and always pop up now
666 mStop->PopUp();
667
668 if (ViewInfo::Get(mProject).playRegion.Active())
669 mLoop->PushDown();
670 else
671 mLoop->PopUp();
672
675}
676
677void ControlToolBar::OnRewind(wxCommandEvent & WXUNUSED(evt))
678{
679 mRewind->PushDown();
680 mRewind->PopUp();
681
683 {
686 }
687}
688
689void ControlToolBar::OnFF(wxCommandEvent & WXUNUSED(evt))
690{
691 mFF->PushDown();
692 mFF->PopUp();
693
695
696 {
699 }
700}
701
702// works out the width of the field in the status bar needed for the state (eg play, record pause)
707 {
708 if ( field == stateStatusBarField ) {
709 TranslatableStrings strings;
710 for ( auto pString :
712 {
713 strings.push_back(
714 /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
715 is playing or recording or stopped, and whether it is paused. */
716 XO("%s Paused.").Format(*pString) );
717 }
718
719 // added constant needed because xMax isn't large enough for some reason, plus some space.
720 return { std::move( strings ), 30 };
721 }
722 return {};
723 }
724};
725
727{
728 TranslatableString state;
729 auto &projectAudioManager = ProjectAudioManager::Get( mProject );
730
731 auto pProject = &mProject;
732 auto scrubState = pProject
735 if (!scrubState.empty())
736 state = scrubState;
737 else if (mPlay->IsDown())
738 state = sStatePlay;
739 else if (projectAudioManager.Recording())
740 state = sStateRecord;
741 else
742 state = sStateStop;
743
744 return ((mPause->IsDown()) ? XO("%s Paused.") : XO("%s."))
745 .Format( state );
746}
747
749{
752 );
753}
754
756{
757 if ( Scrubber::Get( mProject ).IsTransportingPinned() )
759#ifdef __WXMAC__
760 else if (Scrubber::Get( mProject ).HasMark()) {
761 // PRL: cause many "unnecessary" refreshes. For reasons I don't understand,
762 // doing this causes wheel rotation events (mapped from the double finger vertical
763 // swipe) to be delivered more uniformly to the application, so that speed control
764 // works better.
767 }
768#endif
769 else
771}
772
774{
776 const auto project = &mProject;
777 if (project) {
778 auto mode = Mode::Pinned;
779
780#if 0
781 // Enable these lines to pin the playhead right instead of center,
782 // when recording but not overdubbing.
783 auto gAudioIO = AudioIO::Get();
784 if (gAudioIO->GetNumCaptureChannels() > 0) {
785 // recording
786
787 // Display a fixed recording head while scrolling the waves continuously.
788 // If you overdub, you may want to anticipate some context in existing tracks,
789 // so center the head. If not, put it rightmost to display as much wave as we can.
790 bool duplex;
791#ifdef EXPERIMENTAL_DA
792 gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, false);
793#else
794 gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, true);
795#endif
796 if (duplex) {
797 // See if there is really anything being overdubbed
798 if (gAudioIO->GetNumPlaybackChannels() == 0)
799 // No.
800 duplex = false;
801 }
802
803 if (!duplex)
804 mode = Mode::Right;
805 }
806#endif
807
809 }
810}
811
813{
814 const auto project = &mProject;
815 if(project)
818}
819
821 []( AudacityProject &project ){
822 return ToolBar::Holder{ safenew ControlToolBar{ project } }; }
823};
824
825namespace {
827 /* i18n-hint: Clicking this menu item shows the toolbar
828 with the big buttons on it (play record etc) */
829 TransportBarID, wxT("ShowTransportTB"), XXO("&Transport Toolbar")
830};
831}
END_EVENT_TABLE()
static const TranslatableString sStatePlay
Methods for ControlToolBar.
IMPLEMENT_CLASS(ControlToolBar, ToolBar)
static RegisteredToolbarFactory factory
static ProjectStatus::RegisteredStatusWidthFunction registeredStatusWidthFunction
static const TranslatableString sStateRecord
static const TranslatableString sStateStop
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
const TranslatableString name
Definition: Distortion.cpp:82
int teBmps
#define field(n, t)
Definition: ImportAUP.cpp:167
#define XXO(s)
Definition: Internat.h:44
#define XO(s)
Definition: Internat.h:31
#define safenew
Definition: MemoryX.h:10
FileConfig * gPrefs
Definition: Prefs.cpp:71
StatusBarField
Definition: ProjectStatus.h:24
@ stateStatusBarField
Definition: ProjectStatus.h:25
TranslatableString label
Definition: TagsEditor.cpp:163
THEME_API Theme theTheme
Definition: Theme.cpp:82
@ TransportBarID
Definition: ToolBar.h:72
declares abstract base class Track, TrackList, and iterators over TrackList
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
std::vector< TranslatableString > TranslatableStrings
const TranslatableString LoopToggleText
Definition: ViewInfo.cpp:227
A wxButton with mouse-over behaviour.
Definition: AButton.h:25
void SetShift(bool shift)
Definition: AButton.cpp:626
void SetControl(bool control)
Definition: AButton.cpp:631
void PushDown()
Definition: AButton.cpp:597
bool IsDown()
Definition: AButton.h:113
void SetAlternateIdx(unsigned idx)
Definition: AButton.cpp:320
bool WasControlDown()
Definition: AButton.cpp:566
void PopUp()
Definition: AButton.cpp:605
bool WasShiftDown()
Definition: AButton.cpp:561
void SetEnabled(bool state)
Definition: AButton.h:88
void SetFocusRect(wxRect &r)
Definition: AButton.cpp:336
void FollowModifierKeys()
Definition: AButton.cpp:330
void SetLabel(const TranslatableString &label)
Definition: AButton.cpp:274
static void Bevel(wxDC &dc, bool up, const wxRect &r)
Definition: AColor.cpp:266
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:89
static AudioIO * Get()
Definition: AudioIO.cpp:140
Track subclass holding data representing sound (as notes, or samples, or ...)
Definition: Track.h:889
size_t size() const
How many attachment pointers are in the Site.
Definition: ClientData.h:251
A ToolBar that has the main Transport buttons.
void OnPlay(wxCommandEvent &evt)
void OnLoop(wxCommandEvent &evt)
void SetPlay(bool down, PlayAppearance appearance=PlayAppearance::Straight)
void Populate() override
void EnableDisableButtons() override
static ControlToolBar * Find(AudacityProject &project)
static void MakeAlternateImages(AButton &button, int idx, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled)
AButton * mRecord
void StartScrollingIfPreferred()
virtual ~ControlToolBar()
void ReCreateButtons() override
void OnRecord(wxCommandEvent &evt)
wxString mStrLocale
TranslatableString StateForStatusBar()
void Repaint(wxDC *dc) override
AButton * mPause
AButton * mRewind
void RegenerateTooltips() override
void Create(wxWindow *parent) override
static ControlToolBar & Get(AudacityProject &project)
void UpdatePrefs() override
void OnIdle(wxIdleEvent &event)
void OnKeyEvent(wxKeyEvent &event)
void OnStop(wxCommandEvent &evt)
static AButton * MakeButton(ControlToolBar *pBar, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, bool processdownevents, const TranslatableString &label)
void OnPause(wxCommandEvent &evt)
void OnRewind(wxCommandEvent &evt)
void OnFF(wxCommandEvent &evt)
wxBoxSizer * mSizer
static ProjectAudioManager & Get(AudacityProject &project)
void PlayCurrentRegion(bool newDefault=false, bool cutpreview=false)
void OnRecord(bool altAppearance)
std::pair< std::vector< TranslatableString >, unsigned > StatusWidthResult
Definition: ProjectStatus.h:49
static ProjectStatus & Get(AudacityProject &project)
void Set(const TranslatableString &msg, StatusBarField field=mainStatusBarField)
void Rewind(bool shift)
PlaybackScroller & GetPlaybackScroller()
static ProjectWindow & Get(AudacityProject &project)
void SkipEnd(bool shift)
static Scrubber & Get(AudacityProject &project)
Definition: Scrubbing.cpp:202
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:98
AudacityProject & mProject
Definition: ToolBar.h:235
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:873
void Add(wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
Definition: ToolBar.cpp:686
virtual void ReCreateButtons()
Definition: ToolBar.cpp:516
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:840
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:398
static void MakeButtonBackgroundsLarge()
Definition: ToolBar.cpp:776
wxBoxSizer * GetSizer()
Definition: ToolBar.cpp:678
void UpdatePrefs() override
Definition: ToolBar.cpp:605
void Updated()
Definition: ToolBar.cpp:661
virtual void Create(wxWindow *parent)
Definition: ToolBar.cpp:475
void Detach(wxWindow *window)
Definition: ToolBar.cpp:752
wxWindowPtr< ToolBar > Holder
Definition: ToolBar.h:102
static void SetButtonToolTip(AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
Definition: ToolBar.cpp:898
static ToolManager & Get(AudacityProject &project)
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1429
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:467
Holds a msgid for the translation catalog; may also bind format arguments.
TranslatableString & Format(Args &&...args) &
Capture variadic format arguments (by copy) when there is no plural.
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object
PlayRegion playRegion
Definition: ViewInfo.h:217
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
void ActivatePlayRegion(AudacityProject &project)
void InactivatePlayRegion(AudacityProject &project)