00001 // 00002 // CSL interface and main() function for use with CRAM: the CREATE Real-time Applications Manager 00003 // See the copyright and acknowledgment of authors in the file COPYRIGHT 00004 // 00005 // The CSLService class is the wrapper used to manage CSL programs from CRAM. 00006 // This file has the main() function that starts any of a number of different CSL services under the control of CRAM. 00007 // 00008 // Usage: 00009 // CSL_Server service_name listener_port emergency_port CSL_function [-o UDP_IO-port] [-i RemoteFrameStream-in-IP/port] 00010 // The name and l/e port arguments are used by the CRAM management system 00011 // The CSL function is a string to select from the built-in play routines (see the list below) 00012 // Examples 00013 // CSL_Server CSL31 12345 12355 bells -- play bells sending sound out to the local server 00014 // CSL_Server CSL31 12345 12355 speakers -o 33123 -- play voices listening for client requests on port 33123 00015 // -- mix stereo sample streams from the two given servers 00016 // CSL_Server CSL31 12345 12355 mixer -i 128.111.92.51 12445 -i 128.111.92.60 12445 00017 // 00018 // The CSL_Function selects from the various available services: 00019 // bells texture of random FM bells 00020 // noise swept filtered noise 00021 // speakers phoneme streams 00022 // mixer 8-in 2-out network mixer 00023 // 00024 // The optional arguments 00025 // -o port-num -- for UDP_IO clients, to tell them their listener ports 00026 // -i client-IP client-port -- for processors, to identify their inputs 00027 // -a -- for auto-start (run stand-alone without waiting for CRAM start message) 00028 // 00029 // The mixer takes additional arguments to describe its clients 00030 // 00031 00032 #ifndef __CSL_CRAM_INCLUDE__ 00033 #define __CSL_CRAM_INCLUDE__ 00034 00035 #include "Server.h" 00036 #include <stdarg.h> // for va_arg, va_list, etc. 00037 00038 // Logger * mLogger; 00039 00040 namespace csl { 00041 00042 using namespace std; 00043 using namespace cram; 00044 00045 // The CSL CRAM Service class 00046 00047 class CSLService : public Server { 00048 00049 public: 00050 void start(void); // start method 00051 void stop(void); // stop method 00052 void suspend(void); // suspend method 00053 void resume(void); // resume method 00054 // set an option value 00055 void set_opt(const char * nam, const char * val); 00056 00057 // Constructors 00058 CSLService(char * name, unsigned short lport, unsigned short eport, char * which); 00059 ~CSLService(); 00060 00061 pthread_t mThread; // CSL test thread 00062 char * mWhich; // type of CSL service 00063 00064 }; 00065 00066 } 00067 00068 #endif 00069
1.4.5-20051010