Old 28th October 2009, 07:00   #1
moonspy
Junior Member
 
Join Date: Oct 2009
Posts: 2
How to add "open url" button

Hi Project builders

I just started to do build my own skin for a carpc aplication. My idea is to make a very simple skin, but with custom buttons what will open pre defined .pls stream automatically when pressed.

the description:
Like making custom looking buttons for PLAY,PAUSE,NEXT and so on.. I want to make a button that will open "www.di.fm/aacplus/dance.pls" and clears "play list" and start playing the stream automatically.

How can I access this command and can I add this kind of command to player.xml file?

Thanks and Regards
-moonspy-
moonspy is offline   Reply With Quote
Old 28th October 2009, 20:37   #2
moonspy
Junior Member
 
Join Date: Oct 2009
Posts: 2
Found some info my self, but haven't discovered how to put everything together..

If I understand correctly I need to make maki code for the url opening part..

I try to keep everything simple..

player.xml file

<!-- Element definition -->
<elements>
<bitmap id="player.background" file="player/Sunset.jpg"
gammagroup="Backgrounds"/>
<bitmap id="player.button.previous" file="player/blue-previous.png"
gammagroup="Buttons"/>
<bitmap id="player.button.play" file="player/blue-play.png"
gammagroup="Buttons"/>
<bitmap id="player.button.pause" file="player/blue-pause.png"
gammagroup="Buttons"/>
<bitmap id="player.button.stop" file="player/blue-stop.png"
gammagroup="Buttons"/>
<bitmap id="player.button.next" file="player/blue-next.png"
gammagroup="Buttons"/>
<bitmap id="player.button.yourbutton" file="player/url.png"
gammagroup="Buttons"/>
</elements>
<!-- Playback Buttons Group Definition -->
<groupdef id="player.normal.playbuttons" name="Player buttons">
<button
id="Prev"
action="PREV"
x="25" y="0"
image="player.button.previous"
tooltip="Previous"
/>
<button
id="Next"
action="NEXT"
x="50" y="0"
image="player.button.next"
tooltip="Next"
/>
<button
id="Play"
action="PLAY"
x="0" y="25"
image="player.button.play"
tooltip="Play"
/>
<button
id="Pause"
action="PAUSE"
x="25" y="25"
image="player.button.pause"
tooltip="Pause"
/>
<button
id="Stop"
action="STOP"
x="50" y="25"
image="player.button.stop"
tooltip="Stop"
/>
<button
id="Yourbutton"
action="?????????"
x="100" y="100"
image="player.button.stop"
tooltip="Stop"
/>
</groupdef>
<!-- Song File Information and Visualization Group Definition -->
<groupdef id="player.normal" name="Winamp">
<text
id="timer"
display="time"
x="120" y="50"
w="30" h="20"
font="wasabi.font.default" fontsize="12"
timecolonwidth="7"
/>

<!-- Song File Information-->
<text
id="infoline" ticker="1"
display="songinfo" default=""
x="160" y="50"
w="200" h="20"
font="wasabi.font.default" fontsize="12" ghost="1"
/>
<!-- Visualization -->

<vis
id="vis"
x="160" y="12"
w="300" h="100"
/>

</groupdef>

<!-- Main Window: Container and Layout -->
<container id="main" name="Main Window" default_x="0" default_y="0" default_visible="1">
<layout id="normal" background="player.background">
<group id="player.normal" />
<group id="player.normal.playbuttons" x="12" y="12" />
</layout>
</container>





testi.M file

#include std.mi

Global Button yourbutton;

System.onScriptLoaded()
{
Layout mainLayout = getContainer("main").getLayout("normal");
yourbutton = mainLayout.getObject("your.button");
}

yourbutton.onLeftButtonUp(int x,int y)
{
system.navigateUrl("http://www.di.fm/..../...pls");
}

So from here can compile the testi.m to maki, but nothing hapens when i try the button..
I know that something is missing, but what and from where..

Do the button "action" indicates somehow that there is code behind it?

Any help is appreciated.. thanks

moonspy
moonspy 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