Changeset 17:411717cefded in roaraudio for libroar/ctl.c


Ignore:
Timestamp:
06/19/08 22:51:13 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

now we can change the volume, but it will not work if you set it... haha...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/ctl.c

    r0 r17  
    117117int roar_kick         (struct roar_connection * con, int type, int id) { 
    118118 struct roar_message m; 
    119  uint16_t * info = m.data; 
     119 uint16_t * info = (uint16_t *) m.data; 
    120120 
    121121 m.cmd     = ROAR_CMD_KICK; 
     
    123123 info[0] = type; 
    124124 info[1] = id; 
     125 
     126 if ( roar_req(con, &m, NULL) == -1 ) 
     127  return -1; 
     128 
     129 if ( m.cmd != ROAR_CMD_OK ) 
     130  return -1; 
     131 
     132 return 0; 
     133} 
     134 
     135int roar_set_vol      (struct roar_connection * con, int id, struct roar_mixer_settings * mixer, int channels) { 
     136 struct roar_message m; 
     137 uint16_t * info = (uint16_t *) m.data; 
     138 int i; 
     139 
     140 m.cmd     = ROAR_CMD_SET_VOL; 
     141 m.datalen = (3 + channels) * 2; 
     142 info[0] = 0; 
     143 info[1] = id; 
     144 info[2] = ROAR_SET_VOL_ALL; 
     145 
     146 for (i = 0; i < channels; i++) 
     147  info[i+3] = mixer->mixer[i]; 
    125148 
    126149 if ( roar_req(con, &m, NULL) == -1 ) 
     
    261284 
    262285 strncpy(c->name, (m->data)+cur+1, m->data[cur]); 
    263  c->name[m->data[cur]] = 0; 
     286 c->name[(int)m->data[cur]] = 0; 
    264287 
    265288 return 0; 
Note: See TracChangeset for help on using the changeset viewer.