Audacity  2.2.2
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ControlToolBar Class Referencefinal

A ToolBar that has the main Transport buttons. More...

#include <ControlToolBar.h>

Inheritance diagram for ControlToolBar:
ToolBar wxPanelWrapper wxTabTraversalWrapper< wxPanel >

Public Types

enum  PlayAppearance {
  PlayAppearance::Straight, PlayAppearance::Looped, PlayAppearance::CutPreview, PlayAppearance::Scrub,
  PlayAppearance::Seek
}
 
- Public Types inherited from ToolBar
using Holder = Destroy_ptr< ToolBar >
 

Public Member Functions

 ControlToolBar ()
 Methods for ControlToolBar. More...
 
virtual ~ControlToolBar ()
 
void Create (wxWindow *parent) override
 
void UpdatePrefs () override
 
void OnKeyEvent (wxKeyEvent &event)
 
void OnRewind (wxCommandEvent &evt)
 
void OnPlay (wxCommandEvent &evt)
 
void OnStop (wxCommandEvent &evt)
 
void OnRecord (wxCommandEvent &evt)
 
bool DoRecord (AudacityProject &project, const TransportTracks &transportTracks, double t0, double t1, bool altAppearance, const AudioIOStartStreamOptions &options)
 
void OnFF (wxCommandEvent &evt)
 
void OnPause (wxCommandEvent &evt)
 
void SetPlay (bool down, PlayAppearance appearance=PlayAppearance::Straight)
 
void SetStop (bool down)
 
void SetRecord (bool down, bool altAppearance=false)
 
bool IsPauseDown () const
 
bool IsRecordDown () const
 
bool CanStopAudioStream ()
 
void PlayCurrentRegion (bool looped=false, bool cutpreview=false)
 
int PlayPlayRegion (const SelectedRegion &selectedRegion, const AudioIOStartStreamOptions &options, PlayMode playMode, PlayAppearance appearance=PlayAppearance::Straight, bool backwards=false, bool playWhiteSpace=false)
 
void PlayDefault ()
 
void StopPlaying (bool stopStream=true)
 
void Pause ()
 
void Populate () override
 
void Repaint (wxDC *dc) override
 
void EnableDisableButtons () override
 
void ReCreateButtons () override
 
void RegenerateTooltips () override
 
int WidthForStatusBar (wxStatusBar *const)
 
void UpdateStatusBar (AudacityProject *pProject)
 
void StartScrollingIfPreferred ()
 
void StartScrolling ()
 
void StopScrolling ()
 
void CommitRecording ()
 
void CancelRecording ()
 
- Public Member Functions inherited from ToolBar
 ToolBar (int type, const wxString &label, const wxString &section, bool resizable=false)
 
virtual ~ToolBar ()
 
bool AcceptsFocus () const override
 
int GetType ()
 
wxString GetTitle ()
 
wxString GetLabel ()
 
wxString GetSection ()
 
ToolDockGetDock ()
 
void SetLabel (const wxString &label) override
 
void SetDocked (ToolDock *dock, bool pushed)
 
virtual bool Expose (bool show=true)
 
bool IsResizable () const
 
bool IsVisible () const
 
bool IsDocked () const
 
bool IsPositioned ()
 
void SetVisible (bool bVisible)
 
void SetPositioned ()
 
virtual int GetInitialWidth ()
 Resizable toolbars should implement these. More...
 
virtual int GetMinToolbarWidth ()
 
virtual wxSize GetDockedSize ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&...args)
 

Static Public Member Functions

static WaveTrackArray ChooseExistingRecordingTracks (AudacityProject &proj, bool selectedOnly)
 
static bool UseDuplex ()
 
- Static Public Member Functions inherited from ToolBar
static AButtonMakeButton (wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxWindowID id, wxPoint placement, bool processdownevents, wxSize size)
 
static void MakeAlternateImages (AButton &button, int idx, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size)
 
static void SetButtonToolTip (AButton &button, const TranslatedInternalString commands[], size_t nCommands)
 

Private Types

enum  {
  ID_PAUSE_BUTTON = 11000, ID_PLAY_BUTTON, ID_STOP_BUTTON, ID_FF_BUTTON,
  ID_REW_BUTTON, ID_RECORD_BUTTON, BUTTON_COUNT
}
 

Private Member Functions

void ArrangeButtons ()
 
void SetupCutPreviewTracks (double playStart, double cutStart, double cutEnd, double playEnd)
 
void ClearCutPreviewTracks ()
 
wxString StateForStatusBar ()
 

Static Private Member Functions

static AButtonMakeButton (ControlToolBar *pBar, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, bool processdownevents, const wxChar *label)
 
static void MakeAlternateImages (AButton &button, int idx, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled)
 

Private Attributes

AButtonmRewind
 
AButtonmPlay
 
AButtonmRecord
 
AButtonmPause
 
AButtonmStop
 
AButtonmFF
 
bool mPaused
 
bool mErgonomicTransportButtons
 
wxString mStrLocale
 
wxBoxSizer * mSizer
 
std::shared_ptr< TrackListmCutPreviewTracks
 
wxString mStatePlay
 
wxString mStateStop
 
wxString mStateRecord
 
wxString mStatePause
 

Static Private Attributes

static AudacityProjectmBusyProject = NULL
 

Additional Inherited Members

- Protected Member Functions inherited from ToolBar
void SetButton (bool down, AButton *button)
 
void MakeMacRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
void MakeRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
void MakeButtonBackgroundsLarge ()
 
void MakeButtonBackgroundsSmall ()
 
wxBoxSizer * GetSizer ()
 
