<?mml version="0.6" ?>
<!-- Limey 0.9 by Ultratech -->
<mml>

<interface
	cosmetic_name		="Limey"
	unique_name		="Freddy/Limey/LimeyXP/1.1"
	author			="Ultratech"
	url			="http://www.sonique.com/"
	url_title		="Audiowaves from space"
>

<exports>
	<remote name="LimeyXP" window="Limey" thumb_120="Limey.psd|thumb_120" thumb_60="Limey.psd|thumb_60"/>
</exports>

	<exports>
		<remote name="LimeyXP" window="Limey" />
	</exports>

<!-- Define FontStyles -->
<FontStyle name="Fo_mini" face="verdana" size="8" style="bold" />
<FontStyle name="Fo_Smaller" face="verdana" size="9" style="bold" />
<FontStyle name="Fo_medium" face="verdana" size="11" style="bold" />

<!--Define buttonMacros First -->
<?macrodef "btnImageStyle3State"
	<ImageStyle name="$(name)">
		<raster 
			source ="Limey.psd|$(norm)" 
			alignment ="entire"
			blendmode ="COPY|RGB|ALPHA_SRCALPHA"
			source_offset ="Limey.psd|$(norm) @ Limey.psd|$(base)" 
		/>

		<raster 
			state ="HIT" 
			source ="Limey.psd|$(hit)" 
			source_offset ="Limey.psd|$(hit) @ Limey.psd|$(base)" 
			alignment ="entire"
			blendmode = "COPY|RGB|ALPHA_SRCALPHA"
		/>
	
		<raster 
			state ="Hover" 
			source ="Limey.psd|$(hover)" 
			source_offset ="Limey.psd|$(hover) @ Limey.psd|$(base)" 
			alignment ="entire"
			blendmode = "COPY|RGB|ALPHA_SRCALPHA" 
		/> 
	</ImageStyle>
?>

<!--			blendmode ="PS_COLORDODGE" -->


<!-- Button Macro Definition Done -->



<window name="Limey" default_size = "Limey.psd" hitstyle="drag" transparent="true">

<!-- OPEN UP THE GREEN WINDOW -->

	<window name="window" hitstyle="none" transparent="true" >	
		<ImageStyle name="background">
		<raster source = "Limey.psd|base" source_offset="Limey.psd|base" blendmode="ps_normal" alignment="entire" opacity="1" />
		</ImageStyle>
	</window>

<!-- some init stuff  -->

	<script name="OnInit">
		visual.Hide();
 		:sonique.players.default.RegisterCallback("VolumeChanged","OnVolumeChanged()", this);
		OnVolumeChanged();
		vis_is_off=1;
		spinning="stopped";
		SetDesiredFPS(50);
	</script>

	<script name="OnDoubleClick">

<!-- 		:sonique.CompactMem();   -->
	
	</script>



<!-- DEFINING DA BUTTON Macro -->

	<?macrodef btn_start
		<window name="$(name)" type="button" transparent="true" offset = "Limey.psd|$(name)" hitstyle="ACTIVE" >
		<property default_delay = "2" hover="true" hoverhint="$(hint)" />
		<?macroins "btnImageStyle3State" name="state0" norm="$(name)" hit="$(name)s" hover="$(name)" base="$(name)" ?$>
		?>
	<?macrodef btn_end </window> ?>



<!-- DEFINING Visual window -->
	<window name="visual" type="Sonique2_Visual" offset="Limey.psd|visual" transparent="true" shape="visual_shape">
		<property blendmode="COPY|RGB" /> 
		<shape name="visual_shape">
		<shape_raster source="Limey.psd|visual" />
			opacity			=".4"
		</shape> 
	</window>



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


<!-- Then we have the Spinners!  -->


	<!-- window to rotate a raster image -->
	<window name="leftspinner" transparent="true">
		<imagestyle name="background" >
			<raster source			="Limey.psd|leftspinner"   
				source_center_alignment	=".5,.5" 
				center_alignment	=".16,.48" 
				fillmode		="rotate"
				interpolate		="true" 
				angle_direction		="-1"  
				blendmode		="PS_NORMAL"
			/>
		</imagestyle>
		
		<script name="Rotate" >
			if($spinning=="stopped")
			{
				SetAngle(0,0,1,"linear" );
			}

			if($spinning=="playing")
			{
				SetAngle(3600,0,60000,"linear" );
				
			}

			if($spinning=="ffw")
			{
				SetAngle(0,0,1,"linear" );
				SetAngle(1440,0,600,"linear_decel" );
				
			}

			if($spinning=="rew")
			{
				SetAngle(0,0,1,"linear" );
				SetAngle(-1440,0,600,"linear_decel" );
				
			}

		</script>
	</window>

	<window name="Rightspinner" hitstyle="none" transparent="true" >	
		<ImageStyle name="background">
		<raster source = "Limey.psd|rightspinner" source_offset="Limey.psd|rightspinner" blendmode="ps_normal" alignment="entire" />
		</ImageStyle>
	</window>



	<!--  rotate button for raster image, on the main window 			
	<?macroins text_button name="raster_rot_btn" offset="10,275,80,295"	text1="raster ccw" text2="raster cw" ?>
		<script name="OnClick" >
			leftspinn=1;
			Leftspinner.Rotate();
		</script>
	</window>


  -->	






<!-- OpenUpSomeStuff -->
	<window name="Statust" hitstyle="none" transparent="true" >	
		<ImageStyle name="background">
		<raster source = "Limey.psd|statust" source_offset="Limey.psd|statust" blendmode="ps_normal" alignment="entire" />
		</ImageStyle>
	</window>
	<window name="Trackt" hitstyle="none" transparent="true" >	
		<ImageStyle name="background">
		<raster source = "Limey.psd|trackt" source_offset="Limey.psd|trackt" blendmode="ps_normal" alignment="entire" />
		</ImageStyle>
	</window>

	<window name="Trimet" hitstyle="none" transparent="true" >	
		<ImageStyle name="background">
		<raster source = "Limey.psd|timet" source_offset="Limey.psd|timet" blendmode="ps_normal" alignment="entire" />
		</ImageStyle>
	</window>

<!-- No Logo It doesn't work with the skin
	<window name="UTLogo" hitstyle="none" transparent="true" >	
		<ImageStyle name="background">
		<raster source = "Limey.psd|logo" source_offset="Limey.psd|logo" blendmode="ps_normal" alignment="entire" />
		</ImageStyle>
	</window>
-->


<!-- Seek..  -->
	<window name="progress" transparent="true" type="Sonique2_Progress" offset="Limey.psd|seek" shape="seek2" hitstyle="ACTIVE" >

		<shape name="seek2">
			<shape_raster source="Limey.psd|seek"/>
		</shape>
		
		<ImageStyle name="barempty">
		 	<raster 
				source			="Limey.psd|seek"
		 		alignment		="entire"
				offset			="Limey.psd|seek@Limey.psd|seek"
		 		blendmode		="ps_normal"
				opacity			="0"
			/>
		</ImageStyle>

		<ImageStyle name="barfilled">
		 	<raster 
				source			="Limey.psd|seek"
		 		alignment		="entire"
				offset			="Limey.psd|seek@Limey.psd|seek"
		 		blendmode		="ps_normal"
				opacity			="0"
			/>
		</ImageStyle>
				
		<ImageStyle name="handle">
 			<raster 
				source			="Limey.psd|seek_handle"
				alignment		="entire"
				blendmode		="ps_normal"
			/>
		</ImageStyle>
		
		<Property type="SongProgress"
			orientation="left_to_right"
			bar_offset_rect="-2,1,-2,0"
			bar_align_rect ="0,0,1,1"
			outer_handle_offset_rect="-4,-3,8,8"
		hovertext="true"
		/>
		
		/>
		
	</window>



