Old 17th December 2018, 21:46   #1
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 491
move stream from maki to xml

This zip contains two skins using radio.maki. The simpler skin only plays a single station when you click on the snowman's hat, while the more complex skin has a drawer with five radio buttons.

Now, stations may go down. Is there a way to move the stream urls from radio.maki into the xml that calls it (interface.xml/player-normal.xml)? It would be easier to edit an url in an xml file when a station goes down than edit and compile a maki script.
ariszlo is offline   Reply With Quote
Old 18th December 2018, 06:56   #2
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
... Is there a way to move the stream urls from radio.maki into the xml that calls it (interface.xml/player-normal.xml)? It would be easier to edit an url in an xml file when a station goes down than edit and compile a maki script.
From the top of my head I would say no. A xml-file describes the look of a component while the corresponding maki script executes the action.

But you could try the following trick: save the radio's url as a tooltip for a particular button, and try to obtain this tooltip in your script as a string using the guiObject.getXMLparam(string param) command and pass it to the System.playFile(string param) command. Got it?

P.S. What is the name of the button in Venom/xml/player-normal.xml in line 15?

PeterK. is offline   Reply With Quote
Old 18th December 2018, 08:00   #3
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Or add an invisible text line and set the default tag to the url. And again, grab the content of the default tag and pass it to System.playFile() in the script.
PeterK. is offline   Reply With Quote
Old 18th December 2018, 21:26   #4
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 491
Quote:
Originally Posted by PeterK. View Post
Or add an invisible text line and set the default tag to the url.
Something like this?
HTML Code:
<text
  id="stream"
  default="http://us3.internet-radio.com:8371/live"
  visible="0"
/>
Quote:
Originally Posted by PeterK. View Post
And again, grab the content of the default tag and pass it to System.playFile() in the script.
Here I am completely lost:
  • Where do I put guiObject.getXMLparam(string param) in radio.m?
  • Do I use the (string param) part unchanged or change it to something like (string stream)?
ariszlo is offline   Reply With Quote
Old 18th December 2018, 21:44   #5
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
Something like this?
HTML Code:
<text
  id="stream"
  default="http://us3.internet-radio.com:8371/live"
  visible="0"
/>
Yes.


Quote:
Originally Posted by ariszlo View Post
Here I am completely lost:
Please try this:

PHP Code:
Global string myRadio;
Global 
text streamURL;

System.onScriptLoaded()
{
     
streamURL=getScriptGroup().findObject("stream");
     
myRadio=streamURL.getXMLparam("default");
}
myButton.onLeftClick()
{
     
System.playFile(myRadio);

PeterK. is offline   Reply With Quote
Old 18th December 2018, 22:10   #6
ariszlo
Senior Member
 
Join Date: Jun 2015
Location: Hungary
Posts: 491
Thanks a lot, it works! This is how I edited the radio.m of the simpler skin:

PHP Code:
#include "../../../lib/std.mi"

Global Button Rock;
Global 
string myRadio;
Global 
text streamURL;

System.onScriptLoaded() { 
    
Group ButtonGroup getScriptGroup();
    
rock ButtonGroup.getObject("radio_rock");
    
streamURL=getScriptGroup().findObject("stream");
    
myRadio=streamURL.getXMLparam("default");
}

Rock.onLeftClick(){
    
System.playFile(myRadio);

ariszlo is offline   Reply With Quote
Old 18th December 2018, 22:16   #7
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
Quote:
Originally Posted by ariszlo View Post
Thanks a lot, it works!
Cool! and now sleep well ...
PeterK. is offline   Reply With Quote
Old 19th December 2018, 18:31   #8
PeterK.
Quinto Black CT Developer
 
Join Date: Sep 2016
Posts: 589
I was thinking ... you might change the id name for the text because the term "stream" could cause some internal troubles. There are many words within Winamp which have some kind of "registrated" status - and "stream" could be one of them.
PeterK. 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