Changeset 4327:7cad0bc2bcfc in roaraudio


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

added new OTs

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/ctl.h

    r3517 r4327  
    8787char * roar_byteorder2str (int    byteorder); 
    8888 
     89int    roar_str2ot        (const char * ot); 
     90const char * roar_ot2str  (const int    ot); 
     91 
    8992#endif 
    9093 
  • include/roaraudio/proto.h

    r4267 r4327  
    100100 
    101101// object types... 
    102 #define ROAR_OT_CLIENT 1 
    103 #define ROAR_OT_STREAM 2 
    104 #define ROAR_OT_SOURCE 3 
    105 #define ROAR_OT_SAMPLE 4 
     102#define ROAR_OT_CLIENT    1 
     103#define ROAR_OT_STREAM    2 
     104#define ROAR_OT_SOURCE    3 
     105#define ROAR_OT_SAMPLE    4 
     106#define ROAR_OT_OUTPUT    5 
     107#define ROAR_OT_MIXER     6 
     108#define ROAR_OT_BRIDGE    7 
     109#define ROAR_OT_LISTEN    8 
     110#define ROAR_OT_ACTION    9 
     111#define ROAR_OT_MSGQUEUE 10 
     112#define ROAR_OT_MSGBUS   11 
    106113 
    107114// auth types... 
  • libroar/ctl.c

    r3980 r4327  
    557557} 
    558558 
     559// grep '^#define ROAR_OT_' roaraudio/proto.h | cut -d' ' -f2 | sed 's/^\(ROAR_OT_\)\(.*\)$/ {\1\2, "\2"},/' 
     560static 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 
     578int    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 
     588const 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 
    559598//ll 
Note: See TracChangeset for help on using the changeset viewer.