CLAM::NetworkPlayer Class Reference

A NetworkPlayer is an object that controls the playback of a Network providing a high level transport like interface. More...

#include <NetworkPlayer.hxx>

List of all members.

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

NetworkGetNetwork ()
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)

Detailed Description

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.


Member Enumeration Documentation

enum CLAM::NetworkPlayer::Status [protected]
Enumerator:
Playing 
Stopped 
Paused 

Definition at line 43 of file NetworkPlayer.hxx.


Constructor & Destructor Documentation

CLAM::NetworkPlayer::NetworkPlayer (  )  [inline]

Definition at line 46 of file NetworkPlayer.hxx.

virtual CLAM::NetworkPlayer::~NetworkPlayer (  )  [inline, virtual]

Definition at line 52 of file NetworkPlayer.hxx.


Member Function Documentation

virtual unsigned CLAM::NetworkPlayer::BackendBufferSize (  )  [inline, virtual]

Reimplemented in CLAM::JACKNetworkPlayer.

Definition at line 90 of file NetworkPlayer.hxx.

virtual unsigned CLAM::NetworkPlayer::BackendSampleRate (  )  [inline, virtual]

Reimplemented in CLAM::JACKNetworkPlayer.

Definition at line 95 of file NetworkPlayer.hxx.

void CLAM::NetworkPlayer::BePaused (  )  [inline]

Definition at line 82 of file NetworkPlayer.hxx.

References Paused.

Referenced by Pause().

void CLAM::NetworkPlayer::BePlaying (  )  [inline]

Definition at line 84 of file NetworkPlayer.hxx.

References Playing.

void CLAM::NetworkPlayer::BeStopped (  )  [inline]

Definition at line 83 of file NetworkPlayer.hxx.

References Stopped.

Referenced by CLAM::OfflineNetworkPlayer::ProcessInputFile().

void CLAM::NetworkPlayer::CacheSourcesAndSinks (  )  [inline, protected]
Network& CLAM::NetworkPlayer::GetNetwork (  )  [inline, protected]
unsigned CLAM::NetworkPlayer::GetNSinks (  )  const [inline, protected]
unsigned CLAM::NetworkPlayer::GetNSources (  )  const [inline, protected]
virtual void CLAM::NetworkPlayer::Init (  )  [inline, virtual]

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.

bool CLAM::NetworkPlayer::IsPaused (  )  const [inline]

Definition at line 85 of file NetworkPlayer.hxx.

References Paused.

bool CLAM::NetworkPlayer::IsPlaying (  )  const [inline]

Definition at line 87 of file NetworkPlayer.hxx.

References Playing.

Referenced by Pause().

virtual bool CLAM::NetworkPlayer::IsRealTime (  )  const [pure virtual]
bool CLAM::NetworkPlayer::IsStopped (  )  const [inline]

Definition at line 86 of file NetworkPlayer.hxx.

References Stopped.

Referenced by CLAM::OfflineNetworkPlayer::ProcessInputFile().

virtual bool CLAM::NetworkPlayer::IsWorking (  )  [pure virtual]

Should return true when the backend is able to run the network.

Implemented in CLAM::JACKNetworkPlayer, CLAM::MonoOfflineNetworkPlayer, CLAM::OfflineNetworkPlayer, and CLAM::PANetworkPlayer.

virtual std::string CLAM::NetworkPlayer::NonWorkingReason (  )  [pure virtual]

Whenever the backend is not working, this method returns the reason.

Implemented in CLAM::JACKNetworkPlayer, CLAM::MonoOfflineNetworkPlayer, CLAM::OfflineNetworkPlayer, and CLAM::PANetworkPlayer.

virtual void CLAM::NetworkPlayer::Pause (  )  [inline, virtual]

Definition at line 75 of file NetworkPlayer.hxx.

References BePaused(), and IsPlaying().

void CLAM::NetworkPlayer::SetNetworkBackLink ( Network net  )  [inline]

Definition at line 77 of file NetworkPlayer.hxx.

void CLAM::NetworkPlayer::SetSinkBuffer ( unsigned  sink,
float *  data,
unsigned  nframes 
) [protected]

Definition at line 49 of file NetworkPlayer.cxx.

Referenced by CLAM::JACKNetworkPlayer::BlankJackBuffers().

void CLAM::NetworkPlayer::SetSinkFrameSize ( unsigned  sink,
unsigned  frameSize 
) [protected]

Definition at line 56 of file NetworkPlayer.cxx.

void CLAM::NetworkPlayer::SetSourceBuffer ( unsigned  source,
const float *  data,
unsigned  nframes 
) [protected]

Definition at line 42 of file NetworkPlayer.cxx.

Referenced by CLAM::JACKNetworkPlayer::CopySinksToJackBuffers().

void CLAM::NetworkPlayer::SetSourceFrameSize ( unsigned  source,
unsigned  frameSize 
) [protected]

Definition at line 63 of file NetworkPlayer.cxx.

const std::string& CLAM::NetworkPlayer::SinkName ( unsigned  sink  )  const [inline, protected]

Definition at line 150 of file NetworkPlayer.hxx.

Referenced by SourcesAndSinksToString().

const std::string& CLAM::NetworkPlayer::SourceName ( unsigned  source  )  const [inline, protected]

Definition at line 146 of file NetworkPlayer.hxx.

Referenced by SourcesAndSinksToString().

std::string CLAM::NetworkPlayer::SourcesAndSinksToString (  ) 

Definition at line 31 of file NetworkPlayer.cxx.

References CacheSourcesAndSinks(), SinkName(), and SourceName().

virtual void CLAM::NetworkPlayer::Start (  )  [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::MonoOfflineNetworkPlayer, CLAM::OfflineNetworkPlayer, and CLAM::PANetworkPlayer.

virtual void CLAM::NetworkPlayer::Stop (  )  [pure virtual]

Redefine it to deactivate the backend.

Implemented in CLAM::JACKNetworkPlayer, CLAM::MonoOfflineNetworkPlayer, CLAM::OfflineNetworkPlayer, and CLAM::PANetworkPlayer.

Referenced by CLAM::Network::Clear().


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.3