CLAM::Network Class Reference

#include <Network.hxx>

List of all members.

Classes

struct  Connection
struct  Geometry
struct  ProcessingAndGeometry

Public Types

typedef std::list< std::string > NamesList
typedef std::map< std::string,
Processing * > 
ProcessingsMap
typedef std::list< InPortBase * > InPortsList
typedef std::vector< Processing * > Processings
typedef std::vector
< ControlSource * > 
ControlSources
typedef std::vector
< ControlSink * > 
ControlSinks
typedef std::vector
< InformationText * > 
InformationTexts
typedef std::map< std::string,
Geometry
ProcessingsGeometriesMap
typedef std::list< ConnectionConnectionsList
typedef std::set< std::string > NamesSet
typedef std::pair< bool,
std::string > 
ConnectionState
 Has true if ports have the old name AudioIn or AudioOut and which connections are broken.

Public Member Functions

 Network ()
virtual ~Network ()
const std::string & GetName () const
void SetName (const std::string &name)
const TextGetDescription () const
void SetDescription (const Text &description)
virtual const char * GetClassName () const
 Return the class name.
bool IsStopped () const
bool IsPlaying () const
bool IsPaused () const
bool IsRealTime () const
void Start ()
void Stop ()
void Pause ()
void Do ()
void AddFlowControl (FlowControl *)
 Gets the ownership of the FlowControl passed.
void Clear ()
void SetPlayer (NetworkPlayer *player)
 Set the object in charge of managing the processing thread.
unsigned BackendBufferSize ()
unsigned BackendSampleRate ()
virtual void StoreOn (Storage &storage) const
 serialization methods
virtual void LoadFrom (Storage &storage)
 Loads component's subitems from the given Storage.
bool UpdateSelections (const NamesList &processingsNamesList)
 methods related to copy&paste processings from canvas
void setPasteMode ()
bool SetProcessingsGeometries (const ProcessingsGeometriesMap &processingsGeometries)
 canvas related geometries
const ProcessingsGeometriesMap GetAndClearGeometries ()
const Geometry findProcessingGeometry (Processing *) const
 audio sources and sinks and control sources and sinks order
const Processings getOrderedProcessings (const std::string &type, bool horizontalOrder) const
const Processings getOrderedProcessingsByAttribute (const std::string &attribute, bool horizontalOrder=false) const
const ControlSinks getOrderedControlSinks () const
const ControlSources getOrderedControlSources () const
bool ConnectPorts (const std::string &, const std::string &)
 methods related to connect/disconnect interface
bool ConnectControls (const std::string &, const std::string &)
bool DisconnectPorts (const std::string &, const std::string &)
bool DisconnectControls (const std::string &, const std::string &)
ProcessingGetProcessing (const std::string &name) const
 methods used to create processings and get them
void AddProcessing (const std::string &name, Processing *processing, const ProcessingConfig *config=0)
 add method using a pointer to a new processing
ProcessingAddProcessing (const std::string &name, const std::string &key)
 add method using a key to get the new processing from factory
std::string AddProcessing (const std::string &key)
std::string GetUnusedName (const std::string &prefix, const bool cutOnLastSeparator=false, const std::string separator="_") const
void RemoveProcessing (const std::string &)
bool HasProcessing (const std::string &name) const
bool ConfigureProcessing (const std::string &, const ProcessingConfig &)
 It configures the processing with the given processing id and config object and notifies this to the network.
void ReconfigureAllProcessings ()
 Calls Configure() for each processing with its current configuration.
