
<!-- **Checkbox's for prefs** -->

<?macrodef prefs_checkbox
	<window name="$(what)Checkbox" type="button" alignment="$(alignment1)" offset="$(offset1)" transparent="true" hitstyle="ACTIVE" >

		<property hover="true" />
		<imagestyle name="state0">
			<include source="MML_Mood_DlgCheckBoxState0" />
		</imagestyle>
		<imagestyle name="state1">
			<include source="MML_Mood_DlgCheckBoxState1" />
		</imagestyle>

		<script name="OnInit">
			$savestate = :sonique.prefs.GetString("Bluey","$(what)_open");
			if($savestate)
			{
				SetButtonState(1);
			}
			$(extra)
		</script>
		<script name="OnMouseOver">
			:sonique.Status("$(what)");
		</script>
		<script name="OnClick">
			$savestate = :sonique.prefs.GetString("Bluey","$(what)_open");
			if($savestate)
			{
				$(what)_open="false";
				SetButtonState(0);
				:sonique.prefs.SetString("Bluey","$(what)_open","false");
			}
			else
			{
				$(what)_open="true";
				SetButtonState(1);
				:sonique.prefs.SetString("Bluey","$(what)_open","true");
			}
			$(extra)
		</script>
	</window>

	<window name="$(what)_title" type="textdisplay" offset="$(offset2)" alignment="$(alignment2)"  transparent="true" >
		<property font_color="white" />
		<script name="OnInit">
			SetText("$(hint)");
		</script>
	</window>
?>


<!-- **standard window content** -->

<?macrodef sntd_stuff
	<window name="name_$(text)" type="button" transparent="true" alignment="$(alignment)" offset="$(offset)" hitstyle="ACTIVE">
		<property hover="true" default_delay="50" />
		<ImageStyle name="state0">
			<text state="hit" color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text)</text>
			<text state="hover" color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text)</text>
			<text color="dk_grey" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text)</text>
		</ImageStyle>
		<ImageStyle name="state1">
			<text state="hit" color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">!</text>
			<text state="hover" color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">!</text>
			<text color="dk_grey" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">!</text>
		</ImageStyle>
		<script name="OnLeftButtonUp">
			<?macroins $(script_macro) ?$>
		</script>

?>


<!-- **standard buttons** -->

<?macrodef basic_button
	<?macroins sntd_stuff text="$(text)" alignment="$(alignment)" offset="$(offset)" font="$(font)" script_macro="$(script_macro)" ?$>
		<script name="OnMouseOver">
			:sonique.Status("$(script_macro)");
		</script>
	</window>
?>

<?macrodef other_button
	<window name="name_$(script_macro)" type="button" transparent="true" alignment="$(alignment)" offset="$(offset)" hitstyle="ACTIVE">
		<property hover="true" default_delay="50" />
		<ImageStyle name="state0">
			<text state="hit" color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text)</text>
			<text state="hover" color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text)</text>
			<text color="dk_grey" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text)</text>
		</ImageStyle>
		<script name="OnLeftButtonUp">
			<?macroins $(script_macro) windowname="$(windowname)" ?$>
		</script>
		<script name="OnMouseOver">
			:sonique.Status("$(script_macro)");
		</script>
	</window>
?>

<?macrodef onoff_button
	<window name="$(name)" type="button" transparent="true" alignment="$(alignment)" offset="$(offset)" hitstyle="ACTIVE">
		<property hover="true" default_delay="50" />
		<ImageStyle name="state0">
			<text state="hit" color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text)</text>
			<text state="hover" color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text)</text>
			<text color="dk_grey" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text)</text>
		</ImageStyle>
		<ImageStyle name="state1">
			<text state="hit" color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text2)</text>
			<text state="hover" color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text2)</text>
			<text color="dk_grey" justification="h_center|v_center|single_line_only" font_style="BlueyFont$(font)">$(text2)</text>
		</ImageStyle>
		<script name="OnClick"> $(script) </script>
		<script name="OnInit"> $(script2) </script>
		<script name="OnMouseOver">
			:sonique.Status("$(hint)");
		</script>
	</window>
?>

