示例#1
0
文件: options.c 项目: zid/naev
/**
 * @brief Callback to set the music level.
 *
 *    @param wid Window calling the callback.
 *    @param str Name of the widget calling the callback.
 */
static void opt_setMusicLevel( unsigned int wid, char *str )
{
   double vol;

   vol = window_getFaderValue(wid, str);
	music_volume(vol);
}
示例#2
0
文件: options.c 项目: zid/naev
/**
 * @brief Callback to set the sound level.
 *
 *    @param wid Window calling the callback.
 *    @param str Name of the widget calling the callback.
 */
static void opt_setSFXLevel( unsigned int wid, char *str )
{
	double vol;

   vol = window_getFaderValue(wid, str);
	sound_volume(vol);
}
示例#3
0
文件: options.c 项目: s0be/naev
/**
 * @brief Callback to set autonav abort threshold.
 *
 *    @param wid Window calling the callback.
 *    @param str Name of the widget calling the callback.
 */
static void opt_setAutonavAbort( unsigned int wid, char *str )
{
   char buf[PATH_MAX];
   double autonav_abort;

   /* Set fader. */
   autonav_abort = window_getFaderValue(wid, str);
   conf.autonav_abort = autonav_abort;

   opt_getAutonavAbortStr( buf, sizeof(buf) );
   window_modifyText( wid, "txtAutonav", buf );
}
示例#4
0
文件: options.c 项目: isfos/naev
/**
 * @brief Callback to set the music level.
 *
 *    @param wid Window calling the callback.
 *    @param str Name of the widget calling the callback.
 */
static void opt_setMusicLevel( unsigned int wid, char *str )
{
    char buf[32];
    double vol;

    /* Update fader. */
    vol = window_getFaderValue(wid, str);
    music_volume(vol);

    /* Update message. */
    snprintf( buf, sizeof(buf), "Music Volume: %.2f", music_getVolume() );
    window_modifyText( wid, "txtMusic", buf );
}
示例#5
0
文件: options.c 项目: isfos/naev
/**
 * @brief Callback to set the sound level.
 *
 *    @param wid Window calling the callback.
 *    @param str Name of the widget calling the callback.
 */
static void opt_setSFXLevel( unsigned int wid, char *str )
{
    char buf[32];
    double vol;

    /* Set fader. */
    vol = window_getFaderValue(wid, str);
    sound_volume(vol);

    /* Update message. */
    snprintf( buf, sizeof(buf), "Sound Volume: %.2f", sound_getVolume() );
    window_modifyText( wid, "txtSound", buf );
}
示例#6
0
文件: options.c 项目: s0be/naev
/**
 * @brief Callback to set the sound or music level.
 *
 *    @param wid Window calling the callback.
 *    @param str Name of the widget calling the callback.
 *    @param type 0 for sound, 1 for audio.
 */
static void opt_setAudioLevel( unsigned int wid, char *str )
{
   char buf[32], *widget;
   double vol;

   vol = window_getFaderValue(wid, str);
   if (strcmp(str,"fadSound")==0) {
      sound_volume(vol);
      widget = "txtSound";
      opt_audioLevelStr( buf, sizeof(buf), 0, vol );
   }
   else {
      music_volume(vol);
      widget = "txtMusic";
      opt_audioLevelStr( buf, sizeof(buf), 1, vol );
   }

   window_modifyText( wid, widget, buf );
}