bool RenameProcessing (const std::string &oldName, const std::string &newName)
const std::string & GetNetworkId (const Processing *proc) const
ProcessingsMap::iterator BeginProcessings ()
ProcessingsMap::iterator EndProcessings ()
ProcessingsMap::const_iterator BeginProcessings () const
ProcessingsMap::const_iterator EndProcessings () const
void addInformationText (InformationText *informationText)
void removeInformationText (InformationText *informationText)
InformationTexts::iterator BeginInformationTexts ()
InformationTexts::iterator EndInformationTexts ()
InformationTexts::const_iterator BeginInformationTexts () const
InformationTexts::const_iterator EndInformationTexts () const
InPortBaseGetInPortByCompleteName (const std::string &) const
OutPortBaseGetOutPortByCompleteName (const std::string &) const
InControlBaseGetInControlByCompleteName (const std::string &) const
OutControlBaseGetOutControlByCompleteName (const std::string &) const
NamesList GetInPortsConnectedTo (const std::string &) const
NamesList GetInControlsConnectedTo (const std::string &) const
InPortsList GetInPortsConnectedTo (OutPortBase &) const
std::string GetConnectorIdentifier (const std::string &) const
std::string GetProcessingIdentifier (const std::string &) const
bool IsReady () const
 Tells whether the network is ready to rock.
bool IsEmpty () const
 Returns true when it has no processings.
bool HasMisconfiguredProcessings () const
 Returns true when some processing is misconfigured.
bool HasUnconnectedInPorts () const
 Returns true when a processing has an inport that is not connected.
bool HasSyncSource () const
 Tell whether the network contains any processing which limits the cpu usage such as file or device interfaces.
bool SupportsVariableAudioSize () const
 This method reports whether the network supports dynamic buffer-size host.
std::string GetConfigurationErrors () const
 Returns an string containing configuration errors.
std::string GetUnconnectedInPorts () const
 Returns an string the full name of the unconnected inports.
ConnectionState GetConnectionReport () const
void ResetConnectionReport ()

Static Public Member Functions

static const bool compareGeometriesUpperYThan (ProcessingAndGeometry &, ProcessingAndGeometry &)
static const bool compareGeometriesUpperXThan (ProcessingAndGeometry &, ProcessingAndGeometry &)

Static Protected Member Functions

static std::size_t PositionOfLastIdentifier (const std::string &str)
static std::size_t PositionOfProcessingIdentifier (const std::string &str)
static char NamesIdentifiersSeparator ()

Detailed Description

Definition at line 54 of file Network.hxx.


Member Typedef Documentation

Definition at line 73 of file Network.hxx.

typedef std::pair<bool, std::string> CLAM::Network::ConnectionState

Has true if ports have the old name AudioIn or AudioOut and which connections are broken.

Definition at line 226 of file Network.hxx.

Definition at line 65 of file Network.hxx.

Definition at line 64 of file Network.hxx.

Definition at line 67 of file Network.hxx.

typedef std::list<InPortBase *> CLAM::Network::InPortsList

Definition at line 61 of file Network.hxx.

typedef std::list<std::string> CLAM::Network::NamesList

Definition at line 59 of file Network.hxx.

typedef std::set<std::string> CLAM::Network::NamesSet

Definition at line 75 of file Network.hxx.

typedef std::vector<Processing*> CLAM::Network::Processings

Definition at line 63 of file Network.hxx.

typedef std::map<std::string, Geometry> CLAM::Network::ProcessingsGeometriesMap

Definition at line 71 of file Network.hxx.

typedef std::map<std::string, Processing* > CLAM::Network::ProcessingsMap

Definition at line 60 of file Network.hxx.


Constructor & Destructor Documentation

CLAM::Network::Network (  ) 

Definition at line 29 of file Network.cxx.

Referenced by StoreOn().

CLAM::Network::~Network (  )  [virtual]

Definition at line 36 of file Network.cxx.

Referenced by StoreOn().


Member Function Documentation

void CLAM::Network::AddFlowControl ( FlowControl flowControl  ) 

Gets the ownership of the FlowControl passed.

So it will be deleted by the destructor

Definition at line 450 of file Network.cxx.

void CLAM::Network::addInformationText ( InformationText informationText  ) 

Definition at line 790 of file Network.cxx.

std::string CLAM::Network::AddProcessing ( const std::string &  key  ) 

Definition at line 503 of file Network.cxx.

Processing & CLAM::Network::AddProcessing ( const std::string &  name,
const std::string &  key 
)

add method using a key to get the new processing from factory