<?macrodef jpg_button
	<window type="button" transparent="true" shape="$(raster)" alignment="$(alignment)" offset="$(offset)" hitstyle="active">
		<property hover="true" default_delay="50" />
		<ImageStyle name="state0">
			<color_fill state="hover" color="dk_grey" opacity="0.8" />
			<color_fill color="dk_grey" opacity="0.5" />
		</ImageStyle>

		<shape name="$(raster)">
			<shape_raster source="bluey.psd|$(raster)" />
		</shape>

		<script name="OnClick">
			<?macroins $(script_macro) ?$>
		</script>
		<script name="OnMouseOver">
			:sonique.Status("$(script_macro)");
		</script>
	</window>

?>


<!-- **top buttons for windows** -->

<?macrodef top_buttons
	<?macroins basic_button text="X" script_macro="close"
		 font="1" alignment="upperright" offset="-16, 5, -6, 17" ?$>

	<?macroins basic_button text="_" script_macro="minimize"
		 font="1" alignment="upperright" offset="-27, 5, -17, 17" ?$>

	<?macroins onoff_button text="+" text2="o" hint="Always Ontop" name="$(thewindow)_alwaystop"
		script="$topstate = :sonique.prefs.GetString("Bluey","$(thewindow)AlwaysTop");
			if($topstate)
			{
			parent.SetAlwaysOnTop(0);
			SetButtonState(0);
			:sonique.prefs.SetString("Bluey","$(thewindow)AlwaysTop","false");
			}
			else
			{
			parent.SetAlwaysOnTop(1);
			SetButtonState(1);
			:sonique.prefs.SetString("Bluey","$(thewindow)AlwaysTop","true");
			}"
		script2="$topstate = :sonique.prefs.GetString("Bluey","$(thewindow)AlwaysTop");
			if($topstate)
			{
			SetButtonState(1);
			}"
		 font="1" alignment="upperright" offset="-38, 5, -28, 17" ?$>

	<?macroins other_button text="&gt;" script_macro="UpTrans" windowname="$(thewindow)"
		 font="1" alignment="upperright" offset="-52, 5, -42, 17" ?$>

	<?macroins other_button text="&lt;" script_macro="DownTrans" windowname="$(thewindow)"
		 font="1" alignment="upperright" offset="-65, 5, -55, 17" ?$>



?>


<!-- **navigation system macro/scripts for nav buttons** -->

<?macrodef close_windows
	if ($(whatwindow)_open)
	{	
		$(whatwindow).SetAlignment({0,0,0,0},0,600,"linear_accel");
		$(whatwindow)controls.SetAlignment({1,1,1,1},0,400,"linear_accel");
		$(whatwindow)_open="false";
		if (windowsaving_open)
		{
			:sonique.prefs.SetString("Bluey","$(whatwindow)_open",false);
		}
	}
?>

<?macrodef close_controls
	if ($(whatwindow)_open)
	{
		$(whatwindow)controls.SetAlignment({1,1,1,1},0,400,"linear_accel");
	}
?>

