Changeset 3529:fba86b5b08a7 in roaraudio for roarclients/roarctl.c


Ignore:
Timestamp:
02/19/10 17:36:33 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support to read complet mixer from roard, including scale and rpg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarctl.c

    r3517 r3529  
    429429 
    430430int display_mixer (struct roar_connection * con, int stream) { 
     431 struct roar_mixer_settings mixer; 
    431432 int channels; 
    432  struct roar_mixer_settings mixer; 
    433433 int i; 
     434 float fs; 
    434435 
    435436 if ( roar_get_vol(con, stream, &mixer, &channels) == -1 ) { 
     
    444445#endif 
    445446 
     447 fs = (float)mixer.scale / 100.; 
     448 
     449 printf("Mixer ReplayGain      : %i/%i (%.2f%%" _DB ")\n", mixer.rpg_mul, mixer.rpg_div, 
     450                                                         100.*(float)mixer.rpg_mul/((float)mixer.rpg_div) 
     451#ifdef ROAR_HAVE_LIBM 
     452                          , 20*log10f((float)mixer.rpg_mul/(float)mixer.rpg_div) 
     453#endif 
     454       ); 
     455 
    446456 for (i = 0; i < channels; i++) 
    447   printf("Mixer volume chan %2i  : %i (%.2f%%" _DB ")\n", i, mixer.mixer[i], 
    448                            (float)mixer.mixer[i]/655.35f 
     457  printf("Mixer volume chan %2i  : %i/%i (%.2f%%" _DB ")\n", i, mixer.mixer[i], mixer.scale, 
     458                           (float)mixer.mixer[i]/fs 
    449459#ifdef ROAR_HAVE_LIBM 
    450                           , 20*log10f((float)mixer.mixer[i]/65535.f) 
     460                          , 20*log10f((float)mixer.mixer[i]/(float)mixer.scale) 
    451461#endif 
    452462        ); 
Note: See TracChangeset for help on using the changeset viewer.