Audacity  3.0.3
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ProjectAudioIO Class Referencefinal

#include <ProjectAudioIO.h>

Inheritance diagram for ProjectAudioIO:
[legend]
Collaboration diagram for ProjectAudioIO:
[legend]

Public Member Functions

 ProjectAudioIO (AudacityProject &project)
 
 ProjectAudioIO (const ProjectAudioIO &) PROHIBITED
 
ProjectAudioIOoperator= (const ProjectAudioIO &) PROHIBITED
 
 ~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)
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 

Static Public Member Functions

static ProjectAudioIOGet (AudacityProject &project)
 
static const ProjectAudioIOGet (const AudacityProject &project)
 

Private Attributes

AudacityProjectmProject
 
std::shared_ptr< MetermPlaybackMeter
 
std::shared_ptr< MetermCaptureMeter
 
int mAudioIOToken { -1 }
 

Detailed Description

\ brief Holds per-project state needed for interaction with AudioIO, including the audio stream token and pointers to meters

Definition at line 23 of file ProjectAudioIO.h.

Constructor & Destructor Documentation

◆ ProjectAudioIO() [1/2]

ProjectAudioIO::ProjectAudioIO ( AudacityProject project)
explicit

Definition at line 32 of file ProjectAudioIO.cpp.

33 : mProject{ project }
34 {
35 }

◆ ProjectAudioIO() [2/2]

ProjectAudioIO::ProjectAudioIO ( const ProjectAudioIO )

◆ ~ProjectAudioIO()

ProjectAudioIO::~ProjectAudioIO ( )

Definition at line 37 of file ProjectAudioIO.cpp.

38 {
39 }

Member Function Documentation

◆ Get() [1/2]

ProjectAudioIO & ProjectAudioIO::Get ( AudacityProject project)
static

Definition at line 22 of file ProjectAudioIO.cpp.

23 {
24  return project.AttachedObjects::Get< ProjectAudioIO >( sAudioIOKey );
25 }

References sAudioIOKey.

Referenced by AudioIOBusyPred(), StretchHandle::Click(), CutlineHandle::Click(), SampleHandle::Click(), EnvelopeHandle::Click(), SelectHandle::Click(), TimeShiftHandle::Click(), TrackSelectHandle::Click(), SelectButtonHandle::CommitChanges(), CloseButtonHandle::CommitChanges(), DefaultPlayOptions(), anonymous_namespace{SelectMenus.cpp}::DoBoundaryMove(), anonymous_namespace{SelectMenus.cpp}::DoCursorMove(), anonymous_namespace{TransportMenus.cpp}::DoMoveToLabel(), ProjectAudioManager::DoPlayStopSelect(), ProjectAudioManager::DoRecord(), anonymous_namespace{TransportMenus.cpp}::DoStopPlaying(), StretchHandle::Drag(), SampleHandle::Drag(), EnvelopeHandle::Drag(), TimeShiftHandle::Drag(), TrackSelectHandle::Drag(), MeterToolBar::Expose(), Get(), LabelGlyphHandle::HandleGlyphDragRelease(), anonymous_namespace{AdornedRulerPanel.cpp}::PlayheadHandle::HitTest(), anonymous_namespace{WaveTrackControls.cpp}::initFn(), TrackPanel::IsAudioActive(), anonymous_namespace{TransportMenus.cpp}::MakeReadyToPlay(), Scrubber::MarkScrubStart(), ProjectWindow::MayScrollBeyondZero(), LabelEditActions::Handler::OnAddLabelPlaying(), ProjectAudioManager::OnAudioIOStopRecording(), ProjectManager::OnCloseWindow(), SelectActions::Handler::OnCursorPositionStore(), SelectionBar::OnIdle(), TimeToolBar::OnIdle(), AudacityApp::OnKeyDown(), anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), SelectActions::Handler::OnSelectCursorStoredCursor(), SelectUtilities::OnSetRegion(), LyricsWindow::OnTimer(), MixerBoard::OnTimer(), ProjectWindow::PlaybackScroller::OnTimer(), PlayIndicatorOverlay::OnTimer(), ProjectManager::OnTimer(), TrackPanel::OnTimer(), TrackActions::Handler::OnTrackClose(), ProjectAudioManager::PlayPlayRegion(), WaveClipTrimHandle::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(), ProjectAudioManager::Stop(), AdornedRulerPanel::ScrubbingRulerOverlay::Update(), and ProjectWindow::ZoomInByFactor().

◆ Get() [2/2]

const ProjectAudioIO & ProjectAudioIO::Get ( const AudacityProject project)
static

Definition at line 27 of file ProjectAudioIO.cpp.

28 {
29  return Get( const_cast<AudacityProject &>(project) );
30 }

References Get().

Here is the call graph for this function:

◆ GetAudioIOToken()

int ProjectAudioIO::GetAudioIOToken ( ) const

Definition at line 41 of file ProjectAudioIO.cpp.

42 {
43  return mAudioIOToken;
44 }

References mAudioIOToken.

Referenced by ProjectAudioManager::DoPlayStopSelect(), anonymous_namespace{TransportMenus.cpp}::DoStopPlaying(), IsAudioActive(), anonymous_namespace{TransportMenus.cpp}::MakeReadyToPlay(), LabelEditActions::Handler::OnAddLabelPlaying(), AudacityApp::OnKeyDown(), SelectUtilities::OnSetRegion(), and ProjectWindow::ZoomInByFactor().

Here is the caller graph for this function:

