changeset 17448:8fde858ad534 draft

(svn r22202) -Codechange: make MusicFileSettings a proper citizen of the client settings
author rubidium <rubidium@openttd.org>
date Sat, 05 Mar 2011 18:00:48 +0000
parents 1b0b1b2d7b18
children 0f3de47b4f80
files projects/settings_vs100.vcxproj projects/settings_vs100.vcxproj.filters projects/settings_vs80.vcproj projects/settings_vs90.vcproj src/music_gui.cpp src/openttd.cpp src/settings.cpp src/settings_type.h src/sound.cpp src/sound_func.h src/sound_type.h src/table/music_settings.ini src/table/settings.h.preamble src/table/settings.ini
diffstat 14 files changed, 109 insertions(+), 149 deletions(-) [+]
line wrap: on
line diff
--- a/projects/settings_vs100.vcxproj
+++ b/projects/settings_vs100.vcxproj
@@ -23,7 +23,7 @@
   </ImportGroup>
   <PropertyGroup Label="UserMacros">
     <SettingsCommandLine>
-..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\music_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini
+..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini
     </SettingsCommandLine>
   </PropertyGroup>
   <PropertyGroup>
@@ -40,7 +40,6 @@
     <None Include="..\src\table\currency_settings.ini" />
     <None Include="..\src\table\gameopt_settings.ini" />
     <None Include="..\src\table\misc_settings.ini" />
-    <None Include="..\src\table\music_settings.ini" />
     <None Include="..\src\table\settings.ini" />
     <None Include="..\src\table\win32_settings.ini" />
   </ItemGroup>
--- a/projects/settings_vs100.vcxproj.filters
+++ b/projects/settings_vs100.vcxproj.filters
@@ -18,9 +18,6 @@
     <None Include="..\src\table\misc_settings.ini">
       <Filter>INI</Filter>
     </None>
-    <None Include="..\src\table\music_settings.ini">
-      <Filter>INI</Filter>
-    </None>
     <None Include="..\src\table\settings.ini">
       <Filter>INI</Filter>
     </None>
--- a/projects/settings_vs80.vcproj
+++ b/projects/settings_vs80.vcproj
@@ -24,7 +24,7 @@
 				Name="VCPreBuildEventTool"
 				Description="Generating settings.h"
 				CommandLine="
-..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\music_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini
+..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini
 				"
 			/>
 			<Tool
@@ -61,10 +61,6 @@
 			>
 		</File>
 		<File
-			RelativePath="..\src\table\music_settings.ini"
-			>
-		</File>
-		<File
 			RelativePath="..\src\table\settings.ini"
 			>
 		</File>
--- a/projects/settings_vs90.vcproj
+++ b/projects/settings_vs90.vcproj
@@ -25,7 +25,7 @@
 				Name="VCPreBuildEventTool"
 				Description="Generating settings.h"
 				CommandLine="
-..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\music_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini
+..\objs\settings\settings_gen.exe -o ..\objs\settings\table\settings.h -b ..\src\table\settings.h.preamble -a ..\src\table\settings.h.postamble ..\src\table\company_settings.ini ..\src\table\currency_settings.ini ..\src\table\gameopt_settings.ini ..\src\table\misc_settings.ini ..\src\table\settings.ini ..\src\table\win32_settings.ini
 				"
 			/>
 			<Tool
@@ -62,10 +62,6 @@
 			>
 		</File>
 		<File
-			RelativePath="..\src\table\music_settings.ini"
-			>
-		</File>
-		<File
 			RelativePath="..\src\table\settings.ini"
 			>
 		</File>
--- a/src/music_gui.cpp
+++ b/src/music_gui.cpp
@@ -22,6 +22,7 @@
 #include "gui.h"
 #include "core/geometry_func.hpp"
 #include "string_func.h"
+#include "settings_type.h"
 
 #include "table/strings.h"
 #include "table/sprites.h"
@@ -63,8 +64,8 @@
 /** Indices of all ezy street songs */
 static byte _playlist_ezy_street[NUM_SONGS_CLASS + 1];
 
-assert_compile(lengthof(_msf.custom_1) == NUM_SONGS_PLAYLIST + 1);
-assert_compile(lengthof(_msf.custom_2) == NUM_SONGS_PLAYLIST + 1);
+assert_compile(lengthof(_settings_client.music.custom_1) == NUM_SONGS_PLAYLIST + 1);
+assert_compile(lengthof(_settings_client.music.custom_2) == NUM_SONGS_PLAYLIST + 1);
 
 /** The different playlists that can be played. */
 static byte * const _playlists[] = {
@@ -72,8 +73,8 @@
 	_playlist_old_style,
 	_playlist_new_style,
 	_playlist_ezy_street,
-	_msf.custom_1,
-	_msf.custom_2,
+	_settings_client.music.custom_1,
+	_settings_client.music.custom_2,
 };
 
 /**
@@ -116,8 +117,8 @@
 		_playlists[k + 1][j] = 0;
 	}
 
-	ValidatePlaylist(_msf.custom_1);
-	ValidatePlaylist(_msf.custom_2);
+	ValidatePlaylist(_settings_client.music.custom_1);
+	ValidatePlaylist(_settings_client.music.custom_2);
 
 	if (BaseMusic::GetUsedSet()->num_available < _music_wnd_cursong) {
 		/* If there are less songs than the currently played song,
@@ -191,17 +192,17 @@
 
 	memset(_cur_playlist, 0, sizeof(_cur_playlist));
 	do {
-		const char *filename = BaseMusic::GetUsedSet()->files[_playlists[_msf.playlist][i] - 1].filename;
+		const char *filename = BaseMusic::GetUsedSet()->files[_playlists[_settings_client.music.playlist][i] - 1].filename;
 		/* We are now checking for the existence of that file prior
 		 * to add it to the list of available songs */
 		if (!StrEmpty(filename) && FioCheckFileExists(filename, GM_DIR)) {
-			_cur_playlist[j] = _playlists[_msf.playlist][i];
+			_cur_playlist[j] = _playlists[_settings_client.music.playlist][i];
 			j++;
 		}
-	} while (_playlists[_msf.playlist][++i] != 0 && j < lengthof(_cur_playlist) - 1);
+	} while (_playlists[_settings_client.music.playlist][++i] != 0 && j < lengthof(_cur_playlist) - 1);
 
 	/* Do not shuffle when on the intro-start window, as the song to play has to be the original TTD Theme*/
-	if (_msf.shuffle && _game_mode != GM_MENU) {
+	if (_settings_client.music.shuffle && _game_mode != GM_MENU) {
 		i = 500;
 		do {
 			uint32 r = InteractiveRandom();
@@ -235,7 +236,7 @@
 		if (_cur_playlist[0] == 0) {
 			_song_is_active = false;
 			_music_wnd_cursong = 0;
-			_msf.playing = false;
+			_settings_client.music.playing = false;
 			return;
 		}
 	}
@@ -254,9 +255,9 @@
 
 void MusicLoop()
 {
-	if (!_msf.playing && _song_is_active) {
+	if (!_settings_client.music.playing && _song_is_active) {
 		StopMusic();
-	} else if (_msf.playing && !_song_is_active) {
+	} else if (_settings_client.music.playing && !_song_is_active) {
 		PlayPlaylistSong();
 	}
 
@@ -275,7 +276,7 @@
 
 static void SelectPlaylist(byte list)
 {
-	_msf.playlist = list;
+	_settings_client.music.playlist = list;
 	InvalidateWindowData(WC_MUSIC_TRACK_SELECTION, 0);
 	InvalidateWindowData(WC_MUSIC_WINDOW, 0);
 }
@@ -299,15 +300,15 @@
 		this->InitNested(desc, number);
 		this->LowerWidget(MTSW_LIST_LEFT);
 		this->LowerWidget(MTSW_LIST_RIGHT);
-		this->SetWidgetDisabledState(MTSW_CLEAR, _msf.playlist <= 3);
-		this->LowerWidget(MTSW_ALL + _msf.playlist);
+		this->SetWidgetDisabledState(MTSW_CLEAR, _settings_client.music.playlist <= 3);
+		this->LowerWidget(MTSW_ALL + _settings_client.music.playlist);
 	}
 
 	virtual void SetStringParameters(int widget) const
 	{
 		switch (widget) {
 			case MTSW_PLAYLIST:
-				SetDParam(0, STR_MUSIC_PLAYLIST_ALL + _msf.playlist);
+				SetDParam(0, STR_MUSIC_PLAYLIST_ALL + _settings_client.music.playlist);
 				break;
 		}
 	}
@@ -315,9 +316,9 @@
 	virtual void OnInvalidateData(int data = 0)
 	{
 		for (int i = 0; i < 6; i++) {
-			this->SetWidgetLoweredState(MTSW_ALL + i, i == _msf.playlist);
+			this->SetWidgetLoweredState(MTSW_ALL + i, i == _settings_client.music.playlist);
 		}
-		this->SetWidgetDisabledState(MTSW_CLEAR, _msf.playlist <= 3);
+		this->SetWidgetDisabledState(MTSW_CLEAR, _settings_client.music.playlist <= 3);
 		this->SetDirty();
 	}
 
@@ -383,7 +384,7 @@
 				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 0);
 
 				int y = r.top + WD_FRAMERECT_TOP;
-				for (const byte *p = _playlists[_msf.playlist]; *p != 0; p++) {
+				for (const byte *p = _playlists[_settings_client.music.playlist]; *p != 0; p++) {
 					uint i = *p - 1;
 					SetDParam(0, GetTrackNumber(i));
 					SetDParam(1, 2);
@@ -402,10 +403,10 @@
 			case MTSW_LIST_LEFT: { // add to playlist
 				int y = this->GetRowFromWidget(pt.y, widget, 0, FONT_HEIGHT_SMALL);
 
-				if (_msf.playlist < 4) return;
+				if (_settings_client.music.playlist < 4) return;
 				if (!IsInsideMM(y, 0, BaseMusic::GetUsedSet()->num_available)) return;
 
-				byte *p = _playlists[_msf.playlist];
+				byte *p = _playlists[_settings_client.music.playlist];
 				for (uint i = 0; i != NUM_SONGS_PLAYLIST - 1; i++) {
 					if (p[i] == 0) {
 						/* Find the actual song number */
@@ -427,10 +428,10 @@
 			case MTSW_LIST_RIGHT: { // remove from playlist
 				int y = this->GetRowFromWidget(pt.y, widget, 0, FONT_HEIGHT_SMALL);
 
-				if (_msf.playlist < 4) return;
+				if (_settings_client.music.playlist < 4) return;
 				if (!IsInsideMM(y, 0, NUM_SONGS_PLAYLIST)) return;
 
-				byte *p = _playlists[_msf.playlist];
+				byte *p = _playlists[_settings_client.music.playlist];
 				for (uint i = y; i != NUM_SONGS_PLAYLIST - 1; i++) {
 					p[i] = p[i + 1];
 				}
@@ -441,7 +442,7 @@
 			}
 
 			case MTSW_CLEAR: // clear
-				for (uint i = 0; _playlists[_msf.playlist][i] != 0; i++) _playlists[_msf.playlist][i] = 0;
+				for (uint i = 0; _playlists[_settings_client.music.playlist][i] != 0; i++) _playlists[_settings_client.music.playlist][i] = 0;
 				this->SetDirty();
 				StopMusic();
 				SelectSongToPlay();
@@ -535,8 +536,8 @@
 	MusicWindow(const WindowDesc *desc, WindowNumber number) : Window()
 	{
 		this->InitNested(desc, number);
-		this->LowerWidget(_msf.playlist + MW_ALL);
-		this->SetWidgetLoweredState(MW_SHUFFLE, _msf.shuffle);
+		this->LowerWidget(_settings_client.music.playlist + MW_ALL);
+		this->SetWidgetLoweredState(MW_SHUFFLE, _settings_client.music.shuffle);
 	}
 
 	virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
@@ -624,7 +625,7 @@
 
 			case MW_MUSIC_VOL: case MW_EFFECT_VOL: {
 				DrawFrameRect(r.left, r.top + 2, r.right, r.bottom - 2, COLOUR_GREY, FR_LOWERED);
-				byte volume = (widget == MW_MUSIC_VOL) ? _msf.music_vol : _msf.effect_vol;
+				byte volume = (widget == MW_MUSIC_VOL) ? _settings_client.music.music_vol : _settings_client.music.effect_vol;
 				int x = (volume * (r.right - r.left) / 127);
 				if (_current_text_dir == TD_RTL) {
 					x = r.right - x;
@@ -640,7 +641,7 @@
 	virtual void OnInvalidateData(int data = 0)
 	{
 		for (int i = 0; i < 6; i++) {
-			this->SetWidgetLoweredState(MW_ALL + i, i == _msf.playlist);
+			this->SetWidgetLoweredState(MW_ALL + i, i == _settings_client.music.playlist);
 		}
 		this->SetDirty();
 	}
@@ -661,17 +662,17 @@
 				break;
 
 			case MW_STOP: // stop playing
-				_msf.playing = false;
+				_settings_client.music.playing = false;
 				break;
 
 			case MW_PLAY: // start playing
-				_msf.playing = true;
+				_settings_client.music.playing = true;
 				break;
 
 			case MW_MUSIC_VOL: case MW_EFFECT_VOL: { // volume sliders
 				int x = pt.x - this->GetWidget<NWidgetBase>(widget)->pos_x;
 
-				byte *vol = (widget == MW_MUSIC_VOL) ? &_msf.music_vol : &_msf.effect_vol;
+				byte *vol = (widget == MW_MUSIC_VOL) ? &_settings_client.music.music_vol : &_settings_client.music.effect_vol;
 
 				byte new_vol = x * 127 / this->GetWidget<NWidgetBase>(widget)->current_x;
 				if (_current_text_dir == TD_RTL) new_vol = 127 - new_vol;
@@ -686,8 +687,8 @@
 			}
 
 			case MW_SHUFFLE: // toggle shuffle
-				_msf.shuffle ^= 1;
-				this->SetWidgetLoweredState(MW_SHUFFLE, _msf.shuffle);
+				_settings_client.music.shuffle ^= 1;
+				this->SetWidgetLoweredState(MW_SHUFFLE, _settings_client.music.shuffle);
 				this->SetWidgetDirty(MW_SHUFFLE);
 				StopMusic();
 				SelectSongToPlay();
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -642,7 +642,7 @@
 	_screen.zoom = ZOOM_LVL_NORMAL;
 
 	/* restore saved music volume */
-	_music_driver->SetVolume(_msf.music_vol);
+	_music_driver->SetVolume(_settings_client.music.music_vol);
 
 	NetworkStartUp(); // initialize network-core
 
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -1485,7 +1485,6 @@
 static void HandleSettingDescs(IniFile *ini, SettingDescProc *proc, SettingDescProcList *proc_list)
 {
 	proc(ini, (const SettingDesc*)_misc_settings,    "misc",  NULL);
-	proc(ini, (const SettingDesc*)_music_settings,   "music", &_msf);
 #if defined(WIN32) && !defined(DEDICATED)
 	proc(ini, (const SettingDesc*)_win32_settings,   "win32", NULL);
 #endif /* WIN32 */
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -136,6 +136,17 @@
 	}
 };
 
+/** Settings related to music. */
+struct MusicSettings {
+	byte playlist;     ///< The playlist (number) to play
+	byte music_vol;    ///< The requested music volume
+	byte effect_vol;   ///< The requested effects volume
+	byte custom_1[33]; ///< The order of the first custom playlist
+	byte custom_2[33]; ///< The order of the second custom playlist
+	bool playing;      ///< Whether music is playing
+	bool shuffle;      ///< Whether to shuffle the music
+};
+
 /** Settings related to currency/unit systems. */
 struct LocaleSettings {
 	byte   currency;                         ///< currency we currently use
@@ -441,6 +452,7 @@
 	GUISettings          gui;                ///< settings related to the GUI
 	NetworkSettings      network;            ///< settings related to the network
 	CompanySettings      company;            ///< default values for per-company settings
+	MusicSettings        music;              ///< settings related to music/sound
 };
 
 /** The current settings for this game. */
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -22,7 +22,6 @@
 #include "base_media_func.h"
 
 static SoundEntry _original_sounds[ORIGINAL_SAMPLE_COUNT];
-MusicFileSettings _msf;
 
 static void OpenBankFile(const char *filename)
 {
@@ -227,7 +226,7 @@
  */
 static void SndPlayScreenCoordFx(SoundID sound, int left, int right, int top, int bottom)
 {
-	if (_msf.effect_vol == 0) return;
+	if (_settings_client.music.effect_vol == 0) return;
 
 	const Window *w;
 	FOR_ALL_WINDOWS_FROM_BACK(w) {
@@ -243,7 +242,7 @@
 			StartSound(
 				sound,
 				panning,
-				(_msf.effect_vol * _vol_factor_by_zoom[vp->zoom - ZOOM_LVL_BEGIN]) / 256
+				(_settings_client.music.effect_vol * _vol_factor_by_zoom[vp->zoom - ZOOM_LVL_BEGIN]) / 256
 			);
 			return;
 		}
@@ -272,7 +271,7 @@
 
 void SndPlayFx(SoundID sound)
 {
-	StartSound(sound, 0.5, _msf.effect_vol);
+	StartSound(sound, 0.5, _settings_client.music.effect_vol);
 }
 
 INSTANTIATE_BASE_MEDIA_METHODS(BaseMedia<SoundsSet>, SoundsSet)
--- a/src/sound_func.h
+++ b/src/sound_func.h
@@ -16,8 +16,6 @@
 #include "vehicle_type.h"
 #include "tile_type.h"
 
-extern MusicFileSettings _msf;
-
 void SndPlayTileFx(SoundID sound, TileIndex tile);
 void SndPlayVehicleFx(SoundID sound, const Vehicle *v);
 void SndPlayFx(SoundID sound);
--- a/src/sound_type.h
+++ b/src/sound_type.h
@@ -12,16 +12,6 @@
 #ifndef SOUND_TYPE_H
 #define SOUND_TYPE_H
 
-struct MusicFileSettings {
-	byte playlist;
-	byte music_vol;
-	byte effect_vol;
-	byte custom_1[33];
-	byte custom_2[33];
-	bool playing;
-	bool shuffle;
-};
-
 struct SoundEntry {
 	uint8 file_slot;
 	size_t file_offset;
deleted file mode 100644
--- a/src/table/music_settings.ini
+++ /dev/null
@@ -1,75 +0,0 @@
-[pre-amble]
-static const SettingDesc _music_settings[] = {
-[post-amble]
-};
-[templates]
-SDT_BOOL = SDT_BOOL($base, $var,        $flags, $guiflags, $def,                        $str, $proc, $from, $to),
-SDT_VAR  =  SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $proc, $from, $to),
-SDT_LIST = SDT_LIST($base, $var, $type, $flags, $guiflags, $def,                        $str, $proc, $from, $to),
-SDT_END  = SDT_END()
-
-[defaults]
-flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
-guiflags = 0
-interval = 0
-str      = STR_NULL
-proc     = NULL
-load     = NULL
-from     = 0
-to       = SL_MAX_VERSION
-
-
-
-[SDT_VAR]
-base     = MusicFileSettings
-var      = playlist
-type     = SLE_UINT8
-def      = 0
-min      = 0
-max      = 5
-interval = 1
-
-[SDT_VAR]
-base     = MusicFileSettings
-var      = music_vol
-type     = SLE_UINT8
-def      = 127
-min      = 0
-max      = 127
-interval = 1
-
-[SDT_VAR]
-base     = MusicFileSettings
-var      = effect_vol
-type     = SLE_UINT8
-def      = 127
-min      = 0
-max      = 127
-interval = 1
-
-[SDT_LIST]
-base     = MusicFileSettings
-var      = custom_1
-type     = SLE_UINT8
-def      = NULL
-
-[SDT_LIST]
-base     = MusicFileSettings
-var      = custom_2
-type     = SLE_UINT8
-def      = NULL
-
-[SDT_BOOL]
-base     = MusicFileSettings
-var      = playing
-def      = true
-
-[SDT_BOOL]
-base     = MusicFileSettings
-var      = shuffle
-def      = false
-
-[SDT_END]
-
-
-};
--- a/src/table/settings.h.preamble
+++ b/src/table/settings.h.preamble
@@ -153,8 +153,8 @@
 #define SDTC_BOOL(var, flags, guiflags, def, str, proc, from, to)\
 	SDTG_GENERAL(#var, SDT_BOOLX, SL_VAR, SLE_BOOL, flags, guiflags, _settings_client.var, 1, def, 0, 1, 0, NULL, str, proc, from, to)
 
-#define SDTC_LIST(var, type, length, flags, guiflags, def, str, proc, from, to)\
-	SDTG_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, _settings_client.var, length, def, 0, 0, 0, NULL, str, proc, from, to)
+#define SDTC_LIST(var, type, flags, guiflags, def, str, proc, from, to)\
+	SDTG_GENERAL(#var, SDT_INTLIST, SL_ARR, type, flags, guiflags, _settings_client.var, lengthof(_settings_client.var), def, 0, 0, 0, NULL, str, proc, from, to)
 
 #define SDTC_STR(var, type, flags, guiflags, def, str, proc, from, to)\
 	SDTG_GENERAL(#var, SDT_STRING, SL_STR, type, flags, guiflags, _settings_client.var, lengthof(_settings_client.var), def, 0, 0, 0, NULL, str, proc, from, to)
--- a/src/table/settings.ini
+++ b/src/table/settings.ini
@@ -15,14 +15,13 @@
 SDTG_BOOL  =  SDTG_BOOL($name,              $flags, $guiflags, $var, $def,                        $str, $proc, $from, $to),
 SDTG_VAR   =   SDTG_VAR($name,       $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $proc, $from, $to),
 SDTC_BOOL  =  SDTC_BOOL(       $var,        $flags, $guiflags, $def,                              $str, $proc, $from, $to),
+SDTC_LIST  =  SDTC_LIST(       $var, $type, $flags, $guiflags, $def,                              $str, $proc, $from, $to),
+SDTC_OMANY = SDTC_OMANY(       $var, $type, $flags, $guiflags, $def,             $max, $full,     $str, $proc, $from, $to),
+SDTC_STR   =   SDTC_STR(       $var, $type, $flags, $guiflags, $def,                              $str, $proc, $from, $to),
+SDTC_VAR   =   SDTC_VAR(       $var, $type, $flags, $guiflags, $def,       $min, $max, $interval, $str, $proc, $from, $to),
 SDT_BOOL   =   SDT_BOOL($base, $var,        $flags, $guiflags, $def,                              $str, $proc, $from, $to),
-SDTC_DBOOL =  SDTC_BOOL(       $var,        $flags, $guiflags, $def,                              $str, $proc, $from, $to),
-SDT_DBOOL  =   SDT_BOOL($base, $var,        $flags, $guiflags, $def,                              $str, $proc, $from, $to),
-SDTC_OMANY = SDTC_OMANY(       $var, $type, $flags, $guiflags, $def,             $max, $full,     $str, $proc, $from, $to),
 SDT_OMANY  =  SDT_OMANY($base, $var, $type, $flags, $guiflags, $def,             $max, $full,     $str, $proc, $from, $to, $load),
 SDT_STR    =    SDT_STR($base, $var, $type, $flags, $guiflags, $def,                              $str, $proc, $from, $to),
-SDTC_STR   =   SDTC_STR(       $var, $type, $flags, $guiflags, $def,                              $str, $proc, $from, $to),
-SDTC_VAR   =   SDTC_VAR(       $var, $type, $flags, $guiflags, $def,       $min, $max, $interval, $str, $proc, $from, $to),
 SDT_VAR    =    SDT_VAR($base, $var, $type, $flags, $guiflags, $def,       $min, $max, $interval, $str, $proc, $from, $to),
 SDT_NULL   =   SDT_NULL($length, $from, $to),
 SDT_END    = SDT_END()
@@ -2334,6 +2333,55 @@
 max      = 65500
 
 [SDTC_VAR]
+var      = music.playlist
+type     = SLE_UINT8
+flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def      = 0
+min      = 0
+max      = 5
+interval = 1
+
+[SDTC_VAR]
+var      = music.music_vol
+type     = SLE_UINT8
+flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def      = 127
+min      = 0
+max      = 127
+interval = 1
+
+[SDTC_VAR]
+var      = music.effect_vol
+type     = SLE_UINT8
+flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def      = 127
+min      = 0
+max      = 127
+interval = 1
+
+[SDTC_LIST]
+var      = music.custom_1
+type     = SLE_UINT8
+flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def      = NULL
+
+[SDTC_LIST]
+var      = music.custom_2
+type     = SLE_UINT8
+flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def      = NULL
+
+[SDTC_BOOL]
+var      = music.playing
+flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def      = true
+
+[SDTC_BOOL]
+var      = music.shuffle
+flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
+def      = false
+
+[SDTC_VAR]
 ifdef    = ENABLE_NETWORK
 var      = gui.network_chat_box_width
 type     = SLE_UINT16