comparison src/amidi-plug/backend-alsa/b-alsa.c @ 1295:d2e508857ded

"Don't touch debug stuff !" commit. ;-)
author Stany HENRY <StrassBoy@gmail.com>
date Thu, 19 Jul 2007 03:16:44 +0200
parents 8298974410fe
children 5f892afeb8e1
comparison
equal deleted inserted replaced
1294:ea7c0a4fe793 1295:d2e508857ded
162 snd_seq_queue_tempo_set_tempo( sc.queue_tempo , tempo ); 162 snd_seq_queue_tempo_set_tempo( sc.queue_tempo , tempo );
163 snd_seq_queue_tempo_set_ppq( sc.queue_tempo , ppq ); 163 snd_seq_queue_tempo_set_ppq( sc.queue_tempo , ppq );
164 164
165 if ( snd_seq_set_queue_tempo( sc.seq , sc.queue , sc.queue_tempo ) < 0 ) 165 if ( snd_seq_set_queue_tempo( sc.seq , sc.queue , sc.queue_tempo ) < 0 )
166 { 166 {
167 g_warning( _("Cannot set queue tempo (%u/%i)\n"), 167 g_warning( "Cannot set queue tempo (%u/%i)\n",
168 snd_seq_queue_tempo_get_tempo(sc.queue_tempo), 168 snd_seq_queue_tempo_get_tempo(sc.queue_tempo),
169 snd_seq_queue_tempo_get_ppq(sc.queue_tempo) ); 169 snd_seq_queue_tempo_get_ppq(sc.queue_tempo) );
170 return 0; 170 return 0;
171 } 171 }
172 return 1; 172 return 1;
371 if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT ) ) 371 if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT ) )
372 { 372 {
373 snd_mixer_selem_get_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT , &lc ); 373 snd_mixer_selem_get_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT , &lc );
374 /* convert the range to 0-100 (for the case that pv_range is not 0-100 already) */ 374 /* convert the range to 0-100 (for the case that pv_range is not 0-100 already) */
375 *left_volume = (gint)(((lc - pv_min) * 100) / pv_range); 375 *left_volume = (gint)(((lc - pv_min) * 100) / pv_range);
376 DEBUGMSG( _("GET VOLUME requested, get left channel (%i)\n") , *left_volume ); 376 DEBUGMSG( "GET VOLUME requested, get left channel (%i)\n" , *left_volume );
377 } 377 }
378 if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT ) ) 378 if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT ) )
379 { 379 {
380 snd_mixer_selem_get_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT , &rc ); 380 snd_mixer_selem_get_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT , &rc );
381 /* convert the range to 0-100 (for the case that pv_range is not 0-100 already) */ 381 /* convert the range to 0-100 (for the case that pv_range is not 0-100 already) */
382 *right_volume = (gint)(((rc - pv_min) * 100) / pv_range); 382 *right_volume = (gint)(((rc - pv_min) * 100) / pv_range);
383 DEBUGMSG( _("GET VOLUME requested, get right channel (%i)\n") , *right_volume ); 383 DEBUGMSG( "GET VOLUME requested, get right channel (%i)\n" , *right_volume );
384 } 384 }
385 } 385 }
386 } 386 }
387 387
388 if ( mixer_h ) 388 if ( mixer_h )
416 pv_range = pv_max - pv_min; 416 pv_range = pv_max - pv_min;
417 if ( pv_range > 0 ) 417 if ( pv_range > 0 )
418 { 418 {
419 if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT ) ) 419 if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT ) )
420 { 420 {
421 DEBUGMSG( _("SET VOLUME requested, setting left channel to %i%%\n") , left_volume ); 421 DEBUGMSG( "SET VOLUME requested, setting left channel to %i%%\n" , left_volume );
422 snd_mixer_selem_set_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT , 422 snd_mixer_selem_set_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_LEFT ,
423 (gint)((gdouble)(0.01 * (gdouble)(left_volume * pv_range)) + pv_min) ); 423 (gint)((gdouble)(0.01 * (gdouble)(left_volume * pv_range)) + pv_min) );
424 } 424 }
425 if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT ) ) 425 if ( snd_mixer_selem_has_playback_channel( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT ) )
426 { 426 {
427 DEBUGMSG( _("SET VOLUME requested, setting right channel to %i%%\n") , right_volume ); 427 DEBUGMSG( "SET VOLUME requested, setting right channel to %i%%\n" , right_volume );
428 snd_mixer_selem_set_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT , 428 snd_mixer_selem_set_playback_volume( mixer_elem , SND_MIXER_SCHN_FRONT_RIGHT ,
429 (gint)((gdouble)(0.01 * (gdouble)(right_volume * pv_range)) + pv_min) ); 429 (gint)((gdouble)(0.01 * (gdouble)(right_volume * pv_range)) + pv_min) );
430 } 430 }
431 } 431 }
432 } 432 }
801 into commas (65:0,65:1,65:2,...) */ 801 into commas (65:0,65:1,65:2,...) */
802 g_strdelimit( &buffer[11] , " " , ',' ); 802 g_strdelimit( &buffer[11] , " " , ',' );
803 /* remove lf and cr from the end of the string */ 803 /* remove lf and cr from the end of the string */
804 g_strdelimit( &buffer[11] , "\r\n" , '\0' ); 804 g_strdelimit( &buffer[11] , "\r\n" , '\0' );
805 /* ready to go */ 805 /* ready to go */
806 DEBUGMSG( _("init, default values for seq ports detected: %s\n") , &buffer[11] ); 806 DEBUGMSG( "init, default values for seq ports detected: %s\n" , &buffer[11] );
807 fclose( fp ); 807 fclose( fp );
808 return g_strdup( &buffer[11] ); 808 return g_strdup( &buffer[11] );
809 } 809 }
810 } 810 }
811 fclose( fp ); 811 fclose( fp );