INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Why won't my window work?  (Read 2116 times)

FrankL

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 81
Why won't my window work?
« on: May 25, 2003, 09:26:57 pm »

I'm trying to add a window to my skin that displays the track information but for some reason i can't get it to work.  

This is in the Main.xml file:
<WINDOW Name="info" Bitmap="info_body.gif" TransColor="FF00FF">
     
     <INFODISPLAYS>
           <Entry Name="TrackInfo" Tip="Track Info" TrackInfo="PN_POSITION. ALBUM: ARTIST - NAME ( ELAPSED_TIME )" Rect="16,31,224,9" Align="Scroll">
                 <Colors Text="FFFFFF" />                        
                 <Font Facename="Bank Gothic Medium BT" Size="11" Weight="100" Italic="0"/>            
           </Entry>
     </INFODISPLAYS>
     <!--EVENTS>
           <Entry Event="OnInitialize" Action="Script" ActionData="OnInitialize" />
           <Entry Event="OnButtonDown" Item="ToggleInfo" Action="Script" ActionData="OnToggleInfo" />
     </EVENTS-->
     
</WINDOW>


This is in the main window i took out all the extra code that doesn't pertain to the problem:
<Events>
<Entry Event="OnButtonDown" Item="ToggleInfo" Action="Script" ActionData="OnToggleInfoButton" />
<Events/>
<Buttons>
<Entry Name="ToggleInfo" Bitmap="button.gif" Tip="Toggle Info" Position="93,63" NumberImages="3"/>
</Buttons>


Now here is the code where the problem is likely to be occuring:

var stateNormal = 1;
var statePressed = 2;
var stateDisabled = 3;
var stateHidden = 4;

var typeButton = 0;
var typePlaceholder = 1;
var typeSlider = 2;
var typeInfoDisplay = 3;

var stateStopped = 0;
var statePaused = 1;
var statePlaying = 2;
var stateWaiting = 3;

function OnInitialize()
{
     if(Metamorphis.LoadSkinState() == false)
     {
           var x = Player.Left;
           var y = Player.Top;
           
           Vol.SetWindowPos(x - 0, y + 53);
           Vol.ShowWindow(true);
           
           var ButtonVol = Player.GetSkinItem(typeButton, "ToggleVol");
           ButtonVol.State = statePressed;
           ButtonVol.Tooltip = "Hide Volume / Position";
           
           EQ.SetWindowPos(x + 230, y + 100);
           EQ.ShowWindow(true);
           
           var ButtonEQ = Player.GetSkinItem(typeButton, "ToggleEqualizer");
           ButtonEQ.State = statePressed;
           ButtonEQ.Tooltip = "Hide Equalizer";
           
           Info.SetWindowPos(x + 100, y + 0);
           Info.ShowWindow(true);

           var ButtonInfo = Player.GetSkinItem(typeButton, "ToggleInfo");
           ButtonInfo.State = statePressed;
           ButtonInfo.Tooltip = "Hide Info";
           
           Visualization.SetWindowPos(x + 200, y + 0);
           Visualization.ShowWindow(true);

           
           var ButtonVis = Player.GetSkinItem(typeButton, "ToggleVisualization");
           ButtonVis.State = statePressed;
           ButtonVis.Tooltip = "Hide Visualization";
           
           Playlist.SetWindowPos(x - 0, y +85);
           Playlist.ShowWindow(true);
           
           var ButtonPl = Player.GetSkinItem(typeButton, "TogglePlaylist");
           ButtonPl.State = statePressed;
           ButtonPl.Tooltip = "Hide Playlist";
     }
     
     
     OnPlayStateChanged();
}


function OnExit()
{
     Metamorphis.SaveSkinState();
}