<!-- Volume -->

	<window name="volume" transparent="true" type="fillbar" shape="vol2" offset="Limey.psd|volume"  hitstyle="ACTIVE" >
		<shape name="vol2">
		<shape_raster source="Limey.psd|volume"/>
		</shape>

		<script name="OnPosChange">
			:sonique.players.default.SetVolume( GetRealPos() );
		</script>

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


		<ImageStyle name="barfilled">
			<raster 
			 	source			="Limey.psd|volume"
			 	alignment		="upperleft"
				offset			="Limey.psd|volume@Limey.psd|volume"
			 	blendmode		="ps_normal"
			        opacity		="0"
			/>
		</ImageStyle>

		<ImageStyle name="barempty">
			<raster 
		 		source			="Limey.psd|volume"
		 		alignment		="upperleft"
				offset			="Limey.psd|volume@Limey.psd|volume"
		 		blendmode		="ps_normal"
				opacity		="0"
			/>
		</ImageStyle>
		
		<ImageStyle name="handle">
			<raster
				alignment="entire"
				source="Limey.psd|volume_handle"
				offset="Limey.psd|volume_handle @ Limey.psd|volume_handle"
				blendmode="ps_normal"
			/>
		</ImageStyle>

		<property 
			orientation="left_to_right"
			bar_offset_rect="-2,1,-2,0"
			bar_align_rect ="0,0,1,1"
			outer_handle_offset_rect="-4,-3,8,8"
		/>

		<script name="OnHoverPosChange">
			:sonique.Status(" Change Volume");
		</script>

		hovertext="true"
		hoverhint=" Set Volume"
	</window>


<!-- STATUS INFORMATION -->

	<window name="eep" type="Sonique2_StatusBar" offset="Limey.psd|status" transparent="true" shape="eepshape" >

			<shape name="eepshape" >
				<shape_raster source="Limey.psd|status" alignment="entire" />
			</shape>
			
			<ImageStyle name="progress_empty">
               			<color_fill color="#fff5d6" opacity=1 />
               		</ImageStyle>
                	
                	<ImageStyle name="progress_fill">
               			<color_fill color="#99cc66" opacity=1 />
               		</ImageStyle>

			<property 
				info_font_style="Fo_Smaller"
				info_font_color="0xFF000000"
				info_font_justification="trim_pixels"
				error_font_style="Fo_Smaller"
				error_font_color="0xFF000000"
				error_font_justification="trim_pixels"
				warning_font_style="Fo_Smaller"
				warning_font_color="0xFFAA0000"
				warning_font_justification="trim_pixels"
				fallback_font_style="Fo_Smaller"
				fallback_font_color="0xFF000000"
				fallback_font_justification="trim_pixels"
				scroll_mode="horizontal,pingpong"
				scroll_speed="100"
				pause_delay="500"
				whitespace="0"
				rect_status_offset="2,2,-2,-2"
				rect_progress_offset="2,2,-2,-2"
			/>








	</window>



<!-- Track Number INFORMATION -->

	<window name="track_display" transparent="true" type="Sonique2_TrackDisplay" offset="Limey.psd|track" >
		<property font_style="Fo_Smaller" font_color="0xFF000000" font_justification="top|h_center" hint="Track number" />
	</window>



<!-- Progress INFORMATION -->

	<window name="time_display" transparent="true" type="Sonique2_TimeDisplay" offset="Limey.psd|time" hitstyle="ACTIVE" >
		<property font_style="Fo_Smaller" font_color="0xFF000000" format="%(01%Hours):%(02%Minutes):%(02%Seconds)" font_justification="top|left" updateinterval="500" hovertext="true" />
	</window>



<!-- Visuals ON or OFF button -->

	<?macroins btn_start name="show_vis" hint=" Visuals on/off" ?>
		<script name=OnClick >
			if(vis_is_off)
			{
				visual.Show();
				vis_is_off=!vis_is_off;
			}
			else
			{
				visual.Hide();
				vis_is_off=!vis_is_off;
			}
		</script>
	<?macroins btn_end ?>


<!-- Next Viz -->

	<?macroins btn_start name="nextvis" hint=" Next Vis" ?>
		<script name=OnClick> visual.NextVisual(); </script>
	<?macroins btn_end ?>


<!-- Repeat switcher -->

	<?macroins btn_start name="repeat" hint=" Repeat modes" ?>

		<script name="OnClick" > 
			$currentstate = :sonique.players.default.GetRepeat();
			:sonique.players.default.SetRepeat( { off: "one", one: "all", all: "off" }[$currentstate] ); 
		</script>
	
		<script name="OnInit">
			:sonique.players.default.RegisterCallback("RepeatChanged","OnRepeatChange()", this);
			OnRepeatChange();
		</script>
	
		<script name="OnRepeatChange">
			SetButtonState( { off: 0, one: 1, all: 2 }[:sonique.players.default.GetRepeat()] );
		</script>

	<?macroins btn_end ?> 


