Changeset 4327:7cad0bc2bcfc in roaraudio for libroar/ctl.c
- Timestamp:
- 09/09/10 16:19:32 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/ctl.c
r3980 r4327 557 557 } 558 558 559 // grep '^#define ROAR_OT_' roaraudio/proto.h | cut -d' ' -f2 | sed 's/^\(ROAR_OT_\)\(.*\)$/ {\1\2, "\2"},/' 560 static struct { 561 const int ot; 562 const char * name; 563 } _libroar_ot[] = { 564 {ROAR_OT_CLIENT, "client"}, 565 {ROAR_OT_STREAM, "stream"}, 566 {ROAR_OT_SOURCE, "source"}, 567 {ROAR_OT_SAMPLE, "sample"}, 568 {ROAR_OT_OUTPUT, "output"}, 569 {ROAR_OT_MIXER, "mixer"}, 570 {ROAR_OT_BRIDGE, "bridge"}, 571 {ROAR_OT_LISTEN, "listen"}, 572 {ROAR_OT_ACTION, "action"}, 573 {ROAR_OT_MSGQUEUE, "msgqueue"}, 574 {ROAR_OT_MSGBUS, "msgbus"}, 575 {-1, NULL} 576 }; 577 578 int roar_str2ot (const char * ot) { 579 int i; 580 581 for (i = 0; _libroar_ot[i].ot != -1; i++) 582 if ( !strcasecmp(ot, _libroar_ot[i].name) ) 583 return _libroar_ot[i].ot; 584 585 return -1; 586 } 587 588 const char * roar_ot2str (const int ot) { 589 int i; 590 591 for (i = 0; _libroar_ot[i].ot != -1; i++) 592 if ( _libroar_ot[i].ot == ot ) 593 return _libroar_ot[i].name; 594 595 return NULL; 596 } 597 559 598 //ll
Note: See TracChangeset
for help on using the changeset viewer.