<?macrodef complex_button
	<?macroins sntd_stuff text="$(text)" alignment="$(alignment)" offset="$(offset)" font="$(font)" script_macro="$(script_macro)" ?$>
		<script name="OnMouseOver">
			:sonique.Status("$(whatwindow)");
		</script>
		<script name="WindowToggle">

	<!-- **if window already open.. close it** -->

 			if ($(whatwindow)_open)
			{
				$(whatwindow)controls.SetAlignment({1,1,1,1},0,400,"linear_accel");
				$(whatwindow).SetAlignment({1,1,1,1},0,600,"linear_accel");
				$(whatwindow).SetOffset({0,0,0,-30}+window_pos,0,400,"linear_accel");


		<!-- **are we saving this stuff automatically??**-->

				if (windowsaving_open)
				{
					:sonique.prefs.SetString("Bluey","$(whatwindow)_open",false);
				}


		<!-- **now the window is closed** -->

				$(whatwindow)_open="false";
			}

	<!-- **if it aint open, then we should open it :)** -->	
	
			else
			{

		<!-- **do we want to close other windows if they are open??(overlaymode)** -->

				if (OverLayMode_open == "false")
				{
					$(whatwindow)controls.SetAlignment({0.55,1,0.9,1},0,400,"linear_accel");
					$(whatwindow).SetAlignment({0,0,1,1},0,400,"linear_accel");
					$(whatwindow).SetOffset({0,0,0,-30}+window_pos,0,400,"linear_accel");

					<?macroins close_windows whatwindow="player" ?$>
					<?macroins close_windows whatwindow="playlist" ?$>
					<?macroins close_windows whatwindow="visual" ?$>
					<?macroins close_windows whatwindow="console" ?$>
					<?macroins close_windows whatwindow="options" ?$>
					<?macroins close_windows whatwindow="eq" ?$>
				}

		<!-- **if we dont wanna close other windows we'll just open ontop of them but still close controls so they dont mess together** -->

				else
				{
					$(whatwindow).SetAlignment({0,0,1,1},0,400,"linear_accel");
					$(whatwindow).SetOffset({0,0,0,-30}+window_pos,0,400,"linear_accel");
					$(whatwindow)controls.SetAlignment({0.55,1,0.9,1},0,400,"linear_accel");

					<?macroins close_controls whatwindow="player" ?$>
					<?macroins close_controls whatwindow="playlist" ?$>
					<?macroins close_controls whatwindow="visual" ?$>
					<?macroins close_controls whatwindow="console" ?$>
					<?macroins close_controls whatwindow="options" ?$>
					<?macroins close_controls whatwindow="eq" ?$>					
				}

		<!-- **so now we are open** -->

				$(whatwindow)_open="true";

			<!-- **are we saving this stuff automatically??**-->

				if (windowsaving_open)
				{
					:sonique.prefs.SetString("Bluey","$(whatwindow)_open",true);
				}
			}
		</script>

		<script name="OnRightButtonUp">

	<!-- **open the detached window** -->

			:sonique.LaunchWindow("twist/bluey/1.0","Generic","detached$(whatwindow)");


	<!-- **if we are already open, close it before going into detached mode** -->

			if ($(whatwindow)_open)
			{
				$(whatwindow)controls.SetAlignment({1,1,1,1},0,400,"linear_accel");
				$(whatwindow).SetAlignment({1,1,1,1},0,600,"linear_accel");
				$(whatwindow).SetOffset({0,0,0,-30}+window_pos,0,400,"linear_accel");
			}
			
		<!-- **are we saving this stuff automatically??**-->

				if (windowsaving_open)
				{
					:sonique.prefs.SetString("Bluey","$(whatwindow)_open",false);
				}

	<!-- **now its closed** -->

			$(whatwindow)_open="false";

		</script>
	</window>
?>


<!-- **put a title on each window** -->

<?macrodef window_title
	<window name="title" transparent="true" type="textdisplay" alignment="0.3,0,0.5,1" offset="-30,5,20,20" >
		<property 
			font_color="white" 
			font_style="BlueyFont1"
			font_justification="single_line_only|trim_pixels"
			whitespace="20"
			/>
		<script name="OnInit">
			SetText("$(name)");
		</script>
	</window>
?>


<!-- **player control bar** -->

<?macrodef Player_buttons
	<?macroins onoff_button text="s" text2="S" hint="Shuffle Toggle" name="Shuffle"
		script="$topstate = :sonique.prefs.GetString("Bluey","Shuffle");
			if($topstate)
			{
				$currentstate = :sonique.players.default.GetShuffle();
				:sonique.players.default.SetShuffle(0);
				SetButtonState(0);
				:sonique.prefs.SetString("Bluey","Shuffle","false");
			}
			else
			{
				:sonique.players.default.SetShuffle(1);
				SetButtonState(1);
				:sonique.prefs.SetString("Bluey","Shuffle","true");
			}"
		script2="$currentstate = :sonique.prefs.GetString("Bluey","Shuffle");
			if($currentstate)
			{
				SetButtonState(1);
			}"
		 font="3" alignment="0,0,0,0" offset="18,-1,24,6" ?$>

		<window type="button" transparent="true" alignment="0,0,0,0" offset="27,-1,33,6" hitstyle="ACTIVE">
			<property hover="true" default_delay="50" />
			<ImageStyle name="state0">
				<text state="hit" color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont3">r</text>
				<text state="hover" color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont3">r</text>
				<text color="dk_grey" justification="h_center|v_center|single_line_only" font_style="BlueyFont3">r</text>
			</ImageStyle>
			<ImageStyle name="state1">
				<text state="hit" color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont3">R</text>
				<text state="hover" color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont3">R</text>
				<text color="dk_grey" justification="h_center|v_center|single_line_only" font_style="BlueyFont3">R</text>
			</ImageStyle>
			<ImageStyle name="state2">
				<text state="hit" color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont3">R</text>
				<text state="hover" color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont3">R</text>
				<text color="red" justification="h_center|v_center|single_line_only" font_style="BlueyFont3">R</text>
			</ImageStyle>
			<script name="OnClick" > 
				$currentstate = :sonique.players.default.GetRepeat();
				:sonique.players.default.SetRepeat( { off: "one", one: "all", all: "off" }[$currentstate] ); 
				SetButtonState( { off: 0, one: 1, all: 2 }[:sonique.players.default.GetRepeat()] );
				:sonique.prefs.SetString("Bluey","Repeat", :sonique.players.default.GetRepeat());
			</script>
			<script name="OnInit">
				$currentstate = :sonique.prefs.GetString("Bluey","Repeat");
				if($currentstate=="one")
				{
					SetButtonState(1);
				}
				if($currentstate=="all")
				{
					SetButtonState(2);
				}
			</script>
		<script name="OnMouseOver">
			:sonique.Status("Repeat Toggle");
		</script>
		</window>

	</window>
?>


<!-- **playlist control bar** -->

<?macrodef player_contents
		<window name="sgprogress" transparent="true" type="Sonique2_Progress" alignment="0.5,0,0.5,0" offset="-50,20,50,30" hitstyle="ACTIVE" >
			<ImageStyle name="barfilled">
				<color_fill color="vdk_blue" />
				<text color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont1">Song Progress</text>
			</ImageStyle>
			<ImageStyle name="barempty">
		 		<color_fill color="dk_blue" />
				<text color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont1">Song Progress</text>
			</ImageStyle>	
			<Property orientation="left_to_right" />
		</window>

		<window name="plprogress" transparent="true" type="Sonique2_Progress" alignment="0.5,0,0.5,0" offset="-50,40,50,50" hitstyle="ACTIVE" >
			<property type="playlistprogress" />
			<ImageStyle name="barempty">
				<color_fill color="vdk_blue" />
				<text color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont1">PL Progress</text>
			</ImageStyle>
			<ImageStyle name="barfilled">
		 		<color_fill color="dk_blue" />
				<text color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont1">PL Progress</text>
			</ImageStyle>	
			<Property orientation="left_to_right" />
		</window>

		<window name="volume" transparent="true" type="fillbar" alignment="0.5,0,0.5,0" offset="-50,60,50,70" hitstyle="ACTIVE" >
			<script name="OnPosChange">
				:sonique.players.default.SetVolume( GetRealPos() );
			</script>
			<script name="OnInit">
				OnVolumeChanged();
			</script>

			<ImageStyle name="barfilled">
				<color_fill color="vdk_blue" />
				<text color="white" justification="h_center|v_center|single_line_only" font_style="BlueyFont1">Volume</text>
			</ImageStyle>
			<ImageStyle name="barempty">
		 		<color_fill color="dk_blue" />
				<text color="black" justification="h_center|v_center|single_line_only" font_style="BlueyFont1">Volume</text>
			</ImageStyle>	
			<Property orientation="left_to_right" />
		</window>

		<window name="track_display" transparent="true" type="Sonique2_TrackDisplay" alignment="0.5,0,0.5,0" offset="-50,80,-30,90" >
			<property font_style="Blueyfont5" font_color="0xFFFFFFFF" font_justification="v_center|single_line_only" />
		</window>


<!-- format from tool/adil egg remote -->

		<window name="time_display" transparent="true" type="Sonique2_TimeDisplay" alignment="0.5,0,0.5,0" offset="-25,80,50,90 " hitstyle="active" >
			<property font_style="Blueyfont5" font_color="0xFFFFFFFF" format="%(02%Minutes):%(02%Seconds)" font_justification="v_center|right|single_line_only" updateinterval="100" />
		</window>

	<script name="OnVolumeChanged">
 		volume.SetRealPos( :sonique.players.default.GetVolume() );
	</script>
