46#include <wx/statusbr.h>
48#include <wx/tooltip.h>
49#include <wx/datetime.h>
59#include "../ProjectAudioManager.h"
60#include "../ProjectSettings.h"
62#include "../ProjectWindow.h"
63#include "../SelectUtilities.h"
65#include "../widgets/AButton.h"
68#include "../tracks/ui/Scrubbing.h"
69#include "../toolbars/ToolManager.h"
106 return wxT(
"Control");
131 toolManager.GetToolBar(
ID()));
138 toolManager.GetToolBar(
ID()));
159 bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
160 eEnabledUp, eEnabledDown, eDisabled,
177 bmpCutPreview, bmpCutPreview, bmpCutPreviewDisabled);
179 bmpScrub, bmpScrub, bmpScrubDisabled);
181 bmpSeek, bmpSeek, bmpSeekDisabled);
196 bool bPreferNewTrack;
197 gPrefs->
Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
198 if( !bPreferNewTrack )
200 bmpRecordBelowDisabled);
203 bmpRecordBesideDisabled);
214 wxToolTip::Enable(
true);
215 wxToolTip::SetDelay(1000);
227 auto pCtrl =
static_cast<AButton*
>(this->FindWindow(iWinID));
250 name =
wxT(
"CursProjectStart");
253 name =
wxT(
"TogglePlayRegion");
256 std::vector<ComponentInterfaceSymbol> commands(
264 commands.push_back( {
wxT(
"OncePlayStop"),
XO(
"Play Once") } );
268 {
bool bPreferNewTrack;
269 gPrefs->
Read(
"/GUI/PreferNewTrackRecord",&bPreferNewTrack,
false);
271 commands.push_back( {
272 wxT(
"Record2ndChoice"),
274 ?
XO(
"Record New Track")
275 :
XO(
"Append Record")
285 commands.push_back( {
286 wxT(
"SelEnd"),
XO(
"Select to End") } );
290 commands.push_back( {
291 wxT(
"SelStart"),
XO(
"Select to Start") } );
302 bool updated =
false;
333 int flags = wxALIGN_CENTER | wxRIGHT;
339 std::unique_ptr < wxSizer > {
mSizer};
370 SetMinSize(
GetSizer()->GetMinSize() );
375 bool playDown =
false;
376 bool playShift =
false;
377 bool pauseDown =
false;
378 bool recordDown =
false;
379 bool recordShift =
false;
380 bool loopDown =
false;
395 std::unique_ptr < wxSizer > {
mSizer};
430#ifndef USE_AQUA_THEME
431 wxSize s =
mSizer->GetSize();
432 wxPoint p =
mSizer->GetPosition();
434 wxRect bevelRect( p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1 );
443 bool canStop = projectAudioManager.CanStopAudioStream();
449 bool busy = gAudioIO->IsBusy();
457 !(busy && !recording && !paused) &&
458 !(playing && !paused)
498 if (event.ControlDown() || event.AltDown()) {
508 if (event.GetKeyCode() == WXK_SPACE) {
509 if ( projectAudioManager.Playing() || projectAudioManager.Recording() ) {
511 projectAudioManager.Stop();
513 else if (!gAudioIO->IsBusy()) {
514 projectAudioManager.PlayCurrentRegion();
525 bool canStop = projectAudioManager.CanStopAudioStream();
530 projectAudioManager.Stop();
538 bool canStop = projectAudioManager.CanStopAudioStream();
541 projectAudioManager.Stop();
549 const bool newDefault = !cutPreview &&
586 if (!wxTheApp->IsActive())
590 if ( projectAudioManager.Paused() )
595 bool recording = projectAudioManager.Recording();
605 bool playing = projectAudioManager.Playing();
609 wxGetKeyState(WXK_CONTROL)
611 : wxGetKeyState(WXK_SHIFT)
621 projectAudioManager.Cutting()
629 if ( recording || playing )
634 if ( projectAudioManager.Stopping() )
688 XO(
"%s Paused.").Format(*pString) );
692 return { std::move( strings ), 30 };
704 auto scrubState = pProject
707 if (!scrubState.empty())
711 else if (projectAudioManager.Recording())
750 auto mode = Mode::Pinned;
756 if (gAudioIO->GetNumCaptureChannels() > 0) {
763#ifdef EXPERIMENTAL_DA
770 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
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)
virtual bool Read(const wxString &key, bool *value) const =0
void ActivatePlayRegion(AudacityProject &project)
void InactivatePlayRegion(AudacityProject &project)