Codice: Seleziona tutto
/*#########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #
##########################################################################*/
function Station( name, url )
{
this.name = name;
this.url = url;
}
var stationArray = new Array (
new Station( "Virgin Rock Italia", "http://shoutcast.unitedradio.it:1301/listen.pls"),
new Station( "Virgin Rock Classic", "http://shoutcast.unitedradio.it:1307/listen.pls"),
new Station( "Virgin Rock Hard Rock", "http://shoutcast.unitedradio.it:1309/listen.pls"),
new Station( "Virgin Rock Alternative", "http://shoutcast.unitedradio.it:1513/listen.pls"),
new Station( "Virgin Rock 80", "http://shoutcast.unitedradio.it:1411/listen.pls"),
new Station( "Virgin Rock 70", "http://shoutcast.unitedradio.it:1119/listen.pls")
);
function VirginRadio()
{
ScriptableServiceScript.call( this, "Virgin Radio Italia", 1, "Streaming Virgin Radio Italia", false );
}
function onPopulating( level, callbackData, filter )
{
Amarok.debug( " Populating station level..." );
//add the station streams as leaf nodes
for ( i = 0; i < stationArray.length; i++ )
{
item = Amarok.StreamItem;
item.level = 0;
item.callbackData = "";
item.itemName = stationArray[i].name;
item.playableUrl = stationArray[i].url;
item.infoHtml = "A cool stream called " + item.itemName;
script.insertItem( item );
}
script.donePopulating();
}
script = new VirginRadio();
script.populate.connect( onPopulating );
Codice: Seleziona tutto
[Desktop Entry]
Icon=get-hot-new-stuff-amarok
Type=script
ServiceTypes=KPluginInfo
Name=Virgin Radio Italia
Comment=Script che permetta l'ascolto di Virgin Radio Italia
X-KDE-PluginInfo-Author=Costea Alexandru Daniel
X-KDE-PluginInfo-Email=
X-KDE-PluginInfo-Name=Virgin Radio Italia
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Category=Scriptable Service
X-KDE-PluginInfo-Depends=Amarok2.0
X-KDE-PluginInfo-License=LGPL
X-KDE-PluginInfo-EnabledByDefault=true