@Resources/settings.lua
--
-- DO NOT DELETE
--
-- SETTINGS MODULE
-- Made by Redsaph exclusively for Cleartext
--
-- janvelasco.com
-- github.com/redsaph/cleartext
--
-- If you have read this and have the intention
-- of using this, please do not delete this flower box
-- and just append on it.
--
-- Thank you very much.
--
-- Last modified by Redsaph on June 25, 2020
--

playerTable = {
	["Windows Media Player"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "WMP",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_yellow#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["Foobar2000"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "CAD",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_yellow#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["MusicBee"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "CAD",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_yellow#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["Spotify (NowPlaying)"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "Spotify",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_yellow#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["iTunes"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "iTunes",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_yellow#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["VLC"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "CAD",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_yellow#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["WebNowPlaying"] = {
		player_controller = "StateButton2",
		player_mode = "2",
		player_supposed = "Spotify",
		disable_np = "1",
		disable_gpmdp = "1",
		disable_wnp = "0",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_yellow#",
		color_btn_zune_sint = "#const_gray#"
	},
	["GPMDP"] = {
		player_controller = "StateButton1",
		player_mode = "1",
		player_supposed = "Spotify",
		disable_np = "1",
		disable_gpmdp = "0",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_yellow#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["MediaMonkey"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "MediaMonkey",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_yellow#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["Media Player Classic"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "WLM",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_yellow#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["J. River Media Center"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "CAD",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_yellow#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["Winamp"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "Winamp",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_yellow#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	},
	["Zune"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "WLM",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_gray#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_yellow#"
	},
	["AIMP"] = {
		player_controller = "Title0",
		player_mode = "0",
		player_supposed = "AIMP",
		disable_np = "0",
		disable_gpmdp = "1",
		disable_wnp = "1",
		color_btn_aimp_sint = "#const_yellow#",
		color_btn_foobar2000_sint = "#const_gray#",
		color_btn_gpmdp_sint = "#const_gray#",
		color_btn_itunes_sint = "#const_gray#",
		color_btn_jrmc_sint = "#const_gray#",
		color_btn_mediamonkey_sint = "#const_gray#",
		color_btn_mpc_sint = "#const_gray#",
		color_btn_musicbee_sint = "#const_gray#",
		color_btn_spotify_sint = "#const_gray#",
		color_btn_vlc_sint = "#const_gray#",
		color_btn_winamp_sint = "#const_gray#",
		color_btn_wmp_sint = "#const_gray#",
		color_btn_wnp_sint = "#const_gray#",
		color_btn_zune_sint = "#const_gray#"
	}
}

function Initialize()
	dofile(SKIN:GetVariable('@')..'align.lua')
end -- ends Initialize

function setPlayer(selectedPlayerName)
	SKIN:Bang('!WriteKeyValue Variables player_setname "' .. selectedPlayerName .. '" "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables player_supposed ' .. playerTable[selectedPlayerName]['player_supposed'] .. ' "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables player_mode ' .. playerTable[selectedPlayerName]['player_mode'] .. ' "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables player_controller ' .. playerTable[selectedPlayerName]['player_controller'] .. ' "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables disable_np ' .. playerTable[selectedPlayerName]['disable_np'] .. ' "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables disable_gpmdp ' .. playerTable[selectedPlayerName]['disable_gpmdp'] .. ' "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables disable_wnp ' .. playerTable[selectedPlayerName]['disable_wnp'] .. ' "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_aimp_sint "' .. playerTable[selectedPlayerName]['color_btn_aimp_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_foobar2000_sint "' .. playerTable[selectedPlayerName]['color_btn_foobar2000_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_gpmdp_sint "' .. playerTable[selectedPlayerName]['color_btn_gpmdp_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_itunes_sint "' .. playerTable[selectedPlayerName]['color_btn_itunes_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_jrmc_sint "' .. playerTable[selectedPlayerName]['color_btn_jrmc_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_mediamonkey_sint "' .. playerTable[selectedPlayerName]['color_btn_mediamonkey_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_mpc_sint "' .. playerTable[selectedPlayerName]['color_btn_mpc_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_musicbee_sint "' .. playerTable[selectedPlayerName]['color_btn_musicbee_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_spotify_sint "' .. playerTable[selectedPlayerName]['color_btn_spotify_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_vlc_sint "' .. playerTable[selectedPlayerName]['color_btn_vlc_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_winamp_sint "' .. playerTable[selectedPlayerName]['color_btn_winamp_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_wmp_sint "' .. playerTable[selectedPlayerName]['color_btn_wmp_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_wnp_sint "' .. playerTable[selectedPlayerName]['color_btn_wnp_sint'] .. '" "#@#var_int.inc"')
	SKIN:Bang('!WriteKeyValue Variables color_btn_zune_sint "' .. playerTable[selectedPlayerName]['color_btn_zune_sint'] .. '" "#@#var_int.inc"')
end -- ends setPlayer

function toggleAdaptiveHide()
	bool_adaptivehide = SKIN:GetVariable('bool_adaptivehide')

	if bool_adaptivehide == '0' then	
		SKIN:Bang('!WriteKeyValue Variables bool_adaptivehide "1" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables color_btn_adaptivehide_sint "#const_yellow#" "#@#var_int.inc"')
		SKIN:Bang('!WriteKeyValue Variables bool_btn_adaptivehide_sint on "#@#var_int.inc"')
	else
		SKIN:Bang('!WriteKeyValue Variables bool_adaptivehide "0" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables color_btn_adaptivehide_sint "#const_gray#" "#@#var_int.inc"')
		SKIN:Bang('!WriteKeyValue Variables bool_btn_adaptivehide_sint off "#@#var_int.inc"')
	end
end -- ends toggleAdaptiveHide

function toggleScroll()
	bool_scroll = SKIN:GetVariable('bool_scroll')

	if bool_scroll == '0' then	
		SKIN:Bang('!WriteKeyValue Variables bool_scroll "1" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables color_btn_scrolling_sint "#const_gray#" "#@#var_int.inc"')
		SKIN:Bang('!WriteKeyValue Variables bool_btn_scrolling_sint off "#@#var_int.inc"')
	else
		SKIN:Bang('!WriteKeyValue Variables bool_scroll "0" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables color_btn_scrolling_sint "#const_yellow#" "#@#var_int.inc"')
		SKIN:Bang('!WriteKeyValue Variables bool_btn_scrolling_sint on "#@#var_int.inc"')
	end
end -- ends toggleScroll

function toggleStow()
	bool_stow = SKIN:GetVariable('bool_stow')

	if bool_stow == '0' then	
		SKIN:Bang('!WriteKeyValue Variables bool_stow "1" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables name_stowgroup "Stow" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables color_btn_stow_sint "#const_yellow#" "#@#var_int.inc"')
		SKIN:Bang('!WriteKeyValue Variables bool_btn_stow_sint on "#@#var_int.inc"')
	else
		SKIN:Bang('!WriteKeyValue Variables bool_stow "0" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables name_stowgroup "NULL" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables color_btn_stow_sint "#const_gray#" "#@#var_int.inc"')
		SKIN:Bang('!WriteKeyValue Variables bool_btn_stow_sint off "#@#var_int.inc"')
	end
end -- ends toggleStow

function toggleTrim()
	bool_texttrim = SKIN:GetVariable('bool_texttrim')

	if bool_texttrim == '0' then	
		SKIN:Bang('!WriteKeyValue Variables bool_texttrim "1" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables color_btn_trim_sint "#const_yellow#" "#@#var_int.inc"')
		SKIN:Bang('!WriteKeyValue Variables bool_btn_trim_sint on "#@#var_int.inc"')
		print("On")
	else
		SKIN:Bang('!WriteKeyValue Variables bool_texttrim "0" "#@#var.inc"')
		SKIN:Bang('!WriteKeyValue Variables color_btn_trim_sint "#const_gray#" "#@#var_int.inc"')
		SKIN:Bang('!WriteKeyValue Variables bool_btn_trim_sint off "#@#var_int.inc"')
		print("Off")
	end
end -- ends toggleAdaptiveHide

function rescale(size)
	bool_alignright = SKIN:GetVariable('bool_alignright')
	bool_aligncenter = SKIN:GetVariable('bool_aligncenter')
--	width = SKIN:GetVariable('size')
	
--	SKIN:Bang('!Refresh #CURRENTCONFIG#')

	print('size: ' .. size)
	SKIN:Bang('!WriteKeyValue Variables skinSize "' .. size .. '" "#@#var.inc"')
	
-- 	print('in realign')
-- 	print('bool_alignright: ' .. bool_alignright)
-- 	print('bool_aligncenter: ' .. bool_aligncenter)
	
	if bool_alignright == '0' and bool_aligncenter == '0' then
		alignLeft(size)
	elseif bool_alignright == '1' then
		alignRight(size)
	elseif bool_aligncenter == '1' then
		alignCenter(size)
	end

	SKIN:Bang('!Refresh #CURRENTCONFIG#')

end -- ends realign

function resetFonts()
	SKIN:Bang('!WriteKeyValue Variables font_weightbtm 700 "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables font_texttop "Red Hat Display" "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables font_textbtm "Red Hat Display" "#@#var.inc"')
	SKIN:Bang('!WriteKeyValue Variables font_textinterface "Red Hat Text Medium" "#@#var.inc"')
end -- ends resetFonts