?>


<!-- **playlist control bar** -->

<?macrodef Playlist_buttons
		<?macroins other_button text="O" script_macro="OpenPl" windowname="$(windowname)"
			 font="3" offset="0,-1,6,6" alignment="0,0,0,0" ?$>

		<?macroins other_button text="A" script_macro="AppendPl" windowname="$(windowname)"
			 font="3" offset="9,-1,15,6" alignment="0,0,0,0" ?$>

		<?macroins other_button text="R" script_macro="ReversePl" windowname="$(windowname)"
			 font="3" offset="18,-1,24,6" alignment="0,0,0,0" ?$>

		<?macroins other_button text="C" script_macro="ClearPl" windowname="$(windowname)"
			 font="3" offset="27,-1,33,6" alignment="0,0,0,0" ?$>

		<?macroins other_button text="S" script_macro="SavePl" windowname="$(windowname)"
			 font="3" offset="36,-1,42,6" alignment="0,0,0,0" ?$>
	</window>
?>


<!-- **visual control bar** -->

<?macrodef Visual_buttons
		<?macroins other_button text="P" script_macro="PrevVis" windowname="$(windowname)"
			 font="3" offset="1,-1,7,6" alignment="0,0,0,0" ?$>

		<?macroins other_button text="N" script_macro="NextVis" windowname="$(windowname)"
			 font="3" offset="12,-1,18,6" alignment="0,0,0,0" ?$>

		<?macroins other_button text="F" script_macro="FsVis" windowname="$(windowname)"
			 font="3" offset="28,-1,34,6" alignment="0,0,0,0" ?$>
	</window>
?>


<!-- **console control bar** -->

<?macrodef Console_buttons
	</window>
?>


<!-- **options control bar** -->

<?macrodef Options_buttons
	</window>
?>


<!-- **eq control bar** -->

<?macrodef EQ_buttons

		<?macroins other_button text="R" script_macro="ResetEQ" windowname=""
			 font="3" offset="28,-1,34,6" alignment="0,0,0,0" ?$>
	</window>
?>

<!-- **window contents for detached windows** -->

<?macrodef window_contents
	<ImageStyle name="background">
			<gradient_linear angle="25" palette="outter" spread="1" /> 
				<palette name="outter" spline="true">
					<cp x="1.0" value="grey"/>
					<cp x="0.0" value="vdk_grey"/>
				</palette>
		<color_rect color="black" cornerradius="15,15" thickness="2" antialias="true" />
	</ImageStyle>


<!-- **detached window loading/saving shit** -->

	<Script name="OnInit">
		alpha_blend_open=:sonique.prefs.GetString("Bluey","alpha_blend_open");
		SetOpacity(:sonique.prefs.GetString("Bluey","$(thewindow)_opacity"),0,1,"linear_smooth");
		detachedPlaylist_open=:sonique.prefs.GetString("Bluey","detachedPlaylist_open");
		detachedVisual_open=:sonique.prefs.GetString("Bluey","detachedVisual_open");
		detachedConsole_open=:sonique.prefs.GetString("Bluey","detachedConsole_open");
		detachedOptions_open=:sonique.prefs.GetString("Bluey","detachedOptions_open");
		detachedEQ_open=:sonique.prefs.GetString("Bluey","detachedEQ_open");
		$(thewindow)_open = "true";
		windowsaving_open=:sonique.prefs.GetString("Bluey","windowsaving_open");
		VisualFPS=:sonique.prefs.GetString("Bluey","VisualFPS");

		if ( detachedPlaylist_open)
		{
			:app.RegisterWindowKeyScript(	"ctrl-d",	"pl=Playlistinner.openPlaylist.GetPlaylist(); pl.RemoveAll();", this);
		}
		if ( detachedVisual_open)
		{
			SetDesiredFPS(:sonique.prefs.GetString("Bluey","VisualFPS"));
		}
		$Posx=:sonique.prefs.GetString("Bluey","$(thewindow)PosX");
		$Posy=:sonique.prefs.GetString("Bluey","$(thewindow)PosY");
		SetLocation({$Posx,$Posy});
		$Sizex=:sonique.prefs.GetString("Bluey","$(thewindow)SizeX");
		$Sizey=:sonique.prefs.GetString("Bluey","$(thewindow)SizeY");
		SetSize({$Sizex,$Sizey},100,100,"linear_accel");
		if(alpha_blend_open == "false")
		{
			name_UpTrans.Hide();
			name_DownTrans.Hide();
		}
	</script>


<!-- save detached window size and location on close** -->

	<script name="OnDestroy">
		if (windowsaving_open)
		{
			$LastSize=GetSize();
			:sonique.prefs.SetString("Bluey","$(thewindow)SizeX",$LastSize[0]);
			:sonique.prefs.SetString("Bluey","$(thewindow)SizeY",$LastSize[1]);
			$LastPos=GetLocation();
			:sonique.prefs.SetString("Bluey","$(thewindow)PosX",$LastPos[0]);
			:sonique.prefs.SetString("Bluey","$(thewindow)PosY",$LastPos[1]);
		}
		if ( detachedPlaylist_open)
		{
			:app.UnregisterWindowKeyScript(	"ctrl-d",	"pl=detachedPlaylistinner.openPlaylist.GetPlaylist(); pl.RemoveAll();", this);
		}
	</script>


<!-- **top buttons** -->


	<?macroins top_buttons thewindow="$(thewindow)" ?$> 

<!-- **window title** -->

	<?macroins window_title name="$(name)" ?$>


<!-- **inner rounded rect(blue) for detached windows** -->

	<window name="$(thewindow)_inner" alignment="entire" offset="10,20,-10,-15" transparent="true" shape="inner" hitstyle="none">
		
		<ImageStyle name="background">
			<color_fill color="blue" />
			<color_rect cornerradius="5,5" color="black" />
		</ImageStyle>

		<Script name="OnInit">
			SetOpacity(:sonique.prefs.GetString("Bluey","$(thewindow)_opacity"),0,1,"linear_smooth");
		</script>

<!-- **make a window save as "open" for next time bluey is opened** -->

	<?macroins onoff_button text="0" text2="1" hint="Save as Open" name="$(thewindow)_savedopen"
		script="if ($(thewindow)_open == "false")
			{
				$(thewindow)_open = "true";
				if (windowsaving_open)
				{
					:sonique.prefs.SetString("Bluey","$(thewindow)_open",true);
				}
				SetButtonState(1);
			}
			else
			{
				$(thewindow)_open = "false";
				if (windowsaving_open)
				{
					:sonique.prefs.SetString("Bluey","$(thewindow)_open",false);
				}
				SetButtonState(0);
			}"
		script2="$(thewindow)_open = :sonique.prefs.GetString("Bluey","$(thewindow)_open");
			if ($(thewindow)_open)
			{
				SetButtonState(1);
			}"
		font="2" alignment="1,1,1,1" offset="-12, -11, -2 , -2" ?$>
?>


<!-- **basic scripts** -->

<?macrodef Open		:sonique.OpenFiles(); ?>
<?macrodef Back		:sonique.players.default.Previous(); ?>
<?macrodef Play		:sonique.players.default.Play(); ?>
<?macrodef Next		:sonique.players.default.Next(); ?>
<?macrodef Minimize	MinimizeWindow(1); ?>
<?macrodef page1	name_page1.Hide(); name_page2.Show(); BlueyPrefs.Hide(); displaywindow.Show(); ?>
<?macrodef page2	name_page1.Show(); name_page2.Hide(); displaywindow.Hide(); BlueyPrefs.Show(); ?>
<?macrodef Close	parent.DestroyWindow(); ?>
<?macrodef PrevVis	$(windowname).PreviousVisual(); ?>
<?macrodef NextVis	$(windowname).NextVisual(); ?>
<?macrodef WhatWindow	WindowToggle(); ?>
<?macrodef MainWindow	:sonique.LaunchAppWindow("main"); ?>
<?macrodef ResetEQ	:sonique.players.default.equalizer.Reset(); ?>

<?macrodef FsVis
	$cur = $(windowname).GetVisual();
	:sonique.visuals.LaunchFullScreenVis($cur);
