Changeset 4333:d10f93a61265 in roaraudio
- Timestamp:
- 09/10/10 00:32:17 (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/ctl.h
r4332 r4333 50 50 51 51 int roar_list (struct roar_connection * con, int * items, int max, int cmd); 52 int roar_list_filtered(struct roar_connection * con, int * items, int max, int cmd, unsigned char filter, unsigned char cmp, uint32_t id); 52 53 53 54 /* -
include/roaraudio/proto.h
r4331 r4333 118 118 #define ROAR_CTL_CMP_ANY ROAR_CTL_FILTER_ANY 119 119 #define ROAR_CTL_CMP_EQ 1 120 #define ROAR_CTL_CMP_NE 1120 #define ROAR_CTL_CMP_NE 2 121 121 122 122 // auth types... -
libroar/ctl.c
r4332 r4333 134 134 } 135 135 136 int 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 136 150 int 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); 148 152 } 149 153 … … 310 314 311 315 int roar_filter_match (const unsigned cmp, const uint32_t a, const uint32_t b) { 312 switch (cm d) {316 switch (cmp) { 313 317 case ROAR_CTL_CMP_ANY: 314 318 return 1; -
roard/req.c
r4330 r4333 633 633 int streams[ROAR_STREAMS_MAX]; 634 634 int i, c = 0; 635 int match; 635 636 636 637 if ( roar_ctl_m2f(mes, &filter, &cmp, &id) == -1 ) 637 638 return -1; 638 639 639 // TODO: add code to support filter640 if ( filter != ROAR_CTL_FILTER_ANY )641 return -1;642 643 640 for (i = 0; i < ROAR_STREAMS_MAX; i++) { 644 if ( g_streams[i] != NULL ) { 641 if ( g_streams[i] == NULL ) 642 continue; 643 644 match = 0; 645 646 switch (filter) { 647 case ROAR_CTL_FILTER_ANY: 648 match = 1; 649 break; 650 case ROAR_CTL_FILTER_DIR: 651 match = roar_filter_match(cmp, id, ROAR_STREAM(g_streams[i])->dir); 652 break; 653 default: // unsupported filter... 654 return -1; 655 break; 656 } 657 658 if ( match ) 645 659 streams[c++] = i; 646 }647 660 } 648 661
Note: See TracChangeset
for help on using the changeset viewer.