◆ GetCaptureMeter()

const std::shared_ptr< Meter > & ProjectAudioIO::GetCaptureMeter ( ) const

Definition at line 75 of file ProjectAudioIO.cpp.

76 {
77  return mCaptureMeter;
78 }

References mCaptureMeter.

◆ GetPlaybackMeter()

const std::shared_ptr< Meter > & ProjectAudioIO::GetPlaybackMeter ( ) const

Definition at line 58 of file ProjectAudioIO.cpp.

59 {
60  return mPlaybackMeter;
61 }

References mPlaybackMeter.

◆ IsAudioActive()

bool ProjectAudioIO::IsAudioActive ( ) const

Definition at line 51 of file ProjectAudioIO.cpp.

52 {
53  auto gAudioIO = AudioIOBase::Get();
54  return GetAudioIOToken() > 0 &&
55  gAudioIO->IsStreamActive(GetAudioIOToken());
56 }

References AudioIOBase::Get(), and GetAudioIOToken().

Referenced by StretchHandle::Click(), CutlineHandle::Click(), SampleHandle::Click(), EnvelopeHandle::Click(), SelectHandle::Click(), TimeShiftHandle::Click(), TrackSelectHandle::Click(), SelectButtonHandle::CommitChanges(), 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(), ProjectWindow::MayScrollBeyondZero(), SelectActions::Handler::OnCursorPositionStore(), anonymous_namespace{SelectMenus.cpp}::OnlyHandleKeyUp(), SelectActions::Handler::OnSelectCursorStoredCursor(), LyricsWindow::OnTimer(), MixerBoard::OnTimer(), ProjectWindow::PlaybackScroller::OnTimer(), PlayIndicatorOverlay::OnTimer(), TrackActions::Handler::OnTrackClose(), WaveClipTrimHandle::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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

ProjectAudioIO& ProjectAudioIO::operator= ( const ProjectAudioIO )

◆ SetAudioIOToken()

void ProjectAudioIO::SetAudioIOToken ( int  token)

Definition at line 46 of file ProjectAudioIO.cpp.

47 {
48  mAudioIOToken = token;
49 }

References mAudioIOToken.

Referenced by ProjectAudioManager::DoRecord(), Scrubber::MarkScrubStart(), and ProjectAudioManager::PlayPlayRegion().

Here is the caller graph for this function:

◆ SetCaptureMeter()

void ProjectAudioIO::SetCaptureMeter ( const std::shared_ptr< Meter > &  capture)

Definition at line 80 of file ProjectAudioIO.cpp.

82 {
83  auto &project = mProject;
84  mCaptureMeter = capture;
85 
86  auto gAudioIO = AudioIOBase::Get();
87  if (gAudioIO)
88  {
89  gAudioIO->SetCaptureMeter( project.shared_from_this(), mCaptureMeter );
90  }
91 }

References AudioIOBase::Get(), mCaptureMeter, and mProject.

Here is the call graph for this function:

◆ SetPlaybackMeter()

void ProjectAudioIO::SetPlaybackMeter ( const std::shared_ptr< Meter > &  playback)

Definition at line 63 of file ProjectAudioIO.cpp.

65 {
66  auto &project = mProject;
67  mPlaybackMeter = playback;
68  auto gAudioIO = AudioIOBase::Get();
69  if (gAudioIO)
70  {
71  gAudioIO->SetPlaybackMeter( project.shared_from_this() , mPlaybackMeter );
72  }
73 }

References AudioIOBase::Get(), mPlaybackMeter, and mProject.

Here is the call graph for this function:

Member Data Documentation

◆ mAudioIOToken

int ProjectAudioIO::mAudioIOToken { -1 }
private

Definition at line 53 of file ProjectAudioIO.h.

Referenced by GetAudioIOToken(), and SetAudioIOToken().

◆ mCaptureMeter

std::shared_ptr<Meter> ProjectAudioIO::mCaptureMeter
private

Definition at line 51 of file ProjectAudioIO.h.

Referenced by GetCaptureMeter(), and SetCaptureMeter().

◆ mPlaybackMeter

std::shared_ptr<Meter> ProjectAudioIO::mPlaybackMeter
private

Definition at line 50 of file ProjectAudioIO.h.

Referenced by GetPlaybackMeter(), and SetPlaybackMeter().

◆ mProject

AudacityProject& ProjectAudioIO::mProject
private

Definition at line 47 of file ProjectAudioIO.h.

Referenced by SetCaptureMeter(), and SetPlaybackMeter().


The documentation for this class was generated from the following files:
ProjectAudioIO::GetAudioIOToken
int GetAudioIOToken() const
Definition: ProjectAudioIO.cpp:41
ProjectAudioIO::mProject
AudacityProject & mProject
Definition: ProjectAudioIO.h:47
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:22
ProjectAudioIO::mAudioIOToken
int mAudioIOToken
Definition: ProjectAudioIO.h:53
ProjectAudioIO::mPlaybackMeter
std::shared_ptr< Meter > mPlaybackMeter
Definition: ProjectAudioIO.h:50
AudioIOBase::Get
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:89
sAudioIOKey
static const AudacityProject::AttachedObjects::RegisteredFactory sAudioIOKey
Definition: ProjectAudioIO.cpp:16
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
ProjectAudioIO
Definition: ProjectAudioIO.h:25
ProjectAudioIO::mCaptureMeter
std::shared_ptr< Meter > mCaptureMeter
Definition: ProjectAudioIO.h:51