CLAM-Development
1.4.0
|
A NetworkPlayer is an object that controls the playback of a Network providing a high level transport like interface. More...
#include <NetworkPlayer.hxx>
Classes | |
struct | ExportedPort |
Public Member Functions | |
NetworkPlayer () | |
virtual | ~NetworkPlayer () |
virtual bool | IsWorking ()=0 |
Should return true when the backend is able to run the network. | |
virtual std::string | NonWorkingReason ()=0 |
Whenever the backend is not working, this method returns the reason. | |
virtual void | Init () |
Redefine to add any initialization after being attached to a network TODO: Consider removing it as just Jack backend uses it but it is redundant. | |
virtual void | Start ()=0 |
Redefine to make the backend ready to process and start the network. If IsPlaying() should do nothing. If it IsPaused() you should consider just call BePlaying() without starting the processings. | |
virtual void | Stop ()=0 |
Redefine it to deactivate the backend. | |
virtual void | Pause () |
void | SetNetworkBackLink (Network &net) |
void | BePaused () |
void | BeStopped () |
void | BePlaying () |
bool | IsPaused () const |
bool | IsStopped () const |
bool | IsPlaying () const |
virtual bool | IsRealTime () const =0 |
virtual unsigned | BackendBufferSize () |
virtual unsigned | BackendSampleRate () |
std::string | SourcesAndSinksToString () |
Protected Types | |
enum | Status { Playing = 0, Stopped = 1, Paused = 2 } |
Protected Member Functions | |
Network & | GetNetwork () |
unsigned | GetNSinks () const |
unsigned | GetNSources () const |
void | CacheSourcesAndSinks () |
const std::string & | SourceName (unsigned source) const |
const std::string & | SinkName (unsigned sink) const |
void | SetSourceBuffer (unsigned source, const float *data, unsigned nframes) |
void | SetSinkBuffer (unsigned sink, float *data, unsigned nframes) |
void | SetSinkFrameSize (unsigned sink, unsigned frameSize) |
void | SetSourceFrameSize (unsigned source, unsigned frameSize) |
A NetworkPlayer is an object that controls the playback of a Network providing a high level transport like interface.
This class is an abstract class. Subclasses contextualizes the network inside a given execution context dealing with threading, callback calling and device mapping on concrete architectures such as Alsa, PortAudio, Jack, VST, Ladspa...
Definition at line 40 of file NetworkPlayer.hxx.
|
protected |
Definition at line 43 of file NetworkPlayer.hxx.
|
inline |
Definition at line 46 of file NetworkPlayer.hxx.
|
inlinevirtual |
Definition at line 52 of file NetworkPlayer.hxx.
|
inlinevirtual |
Reimplemented in CLAM::JACKNetworkPlayer.
Definition at line 90 of file NetworkPlayer.hxx.
Referenced by CLAM::Network::BackendBufferSize().
|
inlinevirtual |
Reimplemented in CLAM::JACKNetworkPlayer.
Definition at line 95 of file NetworkPlayer.hxx.
Referenced by CLAM::Network::BackendSampleRate().
|
inline |
|
inline |
Definition at line 84 of file NetworkPlayer.hxx.
References Playing.
Referenced by CLAM::MonoOfflineNetworkPlayer::Start(), CLAM::OfflineNetworkPlayer::Start(), CLAM::PANetworkPlayer::Start(), and CLAM::JACKNetworkPlayer::Start().
|
inline |
Definition at line 83 of file NetworkPlayer.hxx.
References Stopped.
Referenced by CLAM::JACKNetworkPlayer::OnShutdown(), CLAM::MonoOfflineNetworkPlayer::Stop(), CLAM::OfflineNetworkPlayer::Stop(), CLAM::PANetworkPlayer::Stop(), and CLAM::JACKNetworkPlayer::Stop().
|
inlineprotected |
Definition at line 111 of file NetworkPlayer.hxx.
References CLAM::Processing::GetInPort(), CLAM::InPortBase::GetName(), CLAM::OutPortBase::GetName(), CLAM::Network::GetNetworkId(), CLAM::Processing::GetNInPorts(), CLAM::Processing::GetNOutPorts(), and CLAM::Processing::GetOutPort().
Referenced by CLAM::MonoOfflineNetworkPlayer::IsWorking(), CLAM::OfflineNetworkPlayer::IsWorking(), SourcesAndSinksToString(), CLAM::MonoOfflineNetworkPlayer::Start(), CLAM::OfflineNetworkPlayer::Start(), CLAM::PANetworkPlayer::Start(), and CLAM::JACKNetworkPlayer::Start().
|
inlineprotected |
Definition at line 103 of file NetworkPlayer.hxx.
References CLAM_ASSERT, and NULL.
Referenced by CLAM::JACKNetworkPlayer::Do(), CLAM::JACKNetworkPlayer::OnShutdown(), CLAM::MonoOfflineNetworkPlayer::ProcessInputFile(), CLAM::OfflineNetworkPlayer::ProcessInputFile(), CLAM::JACKNetworkPlayer::RegisterPorts(), CLAM::MonoOfflineNetworkPlayer::Start(), CLAM::OfflineNetworkPlayer::Start(), CLAM::JACKNetworkPlayer::Start(), and CLAM::JACKNetworkPlayer::Stop().
|
inlineprotected |
Definition at line 109 of file NetworkPlayer.hxx.
Referenced by CLAM::MonoOfflineNetworkPlayer::IsWorking(), CLAM::OfflineNetworkPlayer::IsWorking(), CLAM::OfflineNetworkPlayer::listOfSourcesSinksAndFiles(), CLAM::MonoOfflineNetworkPlayer::NonWorkingReason(), CLAM::OfflineNetworkPlayer::NonWorkingReason(), CLAM::JACKNetworkPlayer::RegisterOutputPorts(), CLAM::MonoOfflineNetworkPlayer::Start(), CLAM::OfflineNetworkPlayer::Start(), and CLAM::PANetworkPlayer::Start().
|
inlineprotected |
Definition at line 110 of file NetworkPlayer.hxx.
Referenced by CLAM::MonoOfflineNetworkPlayer::IsWorking(), CLAM::OfflineNetworkPlayer::IsWorking(), CLAM::OfflineNetworkPlayer::listOfSourcesSinksAndFiles(), CLAM::MonoOfflineNetworkPlayer::NonWorkingReason(), CLAM::OfflineNetworkPlayer::NonWorkingReason(), CLAM::JACKNetworkPlayer::RegisterInputPorts(), CLAM::MonoOfflineNetworkPlayer::Start(), CLAM::OfflineNetworkPlayer::Start(), and CLAM::PANetworkPlayer::Start().
|
inlinevirtual |
Redefine to add any initialization after being attached to a network TODO: Consider removing it as just Jack backend uses it but it is redundant.
Reimplemented in CLAM::JACKNetworkPlayer.
Definition at line 64 of file NetworkPlayer.hxx.
Referenced by CLAM::Network::SetPlayer().
|
inline |
Definition at line 85 of file NetworkPlayer.hxx.
References Paused.
Referenced by CLAM::JACKNetworkPlayer::Do(), CLAM::Network::IsPaused(), CLAM::PANetworkPlayer::Start(), and CLAM::JACKNetworkPlayer::Start().
|
inline |
Definition at line 87 of file NetworkPlayer.hxx.
References Playing.
Referenced by CLAM::Network::IsPlaying(), Pause(), CLAM::MonoOfflineNetworkPlayer::Start(), CLAM::OfflineNetworkPlayer::Start(), CLAM::PANetworkPlayer::Start(), and CLAM::JACKNetworkPlayer::Start().
|
pure virtual |
Implemented in CLAM::JACKNetworkPlayer, CLAM::PANetworkPlayer, CLAM::OfflineNetworkPlayer, and CLAM::MonoOfflineNetworkPlayer.
Referenced by CLAM::Network::IsRealTime().
|
inline |
Definition at line 86 of file NetworkPlayer.hxx.
References Stopped.
Referenced by CLAM::JACKNetworkPlayer::Do(), CLAM::Network::IsStopped(), CLAM::MonoOfflineNetworkPlayer::Stop(), CLAM::OfflineNetworkPlayer::Stop(), CLAM::PANetworkPlayer::Stop(), and CLAM::JACKNetworkPlayer::Stop().
|
pure virtual |
Should return true when the backend is able to run the network.
Implemented in CLAM::JACKNetworkPlayer, CLAM::PANetworkPlayer, CLAM::OfflineNetworkPlayer, and CLAM::MonoOfflineNetworkPlayer.
|
pure virtual |
Whenever the backend is not working, this method returns the reason.
Implemented in CLAM::JACKNetworkPlayer, CLAM::PANetworkPlayer, CLAM::OfflineNetworkPlayer, and CLAM::MonoOfflineNetworkPlayer.
|
inlinevirtual |
Definition at line 75 of file NetworkPlayer.hxx.
References BePaused(), and IsPlaying().
Referenced by CLAM::Network::Pause().
|
inline |
Definition at line 77 of file NetworkPlayer.hxx.
Referenced by CLAM::Network::SetPlayer().
Definition at line 49 of file NetworkPlayer.cxx.
Referenced by CLAM::JACKNetworkPlayer::CopySinksToJackBuffers(), CLAM::MonoOfflineNetworkPlayer::Start(), and CLAM::OfflineNetworkPlayer::Start().
Definition at line 56 of file NetworkPlayer.cxx.
Referenced by CLAM::JACKNetworkPlayer::RegisterOutputPorts().
|
protected |
Definition at line 42 of file NetworkPlayer.cxx.
Referenced by CLAM::JACKNetworkPlayer::CopyJackBuffersToSources(), CLAM::MonoOfflineNetworkPlayer::Start(), and CLAM::OfflineNetworkPlayer::Start().
Definition at line 63 of file NetworkPlayer.cxx.
Referenced by CLAM::JACKNetworkPlayer::RegisterInputPorts().
|
inlineprotected |
Definition at line 150 of file NetworkPlayer.hxx.
Referenced by CLAM::OfflineNetworkPlayer::listOfSourcesSinksAndFiles(), CLAM::JACKNetworkPlayer::RegisterOutputPorts(), SourcesAndSinksToString(), and CLAM::MonoOfflineNetworkPlayer::Start().
|
inlineprotected |
Definition at line 146 of file NetworkPlayer.hxx.
Referenced by CLAM::OfflineNetworkPlayer::listOfSourcesSinksAndFiles(), CLAM::JACKNetworkPlayer::RegisterInputPorts(), SourcesAndSinksToString(), and CLAM::MonoOfflineNetworkPlayer::Start().
std::string CLAM::NetworkPlayer::SourcesAndSinksToString | ( | ) |
Definition at line 31 of file NetworkPlayer.cxx.
References CacheSourcesAndSinks(), SinkName(), and SourceName().
|
pure virtual |
Redefine to make the backend ready to process and start the network. If IsPlaying() should do nothing. If it IsPaused() you should consider just call BePlaying() without starting the processings.
Implemented in CLAM::JACKNetworkPlayer, CLAM::PANetworkPlayer, CLAM::OfflineNetworkPlayer, and CLAM::MonoOfflineNetworkPlayer.
Referenced by CLAM::Network::Start().
|
pure virtual |
Redefine it to deactivate the backend.
Implemented in CLAM::JACKNetworkPlayer, CLAM::PANetworkPlayer, CLAM::OfflineNetworkPlayer, and CLAM::MonoOfflineNetworkPlayer.
Referenced by CLAM::Network::Stop().