function OnToggleVolButton()
{         
     var Button = Player.GetSkinItem(typeButton, "ToggleVol");
     if(Vol.IsWindowVisible() == false)
     {
           Vol.ShowWindow(true);
           Vol.MoveWindowAnimated(0, 27, 1);
           
           if(Playlist.IsWindowVisible() == true)
                 Playlist.MoveWindowAnimated(0, 27, 1);
                 
           Button.State = statePressed;
           Button.Tooltip = "Hide Volume / Position";
     }
     else
     {
           Vol.MoveWindowAnimated(0, -27, 1);
           Vol.ShowWindow(false);
           
           if(Playlist.IsWindowVisible() == true)
                 Playlist.MoveWindowAnimated(0, -27, 1);      
                 
           Button.State = stateNormal;
           Button.Tooltip = "Show Volume / Position";                  
     }
}

function OnToggleEqButton()
{      
     var Button = Player.GetSkinItem(typeButton, "ToggleEqualizer");
     if(EQ.IsWindowVisible())
     {
           EQ.ShowWindow(false);
           
           Button.State = stateNormal;
           Button.Tooltip = "Show Equalizer";      
     }
     else
     {
           EQ.ShowWindow(true);
           
           Button.State = statePressed;
           Button.Tooltip = "Hide Equalizer";      
     }
}

function OnToggleInfoButton()
{      
     var Button = Player.GetSkinItem(typeButton, "ToggleInfo");
     if(Info.IsWindowVisible())
     {
           Info.ShowWindow(false);
           
           Button.State = stateNormal;
           Button.Tooltip = "Show Info";      
     }
     else
     {
           Info.ShowWindow(true);
           
           Button.State = statePressed;
           Button.Tooltip = "Hide Info";      
     }
}


function OnToggleVisualization()
{            
     var Button = Player.GetSkinItem(typeButton, "ToggleVisualization");
     if(Visualization.IsWindowVisible())
     {
           Visualization.ShowWindow(false);
     
           Button.State = stateNormal;
           Button.Tooltip = "Show Visualization";      
     }
     else
     {      
           Visualization.ShowWindow(true);
     
           Button.State = statePressed;
           Button.Tooltip = "Hide Visualization";      
     }
}

function OnTogglePlaylist()
{            
     

     var Button = Player.GetSkinItem(typeButton, "TogglePlaylist");
     if(Playlist.IsWindowVisible())
     {
           Playlist.ShowWindow(false);
           
           Button.State = stateNormal;
           Button.Tooltip = "Show Playlist";      
     }
     else
     {      
           Playlist.ShowWindow(true);
           
           Button.State = statePressed;
           Button.Tooltip = "Show Playlist";      
     }
}

function OnPlayStateChanged()
{
     var PlayState = MJAutomation.GetPlayback().State;

     if(PlayState == statePlaying)
     {
           Visualization.GetSkinItem(typePlaceholder, "LogoAnimated").State = stateHidden;
           Visualization.GetSkinItem(typePlaceholder, "Visualization").State = stateNormal;
     }
     else if(PlayState == stateStopped)
     {
           Visualization.GetSkinItem(typePlaceholder, "LogoAnimated").State = stateNormal;
           Visualization.GetSkinItem(typePlaceholder, "Visualization").State = stateHidden;
     }
}




I Really don't know what it all means i just copied from the eutow skin.  

Here is the error that i get whenever i try to display the Info window:
JScript Error.
Code = 800a1391
Code meaning = Unknown error 0x800A1391
Source = Microsoft JScript runtime error
Description = 'Info' is undefined

I don't know what i'm doing and don't know what this means, can someone help me out?
Logged

FrankL

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 81
Re: Why won't my window work?
« Reply #1 on: May 25, 2003, 09:29:18 pm »

also i can't figure out how to make the extra windows go to a predefined place, they always just end up going to 0, 0 no matter what i do.  I want the playlist and such to show up right next to the main window, how do i fix this?
Logged

FrankL

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 81
Re: Why won't my window work?
« Reply #2 on: May 26, 2003, 06:59:56 am »

ha i figured it out, Information is a restricted variable.  Someone should have told us that

I still can't figure out how to make the windows not appear in the 0,0 position

PLEASE HELP!!!
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
Re: Why won't my window work?
« Reply #3 on: June 04, 2003, 07:56:53 am »

FrankL,

Do you have state.xml file in your skin's directory? Try removing it and see if it helps.

Nikolay
Logged
Pages: [1]   Go Up