Changeset 4333:d10f93a61265 in roaraudio for libroar/ctl.c


Ignore:
Timestamp:
09/10/10 00:32:17 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

finaly added support to do a filtered stream list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/ctl.c

    r4332 r4333  
    134134} 
    135135 
     136int roar_list_filtered(struct roar_connection * con, int * items,   int max, int cmd, unsigned char filter, unsigned char cmp, uint32_t id) { 
     137 struct roar_message m; 
     138 
     139 memset(&m, 0, sizeof(struct roar_message)); // make valgrind happy! 
     140 
     141 roar_ctl_f2m(&m, filter, cmp, id); 
     142 m.cmd = cmd; 
     143 
     144 if ( roar_req(con, &m, NULL) == -1 ) 
     145  return -1; 
     146 
     147 return roar_ctl_m2ia(&m, items, max); 
     148} 
     149 
    136150int roar_list         (struct roar_connection * con, int * items,   int max, int cmd) { 
    137  struct roar_message m; 
    138  
    139  memset(&m, 0, sizeof(struct roar_message)); // make valgrind happy! 
    140  
    141  roar_ctl_f2m_any(&m); 
    142  m.cmd = cmd; 
    143  
    144  if ( roar_req(con, &m, NULL) == -1 ) 
    145   return -1; 
    146  
    147  return roar_ctl_m2ia(&m, items, max); 
     151 return roar_list_filtered(con, items, max, cmd, ROAR_CTL_FILTER_ANY, ROAR_CTL_CMP_ANY, ROAR_CTL_FILTER_ANY); 
    148152} 
    149153 
     
    310314 
    311315int roar_filter_match (const unsigned cmp, const uint32_t a, const uint32_t b) { 
    312  switch (cmd) { 
     316 switch (cmp) { 
    313317  case ROAR_CTL_CMP_ANY: 
    314318    return 1; 
Note: See TracChangeset for help on using the changeset viewer.