Changeset 5268:f9de025a8da8 in roaraudio for plugins/alsavs


Ignore:
Timestamp:
11/15/11 13:30:31 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

make controls access the stream they should, not fixed stream ID 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/alsavs/ctl_roar.c

    r5263 r5268  
    3838#include <string.h> 
    3939 
     40#ifdef DEBUG 
     41static struct roar_vio_calls DEBUG_FH; 
     42#endif 
     43 
    4044static void roar_plugin_close(snd_ctl_ext_t * ext) { 
    4145 struct roar_alsa_ctl * self = ext->private_data; 
     
    6367} 
    6468 
     69// ALSA is strange here, this function makes keys (stream ID) from non-unique stream names... 
    6570static snd_ctl_ext_key_t roar_plugin_find_elem(snd_ctl_ext_t *ext, 
    6671                                               const snd_ctl_elem_id_t *id) { 
    6772 struct roar_alsa_ctl * self = ext->private_data; 
    68  int numid = snd_ctl_elem_id_get_numid(id); 
    69  
    70  return self->streams[numid].id; 
     73// int numid = snd_ctl_elem_id_get_numid(id); 
     74 const char * name; 
     75 int i; 
     76 
     77// ROAR_DBG("roar_plugin_find_elem(ext=%p, id=%p): numid=%i", ext, id, numid); 
     78 
     79// return self->streams[numid].id; 
     80 
     81 name = snd_ctl_elem_id_get_name(id); 
     82 
     83 for (i = 0; i < MAX_STREAMS; i++) { 
     84  if ( !strcmp(self->streams[i].name, name) ) { 
     85   return self->streams[i].id; 
     86  } 
     87 } 
     88 
     89 return SND_CTL_EXT_KEY_NOT_FOUND; 
    7190} 
    7291 
     
    130149 int i; 
    131150 
    132  for (sid = 0; i < MAX_STREAMS && self->streams[sid].id != (int)key; sid++) 
     151 ROAR_DBG("roar_plugin_write_integer(ext=%p, key=%i, value=%p) = ?", ext, (int)key, value); 
     152 
     153 for (sid = 0; sid < MAX_STREAMS && self->streams[sid].id != (int)key; sid++) 
    133154 
    134155 if ( sid == MAX_STREAMS ) 
     
    175196  default: 
    176197    return; 
     198   break; 
     199 } 
     200 
     201 switch (s.dir) { 
     202  case ROAR_DIR_MIXING: 
     203  case ROAR_DIR_BRIDGE: 
     204    if ( strstr(name, "MIDI") != NULL || strstr(name, "Light") != NULL ) 
     205     return; 
    177206   break; 
    178207 } 
     
    236265 (void)root; 
    237266 
     267#ifdef DEBUG 
     268 roar_vio_open_dstr_simple(&DEBUG_FH, "/tmp/alsamixer-roar.log", O_WRONLY|O_CREAT|O_APPEND); 
     269 roar_debug_set_stderr_vio(&DEBUG_FH); 
     270 roar_debug_set_stderr_mode(ROAR_DEBUG_MODE_VIO); 
     271#endif 
     272 
    238273 snd_config_for_each(i, next, conf) { 
    239274  n = snd_config_iterator_entry(i); 
Note: See TracChangeset for help on using the changeset viewer.