Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/gui/gtk/gui_audio.cc @ 9368

Last change on this file since 9368 was 8145, checked in by bensch, 19 years ago

trunk: merged the gui back
merged with command:
svn merge -r8114:HEAD https://svn.orxonox.net/orxonox/branches/gui .
→ no conflicts

File size: 3.1 KB
Line 
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 *  Creates an Audio-Frame
32*/
33GuiAudio::GuiAudio()
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* audioChannels;    //!< A Slider for the count of audio-channels.
45      Slider* musicVolume;      //!< A Slider for music volume.
46      Slider* effectsVolume;    //!< A Slider for effects volume.
47
48      enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO);
49      enableSound->setFlagName ("no-sound", 0);
50      enableSound->setDescription("Disables Sound", "Check this to disable Sound in Orxonox");
51      enableSound->setDefaultValue(0);
52      enableSound->saveability();
53      audioBox->fill(enableSound);
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
64      Label* musicVolumeLabel = new Label(CONFIG_NAME_MUSIC_VOLUME);
65      audioBox->fill(musicVolumeLabel);
66      musicVolume = new Slider(CONFIG_NAME_MUSIC_VOLUME, 0, 100);
67      musicVolume->setFlagName("music-volume", "m", 80);
68      musicVolume->setDescription("Sets the volume of the ingame music");
69      musicVolume->saveability();
70      audioBox->fill (musicVolume);
71
72      Label* effectsVolumeLabel = new Label (CONFIG_NAME_EFFECTS_VOLUME);
73      audioBox->fill (effectsVolumeLabel);
74      effectsVolume = new Slider (CONFIG_NAME_EFFECTS_VOLUME, 0, 100);
75      effectsVolume->setFlagName ("effects-volume", "e", 80);
76      effectsVolume->setDescription("Sets the volune of the ingame SoundEffects");
77      effectsVolume->saveability();
78      audioBox->fill (effectsVolume);
79    }
80    audioFrame->fill(audioBox);
81  }
82  setMainWidget(audioFrame);
83}
84
85/**
86  *  Destructs the Audio-Stuff
87*/
88GuiAudio::~GuiAudio()
89{
90  // nothing to do here.
91}
Note: See TracBrowser for help on using the repository browser.