Author: alink
Date: Wed Apr 25 03:20:00 2007
New Revision: 17065
URL: http://svn.gna.org/viewcvs/wesnoth?rev=17065&view=rev
Log:
do a reversion for Sapient
Modified:
trunk/src/preferences.cpp
trunk/src/preferences.hpp
trunk/src/sound.cpp
trunk/src/sound.hpp
Modified: trunk/src/preferences.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/preferences.cpp?rev=17065&r1=17064&r2=17065&view=diff
==============================================================================
--- trunk/src/preferences.cpp (original)
+++ trunk/src/preferences.cpp Wed Apr 25 03:20:00 2007
@@ -67,9 +67,6 @@
read(prefs, *stream);
set_music_volume(music_volume());
set_sound_volume(sound_volume());
- set_UI_volume(UI_volume());
- set_bell_volume(bell_volume());
- set_sound_sources_volume(sound_sources_volume());
set_show_haloes(prefs["show_haloes"] != "no");
if(prefs["remember_timer_settings"] != "yes") {
@@ -304,40 +301,6 @@
sound::set_UI_volume(UI_volume());
}
-int sound_sources_volume()
-{
- return lexical_cast_default<int>(prefs["sound_sources_volume"], 100);
-}
-
-void set_sound_sources_volume(int vol)
-{
- prefs["sound_sources_volume"] = lexical_cast_default<std::string>(vol,
"100");
- sound::set_sound_sources_volume(sound_sources_volume());
-}
-
-bool sound_sources_on()
-{
- return prefs["sound_sources"] != "no";
-}
-
-bool set_sound_sources(bool ison)
-{
- if(!sound_sources_on() && ison) {
- prefs["sound_sources"] = "yes";
- if(!sound_on() && !music_on() && !turn_bell() &&
!UI_sound_on()) {
- if(!sound::init_sound()) {
- prefs["sound_sources"] = "no";
- return false;
- }
- }
- } else if(sound_sources_on() && !ison) {
- prefs["sound_sources"] = "no";
- sound::stop_sound_sources();
- if(!music_on() && !sound_on() && !turn_bell() && !UI_sound_on)
- sound::close_sound();
- }
- return true;
-}
bool adjust_gamma()
{
@@ -530,7 +493,7 @@
{
if(!turn_bell() && ison) {
prefs["turn_bell"] = "yes";
- if(!music_on() && !sound_on() && !sound_sources_on() &&
!UI_sound_on()) {
+ if(!music_on() && !sound_on() && !UI_sound_on()) {
if(!sound::init_sound()) {
prefs["turn_bell"] = "no";
return false;
@@ -539,7 +502,7 @@
} else if(turn_bell() && !ison) {
prefs["turn_bell"] = "no";
sound::stop_bell();
- if(!music_on() && !sound_on() && !sound_sources_on() &&
!UI_sound_on())
+ if(!music_on() && !sound_on() && !UI_sound_on())
sound::close_sound();
}
return true;
@@ -554,7 +517,7 @@
{
if(!UI_sound_on() && ison) {
prefs["UI_sound"] = "yes";
- if(!music_on() && !sound_on() && !turn_bell() &&
!sound_sources_on()) {
+ if(!music_on() && !sound_on() && !turn_bell()) {
if(!sound::init_sound()) {
prefs["UI_sound"] = "no";
return false;
@@ -563,7 +526,7 @@
} else if(UI_sound_on() && !ison) {
prefs["UI_sound"] = "no";
sound::stop_UI_sound();
- if(!music_on() && !sound_on() && !turn_bell() &&
!sound_sources_on())
+ if(!music_on() && !sound_on() && !turn_bell())
sound::close_sound();
}
return true;
@@ -586,7 +549,7 @@
bool set_sound(bool ison) {
if(!sound_on() && ison) {
prefs["sound"] = "yes";
- if(!music_on() && !turn_bell() && !UI_sound_on() &&
!sound_sources_on()) {
+ if(!music_on() && !turn_bell() && !UI_sound_on()) {
if(!sound::init_sound()) {
prefs["sound"] = "no";
return false;
@@ -595,7 +558,7 @@
} else if(sound_on() && !ison) {
prefs["sound"] = "no";
sound::stop_sound();
- if(!music_on() && !turn_bell() && !UI_sound_on() &&
!sound_sources_on())
+ if(!music_on() && !turn_bell() && !UI_sound_on())
sound::close_sound();
}
return true;
@@ -608,7 +571,7 @@
bool set_music(bool ison) {
if(!music_on() && ison) {
prefs["music"] = "yes";
- if(!sound_on() && !turn_bell() && !UI_sound_on() &&
!sound_sources_on()) {
+ if(!sound_on() && !turn_bell() && !UI_sound_on()) {
if(!sound::init_sound()) {
prefs["music"] = "no";
return false;
@@ -618,7 +581,7 @@
sound::play_music();
} else if(music_on() && !ison) {
prefs["music"] = "no";
- if(!sound_on() && !turn_bell() && !UI_sound_on() &&
!sound_sources_on())
+ if(!sound_on() && !turn_bell() && !UI_sound_on())
sound::close_sound();
else
sound::stop_music();
Modified: trunk/src/preferences.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/preferences.hpp?rev=17065&r1=17064&r2=17065&view=diff
==============================================================================
--- trunk/src/preferences.hpp (original)
+++ trunk/src/preferences.hpp Wed Apr 25 03:20:00 2007
@@ -88,11 +88,6 @@
int UI_volume();
void set_UI_volume(int vol);
-
- bool sound_sources_on();
- bool set_sound_sources(bool ison);
- int sound_sources_volume();
- void set_sound_sources_volume(int vol);
bool music_on();
bool set_music(bool ison);
Modified: trunk/src/sound.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/sound.cpp?rev=17065&r1=17064&r2=17065&view=diff
==============================================================================
--- trunk/src/sound.cpp (original)
+++ trunk/src/sound.cpp Wed Apr 25 03:20:00 2007
@@ -346,7 +346,6 @@
set_sound_volume(preferences::sound_volume());
set_UI_volume(preferences::UI_volume());
- set_sound_sources_volume(preferences::sound_sources_volume());
set_music_volume(preferences::music_volume());
set_bell_volume(preferences::bell_volume());
@@ -465,21 +464,6 @@
}
}
-void stop_sound_sources() {
- if(mix_ok) {
- Mix_HaltGroup(SOUND_SOURCES);
- sound_cache_iterator itor = sound_cache.begin();
- while(itor != sound_cache.end())
- {
- if(itor->group == SOUND_SOURCES) {
- itor = sound_cache.erase(itor);
- } else {
- ++itor;
- }
- }
- }
-}
-
void think_about_music(void)
{
if (!music_start_time) {
@@ -634,8 +618,8 @@
void reposition_sound(int id, unsigned int distance)
{
audio_lock lock();
- for(unsigned int ch = 0; ch < channel_ids.size(); ++ch) {
- int & ch_id = channel_ids[ch];
+ for(int ch = 0; ch < channel_ids.size(); ++ch) {
+ int& ch_id = channel_ids[ch];
if(ch_id == id) {
if(distance >= DISTANCE_SILENT) {
Mix_FadeOutChannel(ch, 100);
@@ -779,8 +763,7 @@
if(vol > MIX_MAX_VOLUME)
vol = MIX_MAX_VOLUME;
- // Bell, UI and sound sources have separate channels which we
- // can't set up from this
+ // Bell has separate channel which we can't set up from this
for (unsigned i = 0; i < n_of_channels; i++){
if(i != UI_sound_channel && i != bell_channel) {
Mix_Volume(i, vol);
@@ -809,16 +792,4 @@
}
}
-void set_sound_sources_volume(int vol)
-{
- if(mix_ok && vol >= 0) {
- if(vol > MIX_MAX_VOLUME)
- vol = MIX_MAX_VOLUME;
-
- for (unsigned i = source_channel_start; i -
source_channel_start < source_channels; i++) {
- Mix_Volume(i, vol);
- }
- }
-}
-
} // end of sound namespace
Modified: trunk/src/sound.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/sound.hpp?rev=17065&r1=17064&r2=17065&view=diff
==============================================================================
--- trunk/src/sound.hpp (original)
+++ trunk/src/sound.hpp Wed Apr 25 03:20:00 2007
@@ -35,7 +35,6 @@
void stop_sound();
void stop_UI_sound();
void stop_bell();
-void stop_sound_sources();
// Read config entry, alter track list accordingly.
void play_music_config(const config &music);
@@ -84,7 +83,6 @@
void set_sound_volume(int vol);
void set_bell_volume(int vol);
void set_UI_volume(int vol);
-void set_sound_sources_volume(int vol);
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits