Example #1
0
File: options.c Project: 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);
}
Example #2
0
File: options.c Project: 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);
}
Example #3
0
File: options.c Project: 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 );
}
Example #4
0
File: options.c Project: 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 );
}
Example #5
0
File: options.c Project: 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 );
}
Example #6
0
File: options.c Project: 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 );
}