38 mMusicVolume(
config.musicVolume),
39 mSfxVolume(
config.sfxVolume),
40 mNotificationsVolume(
config.notificationsVolume),
42 mDownloadEnabled(
config.downloadMusic),
43 mSoundCheckBox(new
CheckBox(
_(
"Sound"), mSoundEnabled)),
44 mDownloadMusicCheckBox(new
CheckBox(
_(
"Download music"), mDownloadEnabled)),
46 mNotificationsSlider(new
Slider(0,
sound.getMaxVolume())),
51 gcn::Label *sfxLabel =
new Label(
_(
"SFX volume"));
52 gcn::Label *notificationsLabel =
new Label(
_(
"Notifications volume"));
53 gcn::Label *musicLabel =
new Label(
_(
"Music volume"));
76 place(1, 1, sfxLabel);
78 place(1, 2, notificationsLabel);
80 place(1, 3, musicLabel);
98 new OkDialog(
_(
"Notice"),
_(
"You may have to restart your client if you want to download new music"));
108 catch (
const char *err)
139 if (event.getId() ==
"sfx")
145 else if (event.getId() ==
"notifications")
151 else if (event.getId() ==
"music")
LayoutCell & place(int x, int y, gcn::Widget *wg, int w=1, int h=1)
Adds a widget to the container and sets it at given cell.
LayoutCell & setVAlign(Alignment a)
Sets the vertical alignment of the cell content.
void setName(const std::string &name)
Sets the name displayed on the tab.
void action(const gcn::ActionEvent &event) override
void cancel() override
Called when the Cancel button is pressed in the setup window.
void apply() override
Called when the Apply button is pressed in the setup window.
gcn::Slider * mMusicSlider
gcn::Slider * mNotificationsSlider
gcn::CheckBox * mSoundCheckBox
gcn::CheckBox * mDownloadMusicCheckBox
void init()
Installs the sound engine.
void setMusicVolume(int volume)
void close()
Removes all sound functionalities.
void setSfxVolume(int volume)
void setNotificationsVolume(int volume)
Config config
Global settings (config.xml)
void warn(const char *log_text,...) LOG_PRINTF_ATTR