Changeset 3942:a160d7f5f19e in roaraudio for roarclients
- Timestamp:
- 06/23/10 23:31:13 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarctl.c
r3875 r3942 875 875 } 876 876 877 int 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 895 int 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 877 915 int main (int argc, char * argv[]) { 878 916 struct roar_connection con; … … 1073 1111 i++; 1074 1112 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 } 1075 1123 } else { 1076 1124 fprintf(stderr, "Error: invalid command: %s\n", k);
Note: See TracChangeset
for help on using the changeset viewer.