Changeset 5226:3cb3cab29e5e in roaraudio
- Timestamp:
- 11/12/11 13:20:14 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/simple.h
r5225 r5226 42 42 int roar_simple_connect2(struct roar_connection * con, const char * server, const char * name, int flags, uint_least32_t timeout); 43 43 44 int roar_simple_stream (int rate, int channels, int bits, int codec, const char * server, int dir, const char * name) _LIBROAR_ATTR_DEPRECATED;45 44 int roar_simple_stream_obj (struct roar_stream * s, int rate, int channels, int bits, int codec, const char * server, int dir, const char * name) _LIBROAR_ATTR_DEPRECATED; 46 45 47 46 int roar_simple_new_stream_attachexeced_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir); 48 47 49 int roar_simple_new_stream (struct roar_connection * con, int rate, int channels, int bits, int codec, int dir) _LIBROAR_ATTR_DEPRECATED;50 48 int roar_simple_new_stream_obj (struct roar_connection * con, struct roar_stream * s, int rate, int channels, int bits, int codec, int dir) _LIBROAR_ATTR_DEPRECATED; 51 49 52 50 int roar_simple_play_file(const char * file, const char * server, const char * name); 53 51 54 int roar_simple_play (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED;55 int roar_simple_monitor (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED;56 int roar_simple_record (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED;57 int roar_simple_filter (int rate, int channels, int bits, int codec, char * server, char * name) _LIBROAR_ATTR_DEPRECATED;58 59 52 int roar_simple_connect_virtual(struct roar_connection * con, struct roar_stream * s, int parent, int dir); 60 61 int roar_simple_close(int fh) _LIBROAR_ATTR_DEPRECATED;62 63 int roar_simple_get_standby (int fh) _LIBROAR_ATTR_DEPRECATED;64 53 65 54 #endif -
libroar/simple.c
r5225 r5226 62 62 } 63 63 64 int roar_simple_stream(int rate, int channels, int bits, int codec, const char * server, int dir, const char * name) {65 struct roar_stream s;66 67 roar_debug_warn_sysio("roar_simple_stream", "roar_vio_simple_stream", NULL);68 69 return roar_simple_stream_obj(&s, rate, channels, bits, codec, server, dir, name);70 }71 72 64 int roar_simple_stream_obj (struct roar_stream * s, int rate, int channels, int bits, int codec, const char * server, int dir, const char * name) { 73 65 struct roar_connection con; … … 78 70 79 71 if ( roar_simple_connect(&con, server, name) == -1 ) { 80 ROAR_DBG("roar_simple_ play(*): roar_simple_connect() faild!");81 ROAR_ERR("roar_simple_stream (*): Can not connect to server");72 ROAR_DBG("roar_simple_stream_obj(*): roar_simple_connect() faild!"); 73 ROAR_ERR("roar_simple_stream_obj(*): Can not connect to server"); 82 74 return -1; 83 75 } … … 140 132 141 133 return fh; 142 }143 144 int roar_simple_new_stream (struct roar_connection * con, int rate, int channels, int bits, int codec, int dir) {145 struct roar_stream s;146 int ret;147 148 roar_debug_warn_sysio("roar_simple_new_stream", "roar_vio_simple_new_stream_obj", NULL);149 150 roar_libroar_nowarn();151 ret = roar_simple_new_stream_obj(con, &s, rate, channels, bits, codec, dir);152 roar_libroar_warn();153 154 return ret;155 134 } 156 135 … … 421 400 } 422 401 423 int roar_simple_play(int rate, int channels, int bits, int codec, char * server, char * name) {424 roar_debug_warn_sysio("roar_simple_play", "roar_vio_simple_stream", NULL);425 426 return roar_simple_stream(rate, channels, bits, codec, server, ROAR_DIR_PLAY, name);427 }428 429 int roar_simple_monitor(int rate, int channels, int bits, int codec, char * server, char * name) {430 roar_debug_warn_sysio("roar_simple_monitor", "roar_vio_simple_stream", NULL);431 432 return roar_simple_stream(rate, channels, bits, codec, server, ROAR_DIR_MONITOR, name);433 }434 435 int roar_simple_record(int rate, int channels, int bits, int codec, char * server, char * name) {436 roar_debug_warn_sysio("roar_simple_record", "roar_vio_simple_stream", NULL);437 438 return roar_simple_stream(rate, channels, bits, codec, server, ROAR_DIR_RECORD, name);439 }440 441 int roar_simple_filter(int rate, int channels, int bits, int codec, char * server, char * name) {442 roar_debug_warn_sysio("roar_simple_filter", "roar_vio_simple_stream", NULL);443 444 return roar_simple_stream(rate, channels, bits, codec, server, ROAR_DIR_FILTER, name);445 }446 447 402 int roar_simple_connect_virtual(struct roar_connection * con, struct roar_stream * s, int parent, int dir) { 448 403 struct roar_stream parent_stream; … … 473 428 } 474 429 475 int roar_simple_close(int fh) {476 roar_debug_warn_sysio("roar_simple_close", "roar_vio_close", NULL);477 478 #ifdef ROAR_TARGET_WIN32479 closesocket(fh);480 return 0;481 #else482 483 #ifdef ROAR_HAVE_IO_POSIX484 return close(fh);485 #else486 return -1;487 #endif488 489 #endif490 }491 492 int roar_simple_get_standby (int fh) {493 struct roar_connection con;494 495 roar_debug_warn_sysio("roar_simple_get_standby", "roar_get_standby", NULL);496 497 if ( roar_connect_fh(&con, fh) == -1 )498 return -1;499 500 return roar_get_standby(&con);501 }502 503 430 //ll -
libroaresd/esdbasic.c
r4708 r5226 71 71 /* closes fd, previously obtained by esd_open */ 72 72 int esd_close( int esd ) { 73 return roar_simple_close(esd); 73 struct roar_vio_calls vio; 74 75 if ( roar_vio_open_fh_socket(&vio, esd) == -1 ) { 76 roar_err_update(); 77 return -1; 78 } 79 80 if ( roar_vio_close(&vio) == -1 ) { 81 roar_err_update(); 82 return -1; 83 } 84 85 return 0; 74 86 } 75 87 -
libroaresd/esdctl.c
r4975 r5226 367 367 /* see if the server is in stnaby, autostandby, etc */ 368 368 esd_standby_mode_t esd_get_standby_mode( int esd ) { 369 return roar_simple_get_standby(esd); 369 struct roar_connection con; 370 371 if ( roar_connect_fh(&con, esd) == -1 ) 372 return -1; 373 374 return roar_get_standby(&con); 370 375 } 371 376 -
libroaresd/esdstream.c
r4978 r5226 50 50 /* open a socket for playing, monitoring, or recording as a stream */ 51 51 /* the *_fallback functions try to open /dev/dsp if there's no EsounD */ 52 int esd_play_stream( esd_format_t format, int rate, 53 const char *host, const char *name) {52 53 static int libroaresd_stream(esd_format_t format, int rate, const char *host, const char *name, int dir) { 54 54 int channels; 55 55 int bits; 56 56 int codec = ROAR_CODEC_DEFAULT; 57 struct roar_stream s; 57 58 58 59 if ( (format & ESD_BITS16) ) { … … 69 70 } 70 71 71 return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_PLAY, (char*) name); 72 return roar_simple_stream_obj(&s, rate, channels, bits, codec, (char*)host, dir, (char*)name); 73 } 74 75 int esd_play_stream( esd_format_t format, int rate, 76 const char *host, const char *name ) { 77 return libroaresd_stream(format, rate, host, name, ROAR_DIR_PLAY); 72 78 } 73 79 … … 87 93 int esd_monitor_stream( esd_format_t format, int rate, 88 94 const char *host, const char *name ) { 89 int channels; 90 int bits; 91 int codec = ROAR_CODEC_DEFAULT; 92 93 ROAR_DBG("esd_monitor_stream(format=%x, rate=%i, host='%s', name='%s') = ?", format, rate, host, name); 94 95 if ( (format & ESD_BITS16) ) { 96 bits = 16; 97 } else { 98 bits = 8; 99 codec = CODEC_DEF_8BIT; 100 } 101 102 if ( (format & ESD_MONO) ) { 103 channels = 1; 104 } else { 105 channels = 2; 106 } 107 108 return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_MONITOR, (char*)name); 95 return libroaresd_stream(format, rate, host, name, ROAR_DIR_MONITOR); 109 96 } 110 97 /* int esd_monitor_stream_fallback( esd_format_t format, int rate ); */ 111 98 int esd_record_stream( esd_format_t format, int rate, 112 99 const char *host, const char *name ) { 113 int channels; 114 int bits; 115 int codec = ROAR_CODEC_DEFAULT; 116 117 ROAR_DBG("esd_record_stream(format=%x, rate=%i, host='%s', name='%s') = ?", format, rate, host, name); 118 119 if ( (format & ESD_BITS16) ) { 120 bits = 16; 121 } else { 122 bits = 8; 123 codec = CODEC_DEF_8BIT; 124 } 125 126 if ( (format & ESD_MONO) ) { 127 channels = 1; 128 } else { 129 channels = 2; 130 } 131 132 return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_RECORD, (char*)name); 100 return libroaresd_stream(format, rate, host, name, ROAR_DIR_RECORD); 133 101 } 134 102 int esd_record_stream_fallback( esd_format_t format, int rate, … … 144 112 int esd_filter_stream( esd_format_t format, int rate, 145 113 const char *host, const char *name ) { 146 int channels; 147 int bits; 148 int codec = ROAR_CODEC_DEFAULT; 149 150 if ( (format & ESD_BITS16) ) { 151 bits = 16; 152 } else { 153 bits = 8; 154 codec = CODEC_DEF_8BIT; 155 } 156 157 if ( (format & ESD_MONO) ) { 158 channels = 1; 159 } else { 160 channels = 2; 161 } 162 163 return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_FILTER, (char*)name); 114 return libroaresd_stream(format, rate, host, name, ROAR_DIR_FILTER); 164 115 } 165 116 -
roarclients/.release-helper
r5223 r5226 1 1 #!RELEASE-HELPER:0.0beta0 2 2 @RM roarcatsendfile.c 3 @RM roarcat2sock.c 3 4 #!END -
roarclients/Makefile
r5223 r5226 9 9 10 10 #TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest 11 #TARGETS_OLD=roarcatad roarcat 2sock roarcatpassfh roarsocktypes11 #TARGETS_OLD=roarcatad roarcatpassfh roarsocktypes 12 12 13 13 TARGETS=$(TARGETS_IO) $(TARGETS_CTL) $(TARGETS_DSP) $(TARGETS_MISC) $(TARGETS_DEVEL) $(TARGETS_EXAMPLE) $(TARGETS_M) $(TARGETS_VIO)
Note: See TracChangeset
for help on using the changeset viewer.