Old 17th June 2002, 02:30   #1
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
#477 issues =(

Hmm ...

I'm a little bit stuck trying to decide what build version to make this curved slider script compatible with. So far I've managed to get everything working with #466 (B3). However, constructs such as:

code:

Layer lyr = new Layer;
lyr.setXmlParam("x", "0");
lyr.setXmlParam("y", "0");
lyr.setXmlParam("w", "100");
lyr.setXmlParam("h", "100");
// ... blah ...
lyr.init(getScriptGroup());



... fail miserably under #477 where they worked fine under #466. I know Gonzotek has done a lot of work with this stuff, so I was wondering if he had any ideas. Incidentally Gonzo, when I use your recommended way of placing a <script> inside a <groupdef>, no matter which build it is, the script just doesn't execute.

Should I make the script #466-only ? Should I carry on trying to get it working using #477 ? Or should I just pack the whole thing in and wait two years until WA3 is finally stable ?

Grr.
DJGrenola is offline   Reply With Quote
Old 17th June 2002, 04:49   #2
Naamloos
Forum King
 
Naamloos's Avatar
 
Join Date: Mar 2001
Location: irc.tehflap.org/*******
Posts: 3,085
there is a lot of stuff broken in build 477 (maki wise) so I think its better to wait...
Naamloos is offline   Reply With Quote
Old 17th June 2002, 15:33   #3
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
Hm, OK then. Maybe I'll finish it off for #466 on which i know i can get everything working.
DJGrenola is offline   Reply With Quote
Old 17th June 2002, 15:40   #4
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
Re: #477 issues =(

Quote:
Originally posted by DJGrenola
Hmm ...

I'm a little bit stuck trying to decide what build version to make this curved slider script compatible with. So far I've managed to get everything working with #466 (B3). However, constructs such as:

code:

Layer lyr = new Layer;
lyr.setXmlParam("x", "0");
lyr.setXmlParam("y", "0");
lyr.setXmlParam("w", "100");
lyr.setXmlParam("h", "100");
// ... blah ...
lyr.init(getScriptGroup());



... fail miserably under #477 where they worked fine under #466. I know Gonzotek has done a lot of work with this stuff, so I was wondering if he had any ideas. Incidentally Gonzo, when I use your recommended way of placing a <script> inside a <groupdef>, no matter which build it is, the script just doesn't execute.

Should I make the script #466-only ? Should I carry on trying to get it working using #477 ? Or should I just pack the whole thing in and wait two years until WA3 is finally stable ?

Grr.
I haven't spent a lot of time with 477, but it certainly should execute in beta3. Perhaps the whole group isn't inside the xml heirarchy? You can either send the whole demo to my yahoo account or post it here, to your liking, and I'll try to troubleshoot that problem, it should work....as far as the xmlparam stuff, I'll poke around with it (with some of my scripts) and see if it's a maki bug, or if there's some change we don't know about yet, or what.

-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Old 17th June 2002, 16:01   #5
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
OK, time for you to tell me I'm doing something really very stupid

code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<WinampAbstractionLayer version="0.8">

<skininfo>
<name>Curved Slider demo 1</name>
</skininfo>

<include file="../default/system/skin.xml"/>

<include file="../default/xml/eq.xml"/>
<include file="../default/xml/thinger.xml"/>
<include file="../default/xml/pledit.xml"/>
<include file="../default/xml/video.xml"/>
<include file="../default/xml/color-presets.xml"/>

<elements>

<!-- bitmaps -->
<bitmap id="bg" file="bg.png"/>
<bitmap id="knob" file="knob.png"/>
<bitmap id="knob.down" file="knob_down.png"/>
<bitmap id="play" file="play.png"/>
<bitmap id="play.down" file="play_down.png"/>
<bitmap id="stop" file="stop.png"/>
<bitmap id="stop.down" file="stop_down.png"/>
<bitmap id="load" file="load.png"/>
<bitmap id="load.down" file="load_down.png"/>

<!-- this one must be defined for the tracemode -->
<bitmap id="pixel" file="null_image.png"/>

</elements>

<container id="main" name="curvedSliderDemo1" default_x="0" default_y="0" default_visible="1">
<layout id="normal" background="bg">

<button id="buttons.play" image="play" downimage="play.down" x="6" y="152" action="PLAY"/>
<button id="buttons.stop" image="stop" downimage="stop.down" x="6" y="168" action="STOP"/>
<button id="buttons.load" image="load" downimage="load.down" x="6" y="184" action="EJECT"/>

<!-- these are the objects necessary for the script to work -->
<layer id="dummy_layer"/>
<button id="knob_button" image="knob" downimage="knob.down" action=""/>

</layout>
</container>

<groupdef id="borken">
<script file="maki.maki" id="DJG_CSE_1.0"
param="x1=0,y1=200,x2=100,y2=0,x3=200,y3=200,knob=knob_button,pixel_image=pixel,dummy=dummy_layer,tolerance=20,tracemode=1"/>
</groupdef>

</WinampAbstractionLayer>

DJGrenola is offline   Reply With Quote
Old 17th June 2002, 16:53   #6
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
Quote:
Originally posted by DJGrenola

code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<WinampAbstractionLayer version="0.8">

...

<container id="main" name="curvedSliderDemo1" default_x="0" default_y="0" default_visible="1">
<layout id="normal" background="bg">

<button id="buttons.play" image="play" downimage="play.down" x="6" y="152" action="PLAY"/>
<button id="buttons.stop" image="stop" downimage="stop.down" x="6" y="168" action="STOP"/>
<button id="buttons.load" image="load" downimage="load.down" x="6" y="184" action="EJECT"/>

<!-- these are the objects necessary for the script to work -->
<layer id="dummy_layer"/>
<button id="knob_button" image="knob" downimage="knob.down" action=""/>

</layout>
</container>

<groupdef id="borken">
<script file="maki.maki" id="DJG_CSE_1.0"
param="x1=0,y1=200,x2=100,y2=0,x3=200,y3=200,knob=knob_button,pixel_image=pixel,dummy=dummy_layer,tolerance=20,tracemode=1"/>
</groupdef>

</WinampAbstractionLayer>

A groupdef only defines what will be in a group, it doesn't actually become instantiated until you place it inside a container/layout, with a <group> element. Also, the layer "dummy_layer" and button "knob_button" probably should go inside the groupdef, if the script will be dealing with them. So the changes to the xml should look like this, more or less:
code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<WinampAbstractionLayer version="0.8">

...
<groupdef id="borken">
<!-- these are the objects necessary for the script to work -->
<layer id="dummy_layer"/>
<button id="knob_button" image="knob" downimage="knob.down" action=""/>
<!--Keep the script as the last object inside a group, so it doesn't start looking for objects before they're instantiated-->
<script file="maki.maki" id="DJG_CSE_1.0"
param="x1=0,y1=200,x2=100,y2=0,x3=200,y3=200,knob=knob_button,pixel_image=pixel,dummy=dummy_layer,tolerance=20,tracemode=1"/>
</groupdef>

<container id="main" name="curvedSliderDemo1" default_x="0" default_y="0" default_visible="1">
<layout id="normal" background="bg">

<button id="buttons.play" image="play" downimage="play.down" x="6" y="152" action="PLAY"/>
<button id="buttons.stop" image="stop" downimage="stop.down" x="6" y="168" action="STOP"/>
<button id="buttons.load" image="load" downimage="load.down" x="6" y="184" action="EJECT"/>

<group id="borken" x="0" y="0" />

</layout>
</container>




This is all of the top of my head, so double-check that all the puncuation is in, and check your script to see if I broke getting the layer and button (I should have).

-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Old 17th June 2002, 17:02   #7
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
Ahhhhhhhhhhhhh. I gotcha. I had a feeling I was doing that wrong all along.

Cheers man.
DJGrenola is offline   Reply With Quote
Old 17th June 2002, 19:35   #8
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
OK, the maki executes now, but I don't seem to be able to get the layout object using System.getContainer("main").getLayout("normal"); - this just returns null.

Is this a #477 quirk, or am I doing something dumb again ?

DJG
DJGrenola is offline   Reply With Quote
Old 17th June 2002, 20:21   #9
mp!
Junior Member
 
Join Date: May 2002
Location: usa-california
Posts: 21
should you be using main and curvedSliderDemo1?
System.getContainer("main").getLayout("curvedSliderDemo1");
i might be wrong.

i am wrong i didnt see that was a container name, sorry
mp! is offline   Reply With Quote
Old 17th June 2002, 21:59   #10
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
Quote:
Originally posted by DJGrenola
OK, the maki executes now, but I don't seem to be able to get the layout object using System.getContainer("main").getLayout("normal"); - this just returns null.

Is this a #477 quirk, or am I doing something dumb again ?

DJG
Couldn't say without seeing the whole kaboodle at once. But why not try avoiding the container/layout levels altogether? With the script being started in the group, you should be now able to use the getScriptGroup() function, and if you can keep all the related objects inside that group you should be able to use that as a reference point. The goal there is to make it easier for your eventual script users to incorporate the script in their skin....they shouldn't have to worry about opening up the .m at all, it should be able to "just work" , keeping in mind that it can still be fed various values through the param="" attribute.

-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Old 17th June 2002, 22:57   #11
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
That makes sense. Thanks. I'll have another play with it later.
DJGrenola is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump