<?mml version="0.5"?>
<mml>

<interface
	cosmetic_name="v-POD"
	unique_name="Travelian/Vpod" 
	author="Travelian"
>
	<exports>
		<sonique2_frame name="main" window="Main" />
	</exports>

	<fontstyle name="status_display_font" face="NasalizationMN" size="10" />
	<fontstyle name="fileinfo_display_font" face="NasalizationMN" size="8" />
	<fontstyle name="time_display_font" face="NasalizationMN" size="18" />
	<fontstyle name="track_display_font" face="NasalizationMN" size="12" />
	<fontstyle name="picker_display_font" face="NasalizationMN" size="14" />
	<fontstyle name="eqpreset_display_font" face="NasalizationMN" size="7" />

<? include overides.mml ?>

<?macrodef playerbutton 
	<window name="$(name)" 
		type="button" 
		offset="Main.psd|$(name) @ Main.psd|buttonarea" 
		transparent="true"
		hitstyle="active"
		shape="$(name)_shape"
	>

		<shape name="$(name)_shape">
			<shape_raster source="Main.psd|$(name)" />
		</shape>

		<property hover="true" hoverhint="$(hint)" />

		<imagestyle name="state0">
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_NORMAL" 
				state="normal"
				opacity="1"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_HARDLIGHT" 
				state="hover"
				opacity="1"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_SOFTLIGHT" 
				state="hit"
				opacity="1"
			/>
		</imagestyle>
		<?macroins $(extra) ?$>
	</window>
?>

<?macrodef outsidebutton 
	<window name="$(name)" 
		type="button" 
		offset="Main.psd|$(name) @ Main.psd|chassis" 
		transparent="true"
		hitstyle="active"
		shape="$(name)_shape"
	>

		<shape name="$(name)_shape">
			<shape_raster source="Main.psd|$(name)" />
		</shape>

		<property hover="true" hoverhint="$(hint)" />

		<imagestyle name="state0">
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_NORMAL" 
				state="normal"
				opacity="1"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_HARDLIGHT" 
				state="hover"
				opacity="1"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_SOFTLIGHT" 
				state="hit"
				opacity="1"
			/>
		</imagestyle>
		<?macroins $(extra) ?$>
	</window>
?>

<?macrodef drawerbutton 
	<window name="$(name)" 
		type="button" 
		offset="Main.psd|$(name) @ Main.psd|drawerbuttoncontainer" 
		transparent="true"
		hitstyle="active"
		shape="$(name)_shape"
	>

		<shape name="$(name)_shape">
			<shape_raster source="Main.psd|$(name)" />
		</shape>

		<property hover="true" hoverhint="$(hint)" />

		<imagestyle name="state0">
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_NORMAL" 
				state="normal"
				opacity="1"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_HARDLIGHT" 
				state="hover"
				opacity="1"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_SOFTLIGHT" 
				state="hit"
				opacity="1"
			/>
		</imagestyle>
		<?macroins $(extra) ?$>
	</window>
?>

<?macrodef pldrawerbutton 
	<window name="$(name)" 
		type="button" 
		offset="Main.psd|$(name) @ Main.psd|pldrawermask" 
		transparent="true"
		hitstyle="active"
		shape="$(name)_shape"
	>

		<shape name="$(name)_shape">
			<shape_raster source="Main.psd|$(name)" />
		</shape>

		<property hover="true" hoverhint="$(hint)" />

		<imagestyle name="state0">
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_NORMAL" 
				state="normal"
				opacity="1"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_HARDLIGHT" 
				state="hover"
				opacity="1"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_SOFTLIGHT" 
				state="hit"
				opacity="1"
			/>
		</imagestyle>
		<?macroins $(extra) ?$>
	</window>
?>

<?macrodef eqbutton 
	<window name="$(name)" 
		type="button" 
		offset="Main.psd|$(name) @ Main.psd|eqcontainer" 
		transparent="true"
		hitstyle="active"
		shape="$(name)_shape"
	>

		<shape name="$(name)_shape">
			<shape_raster source="Main.psd|$(name)" />
		</shape>

		<property hover="true" hoverhint="$(hint)" />

		<imagestyle name="state0">
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_NORMAL" 
				state="normal"
				opacity="0.90"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_LIGHTEN" 
				state="hover"
				opacity="1"
			/>
			<raster 
				source="Main.psd|$(name)" 
				alignment="entire"
				blendmode="PS_HARDLIGHT" 
				state="hit"
				opacity="1"
			/>
		</imagestyle>
		<?macroins $(extra) ?$>
	</window>
?>


<?macrodef play_script

	<!-- Play/Pause script by  MrSmiles121 -->
	
	 <script name="OnInit">
      :sonique.players.default.RegisterCallback("Pausing","OnPauseChange()", this);
      :sonique.players.default.RegisterCallback("Stopping","OnStopChange()", this);
      :sonique.players.default.RegisterCallback("Playing","OnPlayChange()", this);
      overallstate = :sonique.players.default.GetInfo ();
      playstate = overallstate ["playstate"];
      stateinfo = playstate ["state"];

      if ( stateinfo == "paused" ) { SetButtonState ( 0 ); }
      else if ( stateinfo == "stopped" ) { SetButtonState ( 0 ); }
      else { SetButtonState ( 1 ); }
    </script>
    <script name="OnDestroy">
      :sonique.players.default.UnregisterCallback("Pausing", this);
      :sonique.players.default.UnregisterCallback("Stopping", this);
      :sonique.players.default.UnregisterCallback("Playing", this);
    </script>
    <script name="OnClick">
      overallstate = :sonique.players.default.GetInfo ();
      playstate = overallstate ["playstate"];
      stateinfo = playstate["state"];
      stateid = 0;

      if ( stateinfo == "paused" ) { :sonique.players.default.Play (); }
      else if ( stateinfo == "stopped" ) { :sonique.players.default.Play (); }
      else { :sonique.players.default.TogglePause (); }

      SetButtonState ( stateid );
    </script>
    <script name="OnPauseChange">
      SetButtonState (0);
    </script>
    <script name="OnStopChange">
      SetButtonState (0);
    </script>
    <script name="OnPlayChange">
      SetButtonState (1);
    </script>
	
?>


<?macrodef stop_script
	<script name="OnClick">
		:sonique.players.default.Stop();
	</script> 
?>

<?macrodef prev_script
	<script name="OnClick">
		:sonique.players.default.Previous();	
	</script> 
?>

<?macrodef next_script
	<script name="OnClick">
		:sonique.players.default.Next();
	</script> 
?>

<?macrodef open_script
	<script name="OnClick">
		:sonique.OpenFiles();
	</script> 
?>

<?macrodef shuffle_script
	<script name="OnClick">
		:sonique.players.default.ToggleShuffle();
	</script> 
?>

<?macrodef repeat_script
	<script name="OnClick">
	  	:sonique.players.default.ToggleRepeat();
	</script>
?>

<?macrodef crossfade_script
		<script name="OnInit">
			SetButtonState( {"crossfade":1,"seamless":0,"normal":0} [:sonique.players.default.GetPlaybackMethod()[0]]); 
		</script>
		<script name="OnClick">
			$origmethod = :sonique.players.default.GetPlaybackMethod()[0];			
			if ($origmethod == "crossfade") {
				:sonique.players.default.SetPlaybackMethod("seamless");
				SetButtonState(0);
				:sonique.Status("Seamless Playback");   
			} else if ($origmethod == "seamless") {
				:sonique.players.default.SetPlaybackMethod("normal");
				SetButtonState(0);
				:sonique.Status("Normal Playback");
			} else {
				:sonique.players.default.SetPlaybackMethod("crossfade");
				SetButtonState(1);
				:sonique.Status("Crossfade On");
			}
			
		</script>
?>
<?macrodef nextvis_script
	<script name="OnClick">
		Chassis.Viscontainer.Visual.NextVisual();
		Infocontainer.Visinfo.SetText(:sonique.visuals.GetVisualInfo(Viscontainer.Visual.GetVisual())["name"]);
	</script>
?>

<?macrodef previs_script
	<script name="OnClick">
		Chassis.Viscontainer.Visual.PreviousVisual();
		Infocontainer.Visinfo.SetText(:sonique.visuals.GetVisualInfo(Viscontainer.Visual.GetVisual())["name"]);
	</script>
?>

<?macrodef full_script
	<script name="LaunchFullScreen" >
		$visid=Chassis.Viscontainer.Visual.GetVisual();
		$visname=:sonique.visuals.GetVisualInfo($visid)["name"];
		:sonique.visuals.LaunchFullScreenVis($visname, "default", {800,600});
		:sonique.CompactMem();
	</script>
	<script name="OnClick">
		LaunchFullScreen();
	</script>
?>

<?macrodef displaunch_script
	<script name="OnClick">
		if (displayopen == false){
			Displaycontainer.SetLocation({288,182},0,0,"linear",false,true);
			Displaycontainer.SetOffset({134,246,480,504},0,300,"linear_accel");
			displayopen = true;

		}else{
			Displaycontainer.SetLocation({288,182},0,0,"linear",false,true);
			Displaycontainer.SetOffset({288,482,0,0},0,300,"linear_accel");
			displayopen = false;
		}		
	</script>
?>

<?macrodef drawerbutton_script
	<script name="OnClick">
		if (DrawerOpen == true) {
			CloseDrawer();
		} else {
			OpenDrawer();
		}		
	</script>
?>

<?macrodef pllaunch_script
	<script name="OnClick">
		if (plshow==false){
			Chassis.Plcontainer.SetLocation({33,45},0,1000,"linear_decel",false,true);
			Chassis.Buttonarea.SetLocation({-200,42},0,1000,"linear_decel",false,true);
			Chassis.Infocontainer.SetLocation({352,39},0,1000,"linear_decel",false,true);
			Chassis.Viscontainer.SetLocation({352,39},0,1000,"linear_decel",false,true);
			Chassis.previs.SetOpacity(0,0,450,"linear_decel" );
			Chassis.nextvis.SetOpacity(0,0,450,"linear_decel" );
			Chassis.visfullscreen.SetOpacity(0,0,450,"linear_decel" );
			OpenDrawer();
			Drawer.Pldrawercontainer.Show(800);
			Chassis.previs.Hide(450);
			Chassis.nextvis.Hide(450);
			Chassis.visfullscreen.Hide(450);
			Chassis.Eqcontainer.SetOffset({123,97,-45,-201});
			eqon=false;
			plshow=true;
		}else{
			Chassis.Plcontainer.SetLocation({-293,45},0,1000,"linear_decel",false,true);
			Chassis.Buttonarea.SetLocation({3,42},0,1000,"linear_decel",false,true);
			Chassis.Infocontainer.SetLocation({82,39},0,1000,"linear_decel",false,true);
			Chassis.Viscontainer.SetLocation({82,39},0,1000,"linear_decel",false,true);
			Chassis.previs.SetOpacity(1,750,450,"linear_decel" );
			Chassis.nextvis.SetOpacity(1,750,450,"linear_decel" );
			Chassis.visfullscreen.SetOpacity(1,750,450,"linear_decel" );
			CloseDrawer();
			Drawer.Pldrawercontainer.Hide(300);
			Chassis.previs.Show();
			Chassis.nextvis.Show();
			Chassis.visfullscreen.Show();
			plshow=false;
		}		
	</script>
?>

<?macrodef extras_script
	<script name="OnClick">
		if ((extraspresent==true) and (plshow==false)){
			Chassis.Infocontainer.SetLocation({352,39},0,1000,"linear_decel",false,true);
			extraspresent="false";
		}else if ((extraspresent==false) and (plshow==false)){
			Chassis.Infocontainer.SetLocation({82,39},0,1000,"linear_decel",false,true);
			extraspresent="true";
		}else if (eqon==true){}
		else{}
		
	</script>

?>

<?macrodef eqlaunch_script
	<script name="OnClick">
		if (vison==true){
			Chassis.Viscontainer.Visual.Hide();
			tempvishide=true;
		}else{	
			Chassis.Viscontainer.Visual.Hide();
			vison=false;
			tempvishide=false;
		}
		if (plshow==true){
			Chassis.Plcontainer.SetLocation({-293,45},0,1000,"linear_decel",false,true);
			Chassis.Buttonarea.SetLocation({3,42},0,1000,"linear_decel",false,true);
			Chassis.Infocontainer.SetLocation({82,39},0,1000,"linear_decel",false,true);
			Chassis.Viscontainer.SetLocation({82,39},0,1000,"linear_decel",false,true);
			Chassis.previs.SetOpacity(1,750,450,"linear_decel" );
			Chassis.nextvis.SetOpacity(1,750,450,"linear_decel" );
			Chassis.visfullscreen.SetOpacity(1,750,450,"linear_decel" );
			Drawer.Pldrawercontainer.Hide(300);
			Chassis.previs.Show();
			Chassis.nextvis.Show();
			Chassis.visfullscreen.Show();
			plshow=false;
		}		
		if (extraspresent==true){
			Chassis.Infocontainer.SetLocation({352,39},0,1000,"linear_decel",false,true);
			bringback=true;
		}else{
			bringback=false;
		}

		if ((eqon==true)and (bringback==true)){
			Chassis.Eqcontainer.SetOffset({123,97,-45,-201},0,500,"linear_decel");
			Chassis.Infocontainer.SetLocation({82,39},0,1000,"linear_decel",false,true);
			CheckVisHide();
			eqon=false;	
		}else if ((eqon==true)and (bringback==false)){
			Chassis.Eqcontainer.SetOffset({123,97,-45,-201},0,500,"linear_decel");
			CheckVisHide();
			eqon=false;		
		}else{
			Chassis.Eqcontainer.SetOffset({123,77,-45,-81},0,500,"linear_decel");
			eqon=true;
		}	
	</script>
	<script name="CheckVisHide">
		if (tempvishide==true){
			Chassis.Viscontainer.Visual.Show();	
			vison=true;
		}else{
			Chassis.Viscontainer.Visual.Hide();
			vison=false;
		}
	</script>

?>

<?macrodef vislaunch_script
	<script name="OnClick">
		if (vison==true){
			Chassis.Viscontainer.Visual.Hide();
			vison=false;
		}else{
			Chassis.Viscontainer.Visual.Show();
			vison=true;	
		}		
	</script>

?>

<?macrodef pllaunch2_script
	<script name="OnClick">
		:sonique.LaunchRemote("vPod/travelian/playlist", "vPod PL");
		OpenDrawer();
		Drawer.Pldrawercontainer.Show();
	</script>

?>

<?macrodef plctrls_script
	<script name="OnClick">
		Drawer.Pldrawercontainer.Show(200);
	</script>

?>

<?macrodef delete_script
	<script name=OnMouseOver> 
		:sonique.Status("Remove Selected Entry"); 
	</script> 
	<script name="OnClick"> 
		if (Chassis.Plcontainer.Playlist.GetSelection()) {
		:sonique.playlists.default.RemoveItem(Chassis.Plcontainer.Playlist.GetSelection());
		}
	</script>	
?>

<?macrodef reverse_script
	<script name=OnMouseOver> 
		:sonique.Status("Reverse Playlist"); 
	</script> 
	<script name="OnClick">
		:sonique.playlists.default.Reverse()
	</script>
?>

<?macrodef clear_script
	<script name=OnMouseOver> 
		:sonique.Status("Clear Playlist"); 
	</script> 
	<script name="OnClick">
		:sonique.playlists.default.RemoveAll();
	</script>
?>

<?macrodef randomize_script
	<script name=OnMouseOver> 
		:sonique.Status("Randomize Playlist"); 
	</script> 
	<script name="OnClick">
		:sonique.playlists.default.RandomizeList();
	</script>
?>

<?macrodef save_script
	<script name=OnMouseOver> 
		:sonique.Status("Save Playlist"); 
	</script> 
	<script name="OnClick">
		:sonique.SavePlaylistFile(:sonique.playlists.default);
	</script>
?>

<?macrodef aot_script
	<script name="OnClick">
		$topstate = :sonique.prefs.GetString("Universal","AlwaysOnTop");
		if($topstate)
		{
			parent.SetAlwaysOnTop(0);
			SetButtonState(0);
			:sonique.prefs.SetString("Universal","AlwaysOnTop","false");
			:sonique.Status("Always On Top: Off");
		}
		else
		{
			parent.SetAlwaysOnTop(1);
			SetButtonState(1);
			:sonique.prefs.SetString("Universal","AlwaysOnTop","true");
			:sonique.Status("Always On Top: On");
		}
	</script>
	<script name="OnInit">
		$topstate = :sonique.prefs.GetString("Universal","AlwaysOnTop");
		if($topstate)
		{
			SetButtonState(1);
			parent.SetAlwaysOnTop(1);
		}
	</script>
?>

<?macrodef minimize_script
	<script name="OnClick">
		MinimizeWindow(1);
	</script>
?>

<?macrodef exit_script
	<script name="OnClick">
		Main.DestroyWindow();	
	</script>
?>

<?macrodef pitchreset_script
	<script name=OnMouseOver> 
		:sonique.Status("Reset Pitch"); 
	</script> 
	<script name=OnClick>
		:sonique.players.default.PitchAmpBal.SetPitch( 1.0 );
		:sonique.players.default.SendFilterMessage("PitchAmpBalReloadSettings");
		:sonique.Status("Setting pitch: 100%");
	</script>
?>

<?macrodef ampreset_script
	<script name=OnMouseOver> 
		:sonique.Status("Reset PreAmp"); 
	</script> 
	<script name="OnClick">
		:sonique.players.default.PitchAmpBal.SetAmplification( 1.0 );
		:sonique.players.default.SendFilterMessage("PitchAmpBalReloadSettings");
		:sonique.Status("Setting amplification: 100%");
	</script>
?>

<?macrodef balreset_script
	<script name=OnMouseOver> 
		:sonique.Status("Reset Balance"); 
	</script> 
	<script name="OnClick">
		:sonique.players.default.PitchAmpBal.SetBalance( 0.0 );
		:sonique.players.default.SendFilterMessage("PitchAmpBalReloadSettings");
		:sonique.Status("Setting balance: center");
	</script>
?>
	
<window
	name="Main"
	default_size="Main.psd|not_chassis"
	transparent="true" 
	hitstyle="drag"  
	
>		
	<dock_point type="slave" name="MonitorUL" alignment="upperleft" /> 
	<dock_point type="slave" name="MonitorUR" alignment="upperright" /> 
	<dock_point type="slave" name="MonitorLL" alignment="lowerleft" /> 
	<dock_point type="slave" name="MonitorLR" alignment="lowerright" /> 

	<dock_point type="master" name="Remote_UL" alignment="upperleft" /> 
	<dock_point type="master" name="Remote_UR" alignment="upperright" /> 
	<dock_point type="master" name="Remote_LR" alignment="lowerright" /> 
	<dock_point type="master" name="Remote_LL" alignment="lowerleft" /> 

	<window name="Chassis" 
		alignment="entire"
		offset="Main.psd|chassis @ Main.psd|not_chassis" 
		type="generic"
		hitstyle="none"
		transparent="true" 
		shape="chassis_shape"
	>		
		<shape name="chassis_shape">
			<shape_raster 	source="Main.psd|chassis" alignment="entire" />
		</shape>	
		
		<imagestyle name="background">
			<raster source="Main.psd|chassis" blendmode="PS_NORMAL" />
		</imagestyle>	
		

	<window	name="Looks" 	
		alignment="entire"
		offset="Main.psd|looks @ Main.psd|chassis" 
		type="generic"
		hitstyle="none"
		transparent="true" 
		shape="looks_shape"
	>
		<shape name="looks_shape">
			<shape_raster source="Main.psd|looks" alignment="entire" />
		</shape>	
		
		<imagestyle name="background">
			<raster source="Main.psd|looks" blendmode="PS_NORMAL" opacity="1" />
		</imagestyle>	
	</window>
		
	<window name="Viscontainer" 
			alignment="entire"
			offset="Main.psd|viscontainer @ Main.psd|chassis" 
			type="generic"
			hitstyle="none"
			transparent="true" 
			shape="viscontainer_shape"
		>
		<shape name="viscontainer_shape">
			<shape_raster 	source="Main.psd|viscontainer" alignment="entire" />
		</shape>	
		
		<imagestyle name="background">
			<raster source="Main.psd|viscontainer" blendmode="PS_NORMAL" />
		</imagestyle>	

			<window name="Visual" 
				type="Sonique2_Visual" 
				offset="Main.psd|visual @ Main.psd|viscontainer" 
				transparent="True" 
				shape="vis_shape"
			>
				<property Opacity="1" blendmode="screen" /> 
				<shape  name="vis_shape">
					<shape_raster source="Main.psd|visual" />
				</shape>
	
				<script name="OnInit"> 
					SetDesiredFPS(40); 
					EnablePostEffect( :sonique.visuals.GetPostEffectList()[0]["factoryID"], "true" );
				</script>
			</window> 	
		</window>

	<window name="Eqcontainer" 
		alignment="entire"
		offset="Main.psd|eqcontainer @ Main.psd|chassis" 
		type="generic"
		hitstyle="none"
		transparent="true" 
		shape="eqcontainer_shape"
	>
		<shape name="eqcontainer_shape">
			<shape_raster source="Main.psd|eqcontainer" alignment="entire" />
		</shape>	
	
		<window name="Equalizer" 
				type="Sonique2_equalizer" 
				alignment="entire" 
				offset="2,2,-62,-19"  
				hitstyle="active" 
				shape="minieq_shape"
			>
				<ImageStyle name="background">
					<color_fill color=#000000 blendmode="ps_normal" />
				</ImageStyle> 

				<shape name="minieq_shape"> 
					<shape_raster source="Main.psd|eq"/> 
				</shape> 
				<script name="GetNumBands">
					:sonique.players.default.equalizer.GetNumBands()
				</script>
	
				<script name="GetBandGain">
					:sonique.players.default.equalizer.GetBandGain($params[0]);
				</script>
				<script name="SetBandGain">
					:sonique.players.default.equalizer.SetBandGain($params[0], $params[1]);
				</script>
				<script name="OnInit">
					:sonique.players.default.equalizer.SetNumBands(20);
					:sonique.players.default.equalizer.RegisterChangeCallback("", "if( $params[1] ) { UpdateDisplay(); } else { UpdateBands(); } :sonique.players.default.SendFilterMessage(\"equalizerReloadSettings\");", this);
				</script>
				<script name="OnDestroy">
					:sonique.players.default.equalizer.UnregisterChangeCallback("", this);
				</script>
			</window>

			<window name="Presets"
					type="picker"
					alignment="0,0,0,0"
					offset="96,2,156,13"
					hitstyle="active"
					transparent="true"
				>
					<property
						fade_duration="500"
						font_color1="0xFFFFFFFF"
						font_color2="0xFF929292"
						font_color3="0xFFFFFFFF"
						textshadow="true"
						font_style="eqpreset_display_font"
					/>
					<imagestyle name="img_picker_background" transparent="true">
						<color_rect color="0xFFA1A8A7"/>						
					</imagestyle>
					<imagestyle name="img_menu_background" transparent="true">
						<color_rect color="0xFFA1A8A7"/>						
					</imagestyle>
					<imagestyle name="img_item" transparent="true">
						<color_fill color=#455F5E/>
						<color_rect color="0xFFA1A8A7"/>
					</imagestyle>
				<script name="OnInit">
					SetItems({
						{text: "Presets", data: ""}, 
						{text: "0: Flat", data: {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}, 
						{text: "1: Pop", data: {0,0.1,0.2,0.3,0.4,0.3,0.2,0.1,0.1,0,0,0,0.1,0.2,0.3,0.4,0.3,0.2,0.1}},
						{text: "2: Rock", data: {0.4,0.4,0.26,0.12,0,0.1,0.36,0.4,0.1,0,0,0,0,0,0,0.0,0.1,0.2,0.3,0.4}},
						{text: "3: Jazz", data: {0.1,0.1,0.2,0.1,0,0.3,0,0,0.4,0.36,0.5,0.3,0.2,0,0,0,0.1,0.2,0.4,0.3}},
						{text: "4: Classic", data: {0.4,0.4,0.26,0.12,0,0.26,0.36,0.4,0.1,0,0,0,0,0,0,0,0.1,0.2,0.3,0.4}},
						{text: "5: Dance", data: {0.4,0.34,0.26,0.2,0.14,0.06,0,0,0,0,0,0,0,0.06,0.14,0.2,0.26,0.34,0.4,0.46}}
						});
				</script>
				<script name="OnItemSelected">
					SetCurrentItemIndex(0);
						$preset = GetItem($params[0]);
						if ($preset["data"].IsArray()) {
						for ($i in 0 to ($preset["data"].ArraySize() - 1)){
						:sonique.players.default.equalizer.SetBandGain($i, $preset["data"][$i]);
					}
					Equalizer.UpdateBands();
					}
				</script>
			</window>	
		
			<window name="Pitch" 
				type="fillbar" 
				offset="3,44,47,52"
				alignment=0,0.2,0,0.2 
				transparent="true" 
				hitstyle="active"
			>
				<imagestyle name="barempty"><color_rect color=#A1A8A7 /></imagestyle>
				<imagestyle name="barfilled"><color_rect color=#A1A8A7 /></imagestyle>
				<imagestyle name="handle"><color_fill color=#8EE5DE /></imagestyle>
				<property orientation="left_to_right" outer_handle_offset_rect="-1,0,1,5" />
				
			<script name="OnInit">
				:sonique.players.default.PitchAmpBal.RegisterChangeCallback("", "UpdateKnob()", this);
				UpdateKnob();
			</script>
		
			<script name="OnDestroy">
				:sonique.players.default.PitchAmpBal.UnregisterChangeCallback("", this);
			</script>
		
			<script name="UpdateKnob">
				SetRealPos( (:math.Log( 2, :sonique.players.default.PitchAmpBal.GetPitch() )+3)/6 );
			</script>
	
			<script name="OnPosChange">
				$val = :math.Power( 2, $params[0]["real"]*6-3 );
				:sonique.players.default.PitchAmpBal.SetPitch( $val );
				:sonique.players.default.SendFilterMessage("PitchAmpBalReloadSettings");
				:sonique.Status("Setting pitch:" | :math.Truncate($val*100) | "%");
			</script>
		</window>		

		<window name="Amp"
			type="fillbar" 
			offset="55,26,99,34"
			alignment=0,0.4,0,0.4 
			transparent="true" 
			hitstyle="active"
		>
	
			<imagestyle name="barempty"><color_rect color=#A1A8A7 /></imagestyle>
			<imagestyle name="barfilled"><color_rect color=#A1A8A7 /></imagestyle>
			<imagestyle name="handle"><color_fill color=#8EE5DE /></imagestyle>
			<property orientation="left_to_right" outer_handle_offset_rect="-1,0,1,5" />
				
			<script name="OnInit">
				:sonique.players.default.PitchAmpBal.RegisterChangeCallback("","UpdateKnob()", this);
				UpdateKnob();
			</script>
			
			<script name="OnDestroy">
				:sonique.players.default.PitchAmpBal.UnregisterChangeCallback("", this);
			</script>
	
			<script name="UpdateKnob">
				SetRealPos( (:math.Log( 2, :sonique.players.default.PitchAmpBal.GetAmplification() )+3)/6 );
			</script>

			<script name="OnPosChange">
				$val = :math.Power( 2, $params[0]["real"]*6-3 );
				:sonique.players.default.PitchAmpBal.SetAmplification( $val );
				:sonique.players.default.SendFilterMessage("PitchAmpBalReloadSettings");
				:sonique.Status("Setting amplification: " | :math.Truncate($val*100) | "%");
			</script>
		</window>		
			
		<window name="Bal" 
			type="fillbar" 
			offset="107,9,151,17"
			alignment=0,0.6,0,0.6
			transparent="true" 
			hitstyle="active"
		>
			<imagestyle name="barempty"><color_rect color=#A1A8A7 /></imagestyle>
			<imagestyle name="barfilled"><color_rect color=#A1A8A7 /></imagestyle>
			<imagestyle name="handle"><color_fill color=#8EE5DE /></imagestyle>
			<property orientation="left_to_right" outer_handle_offset_rect="-1,0,1,5" />
				
			<script name="OnInit">
				:sonique.players.default.PitchAmpBal.RegisterChangeCallback("", "UpdateKnob()", this);
				UpdateKnob();
			</script>
		
			<script name="OnDestroy">	
				:sonique.players.default.PitchAmpBal.UnregisterChangeCallback("", this);
			</script>
		
			<script name="UpdateKnob">
				SetRealPos( (:sonique.players.default.PitchAmpBal.GetBalance()+1)/2 );
			</script>
				
			<script name="OnPosChange">
				$val = $params[0]["real"]*2-1;
				:sonique.players.default.PitchAmpBal.SetBalance( $val );
				:sonique.players.default.SendFilterMessage("PitchAmpBalReloadSettings");
				if( $val == 0 ){
					:sonique.Status("Setting balance: center");
				} else {
					:sonique.Status("Setting balance: " | :math.Truncate($val*100) | "%");
				}
			</script>
		</window>		

		<?macroins eqbutton name="blancebutton" hint="Reset Balance" extra="balreset_script"?>
		<?macroins eqbutton name="ampbutton" hint="Reset Preamp" extra="ampreset_script"?>
		<?macroins eqbutton name="pitchbutton" hint="Reset pitch" extra="pitchreset_script"?>
	</window>
	

	<window name="Infocontainer" 
		alignment="entire"
		offset="Main.psd|infocontainer @ Main.psd|chassis" 
		type="generic"
		hitstyle="none"
		transparent="true" 
		shape="infocontainer_shape"
	>
		<shape name="infocontainer_shape">
			<shape_raster source="Main.psd|infocontainer" alignment="entire" />
		</shape>	
		
		<window name="Volume" 
			transparent="true" 
			type="fillbar" 
			offset="Main.psd|vempty @ Main.psd|infocontainer"  
			shape="volume_shape"
			hitstyle="active" 
		>
			<shape name="volume_shape"> 
				<shape_raster source="Main.psd|vempty @ Main.psd|vempty"/> 
			</shape> 
			<imagestyle name="barfilled">
				 <raster 
			 		source="Main.psd|vfull"
					offset="Main.psd|vempty @ Main.psd|vempty"
			 		blendmode="COPY|ALPHA_SRCALPHA"
					opacity=".5"
				/>
			</imagestyle>
			<imagestyle name="barempty">
				<raster 
			 		source="Main.psd|vempty"
					offset="Main.psd|vempty @ Main.psd|vempty"
			 		blendmode="COPY|ALPHA_SRCALPHA"
					opacity=".5"
				/>
			</imagestyle>

			<imagestyle name="background">
				<raster 
			 		source="Main.psd|vempty"
					offset="Main.psd|vempty @ Main.psd|vempty"
			 		blendmode="PS_NORMAL"
					opacity="1"
				/>
			</imagestyle>
				<property orientation="bottom_to_top" hoverhint="Volume"/>
			<script name="OnPosChange">
				:sonique.players.default.SetVolume( GetRealPos() );
			</script>
		</window>

		<window name="SongProgress" 
			transparent="true" 
			type="Sonique2_Progress" 
			offset="Main.psd|seekempty @ Main.psd|infocontainer"  
			shape="progress_shape"
			hitstyle="active"
		>
			<imagestyle name="barfilled">
				<raster 
					source="Main.psd|seekfull"
			 		alignment="entire"
					offset="Main.psd|seekempty @ Main.psd|seekempty"
			 		blendmode="COPY|ALPHA_SRCALPHA"
					opacity=".5"
				/>
			</imagestyle>
			<imagestyle name="barempty">
				<raster 
			 		source="Main.psd|seekempty"
			 		alignment="entire"
					offset="Main.psd|seekempty @ Main.psd|seekempty"
			 		blendmode="COPY|ALPHA_SRCALPHA"
					opacity=".5"
				/>
			</imagestyle>

			<imagestyle name="background">
				<raster 
			 		source="Main.psd|seekempty"
			 		alignment="entire"
					offset="Main.psd|seekempty @ Main.psd|seekempty"
			 		blendmode="PS_NORMAL"
					opacity="1"
				/>
			</imagestyle>
			<property orientation="bottom_to_top" hovertext="true" />
			<shape name="progress_shape"> 
				<shape_raster source="Main.psd|seekempty @ Main.psd|seekempty"/> 
			</shape> 
		</window>
		
		<window name="Fileinfo" 
			offset="Main.psd|fileinfo @ Main.psd|infocontainer" 
			type="Sonique2_InfoDisplay"
			alignment="center" 
			transparent="true"
			type="textdisplay"
		>					
			<property	 	
				font_style="fileinfo_display_font" 
				font_color="0xFF000000" 
				font_justification="h_center|v_center"
				format="%(format) %(bitrate)  %(channels) %(samplerate)" 
			/>			
		</window>

		<window name="Visinfo" 
			type="textdisplay" 
			offset="Main.psd|visinfo @ Main.psd|infocontainer"
			alignment="center" 
			transparent="true"
		>
			<property		font_style="fileinfo_display_font" 
					font_color="0xFF000000" 
					font_justification="h_center|v_center" 
					scroll_mode="wrap" 
					scroll_speed=50 whitespace=10
			/>
			<script name=OnInit>
				SetText(:sonique.visuals.GetVisualInfo(Viscontainer.Visual.GetVisual())["name"]);
			</script>
		</window>

		<window name="Track"
			type="Sonique2_TrackDisplay" 
			transparent="true" 
			offset="Main.psd|track @ Main.psd|infocontainer" 
			hitstyle="none"
		>
			<property 	font_style="track_display_font" 
					font_color="0xFF000000" 
					font_justification="v_center|h_center" 
					textshadow="true"
			/>
		</window>
	
		<window	name="Time"
			transparent="true" 
			type="Sonique2_TimeDisplay" 
			offset="Main.psd|time @ Main.psd|infocontainer" 
			hitstyle="ACTIVE" 
			shape="time_shape"
		>
			<ImageStyle name="background">
			</ImageStyle>
			
			<property 	font_style="time_display_font"  
					font_color="0xFF000000" 
					format="%(02%Minutes):%(02%Seconds):%(02Milli)"
					font_justification="v_center|h_center" 
					updateinterval="100" 
					hovertext="true"
					mode="all"
					textshadow="true"
			/>
			<shape name="time_shape"> 
				<shape_raster source="Main.psd|time @ Main.psd|time"/> 
			</shape> 
		</window>		
	</window>

	<window name="Buttonarea" 
		alignment="entire"
		offset="Main.psd|buttonarea @ Main.psd|chassis" 
		type="generic"
		hitstyle="none"
		transparent="true" 
		shape="buttonarea_shape"
	>
		<shape name="buttonarea_shape">
			<shape_raster source="Main.psd|buttonarea" alignment="entire" />
		</shape>	
		
		<imagestyle name="background">
			<raster source="Main.psd|buttonarea" blendmode="PS_NORMAL" />
		</imagestyle>	
		
		<?macroins playerbutton name="play" hint="Play/Pause" extra="play_script" ?>
		<?macroins playerbutton name="stop" hint="Stop" extra="stop_script" ?>
		<?macroins playerbutton name="prev" hint="Previous Track" extra="prev_script" ?>
		<?macroins playerbutton name="next" hint="Next Track" extra="next_script" ?>
		<?macroins playerbutton name="open" hint="Open Files" extra="open_script" ?>
		<?macroins playerbutton name="shuffle" hint="Shuffle" extra="shuffle_script" ?>
		<?macroins playerbutton name="repeat" hint="Repeat" extra="repeat_script" ?>
		<?macroins playerbutton name="crossfade" hint="Crossfade" extra="crossfade_script" ?>
		
	</window>

	<window name="Plcontainer" 
		alignment="entire"
		offset="Main.psd|plcontainer @ Main.psd|chassis" 
		type="generic"
		hitstyle="none"
		transparent="true" 
		shape="plcontainer_shape"
	>
		<shape name="plcontainer_shape">
			<shape_raster source="Main.psd|plcontainer" alignment="entire" />
		</shape>	
		
		<imagestyle name="background">
			<raster source="Main.psd|plcontainer" blendmode="PS_NORMAL" />
		</imagestyle>	
		
			<window name="Playlist" 
				type="Sonique2_Playlist" 
				offset="Main.psd|playlist @ Main.psd|plcontainer" 
				transparent="true"
				alignment="entire"
			>
				<property blendmode="PS_NORMAL" />

				<imagestyle name="background"></imagestyle>	
			</window>
	</window>

		<window name="Statusdisplay" 
			type="Sonique2_StatusBar" 
			offset="Main.psd|status @ Main.psd|chassis" 
			transparent="true"
			
		>
			<imagestyle name="progress_empty">
				<color_fill color="0xFF000000" />
			</imagestyle>
			<imagestyle name="progress_fill">
				<color_fill color="0xFF7FB1B1" />
			</imagestyle>
			<property 	font_style="status_display_font" 
					font_color="0xFF063A37" 
					font_justification="v_center|h_left"
					scroll_mode="horizontal"
					scroll_speed="100"
					pause_delay="0"
					whitespace="20"
					rect_status_offset="0,0,0,0"
					rect_progress_offset="3,2,-6,-3"
			/>					
		</window>

	<window name="Glass" 
		alignment="entire"
		offset="Main.psd|glass @ Main.psd|chassis" 
		type="generic"
		hitstyle="none"
		transparent="true" 
		shape="glass_shape"
	>
		<shape name="glass_shape">
			<shape_raster 	source="Main.psd|glass" alignment="entire" />
		</shape>	
		
		<imagestyle name="background">
			<raster source="Main.psd|glass" blendmode="PS_NORMAL" />
		</imagestyle>	
	</window>

	<?macroins outsidebutton name="previs" hint="Previous Visual" extra="previs_script" ?>
	<?macroins outsidebutton name="nextvis" hint="Next Visual" extra="nextvis_script" ?>	
	<?macroins outsidebutton name="displaunch" hint="Show/Hide Display" extra="displaunch_script" ?>
	<?macroins outsidebutton name="visfullscreen" hint="Full Screen Visual" extra="full_script" ?>	
	<?macroins outsidebutton name="drawerbutton" hint="Open/Close Drawer" extra="drawerbutton_script" ?>	
	<?macroins outsidebutton name="pllaunch" hint="Show/Hide Playlist" extra="pllaunch_script" ?>
	<?macroins outsidebutton name="close" hint="Close vPod" extra="exit_script" ?>	
	<?macroins outsidebutton name="minimize" hint="Minimize Window" extra="minimize_script" ?>	
	<?macroins outsidebutton name="aot" hint="Always On Top" extra="aot_script" ?>
		
	</window>

	<window name="Displaycontainer" 
		offset="Main.psd|display @ Main.psd|not_chassis" 
		popout="true"
		belowparent="true"
		hitstyle="drag"
	>
		<imagestyle name="background">
			<color_fill color=#000000 blendmode="ps_normal" />
		</imagestyle>

		<window name="Display" 
			alignment="entire"
			type="Sonique2_Display"
			transparent="true" 
			hitstyle="none"
		>
			<imagestyle name="background">
			</imagestyle>
			<property blendmode="PS_Normal" />
		</window>

	</window>

<!--	=========	* ***** Drawer and External Window Issues******  	=======

Ok first let me start by explaining what I was trying for here.
I wanted a drawer that allowd for the OnRightButtonDown 
script to work and that was linked to the chassis so they could be 
draged together as a whole. Also in my previous skin Gumdrop I got 
reports of the drawer in that skin turning all black at times (Mantis Bug).
So therefore I decided to use a mask in this skin.  I sorta got the end result
I wanted with new bugs.  Here's the ones i see so far.

1. Using the     belowparent="true"   window attribute makes buttons located in the drawer unusable. 
IE they don't respond to anything.  So I used a SetZOrder script to locate it on the bottom.  Only problem is 
it creates way more work than I wanted repositioning the drawer and its contents... *sigh.

2.  The mask makes skin changing back and forth very messed up.  Cant wait til that is fixed.

3. I had to trim the mask down to almost nothing becaue of performance issues...It was quite the system killer first few times
I loaded this up.

4. The display window is quite the little system resource monster when out.  I have another skin in development that uses the same method to show and hide it
and it barely slows anything down on that other skin.

-->



	<window name="Drawer" 
		offset="Main.psd|drawer @ Main.psd|not_chassis" 
		hitstyle="none"
		shape="drawer_shape"
	>
		<shape name="drawer_shape">
			<shape_raster source="Main.psd|drawer" alignment="entire" />
		</shape>	
		
		<imagestyle name="background">
			<raster source="Main.psd|drawer" blendmode="ps_normal" />
		</imagestyle>

		<window name="Drawercontainer" 
			offset="Main.psd|drawerbuttoncontainer @ Main.psd|drawer" 
			hitstyle="none"
			alignment="entire"
			transparent="true"
		>
			<?macroins drawerbutton name="extras" hint="Show/Hide Extras" extra="extras_script" ?>
			<?macroins drawerbutton name="eqlaunch" hint="Show/Hide EQ" extra="eqlaunch_script" ?>
			<?macroins drawerbutton name="vislaunch" hint="Show/Hide Visual" extra="vislaunch_script" ?>
			<?macroins drawerbutton name="pllaunch2" hint="Launch Tool's Playlist Editor" extra="pllaunch2_script" ?>
			<?macroins drawerbutton name="plctrls" hint="Show Playlist Controlls" extra="plctrls_script" ?>
	
		</window>

		<window name="Pldrawercontainer" 
			offset="Main.psd|pldrawermask @ Main.psd|drawer" 
			hitstyle="none"
			alignment="entire"
			transparent="true"
		>
			<imagestyle name="background">
				<raster source="Main.psd|pldrawermask" blendmode="PS_NORMAL"/>
			</imagestyle>
		
	<!-- sort button picker taken from TypeB -->
			<window name="Sort" 
				offset="Main.psd|sort @ Main.psd|pldrawermask" 
				alignment="entire"
				type="picker"
				transparent="true" 
				hitstyle="active"
			>

				<imagestyle name="img_picker_background" transparent="true">
					<raster source="Main.psd|sort" blendmode="ps_normal" />
				</imagestyle>
			
				<imagestyle name="img_menu_background" transparent="true">
					<raster source="Main.psd|sort" blendmode="ps_normal" />
				</imagestyle>
			
				<imagestyle name="img_item" transparent="true">
					<raster source="Main.psd|buttonextra"  blendmode="ps_normal"/>
				</imagestyle>
			
				<property	 font_style="status_display_font" font_justification="h_center|v_center" font_color=#D4F5F2 />
					
				<script name=OnItemSelected>
					if ($params[0] != 0) {
					:sonique.playlists.default.Sort({"title","author","album","genre","year"}[$params[0]-1],"forwards");
					}
					SetCurrentItemIndex(0);
				</script>
				
				<script name=OnInit>
					SetItems({"Sort","Title","Author","Album","Genre","Year"});
				</script>
			</window>

	<!-- load button picker from Bits's Rez update -->
				<window name="Load" 
					offset="Main.psd|load @ Main.psd|pldrawermask" 
					alignment="entire"
					type="picker"
					transparent="true" 
					hitstyle="active"
				>
		
				<imagestyle name="img_picker_background" transparent="true">
					<raster source="Main.psd|load" blendmode="ps_normal" />
				</imagestyle>
			
				<imagestyle name="img_menu_background" transparent="true">
					<raster source="Main.psd|load" blendmode="ps_normal" />
				</imagestyle>
			
				<imagestyle name="img_item" transparent="true">
					<raster source="Main.psd|buttonextra"  blendmode="ps_normal"/>
				</imagestyle>
			
				<property	 font_style="status_display_font" font_justification="h_center|v_center" font_color=#D4F5F2 />
			
					<script name=OnItemSelected>
						if ($params[0] == 1) {
							$name = :sonique.LoadPlaylistFile(Chassis.Plcontainer.Playlist.playlist);
						}
						if ($params[0] == 2) {
							:sonique.OpenFiles();
						}
						if ($params[0] == 3) {
							$dir = :sonique.BrowseForFolder(); :sonique.AddFile($dir);
						}
						SetCurrentItemIndex(0);
					</script>
					<script name=OnInit>
						SetItems({"Load","Plist","File","Dir"});
					</script>
				</window>
			
			<?macroins pldrawerbutton name="clear" hint="Clear Playlist" extra="clear_script" ?>	
			<?macroins pldrawerbutton name="randomize" hint="Randomize Playlist" extra="randomize_script" ?>	
			<?macroins pldrawerbutton name="save" hint="Save Playlist" extra="save_script" ?>
			<?macroins pldrawerbutton name="delete" hint="Delete Entry" extra="delete_script" ?>
			<?macroins pldrawerbutton name="reverse" hint="Reverse Order" extra="reverse_script" ?>
	
		</window>
				
	</window
	<window name="Logo" 
		offset="Main.psd|logo @ Main.psd|not_chassis" 
		hitstyle="none"
		alignment="entire"
		transparent="true"
	>
		<imagestyle name="background">
			<raster source="Main.psd|logo" blendmode="PS_NORMAL"/>
		</imagestyle>
	</window>

	<script name="OnInit">
		plshow="false";
		Chassis.Plcontainer.SetOffset({-293,45,-358,-46});
		displayopen ="false";
		Displaycontainer.SetOffset({288,482,0,0});
		DrawerOpen ="false";
		Drawer.SetLocation({160,50}, 0, 0, "linear_accel", false, true);
		Chassis.Infocontainer.Volume.SetRealPos( :sonique.players.default.GetVolume() );
		Chassis.Infocontainer.Volume.SetZOrder("top-most",4500);
		Chassis.Infocontainer.SongProgress.SetZOrder("top-most",4500);
		extraspresent="true";
		Drawer.Drawercontainer.SetZOrder("bottom-most"); 
		Drawer.SetZOrder("bottom-most"); 
		Drawer.Drawercontainer.Hide();
		Drawer.Pldrawercontainer.Hide();
		eqon="false";
		Chassis.Eqcontainer.SetOffset({123,97,-45,-201});
		bringback="true";
		tempvishide="false";
		Logo.SetZOrder("top-most");
		Logo.SetOpacity(0,1500,3000,"linear_decel");
			
		if( :sonique.prefs.DoesSectionExist("Universal") == true )
		{}else{
			:sonique.prefs.CreateSection("Universal");
			:sonique.prefs.PrepString("Universal","AlwaysOnTop","false");
		}

		if ( :sonique.prefs.DoesSectionExist("vPod") ) {
				vison=:sonique.prefs.GetString("vPod","vison");		
				$posx = :sonique.prefs.GetString( "vPod", "PosX" );
				$posy = :sonique.prefs.GetString( "vPod", "PosY" );
				SetLocation( {$posx,$posy}, 0, 0, "linear", false, false );							
		}else{
			vison="true";	
		}
		
		if (vison==false){
			Chassis.Viscontainer.Visual.Hide();
		}else{
			Chassis.Viscontainer.Visual.Show();
		}			
		:sonique.CompactMem();
	</script>

	<script name="OnDestroy">
		$pos =  GetLocation();
		:sonique.prefs.SetString( "vPod", "PosX", $pos[0] );
		:sonique.prefs.SetString( "vPod", "PosY", $pos[1] );
		:sonique.prefs.SetString("vPod","vison",vison);
	</script>

	<script name="OpenDrawer">
		Drawer.Show(0);
		Drawer.SetLocation({0,50}, 200, 700, "linear_decel", false, true);
		Drawer.Drawercontainer.Show(800);		
		DrawerOpen = true;	
	</script>

	<script name="CloseDrawer">
		Drawer.SetLocation({160,50}, 200, 700, "linear_accel", false, true);
		Drawer.Hide(900);
		Drawer.Drawercontainer.Hide(300);	
		Drawer.Pldrawercontainer.Hide(300);
		DrawerOpen = false;
	</script>

	<script name="OnMiddleButtonDown">
		if (DrawerOpen == true) {
			CloseDrawer();
		} else {
			OpenDrawer();
		}
	</script>

	
</window>

</interface>
<?include playlist.mml?>

</mml>