Mercurial > audlegacy-plugins
comparison src/amidi-plug/backend-alsa/b-alsa.c @ 1291:8298974410fe
"amidi-plug" : "i18n project" (part 2)
author | Stany HENRY <StrassBoy@gmail.com> |
---|---|
date | Thu, 19 Jul 2007 01:15:59 +0200 |
parents | 9549fea94794 |
children | d2e508857ded |
comparison
equal
deleted
inserted
replaced
1290:5daedb3af7c9 | 1291:8298974410fe |
---|---|
30 gint backend_info_get( gchar ** name , gchar ** longname , gchar ** desc , gint * ppos ) | 30 gint backend_info_get( gchar ** name , gchar ** longname , gchar ** desc , gint * ppos ) |
31 { | 31 { |
32 if ( name != NULL ) | 32 if ( name != NULL ) |
33 *name = g_strdup( "alsa" ); | 33 *name = g_strdup( "alsa" ); |
34 if ( longname != NULL ) | 34 if ( longname != NULL ) |
35 *longname = g_strdup( "ALSA Backend " AMIDIPLUG_VERSION ); | 35 *longname = g_strjoin( "", _("ALSA Backend "), AMIDIPLUG_VERSION, NULL ); |
36 if ( desc != NULL ) | 36 if ( desc != NULL ) |
37 *desc = g_strdup( _("This backend sends MIDI events to a group of user-chosen " | 37 *desc = g_strdup( _("This backend sends MIDI events to a group of user-chosen " |
38 "ALSA sequencer ports. The ALSA sequencer interface is very " | 38 "ALSA sequencer ports. The ALSA sequencer interface is very " |
39 "versatile, it can provide ports for audio cards hardware " | 39 "versatile, it can provide ports for audio cards hardware " |
40 "synthesizers (i.e. emu10k1) but also for software synths, " | 40 "synthesizers (i.e. emu10k1) but also for software synths, " |
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 ); |