Changeset 23:ef529a9bb70f in roaraudio
- Timestamp:
- 06/21/08 13:30:04 (16 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/commands.c
r17 r23 23 23 {ROAR_CMD_KICK, "KICK", req_on_kick}, 24 24 {ROAR_CMD_SET_VOL, "SET_VOL", req_on_set_vol}, 25 {ROAR_CMD_GET_VOL, "GET_VOL", req_on_get_vol}, 25 26 26 27 {ROAR_CMD_ADD_DATA, "ADD_DATA", req_on_add_data}, -
roard/req.c
r18 r23 306 306 } 307 307 308 int req_on_get_vol (int client, struct roar_message * mes, char * data) { 309 uint16_t * info = (uint16_t *) mes->data; 310 int stream; 311 struct roar_stream_server * s; 312 int i; 313 int chans; 314 315 ROAR_DBG("req_on_get_vol(*) = ?"); 316 ROAR_DBG("req_on_get_vol(*): mes->datalen=%i", mes->datalen); 317 318 if ( mes->datalen < (2*2) ) 319 return -1; 320 321 if ( info[0] != 0 ) // version 322 return -1; 323 324 stream = info[1]; 325 ROAR_DBG("req_on_get_vol(*): stream=%i", stream); 326 327 // TODO: change this code. 328 // we should not directly change the stream object but use some stream_*()-func 329 // for that job. 330 331 if ( stream < 0 || stream >= ROAR_STREAMS_MAX ) 332 return -1; 333 334 s = g_streams[stream]; 335 336 if ( s == NULL ) 337 return -1; 338 339 ROAR_DBG("req_on_get_vol(*): s=%p", s); 340 341 // ok, we have everything 342 343 info[0] = 0; 344 info[1] = chans = ROAR_STREAM(s)->info.channels; 345 346 for (i = 0; i < chans; i++) 347 info[2+i] = s->mixer.mixer[i]; 348 349 mes->datalen = (2 + chans)*2; 350 mes->cmd = ROAR_CMD_OK; 351 352 return 0; 353 } 354 308 355 int req_on_add_data (int client, struct roar_message * mes, char * data) { 309 356 struct roar_buffer * b;
Note: See TracChangeset
for help on using the changeset viewer.