51#include <wx/statusbr.h>
54#include <wx/tooltip.h>
55#include <wx/datetime.h>
59#include "../AudioIO.h"
63#include "../ProjectAudioIO.h"
64#include "../ProjectAudioManager.h"
65#include "../ProjectSettings.h"
67#include "../ProjectWindow.h"
68#include "../SelectUtilities.h"
71#include "../widgets/AButton.h"
74#include "../tracks/ui/Scrubbing.h"
75#include "../toolbars/ToolManager.h"
118 mStrLocale =
gPrefs->Read(wxT(
"/Locale/Language"), wxT(
""));
158 bool processdownevents,
162 bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
163 eEnabledUp, eEnabledDown, eDisabled,
165 wxDefaultPosition, processdownevents,
175 r->
SetFocusRect( r->GetClientRect().Deflate( deflation, deflation ) );
187 bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
188 eEnabledUp, eEnabledDown, eDisabled,
205 bmpCutPreview, bmpCutPreview, bmpCutPreviewDisabled);
207 bmpScrub, bmpScrub, bmpScrubDisabled);
209 bmpSeek, bmpSeek, bmpSeekDisabled);
224 bool bPreferNewTrack;
225 gPrefs->Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
226 if( !bPreferNewTrack )
228 bmpRecordBelowDisabled);
231 bmpRecordBesideDisabled);
242 wxToolTip::Enable(
true);
243 wxToolTip::SetDelay(1000);
255 auto pCtrl =
static_cast<AButton*
>(this->FindWindow(iWinID));
261 name = wxT(
"DefaultPlayStop");
266 name = wxT(
"Record1stChoice");
275 name = wxT(
"CursProjectEnd");
278 name = wxT(
"CursProjectStart");
281 name = wxT(
"TogglePlayRegion");
284 std::vector<ComponentInterfaceSymbol> commands(
292 commands.push_back( { wxT(
"OncePlayStop"),
XO(
"Play Once") } );
296 {
bool bPreferNewTrack;
297 gPrefs->Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
299 commands.push_back( {
300 wxT(
"Record2ndChoice"),
302 ?
XO(
"Record New Track")
303 :
XO(
"Append Record")
313 commands.push_back( {
314 wxT(
"SelEnd"),
XO(
"Select to End") } );
318 commands.push_back( {
319 wxT(
"SelStart"),
XO(
"Select to Start") } );
330 bool updated =
false;
333 wxString strLocale =
gPrefs->Read(wxT(
"/Locale/Language"), wxT(
""));
361 int flags = wxALIGN_CENTER | wxRIGHT;
367 std::unique_ptr < wxSizer > {
mSizer};
398 SetMinSize(
GetSizer()->GetMinSize() );
403 bool playDown =
false;
404 bool playShift =
false;
405 bool pauseDown =
false;
406 bool recordDown =
false;
407 bool recordShift =
false;
408 bool loopDown =
false;
423 std::unique_ptr < wxSizer > {
mSizer};
458#ifndef USE_AQUA_THEME
459 wxSize s =
mSizer->GetSize();
460 wxPoint p =
mSizer->GetPosition();
462 wxRect bevelRect( p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1 );
471 bool canStop = projectAudioManager.CanStopAudioStream();
477 bool busy = gAudioIO->IsBusy();
485 !(busy && !recording && !paused) &&
486 !(playing && !paused)
490 mFF->
SetEnabled(tracks && (paused || (!playing && !recording)));
526 if (event.ControlDown() || event.AltDown()) {
536 if (event.GetKeyCode() == WXK_SPACE) {
537 if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
539 projectAudioManager.Stop();
541 else if (!gAudioIO->IsBusy()) {
542 projectAudioManager.PlayCurrentRegion();
553 bool canStop = projectAudioManager.CanStopAudioStream();
558 projectAudioManager.Stop();
566 bool canStop = projectAudioManager.CanStopAudioStream();
569 projectAudioManager.Stop();
577 const bool newDefault = !cutPreview &&
614 if (!wxTheApp->IsActive())
618 if ( projectAudioManager.Paused() )
623 bool recording = projectAudioManager.Recording();
633 bool playing = projectAudioManager.Playing();
637 wxGetKeyState(WXK_CONTROL)
639 : wxGetKeyState(WXK_SHIFT)
649 projectAudioManager.Cutting()
657 if ( recording || playing )
662 if ( projectAudioManager.Stopping() )
716 XO(
"%s Paused.").Format(*pString) );
720 return { std::move( strings ), 30 };
732 auto scrubState = pProject
735 if (!scrubState.empty())
739 else if (projectAudioManager.Recording())
778 auto mode = Mode::Pinned;
784 if (gAudioIO->GetNumCaptureChannels() > 0) {
791#ifdef EXPERIMENTAL_DA
792 gPrefs->Read(wxT(
"/AudioIO/Duplex"), &duplex,
false);
794 gPrefs->Read(wxT(
"/AudioIO/Duplex"), &duplex,
true);
798 if (gAudioIO->GetNumPlaybackChannels() == 0)
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
const TranslatableString name
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.
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)