Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1821 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Apr 14, 2004, 2:42:02 AM (21 years ago)
Author:
bensch
Message:

orxonox/branches/bensch: volume sliders implemented

Location:
orxonox/branches/bensch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/bensch/orxonox_gui_audio.c

    r1819 r1821  
    11#include "orxonox_gui.h"
     2
     3void audio_check_button_change(GtkWidget *widget, int* data)
     4{
     5  *data = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget));
     6  orxonox_flags_update ();
     7  if (verbose >=1)
     8    printf ("%s changed to %i.\n", (char*) gtk_button_get_label(widget), *data);
     9  return;
     10}
     11
     12void audio_slider_change(GtkWidget *widget, int* data)
     13{
     14  *data = gtk_range_get_value ( GTK_RANGE (widget));
     15  orxonox_flags_update ();
     16  if (verbose >=1)
     17    printf ("Changed slider to %i.\n", *data);
     18  return;
     19}
    220
    321GtkWidget *orxonox_gui_audio_frame (struct settings *orxonox_settings)
     
    1836        enable_sound_button = gtk_check_button_new_with_label ("Enable Sound");
    1937        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enable_sound_button), orxonox_settings->audio_enable_sound);
     38        g_signal_connect(GTK_TOGGLE_BUTTON(enable_sound_button), "clicked", G_CALLBACK(audio_check_button_change), &(orxonox_settings->audio_enable_sound));
     39
    2040        gtk_box_pack_start(GTK_BOX (orxonox_gui_audio_vbox), enable_sound_button, TRUE, TRUE, 0);
    2141
     
    2545        gtk_range_set_value ( GTK_RANGE (music_volume_slider), orxonox_settings->audio_music_volume);
    2646        gtk_range_set_update_policy ( GTK_RANGE (music_volume_slider), GTK_UPDATE_DISCONTINUOUS);
    27         /* g_signal_connect (GTK_RANGE (music_volume_slider), "valume_changed", G_CALLBACK (video_filter_crop_slider_changed), GINT_TO_POINTER (0));*/
     47        g_signal_connect (GTK_RANGE (music_volume_slider), "value_changed", G_CALLBACK (audio_slider_change), &(orxonox_settings->audio_music_volume) );
    2848        gtk_box_pack_start ( GTK_BOX (orxonox_gui_audio_vbox), music_volume_slider, TRUE, TRUE, 0);
    2949
     
    3353        gtk_range_set_value ( GTK_RANGE (effects_volume_slider), orxonox_settings->audio_effects_volume);
    3454        gtk_range_set_update_policy ( GTK_RANGE (effects_volume_slider), GTK_UPDATE_DISCONTINUOUS);
    35         /* g_signal_connect (GTK_RANGE (effects_volume_slider), "valume_changed", G_CALLBACK (video_filter_crop_slider_changed), GINT_TO_POINTER (0));*/
     55        g_signal_connect (GTK_RANGE (effects_volume_slider), "value_changed", G_CALLBACK (audio_slider_change), &(orxonox_settings->audio_effects_volume) );
    3656        gtk_box_pack_start ( GTK_BOX (orxonox_gui_audio_vbox), effects_volume_slider, TRUE, TRUE, 0);
    3757
     
    3959    gtk_container_add(GTK_CONTAINER(frame), orxonox_gui_audio_vbox);
    4060  }
    41 
    4261  return frame;
    43 
    4462}
    4563
  • orxonox/branches/bensch/orxonox_gui_audio.h

    r1818 r1821  
    22#define _ORXONOX_GUI_AUDIO_H
    33
     4
     5void audio_check_button_change(GtkWidget *widget, int* data);
    46GtkWidget *orxonox_gui_audio_frame (struct settings *orxonox_settings);
    57
  • orxonox/branches/bensch/orxonox_gui_exec.c

    r1820 r1821  
    5656char * orxonox_flags_text (struct settings *orxonox_settings, char *exec_flags_text)
    5757{
     58  char temp [50];
    5859  bzero(exec_flags_text, 1);
    5960  strcat(exec_flags_text, "orxonox ");
     
    6667  if(!orxonox_settings->audio_enable_sound)
    6768    strcat(exec_flags_text, "--disable_audio ");
    68   /*  if(orxonox_settings->audio_music_volume <> 80)
     69  if(orxonox_settings->audio_music_volume != 80)
    6970    {
    7071      strcat(exec_flags_text, "--music_volume=");
    71       strcat(exec_flags_text, sprintf("%i ",(int *)orxonox_settings->audio_music_volume));
     72      sprintf(temp, "%i ", (int) orxonox_settings->audio_music_volume);
     73      strcat(exec_flags_text, temp);
    7274    }
    73   */
    74   if(orxonox_settings->audio_effects_volume)
    75     strcat(exec_flags_text, "--effects_volume ");
    76 
     75  if(orxonox_settings->audio_effects_volume != 80)
     76    {
     77      strcat(exec_flags_text, "--effects_volume= ");
     78      sprintf(temp, "%i ", (int) orxonox_settings->audio_effects_volume);
     79      strcat(exec_flags_text, temp);
     80    }
    7781  return (exec_flags_text);
    7882}
Note: See TracChangeset for help on using the changeset viewer.