46#include <wx/statusbr.h>
48#include <wx/tooltip.h>
49#include <wx/datetime.h>
58#include "../ProjectAudioManager.h"
60#include "../ProjectWindow.h"
61#include "../SelectUtilities.h"
63#include "../widgets/AButton.h"
66#include "../tracks/ui/Scrubbing.h"
67#include "../toolbars/ToolManager.h"
120 button->SetIcons(iconUp, iconDown, iconDisabled);
121 button->SetLabel(
label);
122 button->SetMinSize(wxSize { 52, 52 });
123 button->SetFrameMid(2);
131 return wxT(
"Control");
156 toolManager.GetToolBar(
ID()));
163 toolManager.GetToolBar(
ID()));
244 bool bPreferNewTrack;
245 gPrefs->
Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
246 if( !bPreferNewTrack )
271 wxToolTip::Enable(
true);
272 wxToolTip::SetDelay(1000);
284 auto pCtrl =
static_cast<AButton*
>(this->FindWindow(iWinID));
307 name =
wxT(
"CursProjectStart");
310 name =
wxT(
"TogglePlayRegion");
313 std::vector<ComponentInterfaceSymbol> commands(
321 commands.push_back( {
wxT(
"OncePlayStop"),
XO(
"Play Once") } );
325 {
bool bPreferNewTrack;
326 gPrefs->
Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
328 commands.push_back( {
329 wxT(
"Record2ndChoice"),
331 ?
XO(
"Record New Track")
332 :
XO(
"Append Record")
342 commands.push_back( {
343 wxT(
"SelEnd"),
XO(
"Select to End") } );
347 commands.push_back( {
348 wxT(
"SelStart"),
XO(
"Select to Start") } );
359 bool updated =
false;
394 std::unique_ptr < wxSizer > {
mSizer};
422 SetMinSize(
GetSizer()->GetMinSize() );
427 bool playDown =
false;
428 bool playShift =
false;
429 bool pauseDown =
false;
430 bool recordDown =
false;
431 bool recordShift =
false;
432 bool loopDown =
false;
447 std::unique_ptr < wxSizer > {
mSizer};
489 bool canStop = projectAudioManager.CanStopAudioStream();
495 bool busy = gAudioIO->IsBusy();
503 !(busy && !recording && !paused) &&
504 !(playing && !paused)
544 if (event.ControlDown() || event.AltDown()) {
554 if (event.GetKeyCode() == WXK_SPACE) {
555 if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
557 projectAudioManager.Stop();
559 else if (!gAudioIO->IsBusy()) {
560 projectAudioManager.PlayCurrentRegion();
571 bool canStop = projectAudioManager.CanStopAudioStream();
576 projectAudioManager.Stop();
584 bool canStop = projectAudioManager.CanStopAudioStream();
587 projectAudioManager.Stop();
595 const bool newDefault = !cutPreview &&
632 if (!wxTheApp->IsActive())
636 if ( projectAudioManager.Paused() )
641 bool recording = projectAudioManager.Recording();
651 bool playing = projectAudioManager.Playing();
655 wxGetKeyState(WXK_CONTROL)
657 : wxGetKeyState(WXK_SHIFT)
667 projectAudioManager.Cutting()
675 if ( recording || playing )
680 if ( projectAudioManager.Stopping() )
734 XO(
"%s Paused.").Format(*pString) );
738 return { std::move( strings ), 30 };
750 auto scrubState = pProject
753 if (!scrubState.empty())
757 else if (projectAudioManager.Recording())
796 auto mode = Mode::Pinned;
802 if (gAudioIO->GetNumCaptureChannels() > 0) {
812 if (gAudioIO->GetNumPlaybackChannels() == 0)
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
XXO("&Cut/Copy/Paste Toolbar")
Extends Track with notions of mute and solo setting.
audacity::BasicSettings * gPrefs
StatusBarField StateStatusBarField()
ID of the first field in the status bar. This filed is used to display playback state.
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
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
static AudioIOBase * Get()
Track subclass holding data representing sound (as notes, or samples, or ...)
size_t size() const
How many attachment pointers are in the Site.
An explicitly nonlocalized string, not meant for the user to see.
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)
const TranslatableString & GetUntranslatedStateString() const
wxColour & Colour(int iIndex)
wxImage & Image(int iIndex)
auto Any() -> TrackIterRange< TrackType >
static TrackList & Get(AudacityProject &project)
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
static ViewInfo & Get(AudacityProject &project)
void ScrollToEnd(bool extend)
void ScrollToStart(bool extend)
static Viewport & Get(AudacityProject &project)
virtual bool Read(const wxString &key, bool *value) const =0
void ActivatePlayRegion(AudacityProject &project)
void InactivatePlayRegion(AudacityProject &project)