3. Node specific Parameters

In several cases you want to configure some node specific parameters like the location of a node. Thus, the clic syntax allows to set such parameters which are prefaced by the symbol '#' followed by a parameter which is identical to the corresponding C++ method. These parameters must be written after the node name and its jack tag. Currently the following parameter types are supported:

The rest of this section describes the usage of these parameters. For simplicity, the MP3 player example is used to describe this features.
MP3ReadNode ! MPEGAudioDecodeNode ! PlaybackNode
    

3.1. setLocation

The clic application normally requests a node from the local system, but the NMM framework allows transparent access to nodes distributed in a network. To support this feature in the clic-application, the location of a node inside the network can be specified with the parameter setLocation. Instead of requesting a node from the local system it is requested from the specified one. This is especially helpful if a resource intensive job, like video encoding, should be done on a powerful computer. To request a node from another host the application serverregistry must be running on this system. This parameter expects a single string as argument which specifies the hostname as seen in the following example.

% This graph description describes a simple MP3 player where the MP3ReadNode
% is running on host "server1". The serverregistry on host "server1" 
% is listening on port 22801.
% Use the -i option of clic to specify the MP3 file

MP3ReadNode         # setLocation("server1") !
MPEGAudioDecodeNode !
PlaybackNode
      
In this graph description the MP3ReadNode is not requested from the local system. Instead the node is requested from a serverregistry running on host "server1" which accepts incoming requests on port 22801. If the node can not be requested from this serverregistry the application terminates with a corresponding error message.

3.2. setPort

If the serverregistry application is listening on a different port for some reason, e.g. 3000, you can set it using the setPort parameter as seen in the following example.

% This graph description describes a simple MP3 player where the MP3ReadNode 
% is running on host "server1". The serverregistry on host "server1" is 
% listening on port 3000.
% Use the -i option of clic to specify the MP3 file

MP3ReadNode         # setLocation("server1") 
                    # setPort(3000) !
MPEGAudioDecodeNode !
PlaybackNode
      

3.3. setSharingType

NMM provides a service called Session Sharing which allows to share parts of a running flow graph between several applications. This is especially useful to use limited hardware devices, like TV cards, efficiently. So several user can share the same TV card, but use different displays in a different room to watch TV. In contrast to a streaming application each user is able to control all nodes of the entire flow graph. The following sharing types are supported:

If no sharing type is specified clic uses the sharing type EXCLUSIVE_OR_SHARED. The following example shows how to use this parameter.
% This graph description describes a simple MP3 player where the MP3ReadNode
% can be reused by other applications. The remaining nodes are exclusive and 
% can not be accessed by other applications. 
% Use the -i option of clic to specify the MP3 file

MP3ReadNode         # setSharingType(EXCLUSIVE_THEN_SHARED) !
MPEGAudioDecodeNode # setSharingType( EXCLUSIVE ) !
PlaybackNode        # setSharingType( EXCLUSIVE )
      
In this graph description the Node MP3ReadNode is declared as EXCLUSIVE_THEN_SHARED and the remaining nodes as EXCLUSIVE. So clic allows other applications to share the MP3ReadNode and to receive the same MP3 file, but the MPEGAudioDecodeNode and the PlaybackNode must not be shared. To access the MP3ReadNode and to listen to the same MP3 file the following graph description can be used.
% This graph description describes a simple MP3 player which requests an
% MP3ReadNode by an already running application. In this case no MP3 file 
% can be specified because it has been set by the running application.

MP3ReadNode         # setSharingType(SHARED) !
MPEGAudioDecodeNode !
PlaybackNode
     
In this graph description the Node MP3ReadNode is declared as SHARED. So this node will be used from another application that allows to share its MP3ReadNode. If no such node is available, clic prints a corresponding error message and exits.