Changeset 3942:a160d7f5f19e in roaraudio for roarclients


Ignore:
Timestamp:
06/23/10 23:31:13 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support for ai-profiles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarctl.c

    r3875 r3942  
    875875} 
    876876 
     877int show_aiprofile (const char * profile) { 
     878 struct roar_audio_info info; 
     879 
     880 if ( roar_profile2info(&info, profile) == -1 ) { 
     881  fprintf(stderr, "Error: unknown profile: %s\n", profile); 
     882  return -1; 
     883 } 
     884 
     885 printf("Profile Name          : %s\n", profile); 
     886 printf("Profile sample rate   : %i\n", info.rate); 
     887 printf("Profile bits          : %i\n", info.bits); 
     888 printf("Profile channels      : %i\n", info.channels); 
     889 printf("Profile codec         : %2i (%s%s)\n", info.codec, roar_codec2str(info.codec), 
     890                                       info.codec == ROAR_CODEC_DEFAULT ? " native" : ""); 
     891 
     892 return 0; 
     893} 
     894 
     895int list_aiprofiles (void) { 
     896 const char * list[1024]; 
     897 ssize_t ret; 
     898 ssize_t i; 
     899 
     900 ret = roar_profiles_list(list, 1024, 0); 
     901 
     902 if ( ret == -1 ) { 
     903  fprintf(stderr, "Error: can not read list of profiles\n"); 
     904  return -1; 
     905 } 
     906 
     907 for (i = 0; i < ret; i++) { 
     908  printf("profile %lli:\n", (long long signed int)i); 
     909  show_aiprofile(list[i]); 
     910 } 
     911 
     912 return 0; 
     913} 
     914 
    877915int main (int argc, char * argv[]) { 
    878916 struct roar_connection con; 
     
    10731111   i++; 
    10741112 
     1113 
     1114  } else if ( !strcmp(k, "listprofiles") ) { 
     1115   if ( list_aiprofiles() == -1 ) { 
     1116    fprintf(stderr, "Error: can not list profiles\n"); 
     1117   } 
     1118  } else if ( !strcmp(k, "profileget") ) { 
     1119   i++; 
     1120   if ( show_aiprofile(argv[i]) == -1 ) { 
     1121    fprintf(stderr, "Error: can not get profile data\n"); 
     1122   } 
    10751123  } else { 
    10761124   fprintf(stderr, "Error: invalid command: %s\n", k); 
Note: See TracChangeset for help on using the changeset viewer.