Definition at line 495 of file Network.cxx.

void CLAM::Network::AddProcessing ( const std::string &  name,
Processing processing,
const ProcessingConfig config = 0 
)

add method using a pointer to a new processing

Definition at line 484 of file Network.cxx.

unsigned CLAM::Network::BackendBufferSize (  ) 

Definition at line 463 of file Network.cxx.

unsigned CLAM::Network::BackendSampleRate (  ) 

Definition at line 468 of file Network.cxx.

References CLAM::FlowControl::AttachToNetwork().

Network::InformationTexts::const_iterator CLAM::Network::BeginInformationTexts (  )  const

Definition at line 815 of file Network.cxx.

Network::InformationTexts::iterator CLAM::Network::BeginInformationTexts (  ) 

Definition at line 805 of file Network.cxx.

Network::ProcessingsMap::const_iterator CLAM::Network::BeginProcessings (  )  const

Definition at line 778 of file Network.cxx.

Network::ProcessingsMap::iterator CLAM::Network::BeginProcessings (  ) 

Definition at line 769 of file Network.cxx.

References IsStopped(), and Stop().

Referenced by Clear(), HasSyncSource(), and StoreOn().

void CLAM::Network::Clear (  ) 

Definition at line 753 of file Network.cxx.

References BeginProcessings(), EndProcessings(), and CLAM::NetworkPlayer::Stop().

Referenced by StoreOn().

const bool CLAM::Network::compareGeometriesUpperXThan ( ProcessingAndGeometry arg1,
ProcessingAndGeometry arg2 
) [static]

Definition at line 416 of file Network.cxx.

const bool CLAM::Network::compareGeometriesUpperYThan ( ProcessingAndGeometry arg1,
ProcessingAndGeometry arg2 
) [static]

Definition at line 411 of file Network.cxx.

bool CLAM::Network::ConfigureProcessing ( const std::string &  name,
const ProcessingConfig newConfig 
)

It configures the processing with the given processing id and config object and notifies this to the network.

So use this method instead of getting the processing with GetProcessing and calling Configure on it.

Definition at line 558 of file Network.cxx.

bool CLAM::Network::ConnectControls ( const std::string &  producer,
const std::string &  consumer 
)

Definition at line 601 of file Network.cxx.

bool CLAM::Network::ConnectPorts ( const std::string &  producer,
const std::string &  consumer 
)

methods related to connect/disconnect interface

Definition at line 579 of file Network.cxx.

bool CLAM::Network::DisconnectControls ( const std::string &  producer,
const std::string &  consumer 
)
bool CLAM::Network::DisconnectPorts ( const std::string &  producer,
const std::string &  consumer 
)
void CLAM::Network::Do ( void   ) 
Network::InformationTexts::const_iterator CLAM::Network::EndInformationTexts (  )  const

Definition at line 820 of file Network.cxx.

Network::InformationTexts::iterator CLAM::Network::EndInformationTexts (  ) 

Definition at line 810 of file Network.cxx.

Network::ProcessingsMap::const_iterator CLAM::Network::EndProcessings (  )  const

Definition at line 783 of file Network.cxx.

Network::ProcessingsMap::iterator CLAM::Network::EndProcessings (  ) 

Definition at line 774 of file Network.cxx.

References RemoveProcessing().

Referenced by Clear(), HasSyncSource(), and StoreOn().

const Network::Geometry CLAM::Network::findProcessingGeometry ( Processing processing  )  const

audio sources and sinks and control sources and sinks order

Definition at line 275 of file Network.cxx.

const Network::ProcessingsGeometriesMap CLAM::Network::GetAndClearGeometries (  ) 

Definition at line 404 of file Network.cxx.

virtual const char* CLAM::Network::GetClassName (  )  const [inline, virtual]

Return the class name.

Implements CLAM::Component.

Definition at line 88 of file Network.hxx.

std::string CLAM::Network::GetConfigurationErrors (  )  const

Returns an string containing configuration errors.

Don't rely on the format because is subject to change.

Definition at line 968 of file Network.cxx.

Network::ConnectionState CLAM::Network::GetConnectionReport (  )  const

Definition at line 1001 of file Network.cxx.

std::string CLAM::Network::GetConnectorIdentifier ( const std::string &  str  )  const

Definition at line 649 of file Network.cxx.

Referenced by GetOutControlByCompleteName(), and IsStopped().

const Text& CLAM::Network::GetDescription (  )  const [inline]

Definition at line 85 of file Network.hxx.

InControlBase & CLAM::Network::GetInControlByCompleteName ( const std::string &  name  )  const

Definition at line 672 of file Network.cxx.

References PositionOfLastIdentifier(), and PositionOfProcessingIdentifier().

Referenced by DisconnectPorts().

Network::NamesList CLAM::Network::GetInControlsConnectedTo ( const std::string &  producer  )  const

Definition at line 845 of file Network.cxx.

Referenced by StoreOn().

InPortBase & CLAM::Network::GetInPortByCompleteName ( const std::string &  name  )  const

Definition at line 660 of file Network.cxx.

Referenced by DisconnectControls().

Network::InPortsList CLAM::Network::GetInPortsConnectedTo ( OutPortBase producer  )  const
Network::NamesList CLAM::Network::GetInPortsConnectedTo ( const std::string &  producer  )  const

Definition at line 826 of file Network.cxx.

Referenced by StoreOn().

const std::string& CLAM::Network::GetName (  )  const [inline]

Definition at line 82 of file Network.hxx.

const std::string & CLAM::Network::GetNetworkId ( const Processing proc  )  const

Definition at line 872 of file Network.cxx.

Referenced by CLAM::NetworkPlayer::CacheSourcesAndSinks().

const Network::ControlSinks CLAM::Network::getOrderedControlSinks (  )  const

Definition at line 339 of file Network.cxx.

const Network::ControlSources CLAM::Network::getOrderedControlSources (  )  const

Definition at line 367 of file Network.cxx.

const Network::Processings CLAM::Network::getOrderedProcessings ( const std::string &  type,
bool  horizontalOrder 
) const

Definition at line 287 of file Network.cxx.

const Network::Processings CLAM::Network::getOrderedProcessingsByAttribute ( const std::string &  attribute,
bool  horizontalOrder = false 
) const

Definition at line 313 of file Network.cxx.

OutControlBase & CLAM::Network::GetOutControlByCompleteName ( const std::string &  name  )  const
OutPortBase & CLAM::Network::GetOutPortByCompleteName ( const std::string &  name  )  const

Definition at line 666 of file Network.cxx.

References PositionOfLastIdentifier().

Referenced by DisconnectControls().

Processing & CLAM::Network::GetProcessing ( const std::string &  name  )  const

methods used to create processings and get them

Definition at line 475 of file Network.cxx.

Referenced by GetOutControlByCompleteName(), and IsStopped().

std::string CLAM::Network::GetProcessingIdentifier ( const std::string &  str  )  const

Definition at line 654 of file Network.cxx.

Referenced by GetOutControlByCompleteName(), IsStopped(), and StoreOn().

std::string CLAM::Network::GetUnconnectedInPorts (  )  const

Returns an string the full name of the unconnected inports.

Don't rely on the format because is subject to change.

Definition at line 932 of file Network.cxx.

std::string CLAM::Network::GetUnusedName ( const std::string &  prefix,
const bool  cutOnLastSeparator = false,
const std::string  separator = "_" 
) const

Definition at line 510 of file Network.cxx.

bool CLAM::Network::HasMisconfiguredProcessings (  )  const

Returns true when some processing is misconfigured.

Definition at line 908 of file Network.cxx.

bool CLAM::Network::HasProcessing ( const std::string &  name  )  const

Definition at line 552 of file Network.cxx.

bool CLAM::Network::HasSyncSource (  )  const

Tell whether the network contains any processing which limits the cpu usage such as file or device interfaces.

This is needed when executing a network in a real time process.

Definition at line 949 of file Network.cxx.

References BeginProcessings(), EndProcessings(), and CLAM::Processing::GetNInPorts().

bool CLAM::Network::HasUnconnectedInPorts (  )  const

Returns true when a processing has an inport that is not connected.

Definition at line 917 of file Network.cxx.

bool CLAM::Network::IsEmpty (  )  const

Returns true when it has no processings.

Definition at line 903 of file Network.cxx.

bool CLAM::Network::IsPaused (  )  const

Definition at line 698 of file Network.cxx.

bool CLAM::Network::IsPlaying (  )  const

Definition at line 691 of file Network.cxx.

bool CLAM::Network::IsReady (  )  const

Tells whether the network is ready to rock.

A network is ready when:

  • it contains any processing,
  • all processings are properly configured, and
  • all in ports are connected,

Definition at line 895 of file Network.cxx.

bool CLAM::Network::IsRealTime (  )  const

Definition at line 705 of file Network.cxx.

bool CLAM::Network::IsStopped (  )  const
void CLAM::Network::LoadFrom ( Storage storage  )  [virtual]

Loads component's subitems from the given Storage.

Parameters:
storage The given storage where the subitem will be loaded from
See also:
Storage

Implements CLAM::Component.

Definition at line 155 of file Network.cxx.

static char CLAM::Network::NamesIdentifiersSeparator (  )  [inline, static, protected]

Definition at line 263 of file Network.hxx.

Referenced by PositionOfLastIdentifier(), and PositionOfProcessingIdentifier().

void CLAM::Network::Pause (  ) 

Definition at line 743 of file Network.cxx.

static std::size_t CLAM::Network::PositionOfLastIdentifier ( const std::string &  str  )  [inline, static, protected]
static std::size_t CLAM::Network::PositionOfProcessingIdentifier ( const std::string &  str  )  [inline, static, protected]

Definition at line 257 of file Network.hxx.

References NamesIdentifiersSeparator(), and PositionOfLastIdentifier().

Referenced by GetInControlByCompleteName().

void CLAM::Network::ReconfigureAllProcessings (  ) 

Calls Configure() for each processing with its current configuration.

Definition at line 569 of file Network.cxx.

void CLAM::Network::removeInformationText ( InformationText informationText  ) 

Definition at line 795 of file Network.cxx.

void CLAM::Network::RemoveProcessing ( const std::string &  name  ) 

Definition at line 532 of file Network.cxx.

Referenced by EndProcessings().

bool CLAM::Network::RenameProcessing ( const std::string &  oldName,
const std::string &  newName 
)

Definition at line 883 of file Network.cxx.

void CLAM::Network::ResetConnectionReport (  ) 

Definition at line 1010 of file Network.cxx.

void CLAM::Network::SetDescription ( const Text description  )  [inline]

Definition at line 86 of file Network.hxx.

void CLAM::Network::SetName ( const std::string &  name  )  [inline]

Definition at line 83 of file Network.hxx.

void CLAM::Network::setPasteMode (  )  [inline]

Definition at line 116 of file Network.hxx.

void CLAM::Network::SetPlayer ( NetworkPlayer player  ) 

Set the object in charge of managing the processing thread.

Receives property of the player.

Definition at line 456 of file Network.cxx.

bool CLAM::Network::SetProcessingsGeometries ( const ProcessingsGeometriesMap processingsGeometries  ) 

canvas related geometries

Definition at line 395 of file Network.cxx.

void CLAM::Network::Start (  ) 

Definition at line 712 of file Network.cxx.

void CLAM::Network::Stop (  ) 

Definition at line 735 of file Network.cxx.

Referenced by BeginProcessings(), DisconnectControls(), and DisconnectPorts().

void CLAM::Network::StoreOn ( Storage storage  )  const [virtual]
bool CLAM::Network::SupportsVariableAudioSize (  )  const

This method reports whether the network supports dynamic buffer-size host.

Definition at line 958 of file Network.cxx.

bool CLAM::Network::UpdateSelections ( const NamesList processingsNamesList  ) 

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