void Add (wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
 
void Add (wxSizer *sizer, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL)
 
void Add (int width, int height, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL)
 
void AddSpacer (int size=14)
 
void AddStretchSpacer (int prop=1)
 
void Detach (wxWindow *window)
 
void Detach (wxSizer *sizer)
 
void Updated ()
 
int GetResizeGrabberWidth ()
 Returns the width in pixels of the resizer element. More...
 
void OnErase (wxEraseEvent &event)
 
void OnPaint (wxPaintEvent &event)
 
void OnMouseEvents (wxMouseEvent &event)
 
- Protected Attributes inherited from ToolBar
wxString mLabel
 
wxString mSection
 
int mType
 

Detailed Description

A ToolBar that has the main Transport buttons.

In the GUI, this is referred to as "Transport Toolbar", as it corresponds to commands in the Transport menu. "Control Toolbar" is historic. This class, which is a child of Toolbar, creates the window containing the Transport (rewind/play/stop/record/ff) buttons. The window can be embedded within a normal project window, or within a ToolbarFrame that is managed by a global ToolBarStub called gControlToolBarStub.

All of the controls in this window were custom-written for Audacity - they are not native controls on any platform - however, it is intended that the images could be easily replaced to allow "skinning" or just customization to match the look and feel of each platform.

Definition at line 47 of file ControlToolBar.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
ID_PAUSE_BUTTON 
ID_PLAY_BUTTON 
ID_STOP_BUTTON 
ID_FF_BUTTON 
ID_REW_BUTTON 
ID_RECORD_BUTTON 
BUTTON_COUNT 

Definition at line 157 of file ControlToolBar.h.

Enumerator
Straight 
Looped 
CutPreview 
Scrub 
Seek 

Definition at line 80 of file ControlToolBar.h.

80  {
81  Straight, Looped, CutPreview, Scrub, Seek
82  };

Constructor & Destructor Documentation

ControlToolBar::ControlToolBar ( )

Methods for ControlToolBar.

Definition at line 103 of file ControlToolBar.cpp.

References gPrefs, and XO.

104 : ToolBar(TransportBarID, _("Transport"), wxT("Control"))
105 {
106  mPaused = false;
107 
108  gPrefs->Read(wxT("/GUI/ErgonomicTransportButtons"), &mErgonomicTransportButtons, true);
109  mStrLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
110 
111  mSizer = NULL;
112 
113  /* i18n-hint: These are strings for the status bar, and indicate whether Audacity
114  is playing or recording or stopped, and whether it is paused. */
115  mStatePlay = XO("Playing");
116  mStateStop = XO("Stopped");
117  mStateRecord = XO("Recording");
118  mStatePause = XO("Paused");
119 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
wxString mStateRecord
#define XO(s)
Definition: Internat.h:33
wxString mStateStop
wxString mStatePause
wxString mStrLocale
wxBoxSizer * mSizer
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
ToolBar(int type, const wxString &label, const wxString &section, bool resizable=false)
Definition: ToolBar.cpp:307
bool mErgonomicTransportButtons
wxString mStatePlay
ControlToolBar::~ControlToolBar ( )
virtual

Definition at line 121 of file ControlToolBar.cpp.

122 {
123 }

Member Function Documentation

void ControlToolBar::ArrangeButtons ( )
private

Definition at line 333 of file ControlToolBar.cpp.

References ToolBar::Add(), ToolBar::Detach(), ToolBar::GetSizer(), mErgonomicTransportButtons, mFF, mPause, mPlay, mRecord, mRewind, mSizer, mStop, and safenew.

Referenced by Populate().

334 {
335  int flags = wxALIGN_CENTER | wxRIGHT;
336 
337  // (Re)allocate the button sizer
338  if( mSizer )
339  {
340  Detach( mSizer );
341  std::unique_ptr < wxSizer > {mSizer}; // DELETE it
342  }
343 
344  Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);
345 
346  // Start with a little extra space
347  mSizer->Add( 5, 55 );
348 
349  // Add the buttons in order based on ergonomic setting
351  {
352  mPause->MoveBeforeInTabOrder( mRecord );
353  mPlay->MoveBeforeInTabOrder( mRecord );
354  mStop->MoveBeforeInTabOrder( mRecord );
355  mRewind->MoveBeforeInTabOrder( mRecord );
356  mFF->MoveBeforeInTabOrder( mRecord );
357 
358  mSizer->Add( mPause, 0, flags, 2 );
359  mSizer->Add( mPlay, 0, flags, 2 );
360  mSizer->Add( mStop, 0, flags, 2 );
361  mSizer->Add( mRewind, 0, flags, 2 );
362  mSizer->Add( mFF, 0, flags, 10 );
363  mSizer->Add( mRecord, 0, flags, 5 );
364  }
365  else
366  {
367  mRewind->MoveBeforeInTabOrder( mFF );
368  mPlay->MoveBeforeInTabOrder( mFF );
369  mRecord->MoveBeforeInTabOrder( mFF );
370  mPause->MoveBeforeInTabOrder( mFF );
371  mStop->MoveBeforeInTabOrder( mFF );
372 
373  mSizer->Add( mRewind, 0, flags, 2 );
374  mSizer->Add( mPlay, 0, flags, 2 );
375  mSizer->Add( mRecord, 0, flags, 2 );
376  mSizer->Add( mPause, 0, flags, 2 );
377  mSizer->Add( mStop, 0, flags, 2 );
378  mSizer->Add( mFF, 0, flags, 5 );
379  }
380 
381  // Layout the sizer
382  mSizer->Layout();
383 
384  // Layout the toolbar
385  Layout();
386 
387  // (Re)Establish the minimum size
388  SetMinSize( GetSizer()->GetMinSize() );
389 }
AButton * mRecord
wxBoxSizer * GetSizer()
Definition: ToolBar.cpp:603
AButton * mPause
void Detach(wxWindow *window)
Definition: ToolBar.cpp:677
#define safenew
Definition: Audacity.h:230
wxBoxSizer * mSizer
void Add(wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
Definition: ToolBar.cpp:611
AButton * mRewind
bool mErgonomicTransportButtons
void ControlToolBar::CancelRecording ( )

Definition at line 1564 of file ControlToolBar.cpp.

References GetActiveProject().

Referenced by DoRecord().

1565 {
1566  const auto project = GetActiveProject();
1567  project->GetTracks()->ClearPendingTracks();
1568 }
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
bool ControlToolBar::CanStopAudioStream ( )

Definition at line 820 of file ControlToolBar.cpp.

References gAudioIO, GetActiveProject(), AudioIO::GetOwningProject(), AudioIO::IsMonitoring(), and AudioIO::IsStreamActive().

Referenced by DoRecord(), EnableDisableButtons(), OnPause(), OnPlay(), OnStop(), Pause(), PlayCurrentRegion(), PlayPlayRegion(), and StopPlaying().

821 {
822  return (!gAudioIO->IsStreamActive() ||
823  gAudioIO->IsMonitoring() ||
825 }
bool IsStreamActive()
Returns true if the audio i/o is running at all, but not during cleanup.
Definition: AudioIO.cpp:2890
AudacityProject * GetOwningProject() const
Definition: AudioIO.h:247
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
bool IsMonitoring()
Returns true if we're monitoring input (but not recording or playing actual audio) ...
Definition: AudioIO.cpp:2914
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
WaveTrackArray ControlToolBar::ChooseExistingRecordingTracks ( AudacityProject proj,
bool  selectedOnly 
)
static

Definition at line 900 of file ControlToolBar.cpp.

References TrackListIterator::First(), Track::GetLink(), Track::GetLinked(), Track::GetSelected(), AudacityProject::GetTracks(), gPrefs, TrackListIterator::Next(), and Track::Wave.

Referenced by OnRecord().

902 {
903  auto p = &proj;
904  size_t recordingChannels =
905  std::max(0L, gPrefs->Read(wxT("/AudioIO/RecordChannels"), 2));
906  bool strictRules = (recordingChannels <= 2);
907 
908  // Iterate over all wave tracks, or over selected wave tracks only.
909  //
910  // In the usual cases of one or two recording channels, seek a first-fit
911  // unbroken sub-sequence for which the total number of channels matches the
912  // required number exactly. Never drop inputs or fill only some channels
913  // of a track.
914  //
915  // In case of more than two recording channels, choose tracks only among the
916  // selected. Simply take the earliest wave tracks, until the number of
917  // channels is enough. If there are fewer channels than inputs, but at least
918  // one channel, then some of the input channels will be dropped.
919  //
920  // Resulting tracks may be non-consecutive within the list of all tracks
921  // (there may be non-wave tracks between, or non-selected tracks when
922  // considering selected tracks only.)
923 
924  if (!strictRules && !selectedOnly)
925  return {};
926 
927  auto trackList = p->GetTracks();
928  TrackListIterator it(trackList);
929  std::vector<unsigned> channelCounts;
930  WaveTrackArray candidates;
931  for (Track *tt = it.First(); tt; tt = it.Next()) {
932  // Eliminate certain tracks from consideration
933  if (tt->GetKind() != Track::Wave)
934  continue;
935  WaveTrack *candidate = static_cast<WaveTrack *>(tt);
936  if (candidate->GetLink() && !candidate->GetLinked())
937  // Don't re-consider right channel apart from the left
938  continue;
939  if (selectedOnly && !candidate->GetSelected())
940  continue;
941 
942  // count channels in this track
943  unsigned nChannels = 0;
944  // This is written with odd seeming generality, looking forward to
945  // the rewrite that removes assumption of at-most-stereo
946  for (auto channel = candidate; channel;
947  channel = channel->GetLinked()
948  ? static_cast<WaveTrack*>(channel->GetLink()) : nullptr)
949  ++nChannels;
950 
951  if (strictRules && nChannels > recordingChannels) {
952  // The recording would under-fill this track's channels
953  // Can't use any partial accumulated results
954  // either. Keep looking.
955  candidates.clear();
956  channelCounts.clear();
957  continue;
958  }
959  else {
960  // Might use this but may have to discard some of the accumulated
961  while(strictRules &&
962  nChannels + candidates.size() > recordingChannels) {
963  auto nOldChannels = channelCounts[0];
964  wxASSERT(nOldChannels > 0);
965  channelCounts.erase(channelCounts.begin());
966  candidates.erase(candidates.begin(),
967  candidates.begin() + nOldChannels);
968  }
969  channelCounts.push_back(nChannels);
970  for (auto channel = candidate; channel;
971  channel = channel->GetLinked()
972  ? static_cast<WaveTrack*>(channel->GetLink()) : nullptr) {
973  candidates.push_back(Track::Pointer<WaveTrack>(channel));
974  if(candidates.size() == recordingChannels)
975  // Done!
976  return candidates;
977  }
978  }
979  }
980 
981  if (!strictRules && !candidates.empty())
982  // good enough
983  return candidates;
984 
985  // If the loop didn't exit early, we could not find enough channels
986  return {};
987 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
bool GetSelected() const
Definition: Track.h:276
bool GetLinked() const
Definition: Track.h:279
std::vector< std::shared_ptr< WaveTrack > > WaveTrackArray
Definition: AudioIO.h:66
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:102
An iterator for a TrackList.
Definition: Track.h:402
Track * GetLink() const
Definition: Track.cpp:269
TrackList * GetTracks()
Definition: Project.h:192
void ControlToolBar::ClearCutPreviewTracks ( )
private

Definition at line 1429 of file ControlToolBar.cpp.

References mCutPreviewTracks.

Referenced by SetupCutPreviewTracks(), and StopPlaying().

1430 {
1431  if (mCutPreviewTracks)
1432  mCutPreviewTracks->Clear();
1433  mCutPreviewTracks.reset();
1434 }
std::shared_ptr< TrackList > mCutPreviewTracks
void ControlToolBar::CommitRecording ( )

Definition at line 1558 of file ControlToolBar.cpp.

References GetActiveProject().

Referenced by AudioIO::StopStream().

1559 {
1560  const auto project = GetActiveProject();
1561  project->GetTracks()->ApplyPendingTracks();
1562 }
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void ControlToolBar::Create ( wxWindow *  parent)
overridevirtual

Reimplemented from ToolBar.

Definition at line 126 of file ControlToolBar.cpp.

References ToolBar::Create().

127 {
128  ToolBar::Create(parent);
129 }
virtual void Create(wxWindow *parent)
Definition: ToolBar.cpp:438
bool ControlToolBar::DoRecord ( AudacityProject project,
const TransportTracks transportTracks,
double  t0,
double  t1,
bool  altAppearance,
const AudioIOStartStreamOptions options 
)

Definition at line 1102 of file ControlToolBar.cpp.

References _(), AlwaysEnabledFlag, AudioIONotBusyFlag, CancelRecording(), CanStopAudioStream(), CanStopAudioStreamFlag, TransportTracks::captureTracks, TrackListIterator::First(), gAudioIO, GetActiveProject(), TracksPrefs::GetDefaultAudioTrackNamePreference(), AudioIO::GetNumCaptureChannels(), gPrefs, AudioIO::IsBusy(), Track::LeftChannel, make_iterator_range(), mBusyProject, Track::MonoChannel, mRecord, TrackListIterator::Next(), AButton::PopUp(), AButton::PushDown(), WaveTrack::Reinit(), Track::RightChannel, SetPlay(), SetRecord(), SetStop(), ShowErrorDialog(), StartScrollingIfPreferred(), AudioIO::StartStream(), AudacityProject::TryToMakeActionAllowed(), UpdateStatusBar(), and Track::Wave.

Referenced by AudacityProject::OnPunchAndRoll(), and OnRecord().

1107 {
1108  CommandFlag flags = AlwaysEnabledFlag; // 0 means recalc flags.
1109 
1110  // NB: The call may have the side effect of changing flags.
1111  bool allowed = project.TryToMakeActionAllowed(
1112  flags,
1115 
1116  if (!allowed)
1117  return false;
1118  // ...end of code from CommandHandler.
1119 
1120  if (gAudioIO->IsBusy()) {
1122  mRecord->PopUp();
1123  else
1124  mRecord->PushDown();
1125  return false;
1126  }
1127 
1128  SetRecord(true, altAppearance);
1129 
1130  bool success = false;
1131  auto cleanup = finally([&] {
1132  if (!success) {
1133  SetPlay(false);
1134  SetStop(false);
1135  SetRecord(false);
1136  }
1137 
1138  // Success or not:
1140  });
1141 
1142  auto transportTracks = tracks;
1143 
1144  // Will replace any given capture tracks with temporaries
1145  transportTracks.captureTracks.clear();
1146 
1147  const auto p = &project;
1148 
1149  bool appendRecord = !tracks.captureTracks.empty();
1150 
1151  {
1152  if (appendRecord) {
1153  // Append recording:
1154  // Pad selected/all wave tracks to make them all the same length
1155  for (const auto &wt : tracks.captureTracks)
1156  {
1157  auto endTime = wt->GetEndTime();
1158 
1159  // If the track was chosen for recording and playback both,
1160  // remember the original in preroll tracks, before making the
1161  // pending replacement.
1162  bool prerollTrack = make_iterator_range(transportTracks.playbackTracks).contains(wt);
1163  if (prerollTrack)
1164  transportTracks.prerollTracks.push_back(wt);
1165 
1166  // A function that copies all the non-sample data between
1167  // wave tracks; in case the track recorded to changes scale
1168  // type (for instance), during the recording.
1169  auto updater = [](Track &d, const Track &s){
1170  auto &dst = static_cast<WaveTrack&>(d);
1171  auto &src = static_cast<const WaveTrack&>(s);
1172  dst.Reinit(src);
1173  };
1174 
1175  // Get a copy of the track to be appended, to be pushed into
1176  // undo history only later.
1177  auto pending = std::static_pointer_cast<WaveTrack>(
1178  p->GetTracks()->RegisterPendingChangedTrack(
1179  updater, wt.get() ) );
1180 
1181  // End of current track is before or at recording start time.
1182  // Less than or equal, not just less than, to ensure a clip boundary.
1183  // when append recording.
1184  if (endTime <= t0) {
1185 
1186  // Pad the recording track with silence, up to the
1187  // maximum time.
1188  auto newTrack = p->GetTrackFactory()->NewWaveTrack();
1189  newTrack->SetWaveColorIndex( wt->GetWaveColorIndex() );
1190  newTrack->InsertSilence(0.0, t0 - endTime);
1191  newTrack->Flush();
1192  pending->Clear(endTime, t0);
1193  pending->Paste(endTime, newTrack.get());
1194  }
1195  transportTracks.captureTracks.push_back(pending);
1196  }
1197  }
1198 
1199  if( transportTracks.captureTracks.empty() )
1200  { // recording to NEW track(s).
1201  bool recordingNameCustom, useTrackNumber, useDateStamp, useTimeStamp;
1202  wxString defaultTrackName, defaultRecordingTrackName;
1203 
1204  // Count the tracks.
1205  int numTracks = 0;
1206 
1207  TrackList *trackList = p->GetTracks();
1208  TrackListIterator it(trackList);
1209  for (Track *tt = it.First(); tt; tt = it.Next()) {
1210  if (tt->GetKind() == Track::Wave && !tt->GetLinked())
1211  numTracks++;
1212  }
1213  numTracks++;
1214 
1215  auto recordingChannels = std::max(1L, gPrefs->Read(wxT("/AudioIO/RecordChannels"), 2));
1216 
1217  gPrefs->Read(wxT("/GUI/TrackNames/RecordingNameCustom"), &recordingNameCustom, false);
1218  gPrefs->Read(wxT("/GUI/TrackNames/TrackNumber"), &useTrackNumber, false);
1219  gPrefs->Read(wxT("/GUI/TrackNames/DateStamp"), &useDateStamp, false);
1220  gPrefs->Read(wxT("/GUI/TrackNames/TimeStamp"), &useTimeStamp, false);
1222  gPrefs->Read(wxT("/GUI/TrackNames/RecodingTrackName"), &defaultRecordingTrackName, defaultTrackName);
1223 
1224  wxString baseTrackName = recordingNameCustom? defaultRecordingTrackName : defaultTrackName;
1225 
1226  for (int c = 0; c < recordingChannels; c++) {
1227  std::shared_ptr<WaveTrack> newTrack{
1228  p->GetTrackFactory()->NewWaveTrack().release()
1229  };
1230 
1231  // Quantize bounds to the rate of the new track.
1232  if (c == 0) {
1233  if (t0 < DBL_MAX)
1234  t0 = newTrack->LongSamplesToTime(newTrack->TimeToLongSamples(t0));
1235  if (t1 < DBL_MAX)
1236  t1 = newTrack->LongSamplesToTime(newTrack->TimeToLongSamples(t1));
1237  }
1238 
1239  newTrack->SetOffset(t0);
1240  wxString nameSuffix = wxString(wxT(""));
1241 
1242  if (useTrackNumber) {
1243  nameSuffix += wxString::Format(wxT("%d"), numTracks + c);
1244  }
1245 
1246  if (useDateStamp) {
1247  if (!nameSuffix.IsEmpty()) {
1248  nameSuffix += wxT("_");
1249  }
1250  nameSuffix += wxDateTime::Now().FormatISODate();
1251  }
1252 
1253  if (useTimeStamp) {
1254  if (!nameSuffix.IsEmpty()) {
1255  nameSuffix += wxT("_");
1256  }
1257  nameSuffix += wxDateTime::Now().FormatISOTime();
1258  }
1259 
1260  // ISO standard would be nice, but ":" is unsafe for file name.
1261  nameSuffix.Replace(wxT(":"), wxT("-"));
1262 
1263  if (baseTrackName.IsEmpty()) {
1264  newTrack->SetName(nameSuffix);
1265  }
1266  else if (nameSuffix.IsEmpty()) {
1267  newTrack->SetName(baseTrackName);
1268  }
1269  else {
1270  newTrack->SetName(baseTrackName + wxT("_") + nameSuffix);
1271  }
1272 
1273  if (recordingChannels > 2)
1274  newTrack->SetMinimized(true);
1275 
1276  if (recordingChannels == 2) {
1277  if (c == 0) {
1278  newTrack->SetChannel(Track::LeftChannel);
1279  newTrack->SetLinked(true);
1280  }
1281  else {
1282  newTrack->SetChannel(Track::RightChannel);
1283  }
1284  }
1285  else {
1286  newTrack->SetChannel( Track::MonoChannel );
1287  }
1288 
1289  p->GetTracks()->RegisterPendingNewTrack( newTrack );
1290  transportTracks.captureTracks.push_back(newTrack);
1291  // Bug 1548. New track needs the focus.
1292  p->GetTrackPanel()->SetFocusedTrack( newTrack.get() );
1293  }
1294  }
1295 
1296  //Automated Input Level Adjustment Initialization
1297  #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
1298  gAudioIO->AILAInitialize();
1299  #endif
1300 
1301  int token = gAudioIO->StartStream(transportTracks, t0, t1, options);
1302 
1303  success = (token != 0);
1304 
1305  if (success) {
1306  p->SetAudioIOToken(token);
1307  mBusyProject = p;
1308 
1310  }
1311  else {
1312  CancelRecording();
1313 
1314  // Show error message if stream could not be opened
1315  ShowErrorDialog(this, _("Error"),
1316  _("Error opening sound device.\nTry changing the audio host, recording device and the project sample rate."),
1317  wxT("Error_opening_sound_device"));
1318  }
1319  }
1320 
1321  return success;
1322 }
int StartStream(const TransportTracks &tracks, double t0, double t1, const AudioIOStartStreamOptions &options)
Start recording or playing back audio.
Definition: AudioIO.cpp:1864
AButton * mRecord
void SetPlay(bool down, PlayAppearance appearance=PlayAppearance::Straight)
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
A list of TrackListNode items.
Definition: Track.h:619
void PopUp()
Definition: AButton.cpp:525
WaveTrackConstArray prerollTracks
Definition: AudioIO.h:165
void Reinit(const WaveTrack &orig)
Definition: WaveTrack.cpp:166
static wxString GetDefaultAudioTrackNamePreference()
unsigned GetNumCaptureChannels() const
Definition: AudioIO.h:399
bool IsBusy()
Returns true if audio i/o is busy starting, stopping, playing, or recording.
Definition: AudioIO.cpp:2882
void ShowErrorDialog(wxWindow *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, const bool Close)
Displays an error dialog with a button that offers help.
void UpdateStatusBar(AudacityProject *pProject)
void SetStop(bool down)
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:677
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:102
WaveTrackConstArray playbackTracks
Definition: AudioIO.h:158
An iterator for a TrackList.
Definition: Track.h:402
void StartScrollingIfPreferred()
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
static AudacityProject * mBusyProject
CommandFlag
Definition: CommandFlag.h:16
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void PushDown()
Definition: AButton.cpp:517
void SetRecord(bool down, bool altAppearance=false)
WaveTrackArray captureTracks
Definition: AudioIO.h:159
bool TryToMakeActionAllowed(CommandFlag &flags, CommandFlag flagsRqd, CommandFlag mask)
Definition: Project.cpp:2311
void ControlToolBar::EnableDisableButtons ( )
overridevirtual

Implements ToolBar.

Definition at line 451 of file ControlToolBar.cpp.

References CanStopAudioStream(), gAudioIO, GetActiveProject(), AudacityProject::GetTracks(), AudacityProject::GetTranscriptionToolBar(), AudioIO::IsBusy(), AButton::IsDown(), IsPauseDown(), mFF, mPause, mPlay, mRecord, mRewind, mStop, AButton::SetEnabled(), and TranscriptionToolBar::SetEnabled().

Referenced by ReCreateButtons(), SetPlay(), SetRecord(), and SetStop().

452 {
454  bool tracks = false;
455 
456  bool paused = mPause->IsDown();
457  bool playing = mPlay->IsDown();
458  bool recording = mRecord->IsDown();
459  bool busy = gAudioIO->IsBusy();
460 
461  // Only interested in audio type tracks
462  if (p) {
463  TrackListIterator iter( p->GetTracks() );
464  for (Track *t = iter.First(); t; t = iter.Next()) {
465  if (dynamic_cast<const AudioTrack*>(t)) {
466  tracks = true;
467  break;
468  }
469  }
470  }
471 
472  if (p) {
473  TranscriptionToolBar *const playAtSpeedTB = p->GetTranscriptionToolBar();
474  if (playAtSpeedTB)
475  playAtSpeedTB->SetEnabled(CanStopAudioStream() && tracks && !recording);
476  }
477 
478  mPlay->SetEnabled(CanStopAudioStream() && tracks && !recording);
480  CanStopAudioStream() &&
481  !(busy && !recording && !paused) &&
482  !(playing && !paused)
483  );
484  mStop->SetEnabled(CanStopAudioStream() && (playing || recording));
485  mRewind->SetEnabled(IsPauseDown() || (!playing && !recording));
486  mFF->SetEnabled(tracks && (IsPauseDown() || (!playing && !recording)));
487 
488  //auto pProject = GetActiveProject();
490 }
AButton * mRecord
bool IsDown()
Definition: AButton.h:123
AButton * mPause
bool IsBusy()
Returns true if audio i/o is busy starting, stopping, playing, or recording.
Definition: AudioIO.cpp:2882
bool IsPauseDown() const
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
void SetEnabled(bool state)
Definition: AButton.h:98
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:102
TranscriptionToolBar * GetTranscriptionToolBar()
Definition: Project.cpp:5082
void SetEnabled(bool enabled)
An iterator for a TrackList.
Definition: Track.h:402
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
AButton * mRewind
TrackList * GetTracks()
Definition: Project.h:192
A kind of ToolBar used to help with analysing voice recordings.
bool ControlToolBar::IsPauseDown ( ) const

Definition at line 535 of file ControlToolBar.cpp.

References AButton::IsDown(), and mPause.

Referenced by EnableDisableButtons(), and Scrubber::OnActivateOrDeactivateApp().

536 {
537  return mPause->IsDown();
538 }
bool IsDown()
Definition: AButton.h:123
AButton * mPause
bool ControlToolBar::IsRecordDown ( ) const

Definition at line 540 of file ControlToolBar.cpp.

References AButton::IsDown(), and mRecord.

541 {
542  return mRecord->IsDown();
543 }
AButton * mRecord
bool IsDown()
Definition: AButton.h:123
void ControlToolBar::MakeAlternateImages ( AButton button,
int  idx,
teBmps  eEnabledUp,
teBmps  eEnabledDown,
teBmps  eDisabled 
)
staticprivate

Definition at line 159 of file ControlToolBar.cpp.

References ThemeBase::ImageSize(), ToolBar::MakeAlternateImages(), and theTheme.

Referenced by Populate().

163 {
164  ToolBar::MakeAlternateImages(button, idx,
165  bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
166  eEnabledUp, eEnabledDown, eDisabled,
167  theTheme.ImageSize( bmpRecoloredUpLarge ));
168 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
wxSize ImageSize(int iIndex)
Definition: Theme.cpp:1257
static void MakeAlternateImages(AButton &button, int idx, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size)
Definition: ToolBar.cpp:798
AButton * ControlToolBar::MakeButton ( ControlToolBar pBar,
teBmps  eEnabledUp,
teBmps  eEnabledDown,
teBmps  eDisabled,
int  id,
bool  processdownevents,
const wxChar *  label 
)
staticprivate

Definition at line 133 of file ControlToolBar.cpp.

References ThemeBase::ImageSize(), ToolBar::MakeButton(), AButton::SetFocusRect(), and theTheme.

Referenced by Populate().

138 {
139  AButton *r = ToolBar::MakeButton(pBar,
140  bmpRecoloredUpLarge, bmpRecoloredDownLarge, bmpRecoloredUpHiliteLarge, bmpRecoloredHiliteLarge,
141  eEnabledUp, eEnabledDown, eDisabled,
142  wxWindowID(id),
143  wxDefaultPosition, processdownevents,
144  theTheme.ImageSize( bmpRecoloredUpLarge ));
145  r->SetLabel(label);
146  enum { deflation =
147 #ifdef __WXMAC__
148  6
149 #else
150  12
151 #endif
152  };
153  r->SetFocusRect( r->GetClientRect().Deflate( deflation, deflation ) );
154 
155  return r;
156 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
void SetFocusRect(wxRect &r)
Definition: AButton.cpp:264
wxString label
Definition: Tags.cpp:727
wxSize ImageSize(int iIndex)
Definition: Theme.cpp:1257
static AButton * MakeButton(wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxWindowID id, wxPoint placement, bool processdownevents, wxSize size)
Definition: ToolBar.cpp:765
A wxButton with mouse-over behaviour.
Definition: AButton.h:28
void ControlToolBar::OnFF ( wxCommandEvent &  evt)

Definition at line 1367 of file ControlToolBar.cpp.

References GetActiveProject(), mFF, AButton::PopUp(), AButton::PushDown(), AudacityProject::SkipEnd(), AudacityProject::StopIfPaused(), and AButton::WasShiftDown().

Referenced by AudacityProject::OnSkipEnd().

1368 {
1369  mFF->PushDown();
1370  mFF->PopUp();
1371 
1373 
1374  if (p) {
1375  p->StopIfPaused();
1376  p->SkipEnd(mFF->WasShiftDown());
1377  }
1378 }
void PopUp()
Definition: AButton.cpp:525
bool WasShiftDown()
Definition: AButton.cpp:485
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void StopIfPaused()
Definition: Menus.cpp:2356
void PushDown()
Definition: AButton.cpp:517
void SkipEnd(bool shift)
Definition: Project.cpp:4985
void ControlToolBar::OnKeyEvent ( wxKeyEvent &  event)

Definition at line 772 of file ControlToolBar.cpp.

References gAudioIO, GetActiveProject(), AudioIO::IsBusy(), AudioIO::IsStreamActive(), PlayCurrentRegion(), SetPlay(), SetStop(), and StopPlaying().

773 {
774  if (event.ControlDown() || event.AltDown()) {
775  event.Skip();
776  return;
777  }
778 
779  // Does not appear to be needed on Linux. Perhaps on some other platform?
780  // If so, "!CanStopAudioStream()" should probably apply.
781  if (event.GetKeyCode() == WXK_SPACE) {
782  if (gAudioIO->IsStreamActive(GetActiveProject()->GetAudioIOToken())) {
783  SetPlay(false);
784  SetStop(true);
785  StopPlaying();
786  }
787  else if (!gAudioIO->IsBusy()) {
788  //SetPlay(true);// Not needed as done in PlayPlayRegion
789  SetStop(false);
791  }
792  return;
793  }
794  event.Skip();
795 }
void SetPlay(bool down, PlayAppearance appearance=PlayAppearance::Straight)
bool IsStreamActive()
Returns true if the audio i/o is running at all, but not during cleanup.
Definition: AudioIO.cpp:2890
void PlayCurrentRegion(bool looped=false, bool cutpreview=false)
void StopPlaying(bool stopStream=true)
bool IsBusy()
Returns true if audio i/o is busy starting, stopping, playing, or recording.
Definition: AudioIO.cpp:2882
void SetStop(bool down)
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void ControlToolBar::OnPause ( wxCommandEvent &  evt)

Definition at line 1325 of file ControlToolBar.cpp.

References CanStopAudioStream(), gAudioIO, GetActiveProject(), AudacityProject::GetScrubber(), AudioIO::IsScrubbing(), mPause, mPaused, Scrubber::Pause(), AButton::PopUp(), AButton::PushDown(), AudioIO::SetPaused(), and UpdateStatusBar().

Referenced by AudacityProject::OnPause(), and Pause().

1326 {
1327  if (!CanStopAudioStream()) {
1328  return;
1329  }
1330 
1331 
1332  if(mPaused)
1333  {
1334  mPause->PopUp();
1335  mPaused=false;
1336  }
1337  else
1338  {
1339  mPause->PushDown();
1340  mPaused=true;
1341  }
1342 
1343 #ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
1344  if (gAudioIO->IsScrubbing())
1346  else
1347 #endif
1348  {
1350  }
1351 
1353 }
void Pause(bool paused)
Definition: Scrubbing.cpp:678
void PopUp()
Definition: AButton.cpp:525
Scrubber & GetScrubber()
Definition: Project.h:801
AButton * mPause
void UpdateStatusBar(AudacityProject *pProject)
bool IsScrubbing()
Definition: AudioIO.h:212
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void PushDown()
Definition: AButton.cpp:517
void SetPaused(bool state)
Pause and un-pause playback and recording.
Definition: AudioIO.cpp:2840
void ControlToolBar::OnPlay ( wxCommandEvent &  evt)

Definition at line 797 of file ControlToolBar.cpp.

References CanStopAudioStream(), GetActiveProject(), PlayDefault(), StopPlaying(), and UpdateStatusBar().

798 {
799  auto p = GetActiveProject();
800 
801  if (!CanStopAudioStream())
802  return;
803 
804  StopPlaying();
805 
806  if (p) p->TP_DisplaySelection();
807 
808  auto cleanup = finally( [&]{ UpdateStatusBar(p); } );
809  PlayDefault();
810 }
void StopPlaying(bool stopStream=true)
void UpdateStatusBar(AudacityProject *pProject)
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void ControlToolBar::OnRecord ( wxCommandEvent &  evt)

Definition at line 989 of file ControlToolBar.cpp.

References TransportTracks::captureTracks, ChooseExistingRecordingTracks(), DoRecord(), TrackListIterator::First(), GetActiveProject(), GetAllPlaybackTracks(), AudacityProject::GetDefaultPlayOptions(), WaveTrack::GetEndTime(), AudacityProject::GetSel0(), AudacityProject::GetSel1(), Track::GetSelected(), AudacityProject::GetTracks(), gPrefs, mRecord, TrackListIterator::Next(), TransportTracks::playbackTracks, UseDuplex(), AButton::WasShiftDown(), and Track::Wave.

Referenced by AudacityProject::OnRecord(), and AudacityProject::OnRecord2ndChoice().

991 {
992  // TODO: It would be neater if Menu items and Toolbar buttons used the same code for
993  // enabling/disabling, and all fell into the same action routines.
994  // Here instead we reduplicate some logic (from CommandHandler) because it isn't
995  // normally used for buttons.
996 
997  // Code from CommandHandler start...
999  wxASSERT(p);
1000  if (!p)
1001  return;
1002 
1003  bool altAppearance = mRecord->WasShiftDown();
1004  if (evt.GetInt() == 1) // used when called by keyboard shortcut. Default (0) ignored.
1005  altAppearance = true;
1006  if (evt.GetInt() == 2)
1007  altAppearance = false;
1008 
1009  bool bPreferNewTrack;
1010  gPrefs->Read("/GUI/PreferNewTrackRecord", &bPreferNewTrack, false);
1011  const bool appendRecord = (altAppearance == bPreferNewTrack);
1012 
1013  if (p) {
1014  double t0 = p->GetSel0();
1015  double t1 = p->GetSel1();
1016  // When no time selection, recording duration is 'unlimited'.
1017  if (t1 == t0)
1018  t1 = DBL_MAX;
1019 
1020  double allt0 = t0;
1021 
1022  WaveTrackArray existingTracks;
1023 
1024  double selt0 = t0;
1025  if (appendRecord) {
1026  TrackList *trackList = p->GetTracks();
1027  TrackListIterator it(trackList);
1028 
1029  // Find the maximum end time of selected and all wave tracks
1030  for (Track *tt = it.First(); tt; tt = it.Next()) {
1031  if (tt->GetKind() == Track::Wave) {
1032  WaveTrack *wt = static_cast<WaveTrack *>(tt);
1033  if (wt->GetEndTime() > allt0)
1034  allt0 = wt->GetEndTime();
1035 
1036  if (wt->GetSelected()) {
1037  if (wt->GetEndTime() > selt0)
1038  selt0 = wt->GetEndTime();
1039  }
1040  }
1041  }
1042 
1043  // Try to find wave tracks to record into. (If any are selected,
1044  // try to choose only from them; else if wave tracks exist, may record into any.)
1045  existingTracks = ChooseExistingRecordingTracks(*p, true);
1046  if (!existingTracks.empty()) {
1047  // selt0 is now: max(selection-start, end-of-selected-wavetracks)
1048  t0 = selt0;
1049  }
1050  else {
1051  // allt0 is: max(selection-start, end-of-all-tracks)
1052  // Use end time of all wave tracks if recording to non-selected
1053  t0 = allt0;
1054  existingTracks = ChooseExistingRecordingTracks(*p, false);
1055  // If suitable tracks still not found, will record into NEW ones,
1056  // but the choice of t0 does not depend on that.
1057  }
1058 
1059  // Whether we decided on NEW tracks or not:
1060  if (t1 <= p->GetSel0() && p->GetSel1() > p->GetSel0()) {
1061  t1 = p->GetSel1(); // record within the selection
1062  }
1063  else {
1064  t1 = DBL_MAX; // record for a long, long time
1065  }
1066  }
1067 
1068  TransportTracks transportTracks;
1069  if (UseDuplex()) {
1070  // Remove recording tracks from the list of tracks for duplex ("overdub")
1071  // playback.
1072  /* TODO: set up stereo tracks if that is how the user has set up
1073  * their preferences, and choose sample format based on prefs */
1074  transportTracks = GetAllPlaybackTracks(*p->GetTracks(), false, true);
1075  for (const auto &wt : existingTracks) {
1076  auto end = transportTracks.playbackTracks.end();
1077  auto it = std::find(transportTracks.playbackTracks.begin(), end, wt);
1078  if (it != end)
1079  transportTracks.playbackTracks.erase(it);
1080  }
1081  }
1082 
1083  transportTracks.captureTracks = existingTracks;
1085  DoRecord(*p, transportTracks, t0, t1, altAppearance, options);
1086  }
1087 }
AButton * mRecord
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
A list of TrackListNode items.
Definition: Track.h:619
AudioIOStartStreamOptions GetDefaultPlayOptions()
Definition: Project.cpp:1298
double GetSel0() const
Definition: Project.h:204
bool WasShiftDown()
Definition: AButton.cpp:485
bool GetSelected() const
Definition: Track.h:276
bool DoRecord(AudacityProject &project, const TransportTracks &transportTracks, double t0, double t1, bool altAppearance, const AudioIOStartStreamOptions &options)
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
Definition: WaveTrack.cpp:1873
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
std::vector< std::shared_ptr< WaveTrack > > WaveTrackArray
Definition: AudioIO.h:66
struct holding stream options, including a pointer to the TimeTrack and AudioIOListener and whether t...
Definition: AudioIO.h:123
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:102
WaveTrackConstArray playbackTracks
Definition: AudioIO.h:158
An iterator for a TrackList.
Definition: Track.h:402
TransportTracks GetAllPlaybackTracks(const TrackList &trackList, bool selectedOnly, bool useMidi)
Definition: Track.cpp:1579
static WaveTrackArray ChooseExistingRecordingTracks(AudacityProject &proj, bool selectedOnly)
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
static bool UseDuplex()
double GetSel1() const
Definition: Project.h:205
TrackList * GetTracks()
Definition: Project.h:192
WaveTrackArray captureTracks
Definition: AudioIO.h:159
void ControlToolBar::OnRewind ( wxCommandEvent &  evt)

Definition at line 1355 of file ControlToolBar.cpp.

References GetActiveProject(), mRewind, AButton::PopUp(), AButton::PushDown(), AudacityProject::Rewind(), AudacityProject::StopIfPaused(), and AButton::WasShiftDown().

Referenced by AudacityProject::OnSkipStart().

1356 {
1357  mRewind->PushDown();
1358  mRewind->PopUp();
1359 
1361  if (p) {
1362  p->StopIfPaused();
1363  p->Rewind(mRewind->WasShiftDown());
1364  }
1365 }
void PopUp()
Definition: AButton.cpp:525
bool WasShiftDown()
Definition: AButton.cpp:485
void Rewind(bool shift)
Definition: Project.cpp:4967
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void StopIfPaused()
Definition: Menus.cpp:2356
AButton * mRewind
void PushDown()
Definition: AButton.cpp:517
void ControlToolBar::OnStop ( wxCommandEvent &  evt)

Definition at line 812 of file ControlToolBar.cpp.

References CanStopAudioStream(), GetActiveProject(), StopPlaying(), and UpdateStatusBar().

Referenced by Scrubber::ContinueScrubbingUI(), AudacityProject::MakeReadyToPlay(), AudacityProject::OnCloseWindow(), AudacityProject::OnPlayStopSelect(), AudacityProject::OnStop(), and AudacityProject::OnStopSelect().

813 {
814  if (CanStopAudioStream()) {
815  StopPlaying();
817  }
818 }
void StopPlaying(bool stopStream=true)
void UpdateStatusBar(AudacityProject *pProject)
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void ControlToolBar::Pause ( )

Definition at line 890 of file ControlToolBar.cpp.

References CanStopAudioStream(), gAudioIO, AudioIO::IsPaused(), OnPause(), and AudioIO::SetPaused().

Referenced by audacityAudioCallback().

891 {
892  if (!CanStopAudioStream())
894  else {
895  wxCommandEvent dummy;
896  OnPause(dummy);
897  }
898 }
void OnPause(wxCommandEvent &evt)
bool IsPaused()
Find out if playback / recording is currently paused.
Definition: AudioIO.cpp:2857
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
void SetPaused(bool state)
Pause and un-pause playback and recording.
Definition: AudioIO.cpp:2840
void ControlToolBar::PlayCurrentRegion ( bool  looped = false,
bool  cutpreview = false 
)

Definition at line 743 of file ControlToolBar.cpp.

References CanStopAudioStream(), CutPreview, GetActiveProject(), AudacityProject::GetDefaultPlayOptions(), AudacityProject::GetPlayRegion(), Looped, loopedPlay, normalPlay, AudioIOStartStreamOptions::playLooped, PlayPlayRegion(), and Straight.

Referenced by OnKeyEvent(), AudacityProject::OnPlayCutPreview(), AudacityProject::OnPlayLooped(), AudacityProject::OnPlayStop(), AudacityProject::OnPlayStopSelect(), and PlayDefault().

745 {
746  if (!CanStopAudioStream())
747  return;
748 
750 
751  if (p)
752  {
753 
754  double playRegionStart, playRegionEnd;
755  p->GetPlayRegion(&playRegionStart, &playRegionEnd);
756 
758  options.playLooped = looped;
759  if (cutpreview)
760  options.timeTrack = NULL;
761  ControlToolBar::PlayAppearance appearance =
765  PlayPlayRegion(SelectedRegion(playRegionStart, playRegionEnd),
766  options,
768  appearance);
769  }
770 }
AudioIOStartStreamOptions GetDefaultPlayOptions()
Definition: Project.cpp:1298
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
Defines a selected portion of a project.
struct holding stream options, including a pointer to the TimeTrack and AudioIOListener and whether t...
Definition: AudioIO.h:123
int PlayPlayRegion(const SelectedRegion &selectedRegion, const AudioIOStartStreamOptions &options, PlayMode playMode, PlayAppearance appearance=PlayAppearance::Straight, bool backwards=false, bool playWhiteSpace=false)
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void GetPlayRegion(double *playRegionStart, double *playRegionEnd)
Definition: Project.cpp:5448
void ControlToolBar::PlayDefault ( )

Definition at line 827 of file ControlToolBar.cpp.

References mPlay, PlayCurrentRegion(), AButton::WasControlDown(), and AButton::WasShiftDown().

Referenced by OnPlay().

828 {
829  // Let control have precedence over shift
830  const bool cutPreview = mPlay->WasControlDown();
831  const bool looped = !cutPreview &&
832  mPlay->WasShiftDown();
833  PlayCurrentRegion(looped, cutPreview);
834 }
bool WasShiftDown()
Definition: AButton.cpp:485
void PlayCurrentRegion(bool looped=false, bool cutpreview=false)
bool WasControlDown()
Definition: AButton.cpp:490
int ControlToolBar::PlayPlayRegion ( const SelectedRegion selectedRegion,
const AudioIOStartStreamOptions options,
PlayMode  playMode,
PlayAppearance  appearance = PlayAppearance::Straight,
bool  backwards = false,
bool  playWhiteSpace = false 
)

Definition at line 545 of file ControlToolBar.cpp.

References _(), CanStopAudioStream(), CutPreview, AudioIOStartStreamOptions::cutPreviewGapLen, AudioIOStartStreamOptions::cutPreviewGapStart, TrackListIterator::First(), gAudioIO, GetActiveProject(), GetAllPlaybackTracks(), TrackList::GetEndTime(), AudacityProject::GetRulerPanel(), AudacityProject::GetSel0(), AudacityProject::GetSel1(), TrackList::GetStartTime(), AudacityProject::GetTracks(), gPrefs, AdornedRulerPanel::HideQuickPlayIndicator(), AudioIO::IsBusy(), mBusyProject, mCutPreviewTracks, min(), AudacityProject::mLastPlayMode, TrackListIterator::Next(), AudioIOStartStreamOptions::playLooped, AudioIOStartStreamOptions::pScrubbingOptions, AudioIO::SeekStream(), AudacityProject::SetAudioIOToken(), SetPlay(), SetRecord(), SetStop(), SetupCutPreviewTracks(), ShowErrorDialog(), StartScrollingIfPreferred(), AudioIO::StartStream(), SelectedRegion::t0(), SelectedRegion::t1(), and Track::Wave.

Referenced by Scrubber::MaybeStartScrubbing(), EffectUIHost::OnPlay(), AudacityProject::OnPlayAfterSelectionEnd(), AudacityProject::OnPlayAfterSelectionStart(), AudacityProject::OnPlayBeforeAndAfterSelectionEnd(), AudacityProject::OnPlayBeforeAndAfterSelectionStart(), AudacityProject::OnPlayBeforeSelectionEnd(), AudacityProject::OnPlayBeforeSelectionStart(), AudacityProject::OnPlayOneSecond(), AudacityProject::OnPlayToSelection(), TranscriptionToolBar::PlayAtSpeed(), PlayCurrentRegion(), and AdornedRulerPanel::StartQPPlay().

552 {
553  if (!CanStopAudioStream())
554  return -1;
555 
556  bool useMidi = true;
557 
558  // Remove these lines to experiment with scrubbing/seeking of note tracks
559  if (options.pScrubbingOptions)
560  useMidi = false;
561 
562  // Uncomment this for laughs!
563  // backwards = true;
564 
565  double t0 = selectedRegion.t0();
566  double t1 = selectedRegion.t1();
567  // SelectedRegion guarantees t0 <= t1, so we need another boolean argument
568  // to indicate backwards play.
569  const bool looped = options.playLooped;
570 
571  if (backwards)
572  std::swap(t0, t1);
573 
574  SetPlay(true, appearance);
575 
576  bool success = false;
577  auto cleanup = finally( [&] {
578  if (!success) {
579  SetPlay(false);
580  SetStop(false);
581  SetRecord(false);
582  }
583  } );
584 
585  if (gAudioIO->IsBusy())
586  return -1;
587 
588  const bool cutpreview = appearance == PlayAppearance::CutPreview;
589  if (cutpreview && t0==t1)
590  return -1; /* msmeyer: makes no sense */
591 
593  if (!p)
594  return -1; // Should never happen, but...
595 
596  TrackList *t = p->GetTracks();
597  if (!t)
598  return -1; // Should never happen, but...
599 
600  p->mLastPlayMode = mode;
601 
602  bool hasaudio = false;
603  TrackListIterator iter(t);
604  for (Track *trk = iter.First(); trk; trk = iter.Next()) {
605  if (trk->GetKind() == Track::Wave
606 #ifdef EXPERIMENTAL_MIDI_OUT
607  || (trk->GetKind() == Track::Note && useMidi)
608 #endif
609  ) {
610  hasaudio = true;
611  break;
612  }
613  }
614 
615  double latestEnd = (playWhiteSpace)? t1 : t->GetEndTime();
616 
617  if (!hasaudio)
618  return -1; // No need to continue without audio tracks
619 
620 #if defined(EXPERIMENTAL_SEEK_BEHIND_CURSOR)
621  double init_seek = 0.0;
622 #endif
623 
624  if (t1 == t0) {
625  if (looped) {
626  // play selection if there is one, otherwise
627  // set start of play region to project start,
628  // and loop the project from current play position.
629 
630  if ((t0 > p->GetSel0()) && (t0 < p->GetSel1())) {
631  t0 = p->GetSel0();
632  t1 = p->GetSel1();
633  }
634  else {
635  // loop the entire project
636  t0 = t->GetStartTime();
637  t1 = t->GetEndTime();
638  }
639  } else {
640  // move t0 to valid range
641  if (t0 < 0) {
642  t0 = t->GetStartTime();
643  }
644  else if (t0 > t->GetEndTime()) {
645  t0 = t->GetEndTime();
646  }
647 #if defined(EXPERIMENTAL_SEEK_BEHIND_CURSOR)
648  else {
649  init_seek = t0; //AC: init_seek is where playback will 'start'
650  t0 = t->GetStartTime();
651  }
652 #endif
653  }
654  t1 = t->GetEndTime();
655  }
656  else {
657  // maybe t1 < t0, with backwards scrubbing for instance
658  if (backwards)
659  std::swap(t0, t1);
660 
661  t0 = std::max(0.0, std::min(t0, latestEnd));
662  t1 = std::max(0.0, std::min(t1, latestEnd));
663 
664  if (backwards)
665  std::swap(t0, t1);
666  }
667 
668  int token = -1;
669 
670  if (t1 != t0) {
671  if (cutpreview) {
672  const double tless = std::min(t0, t1);
673  const double tgreater = std::max(t0, t1);
674  double beforeLen, afterLen;
675  gPrefs->Read(wxT("/AudioIO/CutPreviewBeforeLen"), &beforeLen, 2.0);
676  gPrefs->Read(wxT("/AudioIO/CutPreviewAfterLen"), &afterLen, 1.0);
677  double tcp0 = tless-beforeLen;
678  double diff = tgreater - tless;
679  double tcp1 = (tgreater+afterLen) - diff;
680  SetupCutPreviewTracks(tcp0, tless, tgreater, tcp1);
681  if (backwards)
682  std::swap(tcp0, tcp1);
683  if (mCutPreviewTracks)
684  {
685  AudioIOStartStreamOptions myOptions = options;
686  myOptions.cutPreviewGapStart = t0;
687  myOptions.cutPreviewGapLen = t1 - t0;
688  token = gAudioIO->StartStream(
689  GetAllPlaybackTracks(*mCutPreviewTracks, false, useMidi),
690  tcp0, tcp1, myOptions);
691  }
692  else
693  // Cannot create cut preview tracks, clean up and exit
694  return -1;
695  }
696  else {
697  // Lifted the following into AudacityProject::GetDefaultPlayOptions()
698  /*
699  if (!timetrack) {
700  timetrack = t->GetTimeTrack();
701  }
702  */
703  token = gAudioIO->StartStream(
704  GetAllPlaybackTracks(*t, false, useMidi),
705  t0, t1, options);
706  }
707  if (token != 0) {
708  success = true;
709  p->SetAudioIOToken(token);
710  mBusyProject = p;
711 #if defined(EXPERIMENTAL_SEEK_BEHIND_CURSOR)
712  //AC: If init_seek was set, now's the time to make it happen.
713  gAudioIO->SeekStream(init_seek);
714 #endif
715  }
716  else {
717  // Bug1627 (part of it):
718  // infinite error spew when trying to start scrub:
719  // Problem was that the error dialog yields to events,
720  // causing recursion to this function in the scrub timer
721  // handler! Easy fix, just delay the user alert instead.
722  CallAfter( [=]{
723  // Show error message if stream could not be opened
724  ShowErrorDialog(this, _("Error"),
725  _("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."),
726  wxT("Error_opening_sound_device"));
727  });
728  }
729  }
730 
731  if (!success)
732  return -1;
733 
735 
736  // Let other UI update appearance
737  if (p)
739 
740  return token;
741 }
int StartStream(const TransportTracks &tracks, double t0, double t1, const AudioIOStartStreamOptions &options)
Start recording or playing back audio.
Definition: AudioIO.cpp:1864
void SetPlay(bool down, PlayAppearance appearance=PlayAppearance::Straight)
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
A list of TrackListNode items.
Definition: Track.h:619
double t0() const
double GetSel0() const
Definition: Project.h:204
double GetStartTime() const
Definition: Track.cpp:1413
double GetEndTime() const
Definition: Track.cpp:1418
void SetAudioIOToken(int token)
Definition: Project.cpp:1449
bool IsBusy()
Returns true if audio i/o is busy starting, stopping, playing, or recording.
Definition: AudioIO.cpp:2882
ScrubbingOptions * pScrubbingOptions
Definition: AudioIO.h:150
double t1() const
void ShowErrorDialog(wxWindow *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, const bool Close)
Displays an error dialog with a button that offers help.
void HideQuickPlayIndicator(bool repaint_all=false)
Definition: Ruler.cpp:3342
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
void SetStop(bool down)
struct holding stream options, including a pointer to the TimeTrack and AudioIOListener and whether t...
Definition: AudioIO.h:123
AdornedRulerPanel * GetRulerPanel()
Definition: Project.cpp:1439
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:102
void SetupCutPreviewTracks(double playStart, double cutStart, double cutEnd, double playEnd)
int min(int a, int b)
PlayMode mLastPlayMode
Definition: Project.h:557
An iterator for a TrackList.
Definition: Track.h:402
TransportTracks GetAllPlaybackTracks(const TrackList &trackList, bool selectedOnly, bool useMidi)
Definition: Track.cpp:1579
void StartScrollingIfPreferred()
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
static AudacityProject * mBusyProject
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void SetRecord(bool down, bool altAppearance=false)
double GetSel1() const
Definition: Project.h:205
TrackList * GetTracks()
Definition: Project.h:192
void SeekStream(double seconds)
Move the playback / recording position of the current stream by the specified amount from where it is...
Definition: AudioIO.h:209
std::shared_ptr< TrackList > mCutPreviewTracks
void ControlToolBar::Populate ( )
overridevirtual

Implements ToolBar.

Definition at line 170 of file ControlToolBar.cpp.

References _(), ArrangeButtons(), ThemeBase::Colour(), AButton::FollowModifierKeys(), gPrefs, ID_FF_BUTTON, ID_PAUSE_BUTTON, ID_PLAY_BUTTON, ID_RECORD_BUTTON, ID_REW_BUTTON, ID_STOP_BUTTON, MakeAlternateImages(), MakeButton(), ToolBar::MakeButtonBackgroundsLarge(), mFF, mPause, mPlay, mRecord, mRewind, mStop, RegenerateTooltips(), and theTheme.

171 {
172  SetBackgroundColour( theTheme.Colour( clrMedium ) );
174 
175  mPause = MakeButton(this, bmpPause, bmpPause, bmpPauseDisabled,
176  ID_PAUSE_BUTTON, true, _("Pause"));
177 
178  mPlay = MakeButton(this, bmpPlay, bmpPlay, bmpPlayDisabled,
179  ID_PLAY_BUTTON, true, _("Play"));
180  MakeAlternateImages(*mPlay, 1, bmpLoop, bmpLoop, bmpLoopDisabled);
182  bmpCutPreview, bmpCutPreview, bmpCutPreviewDisabled);
184  bmpScrub, bmpScrub, bmpScrubDisabled);
186  bmpSeek, bmpSeek, bmpSeekDisabled);
188 
189  mStop = MakeButton(this, bmpStop, bmpStop, bmpStopDisabled ,
190  ID_STOP_BUTTON, false, _("Stop"));
191 
192  mRewind = MakeButton(this, bmpRewind, bmpRewind, bmpRewindDisabled,
193  ID_REW_BUTTON, false, _("Skip to Start"));
194 
195  mFF = MakeButton(this, bmpFFwd, bmpFFwd, bmpFFwdDisabled,
196  ID_FF_BUTTON, false, _("Skip to End"));
197 
198  mRecord = MakeButton(this, bmpRecord, bmpRecord, bmpRecordDisabled,
199  ID_RECORD_BUTTON, false, _("Record"));
200 
201  bool bPreferNewTrack;
202  gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
203  if( !bPreferNewTrack )
204  MakeAlternateImages(*mRecord, 1, bmpRecordBelow, bmpRecordBelow,
205  bmpRecordBelowDisabled);
206  else
207  MakeAlternateImages(*mRecord, 1, bmpRecordBeside, bmpRecordBeside,
208  bmpRecordBesideDisabled);
209 
211 
212 #if wxUSE_TOOLTIPS
214  wxToolTip::Enable(true);
215  wxToolTip::SetDelay(1000);
216 #endif
217 
218  // Set default order and mode
219  ArrangeButtons();
220 }
AButton * mRecord
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
void MakeButtonBackgroundsLarge()
Definition: ToolBar.cpp:701
void RegenerateTooltips() override
static AButton * MakeButton(ControlToolBar *pBar, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, bool processdownevents, const wxChar *label)
AButton * mPause
void FollowModifierKeys()
Definition: AButton.cpp:258
static void MakeAlternateImages(AButton &button, int idx, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled)
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
AButton * mRewind
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225
void ControlToolBar::ReCreateButtons ( )
overridevirtual

Reimplemented from ToolBar.

Definition at line 391 of file ControlToolBar.cpp.

References ToolBar::Detach(), EnableDisableButtons(), AButton::IsDown(), Looped, mPause, mPlay, mRecord, mSizer, AButton::PushDown(), ToolBar::ReCreateButtons(), RegenerateTooltips(), SetPlay(), SetRecord(), Straight, and AButton::WasShiftDown().

Referenced by UpdatePrefs().

392 {
393  bool playDown = false;
394  bool playShift = false;
395  bool pauseDown = false;
396  bool recordDown = false;
397  bool recordShift = false;
398 
399  // ToolBar::ReCreateButtons() will get rid of its sizer and
400  // since we've attached our sizer to it, ours will get deleted too
401  // so clean ours up first.
402  if( mSizer )
403  {
404  playDown = mPlay->IsDown();
405  playShift = mPlay->WasShiftDown();
406  pauseDown = mPause->IsDown();
407  recordDown = mRecord->IsDown();
408  recordShift = mRecord->WasShiftDown();
409  Detach( mSizer );
410 
411  std::unique_ptr < wxSizer > {mSizer}; // DELETE it
412  mSizer = NULL;
413  }
414 
416 
417  if (playDown)
418  {
419  ControlToolBar::PlayAppearance appearance =
422  SetPlay(playDown, appearance);
423  }
424 
425  if (pauseDown)
426  {
427  mPause->PushDown();
428  }
429 
430  if (recordDown)
431  {
432  SetRecord(recordDown, recordShift);
433  }
434 
436 
438 }
AButton * mRecord
void EnableDisableButtons() override
void SetPlay(bool down, PlayAppearance appearance=PlayAppearance::Straight)
bool IsDown()
Definition: AButton.h:123
bool WasShiftDown()
Definition: AButton.cpp:485
void RegenerateTooltips() override
virtual void ReCreateButtons()
Definition: ToolBar.cpp:459
AButton * mPause
void Detach(wxWindow *window)
Definition: ToolBar.cpp:677
wxBoxSizer * mSizer
void PushDown()
Definition: AButton.cpp:517
void SetRecord(bool down, bool altAppearance=false)
void ControlToolBar::RegenerateTooltips ( )
overridevirtual

Implements ToolBar.

Definition at line 222 of file ControlToolBar.cpp.

References _(), BUTTON_COUNT, gPrefs, ID_FF_BUTTON, ID_PAUSE_BUTTON, ID_PLAY_BUTTON, ID_RECORD_BUTTON, ID_REW_BUTTON, ID_STOP_BUTTON, name, and ToolBar::SetButtonToolTip().

Referenced by Populate(), ReCreateButtons(), and UpdatePrefs().

223 {
224 #if wxUSE_TOOLTIPS
225  for (long iWinID = ID_PLAY_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
226  {
227  auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
228  const wxChar *name = nullptr;
229  switch (iWinID)
230  {
231  case ID_PLAY_BUTTON:
232  // Without shift
233  name = wxT("PlayStop");
234  break;
235  case ID_RECORD_BUTTON:
236  // Without shift
237  //name = wxT("Record");
238  name = wxT("Record1stChoice");
239  break;
240  case ID_PAUSE_BUTTON:
241  name = wxT("Pause");
242  break;
243  case ID_STOP_BUTTON:
244  name = wxT("Stop");
245  break;
246  case ID_FF_BUTTON:
247  name = wxT("CursProjectEnd");
248  break;
249  case ID_REW_BUTTON:
250  name = wxT("CursProjectStart");
251  break;
252  }
253  std::vector<TranslatedInternalString> commands(
254  1u, { name, pCtrl->GetLabel() } );
255 
256  // Some have a second
257  switch (iWinID)
258  {
259  case ID_PLAY_BUTTON:
260  // With shift
261  commands.push_back( { wxT("PlayLooped"), _("Loop Play") } );
262  break;
263  case ID_RECORD_BUTTON:
264  // With shift
265  { bool bPreferNewTrack;
266  gPrefs->Read("/GUI/PreferNewTrackRecord",&bPreferNewTrack, false);
267  // For the shortcut tooltip.
268  commands.push_back( {
269  wxT("Record2ndChoice"),
270  !bPreferNewTrack
271  ? _("Record New Track")
272  : _("Append Record")
273  } );
274  }
275  break;
276  case ID_PAUSE_BUTTON:
277  break;
278  case ID_STOP_BUTTON:
279  break;
280  case ID_FF_BUTTON:
281  // With shift
282  commands.push_back( {
283  wxT("SelEnd"), _("Select to End") } );
284  break;
285  case ID_REW_BUTTON:
286  // With shift
287  commands.push_back( {
288  wxT("SelStart"), _("Select to Start") } );
289  break;
290  }
291  ToolBar::SetButtonToolTip(*pCtrl, commands.data(), commands.size());
292  }
293 #endif
294 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
const wxChar * name
Definition: Distortion.cpp:94
static void SetButtonToolTip(AButton &button, const TranslatedInternalString commands[], size_t nCommands)
Definition: ToolBar.cpp:823
A wxButton with mouse-over behaviour.
Definition: AButton.h:28
void ControlToolBar::Repaint ( wxDC *  dc)
overridevirtual

Implements ToolBar.

Definition at line 440 of file ControlToolBar.cpp.

References AColor::Bevel(), and mSizer.

441 {
442 #ifndef USE_AQUA_THEME
443  wxSize s = mSizer->GetSize();
444  wxPoint p = mSizer->GetPosition();
445 
446  wxRect bevelRect( p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1 );
447  AColor::Bevel( *dc, true, bevelRect );
448 #endif
449 }
static void Bevel(wxDC &dc, bool up, const wxRect &r)
Definition: AColor.cpp:202
wxBoxSizer * mSizer
void ControlToolBar::SetPlay ( bool  down,
PlayAppearance  appearance = PlayAppearance::Straight 
)

Definition at line 492 of file ControlToolBar.cpp.

References CutPreview, EnableDisableButtons(), GetActiveProject(), Looped, mPlay, AButton::PopUp(), AButton::PushDown(), AButton::SetAlternateIdx(), AButton::SetControl(), AButton::SetShift(), and UpdateStatusBar().

Referenced by AudacityProject::DoPlayStopSelect(), DoRecord(), AudacityProject::MakeReadyToPlay(), Scrubber::MarkScrubStart(), OnKeyEvent(), AudacityProject::OnPlayStop(), PlayPlayRegion(), ReCreateButtons(), StopPlaying(), and Scrubber::StopScrubbing().

493 {
494  if (down) {
495  mPlay->SetShift(appearance == PlayAppearance::Looped);
497  mPlay->SetAlternateIdx(static_cast<int>(appearance));
498  mPlay->PushDown();
499  }
500  else {
501  mPlay->PopUp();
503  }
506 }
void EnableDisableButtons() override
void SetAlternateIdx(unsigned idx)
Definition: AButton.cpp:248
void PopUp()
Definition: AButton.cpp:525
void SetShift(bool shift)
Definition: AButton.cpp:546
void UpdateStatusBar(AudacityProject *pProject)
void SetControl(bool control)
Definition: AButton.cpp:551
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void PushDown()
Definition: AButton.cpp:517
void ControlToolBar::SetRecord ( bool  down,
bool  altAppearance = false 
)

Definition at line 520 of file ControlToolBar.cpp.

References EnableDisableButtons(), mRecord, AButton::PopUp(), AButton::PushDown(), and AButton::SetAlternateIdx().

Referenced by DoRecord(), PlayPlayRegion(), ReCreateButtons(), and StopPlaying().

521 {
522  if (down)
523  {
524  mRecord->SetAlternateIdx(altAppearance ? 1 : 0);
525  mRecord->PushDown();
526  }
527  else
528  {
530  mRecord->PopUp();
531  }
533 }
AButton * mRecord
void EnableDisableButtons() override
void SetAlternateIdx(unsigned idx)
Definition: AButton.cpp:248
void PopUp()
Definition: AButton.cpp:525
void PushDown()
Definition: AButton.cpp:517
void ControlToolBar::SetStop ( bool  down)

Definition at line 508 of file ControlToolBar.cpp.

References EnableDisableButtons(), mPlay, mStop, AButton::PopUp(), and AButton::PushDown().

Referenced by AudacityProject::DoPlayStopSelect(), DoRecord(), AudacityProject::MakeReadyToPlay(), OnKeyEvent(), AudacityProject::OnPlayStop(), AudacityProject::OnPlayStopSelect(), PlayPlayRegion(), and StopPlaying().

509 {
510  if (down)
511  mStop->PushDown();
512  else {
513  if(FindFocus() == mStop)
514  mPlay->SetFocus();
515  mStop->PopUp();
516  }
518 }
void EnableDisableButtons() override
void PopUp()
Definition: AButton.cpp:525
void PushDown()
Definition: AButton.cpp:517
void ControlToolBar::SetupCutPreviewTracks ( double  playStart,
double  cutStart,
double  cutEnd,
double  playEnd 
)
private

Definition at line 1380 of file ControlToolBar.cpp.

References ClearCutPreviewTracks(), TrackList::Create(), Track::Duplicate(), GetActiveProject(), Track::GetLink(), AudacityProject::GetTracks(), mCutPreviewTracks, and Track::Wave.

Referenced by PlayPlayRegion().

1384 {
1387  if (p) {
1388  // Find first selected track (stereo or mono) and duplicate it
1389  const Track *track1 = NULL, *track2 = NULL;
1390  TrackListIterator it(p->GetTracks());
1391  for (Track *t = it.First(); t; t = it.Next())
1392  {
1393  if (t->GetSelected() &&
1394  (t->GetKind() == Track::Wave
1395 #ifdef EXPERIMENTAL_MIDI_OUT
1396  || t->GetKind() == Track::Note
1397 #endif
1398  ))
1399  {
1400  track1 = t;
1401  track2 = t->GetLink();
1402  break;
1403  }
1404  }
1405 
1406  if (track1)
1407  {
1408  // Duplicate and change tracks
1409  // Clear has a very small chance of throwing
1410  auto new1 = track1->Duplicate();
1411  new1->Clear(cutStart, cutEnd);
1412  decltype(new1) new2{};
1413  if (track2)
1414  {
1415  new2 = track2->Duplicate();
1416  new2->Clear(cutStart, cutEnd);
1417  }
1418 
1419  // use NOTHROW-GUARANTEE:
1420 
1422  mCutPreviewTracks->Add(std::move(new1));
1423  if (track2)
1424  mCutPreviewTracks->Add(std::move(new2));
1425  }
1426  }
1427 }
static std::shared_ptr< TrackList > Create()
Definition: Track.cpp:792
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
void ClearCutPreviewTracks()
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:102
An iterator for a TrackList.
Definition: Track.h:402
Track * GetLink() const
Definition: Track.cpp:269
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
TrackList * GetTracks()
Definition: Project.h:192
virtual Holder Duplicate() const =0
std::shared_ptr< TrackList > mCutPreviewTracks
void ControlToolBar::StartScrolling ( )

Definition at line 1512 of file ControlToolBar.cpp.

References gAudioIO, GetActiveProject(), AudioIO::GetNumCaptureChannels(), AudioIO::GetNumPlaybackChannels(), and gPrefs.

Referenced by StartScrollingIfPreferred().

1513 {
1515  const auto project = GetActiveProject();
1516  if (project) {
1517  auto mode = Mode::Centered;
1518 
1519 #if 0
1520  // Enable these lines to pin the playhead right instead of center,
1521  // when recording but not overdubbing.
1522  if (gAudioIO->GetNumCaptureChannels() > 0) {
1523  // recording
1524 
1525  // Display a fixed recording head while scrolling the waves continuously.
1526  // If you overdub, you may want to anticipate some context in existing tracks,
1527  // so center the head. If not, put it rightmost to display as much wave as we can.
1528  bool duplex;
1529 #ifdef EXPERIMENTAL_DA
1530  gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, false);
1531 #else
1532  gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, true);
1533 #endif
1534  if (duplex) {
1535  // See if there is really anything being overdubbed
1536  if (gAudioIO->GetNumPlaybackChannels() == 0)
1537  // No.
1538  duplex = false;
1539  }
1540 
1541  if (!duplex)
1542  mode = Mode::Right;
1543  }
1544 #endif
1545 
1546  project->GetPlaybackScroller().Activate(mode);
1547  }
1548 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
unsigned GetNumCaptureChannels() const
Definition: AudioIO.h:399
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
unsigned GetNumPlaybackChannels() const
Definition: AudioIO.h:398
void ControlToolBar::StartScrollingIfPreferred ( )

Definition at line 1494 of file ControlToolBar.cpp.

References AudacityProject::PlaybackScroller::Activate(), GetActiveProject(), TracksPrefs::GetPinnedHeadPreference(), AudacityProject::GetPlaybackScroller(), AudacityProject::PlaybackScroller::Refresh, StartScrolling(), and StopScrolling().

Referenced by DoRecord(), AudacityProject::OnTogglePinnedHead(), and PlayPlayRegion().

1495 {
1497  StartScrolling();
1498 #ifdef __WXMAC__
1499  else if (::GetActiveProject()->GetScrubber().HasStartedScrubbing()) {
1500  // PRL: cause many "unnecessary" refreshes. For reasons I don't understand,
1501  // doing this causes wheel rotation events (mapped from the double finger vertical
1502  // swipe) to be delivered more uniformly to the application, so that speed control
1503  // works better.
1506  }
1507 #endif
1508  else
1509  StopScrolling();
1510 }
PlaybackScroller & GetPlaybackScroller()
Definition: Project.h:832
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
static bool GetPinnedHeadPreference()
wxString ControlToolBar::StateForStatusBar ( )
private

Definition at line 1462 of file ControlToolBar.cpp.

References GetActiveProject(), AButton::IsDown(), mPause, mPlay, mRecord, mStatePause, mStatePlay, mStateRecord, and mStateStop.

Referenced by UpdateStatusBar().

1463 {
1464  wxString state;
1465 
1466  auto pProject = GetActiveProject();
1467  auto scrubState =
1468  pProject ? pProject->GetScrubber().GetUntranslatedStateString() : wxString();
1469  if (!scrubState.IsEmpty())
1470  state = wxGetTranslation(scrubState);
1471  else if (mPlay->IsDown())
1472  state = wxGetTranslation(mStatePlay);
1473  else if (mRecord->IsDown())
1474  state = wxGetTranslation(mStateRecord);
1475  else
1476  state = wxGetTranslation(mStateStop);
1477 
1478  if (mPause->IsDown())
1479  {
1480  state.Append(wxT(" "));
1481  state.Append(wxGetTranslation(mStatePause));
1482  }
1483 
1484  state.Append(wxT("."));
1485 
1486  return state;
1487 }
AButton * mRecord
bool IsDown()
Definition: AButton.h:123
wxString mStateRecord
AButton * mPause
wxString mStateStop
wxString mStatePause
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
wxString mStatePlay
void ControlToolBar::StopPlaying ( bool  stopStream = true)

Definition at line 836 of file ControlToolBar.cpp.

References CanStopAudioStream(), MeterPanel::Clear(), ClearCutPreviewTracks(), ToolBar::EnableDisableButtons(), gAudioIO, GetActiveProject(), AudacityProject::GetCaptureMeter(), AudacityProject::GetPlaybackMeter(), AudacityProject::GetScrubber(), ToolManager::GetToolBar(), AudacityProject::GetToolManager(), AudacityProject::MayStartMonitoring(), mBusyProject, mPause, mPaused, mStop, AButton::PopUp(), AButton::PushDown(), ScrubbingBarID, AudioIO::SetPaused(), SetPlay(), SetRecord(), SetStop(), StopScrolling(), Scrubber::StopScrubbing(), and AudioIO::StopStream().

Referenced by AdornedRulerPanel::ClearPlayRegion(), Scrubber::DoScrub(), Scrubber::MarkScrubStart(), Scrubber::MaybeStartScrubbing(), OnKeyEvent(), OnPlay(), EffectUIHost::OnPlay(), AudacityProject::OnPlayStop(), OnStop(), TrackPanel::OnTimer(), TranscriptionToolBar::PlayAtSpeed(), and AdornedRulerPanel::StartQPPlay().

837 {
838  StopScrolling();
839 
840  AudacityProject *project = GetActiveProject();
841 
842  if(project) {
843  // Let scrubbing code do some appearance change
844  project->GetScrubber().StopScrubbing();
845  }
846 
847  if (!CanStopAudioStream())
848  return;
849 
850  mStop->PushDown();
851 
852  SetStop(false);
853  if(stopStream)
854  gAudioIO->StopStream();
855  SetPlay(false);
856  SetRecord(false);
857 
858  #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
859  gAudioIO->AILADisable();
860  #endif
861 
862  mPause->PopUp();
863  mPaused=false;
864  //Make sure you tell gAudioIO to unpause
866 
868 
869  mBusyProject = NULL;
870  // So that we continue monitoring after playing or recording.
871  // also clean the MeterQueues
872  if( project ) {
873  project->MayStartMonitoring();
874 
875  MeterPanel *meter = project->GetPlaybackMeter();
876  if( meter ) {
877  meter->Clear();
878  }
879 
880  meter = project->GetCaptureMeter();
881  if( meter ) {
882  meter->Clear();
883  }
884  }
885 
886  const auto toolbar = project->GetToolManager()->GetToolBar(ScrubbingBarID);
887  toolbar->EnableDisableButtons();
888 }
void SetPlay(bool down, PlayAppearance appearance=PlayAppearance::Straight)
void StopStream()
Stop recording, playback or input monitoring.
Definition: AudioIO.cpp:2562
void PopUp()
Definition: AButton.cpp:525
Scrubber & GetScrubber()
Definition: Project.h:801
void Clear()
Definition: Meter.cpp:335
AButton * mPause
void MayStartMonitoring()
Definition: Project.cpp:5534
MeterPanel is a panel that paints the meter used for monitoring or playback.
Definition: Meter.h:97
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
void StopScrubbing()
Definition: Scrubbing.cpp:536
void ClearCutPreviewTracks()
MeterPanel * GetCaptureMeter()
Definition: Project.cpp:5104
void SetStop(bool down)
virtual void EnableDisableButtons()=0
ToolManager * GetToolManager()
Definition: Project.h:704
static AudacityProject * mBusyProject
AudioIO * gAudioIO
Definition: AudioIO.cpp:482
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
MeterPanel * GetPlaybackMeter()
Definition: Project.cpp:5090
void PushDown()
Definition: AButton.cpp:517
void SetRecord(bool down, bool altAppearance=false)
void SetPaused(bool state)
Pause and un-pause playback and recording.
Definition: AudioIO.cpp:2840
ToolBar * GetToolBar(int type) const
void ControlToolBar::StopScrolling ( )

Definition at line 1550 of file ControlToolBar.cpp.

References GetActiveProject(), and AudacityProject::PlaybackScroller::Off.

Referenced by StartScrollingIfPreferred(), and StopPlaying().

1551 {
1552  const auto project = GetActiveProject();
1553  if(project)
1554  project->GetPlaybackScroller().Activate
1556 }
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
void ControlToolBar::UpdatePrefs ( )
overridevirtual

Reimplemented from ToolBar.

Definition at line 296 of file ControlToolBar.cpp.

References _(), gPrefs, mErgonomicTransportButtons, mStrLocale, ReCreateButtons(), RegenerateTooltips(), ToolBar::SetLabel(), ToolBar::Updated(), and ToolBar::UpdatePrefs().

297 {
298  bool updated = false;
299  bool active;
300 
301  gPrefs->Read( wxT("/GUI/ErgonomicTransportButtons"), &active, true );
302  if( mErgonomicTransportButtons != active )
303  {
305  updated = true;
306  }
307  wxString strLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
308  if (mStrLocale != strLocale)
309  {
310  mStrLocale = strLocale;
311  updated = true;
312  }
313 
314  if( updated )
315  {
316  ReCreateButtons(); // side effect: calls RegenerateTooltips()
317  Updated();
318  }
319  else
320  // The other reason to regenerate tooltips is if keyboard shortcuts for
321  // transport buttons changed, but that's too much work to check for, so just
322  // always do it. (Much cheaper than calling ReCreateButtons() in all cases.
324 
325 
326  // Set label to pull in language change
327  SetLabel(_("Transport"));
328 
329  // Give base class a chance
331 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
virtual void UpdatePrefs()
Definition: ToolBar.cpp:535
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:374
void RegenerateTooltips() override
void ReCreateButtons() override
wxString mStrLocale
void Updated()
Definition: ToolBar.cpp:592
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
bool mErgonomicTransportButtons
void ControlToolBar::UpdateStatusBar ( AudacityProject pProject)
bool ControlToolBar::UseDuplex ( )
static

Definition at line 1089 of file ControlToolBar.cpp.

References gPrefs.

Referenced by AudacityProject::OnPunchAndRoll(), and OnRecord().

1090 {
1091  bool duplex;
1092  gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex,
1093 #ifdef EXPERIMENTAL_DA
1094  false
1095 #else
1096  true
1097 #endif
1098  );
1099  return duplex;
1100 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
int ControlToolBar::WidthForStatusBar ( wxStatusBar * const  sb)

Definition at line 1437 of file ControlToolBar.cpp.

References Scrubber::GetAllUntranslatedStatusStrings(), mStatePause, mStatePlay, mStateRecord, and mStateStop.

Referenced by AudacityProject::OnAudioIORate().

1438 {
1439  int xMax = 0;
1440  const auto pauseString = wxT(" ") + wxGetTranslation(mStatePause);
1441 
1442  auto update = [&] (const wxString &state) {
1443  int x, y;
1444  sb->GetTextExtent(
1445  wxGetTranslation(state) + pauseString + wxT("."),
1446  &x, &y
1447  );
1448  xMax = std::max(x, xMax);
1449  };
1450 
1451  update(mStatePlay);
1452  update(mStateStop);
1453  update(mStateRecord);
1454 
1455  // Note that Scrubbing + Paused is not allowed.
1456  for(const auto &state : Scrubber::GetAllUntranslatedStatusStrings())
1457  update(state);
1458 
1459  return xMax + 30; // added constant needed because xMax isn't large enough for some reason, plus some space.
1460 }
wxString mStateRecord
wxString mStateStop
static std::vector< wxString > GetAllUntranslatedStatusStrings()
Definition: Scrubbing.cpp:974
wxString mStatePause
wxString mStatePlay

Member Data Documentation

AudacityProject * ControlToolBar::mBusyProject = NULL
staticprivate

Definition at line 175 of file ControlToolBar.h.

Referenced by DoRecord(), PlayPlayRegion(), and StopPlaying().

std::shared_ptr<TrackList> ControlToolBar::mCutPreviewTracks
private

Definition at line 187 of file ControlToolBar.h.

Referenced by ClearCutPreviewTracks(), PlayPlayRegion(), and SetupCutPreviewTracks().

bool ControlToolBar::mErgonomicTransportButtons
private

Definition at line 181 of file ControlToolBar.h.

Referenced by ArrangeButtons(), and UpdatePrefs().

AButton* ControlToolBar::mFF
private

Definition at line 173 of file ControlToolBar.h.

Referenced by ArrangeButtons(), EnableDisableButtons(), OnFF(), and Populate().

AButton* ControlToolBar::mPause
private
bool ControlToolBar::mPaused
private

Definition at line 178 of file ControlToolBar.h.

Referenced by OnPause(), and StopPlaying().

AButton* ControlToolBar::mPlay
private
AButton* ControlToolBar::mRecord
private
AButton* ControlToolBar::mRewind
private

Definition at line 168 of file ControlToolBar.h.

Referenced by ArrangeButtons(), EnableDisableButtons(), OnRewind(), and Populate().

wxBoxSizer* ControlToolBar::mSizer
private

Definition at line 185 of file ControlToolBar.h.

Referenced by ArrangeButtons(), ReCreateButtons(), and Repaint().

wxString ControlToolBar::mStatePause
private

Definition at line 193 of file ControlToolBar.h.

Referenced by StateForStatusBar(), and WidthForStatusBar().

wxString ControlToolBar::mStatePlay
private

Definition at line 190 of file ControlToolBar.h.

Referenced by StateForStatusBar(), and WidthForStatusBar().

wxString ControlToolBar::mStateRecord
private

Definition at line 192 of file ControlToolBar.h.

Referenced by StateForStatusBar(), and WidthForStatusBar().

wxString ControlToolBar::mStateStop
private

Definition at line 191 of file ControlToolBar.h.

Referenced by StateForStatusBar(), and WidthForStatusBar().

AButton* ControlToolBar::mStop
private
wxString ControlToolBar::mStrLocale
private

Definition at line 183 of file ControlToolBar.h.

Referenced by UpdatePrefs().


The documentation for this class was generated from the following files: