48#include <wx/statusbr.h>
50#include <wx/tooltip.h>
51#include <wx/datetime.h>
60#include "../ProjectAudioManager.h"
61#include "../ProjectSettings.h"
63#include "../ProjectWindow.h"
64#include "../SelectUtilities.h"
67#include "../widgets/AButton.h"
70#include "../tracks/ui/Scrubbing.h"
71#include "../toolbars/ToolManager.h"
108 return wxT(
"Control");
133 toolManager.GetToolBar(
ID()));
140 toolManager.GetToolBar(
ID()));
161 bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
162 eEnabledUp, eEnabledDown, eDisabled,
179 bmpCutPreview, bmpCutPreview, bmpCutPreviewDisabled);
181 bmpScrub, bmpScrub, bmpScrubDisabled);
183 bmpSeek, bmpSeek, bmpSeekDisabled);
198 bool bPreferNewTrack;
199 gPrefs->Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
200 if( !bPreferNewTrack )
202 bmpRecordBelowDisabled);
205 bmpRecordBesideDisabled);
216 wxToolTip::Enable(
true);
217 wxToolTip::SetDelay(1000);
229 auto pCtrl =
static_cast<AButton*
>(this->FindWindow(iWinID));
252 name =
wxT(
"CursProjectStart");
255 name =
wxT(
"TogglePlayRegion");
258 std::vector<ComponentInterfaceSymbol> commands(
266 commands.push_back( {
wxT(
"OncePlayStop"),
XO(
"Play Once") } );
270 {
bool bPreferNewTrack;
271 gPrefs->Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
273 commands.push_back( {
274 wxT(
"Record2ndChoice"),
276 ?
XO(
"Record New Track")
277 :
XO(
"Append Record")
287 commands.push_back( {
288 wxT(
"SelEnd"),
XO(
"Select to End") } );
292 commands.push_back( {
293 wxT(
"SelStart"),
XO(
"Select to Start") } );
304 bool updated =
false;
307 wxString strLocale =
gPrefs->Read(
wxT(
"/Locale/Language"),
wxT(
""));
335 int flags = wxALIGN_CENTER | wxRIGHT;
341 std::unique_ptr < wxSizer > {
mSizer};
372 SetMinSize(
GetSizer()->GetMinSize() );
377 bool playDown =
false;
378 bool playShift =
false;
379 bool pauseDown =
false;
380 bool recordDown =
false;
381 bool recordShift =
false;
382 bool loopDown =
false;
397 std::unique_ptr < wxSizer > {
mSizer};
432#ifndef USE_AQUA_THEME
433 wxSize s =
mSizer->GetSize();
434 wxPoint p =
mSizer->GetPosition();
436 wxRect bevelRect( p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1 );
445 bool canStop = projectAudioManager.CanStopAudioStream();
451 bool busy = gAudioIO->IsBusy();
459 !(busy && !recording && !paused) &&
460 !(playing && !paused)
464 mFF->
SetEnabled(tracks && (paused || (!playing && !recording)));
500 if (event.ControlDown() || event.AltDown()) {
510 if (event.GetKeyCode() == WXK_SPACE) {
511 if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
513 projectAudioManager.Stop();
515 else if (!gAudioIO->IsBusy()) {
516 projectAudioManager.PlayCurrentRegion();
527 bool canStop = projectAudioManager.CanStopAudioStream();
532 projectAudioManager.Stop();
540 bool canStop = projectAudioManager.CanStopAudioStream();
543 projectAudioManager.Stop();
551 const bool newDefault = !cutPreview &&
588 if (!wxTheApp->IsActive())
592 if ( projectAudioManager.Paused() )
597 bool recording = projectAudioManager.Recording();
607 bool playing = projectAudioManager.Playing();
611 wxGetKeyState(WXK_CONTROL)
613 : wxGetKeyState(WXK_SHIFT)
623 projectAudioManager.Cutting()
631 if ( recording || playing )
636 if ( projectAudioManager.Stopping() )
690 XO(
"%s Paused.").Format(*pString) );
694 return { std::move( strings ), 30 };
706 auto scrubState = pProject
709 if (!scrubState.empty())
713 else if (projectAudioManager.Recording())
752 auto mode = Mode::Pinned;
758 if (gAudioIO->GetNumCaptureChannels() > 0) {
765#ifdef EXPERIMENTAL_DA
766 gPrefs->Read(
wxT(
"/AudioIO/Duplex"), &duplex,
false);
768 gPrefs->Read(
wxT(
"/AudioIO/Duplex"), &duplex,
true);
772 if (gAudioIO->GetNumPlaybackChannels() == 0)
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
const TranslatableString name
XXO("&Cut/Copy/Paste Toolbar")
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
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 ActivatePlayRegion(AudacityProject &project)
void InactivatePlayRegion(AudacityProject &project)