?>
<?macrodef OpenPl
	pl=$(windowname).GetPlaylist();
	:sonique.LoadPlaylistFile(pl,"false");
?>
<?macrodef AppendPl
	pl=$(windowname).GetPlaylist();
	:sonique.LoadPlaylistFile(pl,"false");
?>
<?macrodef ReversePl
	pl=$(windowname).GetPlaylist();
	pl.Reverse();
?>
<?macrodef ClearPl
	pl=$(windowname).GetPlaylist();
	pl.RemoveAll();
?>
<?macrodef SavePl
	pl=$(windowname).GetPlaylist();
	:sonique.SavePlaylistFile(pl);
?> 
<?macrodef UpTrans
	$currenttrans = parent.GetOpacity();
	$nexttrans = :math.Truncate($currenttrans+0.1, 1);
	if($currenttrans!="1.0")
	{
		parent.SetOpacity($nexttrans,0,1,"linear_smooth");
		$(windowname)_inner.SetOpacity($nexttrans,0,1,"linear_smooth");
	}
	else if($currenttrans=="1.0")
	{
		parent.SetOpacity(1.0,0,1,"linear_smooth" );
		$(windowname)_inner.SetOpacity(1.0,0,1,"linear_smooth" );
	}
	:sonique.prefs.SetString("Bluey","$(windowname)_opacity",$currenttrans);
?>
<?macrodef DownTrans
	$currenttrans = parent.GetOpacity();
	$nexttrans = :math.Truncate($currenttrans-0.1, 1);
	if($currenttrans!="0.2")
	{
		parent.SetOpacity($nexttrans,0,1,"linear_smooth");
		$(windowname)_inner.SetOpacity($nexttrans,0,1,"linear_smooth");
	}
	else if($currenttrans=="0.2")
	{
		parent.SetOpacity(0.2,0,1,"linear_smooth" );
		$(windowname)_inner.SetOpacity(0.2,0,1,"linear_smooth" );
	}
	:sonique.prefs.SetString("Bluey","$(windowname)_opacity",$currenttrans);
?>

<!-- **fonts** -->

	<FontStyle name="BlueyFont1" face="MS Sans Serif" size="10" style="bold" />
	<FontStyle name="BlueyFont2" face="MS Sans Serif" size="8" style="bold" />
	<FontStyle name="BlueyFont3" face="sserife" size="8" />
	<FontStyle name="BlueyFont4" face="webdings" size="6" />


<!-- **colours** -->

	<color name="blue">0xFF398BFB</color>
	<color name="dk_blue">0xFF1111FF</color>
	<color name="vdk_blue">0xFF3344AA</color>
	<color name="vdk_grey">0xFF333333</color>
	<color name="dk_grey">0xFF3A3C3E</color>
	<color name="grey">0xFF787878</color>
	<color name="black">0xFF000000</color>
	<color name="white">0xFFFFFFFF</color>
	<color name="red">0xFFFF0000</color>


<!-- **resizable/draggable body for windows** -->

	<HitStyle name="Body" default_hitcode="DRAG" >
		<hitcode type="BOTTOMRIGHT">
			<shape>
				<shape_rect alignment="lowerright" offset="-15,-15,0,0" />
			</shape>
		</hitcode>
		<hitcode type="BOTTOMLEFT">
			<shape>
				<shape_rect alignment="lowerLeft" offset="0,-15,15,0" />
			</shape>
		</hitcode>
		<hitcode type="LEFT" >
			<shape>
				<shape_rect alignment="0,0,0,1" offset="0,0,5,0" />
			</shape>
		</hitcode>
		<hitcode type="BOTTOM" >
			<shape>
				<shape_rect alignment="0,1,1,1" offset="0,-5,0,0" />
			</shape>
		</hitcode>
		<hitcode type="RIGHT">
			<shape>
				<shape_rect alignment="1,0,1,1" offset="-5,0,0,0" />
			</shape>
		</hitcode>
	</HitStyle>


<!-- **basic shape for windows** -->

	<shape name="Round">
		<shape_roundrect corner_size="30,30" />
	</shape>


<!-- **basic inner shape for windows** -->
	<shape name="inner">
		<shape_roundrect corner_size="10,10" />
	</shape>