46#include <wx/statusbr.h>
48#include <wx/tooltip.h>
49#include <wx/datetime.h>
59#include "../ProjectAudioManager.h"
61#include "../ProjectWindow.h"
62#include "../SelectUtilities.h"
64#include "../widgets/AButton.h"
67#include "../tracks/ui/Scrubbing.h"
68#include "../toolbars/ToolManager.h"
105 return wxT(
"Control");
130 toolManager.GetToolBar(
ID()));
137 toolManager.GetToolBar(
ID()));
158 bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
159 eEnabledUp, eEnabledDown, eDisabled,
176 bmpCutPreview, bmpCutPreview, bmpCutPreviewDisabled);
178 bmpScrub, bmpScrub, bmpScrubDisabled);
180 bmpSeek, bmpSeek, bmpSeekDisabled);
195 bool bPreferNewTrack;
196 gPrefs->
Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
197 if( !bPreferNewTrack )
199 bmpRecordBelowDisabled);
202 bmpRecordBesideDisabled);
213 wxToolTip::Enable(
true);
214 wxToolTip::SetDelay(1000);
226 auto pCtrl =
static_cast<AButton*
>(this->FindWindow(iWinID));
249 name =
wxT(
"CursProjectStart");
252 name =
wxT(
"TogglePlayRegion");
255 std::vector<ComponentInterfaceSymbol> commands(
263 commands.push_back( {
wxT(
"OncePlayStop"),
XO(
"Play Once") } );
267 {
bool bPreferNewTrack;
268 gPrefs->
Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
270 commands.push_back( {
271 wxT(
"Record2ndChoice"),
273 ?
XO(
"Record New Track")
274 :
XO(
"Append Record")
284 commands.push_back( {
285 wxT(
"SelEnd"),
XO(
"Select to End") } );
289 commands.push_back( {
290 wxT(
"SelStart"),
XO(
"Select to Start") } );
301 bool updated =
false;
332 int flags = wxALIGN_CENTER | wxRIGHT;
338 std::unique_ptr < wxSizer > {
mSizer};
369 SetMinSize(
GetSizer()->GetMinSize() );
374 bool playDown =
false;
375 bool playShift =
false;
376 bool pauseDown =
false;
377 bool recordDown =
false;
378 bool recordShift =
false;
379 bool loopDown =
false;
394 std::unique_ptr < wxSizer > {
mSizer};
429#ifndef USE_AQUA_THEME
430 wxSize s =
mSizer->GetSize();
431 wxPoint p =
mSizer->GetPosition();
433 wxRect bevelRect( p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1 );
442 bool canStop = projectAudioManager.CanStopAudioStream();
448 bool busy = gAudioIO->IsBusy();
456 !(busy && !recording && !paused) &&
457 !(playing && !paused)
497 if (event.ControlDown() || event.AltDown()) {
507 if (event.GetKeyCode() == WXK_SPACE) {
508 if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
510 projectAudioManager.Stop();
512 else if (!gAudioIO->IsBusy()) {
513 projectAudioManager.PlayCurrentRegion();
524 bool canStop = projectAudioManager.CanStopAudioStream();
529 projectAudioManager.Stop();
537 bool canStop = projectAudioManager.CanStopAudioStream();
540 projectAudioManager.Stop();
548 const bool newDefault = !cutPreview &&
585 if (!wxTheApp->IsActive())
589 if ( projectAudioManager.Paused() )
594 bool recording = projectAudioManager.Recording();
604 bool playing = projectAudioManager.Playing();
608 wxGetKeyState(WXK_CONTROL)
610 : wxGetKeyState(WXK_SHIFT)
620 projectAudioManager.Cutting()
628 if ( recording || playing )
633 if ( projectAudioManager.Stopping() )
687 XO(
"%s Paused.").Format(*pString) );
691 return { std::move( strings ), 30 };
703 auto scrubState = pProject
706 if (!scrubState.empty())
710 else if (projectAudioManager.Recording())
749 auto mode = Mode::Pinned;
755 if (gAudioIO->GetNumCaptureChannels() > 0) {
765 if (gAudioIO->GetNumPlaybackChannels() == 0)
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
const TranslatableString name
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
static void Bevel(wxDC &dc, bool up, const wxRect &r)
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)
wxSize ImageSize(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)