Changeset 3576:6225aa407bf5 in roaraudio


Ignore:
Timestamp:
02/27/10 20:04:09 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

create a stream, this is still not working, but a start

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/beep.c

    r3573 r3576  
    2727 
    2828int beep_start (int client, struct roar_beep * beep) { 
    29  return -1; 
     29 struct roar_stream_server * ss; 
     30 struct roar_stream        *  s; 
     31 int stream; 
     32 
     33 if ( beep->vol  == 0 ) 
     34  beep->vol  = ROAR_BEEP_MAX_VOL; 
     35 
     36 if ( beep->time == 0 ) 
     37  beep->time = 512; // 512ms 
     38 
     39 if ( beep->freq == 0 ) 
     40  beep->freq = 440; 
     41 
     42 if ( beep->type == 0 ) 
     43  beep->type = ROAR_BEEP_TYPE_DEFAULT; 
     44 
     45 // x, y, z location '0' is allready centered. 
     46 
     47 // TODO: remove the following lions as soon as we support non zero values 
     48 if ( beep->z != 0 ) 
     49  return -1; 
     50 
     51 if ( beep->y != 0 ) 
     52  return -1; 
     53 
     54 if ( beep->x != 0 ) 
     55  return -1; 
     56 
     57 if ((stream = streams_new()) == -1 ) 
     58  return -1; 
     59 
     60 if ( client_stream_add(client, stream) == -1 ) { 
     61  streams_delete(stream); 
     62  return -1; 
     63 } 
     64 
     65 if ( streams_get(stream, &ss) == -1 ) { 
     66  streams_delete(stream); 
     67  return -1; 
     68 } 
     69 
     70 s = ROAR_STREAM(ss); 
     71 
     72 memcpy(&(s->info), g_sa, sizeof(s->info)); 
     73 
     74 s->info.channels = 1; 
     75 
     76 if ( streams_set_dir(stream, ROAR_DIR_PLAY, 1) == -1 ) { 
     77  streams_delete(stream); 
     78  return -1; 
     79 } 
     80 
     81 return stream; 
    3082} 
    3183 
Note: See TracChangeset for help on using the changeset viewer.