[5298] | 1 | /* |
---|
[2581] | 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, |
---|
[5298] | 18 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
[2581] | 19 | |
---|
| 20 | |
---|
| 21 | ### File Specific: |
---|
| 22 | main-programmer: Benjamin Grauer |
---|
| 23 | |
---|
| 24 | */ |
---|
| 25 | |
---|
[4047] | 26 | #include "gui_audio.h" |
---|
[2018] | 27 | |
---|
[4049] | 28 | #include "gui_gtk.h" |
---|
| 29 | |
---|
[2588] | 30 | /** |
---|
[4836] | 31 | * Creates an Audio-Frame |
---|
[2588] | 32 | */ |
---|
[4746] | 33 | GuiAudio::GuiAudio() |
---|
[2018] | 34 | { |
---|
[4046] | 35 | Frame* audioFrame; //!< The Frame that holds the audio Options. |
---|
[2018] | 36 | |
---|
[4046] | 37 | audioFrame = new Frame("Audio-Options:"); |
---|
[4091] | 38 | audioFrame->setGroupName(CONFIG_SECTION_AUDIO); |
---|
[4046] | 39 | { |
---|
[4049] | 40 | Box* audioBox; //!< The Box that holds the audio Options. |
---|
[4046] | 41 | audioBox = new Box('v'); |
---|
| 42 | { |
---|
[4049] | 43 | CheckButton* enableSound; //!< A Ckeckbutton for enabling Sound. |
---|
[5953] | 44 | Slider* audioChannels; //!< A Slider for the count of audio-channels. |
---|
[4049] | 45 | Slider* musicVolume; //!< A Slider for music volume. |
---|
| 46 | Slider* effectsVolume; //!< A Slider for effects volume. |
---|
[5298] | 47 | |
---|
[4091] | 48 | enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO); |
---|
[4046] | 49 | enableSound->setFlagName ("no-sound", 0); |
---|
[4132] | 50 | enableSound->setDescription("Disables Sound", "Check this to disable Sound in Orxonox"); |
---|
| 51 | enableSound->setDefaultValue(0); |
---|
[4046] | 52 | enableSound->saveability(); |
---|
| 53 | audioBox->fill(enableSound); |
---|
[5953] | 54 | |
---|
| 55 | Label* audioChannelsLabel = new Label(CONFIG_NAME_AUDIO_CHANNELS); |
---|
| 56 | audioBox->fill(audioChannelsLabel); |
---|
| 57 | audioChannels = new Slider(CONFIG_NAME_AUDIO_CHANNELS, 0, 32); |
---|
| 58 | audioChannels->setFlagName("channels", "c", 32); |
---|
| 59 | audioChannels->setDescription("Sets the count of channels in the game"); |
---|
| 60 | audioChannels->saveability(); |
---|
| 61 | audioBox->fill (audioChannels); |
---|
| 62 | |
---|
| 63 | |
---|
[4091] | 64 | Label* musicVolumeLabel = new Label(CONFIG_NAME_MUSIC_VOLUME); |
---|
[4046] | 65 | audioBox->fill(musicVolumeLabel); |
---|
[5298] | 66 | musicVolume = new Slider(CONFIG_NAME_MUSIC_VOLUME, 0, 100); |
---|
[4046] | 67 | musicVolume->setFlagName("music-volume", "m", 80); |
---|
[4132] | 68 | musicVolume->setDescription("Sets the volume of the ingame music"); |
---|
[4046] | 69 | musicVolume->saveability(); |
---|
| 70 | audioBox->fill (musicVolume); |
---|
[5953] | 71 | |
---|
[4091] | 72 | Label* effectsVolumeLabel = new Label (CONFIG_NAME_EFFECTS_VOLUME); |
---|
[4046] | 73 | audioBox->fill (effectsVolumeLabel); |
---|
[5298] | 74 | effectsVolume = new Slider (CONFIG_NAME_EFFECTS_VOLUME, 0, 100); |
---|
[4046] | 75 | effectsVolume->setFlagName ("effects-volume", "e", 80); |
---|
[4132] | 76 | effectsVolume->setDescription("Sets the volune of the ingame SoundEffects"); |
---|
[4046] | 77 | effectsVolume->saveability(); |
---|
| 78 | audioBox->fill (effectsVolume); |
---|
| 79 | } |
---|
| 80 | audioFrame->fill(audioBox); |
---|
| 81 | } |
---|
| 82 | setMainWidget(audioFrame); |
---|
[2018] | 83 | } |
---|
| 84 | |
---|
[5298] | 85 | /** |
---|
[4836] | 86 | * Destructs the Audio-Stuff |
---|
[3423] | 87 | */ |
---|
[4746] | 88 | GuiAudio::~GuiAudio() |
---|
[3423] | 89 | { |
---|
| 90 | // nothing to do here. |
---|
| 91 | } |
---|