Audacity 3.2.0
|
#include <ProjectAudioIO.h>
Classes | |
struct | DefaultOptions |
Public Member Functions | |
ProjectAudioIO (AudacityProject &project) | |
ProjectAudioIO (const ProjectAudioIO &)=delete | |
ProjectAudioIO & | operator= (const ProjectAudioIO &)=delete |
~ProjectAudioIO () | |
int | GetAudioIOToken () const |
bool | IsAudioActive () const |
void | SetAudioIOToken (int token) |
const std::shared_ptr< Meter > & | GetPlaybackMeter () const |
void | SetPlaybackMeter (const std::shared_ptr< Meter > &playback) |
const std::shared_ptr< Meter > & | GetCaptureMeter () const |
void | SetCaptureMeter (const std::shared_ptr< Meter > &capture) |
double | GetPlaySpeed () const |
void | SetPlaySpeed (double value) |
Public Member Functions inherited from ClientData::Base | |
virtual | ~Base () |
Public Member Functions inherited from Observer::Publisher< SpeedChangeMessage > | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (Publisher &&)=default |
Subscription | Subscribe (Callback callback) |
Connect a callback to the Publisher; later-connected are called earlier. More... | |
Subscription | Subscribe (Object &obj, Return(Object::*callback)(Args...)) |
Overload of Subscribe takes an object and pointer-to-member-function. More... | |
Static Public Member Functions | |
static AudioIOStartStreamOptions | DefaultOptionsFactory (AudacityProject &project, bool newDefaults) |
Default factory function ignores the second argument. More... | |
static AudioIOStartStreamOptions | GetDefaultOptions (AudacityProject &project, bool newDefaults=false) |
Invoke the global hook, supplying a default argument. More... | |
static ProjectAudioIO & | Get (AudacityProject &project) |
static const ProjectAudioIO & | Get (const AudacityProject &project) |
Private Attributes | |
AudacityProject & | mProject |
std::shared_ptr< Meter > | mPlaybackMeter |
std::shared_ptr< Meter > | mCaptureMeter |
std::atomic< double > | mPlaySpeed {} |
int | mAudioIOToken { -1 } |
Additional Inherited Members | |
Public Types inherited from Observer::Publisher< SpeedChangeMessage > | |
using | message_type = SpeedChangeMessage |
using | CallbackReturn = std::conditional_t< true, void, bool > |
using | Callback = std::function< CallbackReturn(const SpeedChangeMessage &) > |
Type of functions that can be connected to the Publisher. More... | |
Static Public Attributes inherited from Observer::Publisher< SpeedChangeMessage > | |
static constexpr bool | notifies_all |
Protected Member Functions inherited from Observer::Publisher< SpeedChangeMessage > | |
CallbackReturn | Publish (const SpeedChangeMessage &message) |
Send a message to connected callbacks. More... | |
\ brief Holds per-project state needed for interaction with AudioIO, including the audio stream token and pointers to meters
Definition at line 29 of file ProjectAudioIO.h.
|
explicit |
Definition at line 56 of file ProjectAudioIO.cpp.
|
delete |
ProjectAudioIO::~ProjectAudioIO | ( | ) |
Definition at line 61 of file ProjectAudioIO.cpp.
|
static |
Default factory function ignores the second argument.
Definition at line 19 of file ProjectAudioIO.cpp.
References GlobalHook< DefaultWarp, const BoundedEnvelope *(const AudacityProject *) >::Call(), Get(), ProjectRate::Get(), ProjectRate::GetRate(), and project.
|
static |
Definition at line 46 of file ProjectAudioIO.cpp.
References project, and sAudioIOKey.
Referenced by AudioIOBusyPred(), StretchHandle::Click(), CutlineHandle::Click(), SampleHandle::Click(), WaveClipAdjustBorderHandle::Click(), EnvelopeHandle::Click(), SelectHandle::Click(), TimeShiftHandle::Click(), TrackSelectHandle::Click(), CloseButtonHandle::CommitChanges(), Scrubber::ContinueScrubbingPoll(), DefaultOptionsFactory(), anonymous_namespace{SelectMenus.cpp}::DoBoundaryMove(), anonymous_namespace{SelectMenus.cpp}::DoCursorMove(), anonymous_namespace{TransportMenus.cpp}::DoMoveToLabel(), ProjectAudioManager::DoPlayStopSelect(), ProjectAudioManager::DoRecord(), TransportUtilities::DoStopPlaying(), StretchHandle::Drag(), SampleHandle::Drag(), EnvelopeHandle::Drag(), TimeShiftHandle::Drag(), TrackSelectHandle::Drag(), MeterToolBar::Expose(), DefaultPlaybackPolicy::GetPlaySpeed(), LabelGlyphHandle::HandleGlyphDragRelease(), anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::HitTest(), anonymous_namespace{WaveTrackControls.cpp}::initFn(), DefaultPlaybackPolicy::Initialize(), TrackPanel::IsAudioActive(), Scrubber::IsScrubbing(), anonymous_namespace{TransportMenus.cpp}::MakeReadyToPlay(), Scrubber::MarkScrubStart(), anonymous_namespace{LabelMenus.cpp}::OnAddLabelPlaying(), ProjectAudioManager::OnAudioIOStopRecording(), ProjectManager::OnCloseWindow(), SelectActions::Handler::OnCursorPositionStore(), TimeToolBar::OnIdle(), AudacityApp::OnKeyDown(), anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), SelectActions::Handler::OnSelectCursorStoredCursor(), SelectUtilities::OnSetRegion(), ProjectWindow::PlaybackScroller::OnTimer(), MixerBoard::OnTimer(), PlayIndicatorOverlay::OnTimer(), ProjectManager::OnTimer(), TrackPanel::OnTimer(), anonymous_namespace{TrackMenus.cpp}::OnTrackClose(), anonymous_namespace{ViewMenus.cpp}::OnZoomIn(), ProjectAudioManager::PlayPlayRegion(), PitchAndSpeedDialog::PopulateOrExchange(), WaveClipAdjustBorderHandle::Preview(), AffordanceHandle::Preview(), StretchHandle::Preview(), CutlineHandle::Preview(), SampleHandle::Preview(), EnvelopeHandle::Preview(), TimeShiftHandle::Preview(), TrackSelectHandle::Preview(), MeterToolBar::ReCreateButtons(), StretchHandle::Release(), SampleHandle::Release(), EnvelopeHandle::Release(), TimeShiftHandle::Release(), anonymous_namespace{SelectMenus.cpp}::SeekLeftOrRight(), TranscriptionToolBar::SetPlaySpeed(), ProjectAudioManager::Stop(), and AdornedRulerPanel::ScrubbingRulerOverlay::Update().
|
static |
Definition at line 51 of file ProjectAudioIO.cpp.
References Get(), and project.
Referenced by Get().
int ProjectAudioIO::GetAudioIOToken | ( | ) | const |
Definition at line 65 of file ProjectAudioIO.cpp.
References mAudioIOToken.
Referenced by ProjectAudioManager::DoPlayStopSelect(), TransportUtilities::DoStopPlaying(), IsAudioActive(), anonymous_namespace{TransportMenus.cpp}::MakeReadyToPlay(), anonymous_namespace{LabelMenus.cpp}::OnAddLabelPlaying(), AudacityApp::OnKeyDown(), SelectUtilities::OnSetRegion(), and anonymous_namespace{ViewMenus.cpp}::OnZoomIn().
const std::shared_ptr< Meter > & ProjectAudioIO::GetCaptureMeter | ( | ) | const |
|
static |
Invoke the global hook, supplying a default argument.
newDefaults | if true, policy is meant to respond to looping region; but specifying that is outside this library's scope |
Definition at line 34 of file ProjectAudioIO.cpp.
References GlobalHook< DefaultOptions, std::remove_pointer_t< decltype(DefaultFunction)>, DefaultFunction, Options... >::Call(), and project.
Referenced by DefaultSpeedPlayOptions(), EffectPreview(), Scrubber::MaybeStartScrubbing(), anonymous_namespace{TransportMenus.cpp}::OnPlayAfterSelectionEnd(), anonymous_namespace{TransportMenus.cpp}::OnPlayAfterSelectionStart(), anonymous_namespace{TransportMenus.cpp}::OnPlayBeforeAndAfterSelectionEnd(), anonymous_namespace{TransportMenus.cpp}::OnPlayBeforeAndAfterSelectionStart(), anonymous_namespace{TransportMenus.cpp}::OnPlayBeforeSelectionEnd(), anonymous_namespace{TransportMenus.cpp}::OnPlayBeforeSelectionStart(), anonymous_namespace{TransportMenus.cpp}::OnPlayOneSecond(), anonymous_namespace{TransportMenus.cpp}::OnPlayToSelection(), anonymous_namespace{TransportMenus.cpp}::OnPunchAndRoll(), ProjectAudioManager::OnRecord(), TranscriptionToolBar::PlayAtSpeed(), ProjectAudioManager::PlayCurrentRegion(), MeterPanel::StartMonitoring(), and AdornedRulerPanel::StartQPPlay().
const std::shared_ptr< Meter > & ProjectAudioIO::GetPlaybackMeter | ( | ) | const |
Definition at line 82 of file ProjectAudioIO.cpp.
References mPlaybackMeter.
|
inline |
Definition at line 72 of file ProjectAudioIO.h.
Referenced by DefaultPlaybackPolicy::GetPlaySpeed(), and SetPlaySpeed().
bool ProjectAudioIO::IsAudioActive | ( | ) | const |
Definition at line 75 of file ProjectAudioIO.cpp.
References AudioIOBase::Get(), and GetAudioIOToken().
Referenced by StretchHandle::Click(), CutlineHandle::Click(), SampleHandle::Click(), WaveClipAdjustBorderHandle::Click(), EnvelopeHandle::Click(), SelectHandle::Click(), TimeShiftHandle::Click(), TrackSelectHandle::Click(), CloseButtonHandle::CommitChanges(), anonymous_namespace{SelectMenus.cpp}::DoBoundaryMove(), StretchHandle::Drag(), SampleHandle::Drag(), EnvelopeHandle::Drag(), TimeShiftHandle::Drag(), TrackSelectHandle::Drag(), LabelGlyphHandle::HandleGlyphDragRelease(), anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::HitTest(), anonymous_namespace{WaveTrackControls.cpp}::initFn(), TrackPanel::IsAudioActive(), SelectActions::Handler::OnCursorPositionStore(), anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), SelectActions::Handler::OnSelectCursorStoredCursor(), ProjectWindow::PlaybackScroller::OnTimer(), MixerBoard::OnTimer(), PlayIndicatorOverlay::OnTimer(), anonymous_namespace{TrackMenus.cpp}::OnTrackClose(), PitchAndSpeedDialog::PopulateOrExchange(), WaveClipAdjustBorderHandle::Preview(), AffordanceHandle::Preview(), StretchHandle::Preview(), CutlineHandle::Preview(), SampleHandle::Preview(), EnvelopeHandle::Preview(), TimeShiftHandle::Preview(), TrackSelectHandle::Preview(), StretchHandle::Release(), SampleHandle::Release(), EnvelopeHandle::Release(), TimeShiftHandle::Release(), and AdornedRulerPanel::ScrubbingRulerOverlay::Update().
|
delete |
void ProjectAudioIO::SetAudioIOToken | ( | int | token | ) |
Definition at line 70 of file ProjectAudioIO.cpp.
References mAudioIOToken.
Referenced by ProjectAudioManager::DoRecord(), Scrubber::MarkScrubStart(), and ProjectAudioManager::PlayPlayRegion().
void ProjectAudioIO::SetCaptureMeter | ( | const std::shared_ptr< Meter > & | capture | ) |
Definition at line 104 of file ProjectAudioIO.cpp.
References AudioIOBase::Get(), mCaptureMeter, mProject, and project.
void ProjectAudioIO::SetPlaybackMeter | ( | const std::shared_ptr< Meter > & | playback | ) |
Definition at line 87 of file ProjectAudioIO.cpp.
References AudioIOBase::Get(), mPlaybackMeter, mProject, and project.
void ProjectAudioIO::SetPlaySpeed | ( | double | value | ) |
Definition at line 117 of file ProjectAudioIO.cpp.
References GetPlaySpeed(), mPlaySpeed, and Observer::Publisher< SpeedChangeMessage >::Publish().
Referenced by TranscriptionToolBar::SetPlaySpeed().
|
private |
Definition at line 87 of file ProjectAudioIO.h.
Referenced by GetAudioIOToken(), and SetAudioIOToken().
|
private |
Definition at line 81 of file ProjectAudioIO.h.
Referenced by GetCaptureMeter(), and SetCaptureMeter().
|
private |
Definition at line 80 of file ProjectAudioIO.h.
Referenced by GetPlaybackMeter(), and SetPlaybackMeter().
|
private |
Definition at line 85 of file ProjectAudioIO.h.
Referenced by SetPlaySpeed().
|
private |
Definition at line 77 of file ProjectAudioIO.h.
Referenced by SetCaptureMeter(), and SetPlaybackMeter().