<!-- Shuffle -->

	<?macroins btn_start name="shuffle" hint=" Toggle shuffle" ?>
		<script name="OnInit">:sonique.players.default.RegisterCallback("ShuffleChanged","OnShuffleChange()", this);
			OnShuffleChange();
		</script>
		<script name="OnClick">
			$currentstate = :sonique.players.default.GetShuffle();
			:sonique.players.default.SetShuffle( { "false": "true", "true": "false" }[$currentstate] );
		</script>
		<script name="OnShuffleChange">
			SetButtonState( { "false": 0, "true": 1 }[:sonique.players.default.GetShuffle()] );
		</script>

	<?macroins btn_end ?> 


<!-- Open and Previous -->

	<?macroins btn_start name="open" hint=" Open" ?>
		<script name="OnClick"> :sonique.OpenFiles(); </script>
	<?macroins btn_end ?>

	<?macroins btn_start name="previous" hint=" Previous" ?>
		<script name=OnClick > 
			:sonique.players.default.Previous(); 
			$spinning="rew";
			leftspinner.Rotate();
		</script>
	<?macroins btn_end ?>















<!-- Play and Pause BUTONS.. Coding probably suxx here...mouahahaaa -->

	<?macroins btn_start name="Play" hint=" Play/Pause" ?>
		<script name="OnClick" > 
			$button_state=GetButtonState();
			if($button_state==0)
				{
				:sonique.players.default.Play();
				}
			else
				{
				:sonique.players.default.TogglePause();
				}
		</script>
		<script name="OnInit">
			:sonique.players.default.RegisterCallback("Pausing","State()", this);
			:sonique.players.default.RegisterCallback("Stopping","State()", this);
			:sonique.players.default.RegisterCallback("Playing","State1()", this);
			$currentstate = :sonique.players.default.GetInfo();
			$playstate=$currentstate["playstate"];
			$status=$playstate["state"];
			if($status=="paused")
				{
				SetButtonState(0);
				$spinning="stopped";
				leftspinner.Rotate();
				} 
			else if($status=="stopped")
				{
				SetButtonState(0);
				$spinning="stopped";
				leftspinner.Rotate();
				}
			else
				{
				SetButtonState(1);
				$spinning="playing";
				leftspinner.Rotate();
				}
		</script>
		
		<script name="State1">
			SetButtonState(1);
			$spinning="playing";
			leftspinner.Rotate();

		</script>

		<script name="State">
			SetButtonState(0);
			$spinning="stopped";
			leftspinner.Rotate();

		</script>
		
		<?macroins "btnImageStyle3State" name="state" norm="play" hit="plays" hover="play" base="play" $?>
		<?macroins "btnImageStyle3State" name="state1" norm="pause" hit="pauses" hover="pause" base="pause" $?>
	<?macroins btn_end ?> 


<!-- Next and Stop -->

	<?macroins btn_start name="next" hint=" Next" ?>
		<script name=OnClick > 
			:sonique.players.default.Next(); 
			$spinning="ffw";
			leftspinner.Rotate();
		</script>
	<?macroins btn_end ?>

	<?macroins btn_start name="stop" hint=" Stop" ?>
		<script name=OnClick > 
		:sonique.players.default.Stop();
		$spinning="stopped";
		leftspinner.Rotate();
		</script>
	<?macroins btn_end ?> 


<!-- Ontop switcher thingie -->
	<?macroins btn_start name="ontop" hint=" On Top" ?>
		<script name="OnClick" >
			$topstate = parent.GetAlwaysOnTop();
			if($topstate==true)
				{	parent.SetAlwaysOnTop(0);
				}
			else
				{	parent.SetAlwaysOnTop(1);
				}
		</script>
	<?macroins btn_end ?>



<!-- open main window -->
	<?macroins btn_start name="open_main" hint=" Main Window" ?>
		<script name="OnClick"> :sonique.LaunchAppWindow("main"); </script>
	<?macroins btn_end ?> 



<!-- Close window button -->
	<?macroins btn_start name="exit" hint=" Close" ?>
		<script name="OnClick" > 
			parent.DestroyWindow();
		</script>
	<?macroins btn_end ?>







</window>
</interface>
</mml>
