1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | This program is distributed in the hope that it will be useful, |
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | GNU General Public License for more details. |
---|
15 | |
---|
16 | You should have received a copy of the GNU General Public License |
---|
17 | along with this program; if not, write to the Free Software Foundation, |
---|
18 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
19 | |
---|
20 | |
---|
21 | ### File Specific: |
---|
22 | main-programmer: Benjamin Grauer |
---|
23 | |
---|
24 | */ |
---|
25 | |
---|
26 | #include "gui_audio.h" |
---|
27 | |
---|
28 | #include "gui_gtk.h" |
---|
29 | |
---|
30 | /** |
---|
31 | \brief Creates an Audio-Frame |
---|
32 | */ |
---|
33 | GuiAudio::GuiAudio(void) |
---|
34 | { |
---|
35 | Frame* audioFrame; //!< The Frame that holds the audio Options. |
---|
36 | |
---|
37 | audioFrame = new Frame("Audio-Options:"); |
---|
38 | audioFrame->setGroupName(CONFIG_SECTION_AUDIO); |
---|
39 | { |
---|
40 | Box* audioBox; //!< The Box that holds the audio Options. |
---|
41 | audioBox = new Box('v'); |
---|
42 | { |
---|
43 | CheckButton* enableSound; //!< A Ckeckbutton for enabling Sound. |
---|
44 | Slider* musicVolume; //!< A Slider for music volume. |
---|
45 | Slider* effectsVolume; //!< A Slider for effects volume. |
---|
46 | |
---|
47 | enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO); |
---|
48 | enableSound->setFlagName ("no-sound", 0); |
---|
49 | enableSound->setDescription("Disables Sound", "Check this to disable Sound in Orxonox"); |
---|
50 | enableSound->setDefaultValue(0); |
---|
51 | enableSound->saveability(); |
---|
52 | audioBox->fill(enableSound); |
---|
53 | Label* musicVolumeLabel = new Label(CONFIG_NAME_MUSIC_VOLUME); |
---|
54 | audioBox->fill(musicVolumeLabel); |
---|
55 | musicVolume = new Slider("Music Volume", 0, 100); |
---|
56 | musicVolume->setFlagName("music-volume", "m", 80); |
---|
57 | musicVolume->setDescription("Sets the volume of the ingame music"); |
---|
58 | musicVolume->saveability(); |
---|
59 | audioBox->fill (musicVolume); |
---|
60 | Label* effectsVolumeLabel = new Label (CONFIG_NAME_EFFECTS_VOLUME); |
---|
61 | audioBox->fill (effectsVolumeLabel); |
---|
62 | effectsVolume = new Slider ("Effects Volume", 0, 100); |
---|
63 | effectsVolume->setFlagName ("effects-volume", "e", 80); |
---|
64 | effectsVolume->setDescription("Sets the volune of the ingame SoundEffects"); |
---|
65 | effectsVolume->saveability(); |
---|
66 | audioBox->fill (effectsVolume); |
---|
67 | } |
---|
68 | audioFrame->fill(audioBox); |
---|
69 | } |
---|
70 | setMainWidget(audioFrame); |
---|
71 | } |
---|
72 | |
---|
73 | /** |
---|
74 | \brief Destructs the Audio-Stuff |
---|
75 | */ |
---|
76 | GuiAudio::~GuiAudio(void) |
---|
77 | { |
---|
78 | // nothing to do here. |
---|
79 | } |
---|