[Slim-Checkins] r10807 - in /trunk/server/Plugins/Live365: HTML/EN/plugins/ HTML/EN/plugins/Live365/ HTML/EN/plugins/Live365/settings/ HTML/EN/plugins/Live365/settings/basic.html Plugin.pm Settings.pm Web.pm

dsully at svn.slimdevices.com dsully at svn.slimdevices.com
Thu Nov 30 17:28:13 PST 2006


Author: dsully
Date: Thu Nov 30 17:28:12 2006
New Revision: 10807

URL: http://svn.slimdevices.com?rev=10807&view=rev
Log:
Bug: N/A
Description: Convert Live365

Added:
    trunk/server/Plugins/Live365/HTML/EN/plugins/
    trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/
    trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/settings/
    trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/settings/basic.html   (with props)
    trunk/server/Plugins/Live365/Settings.pm   (with props)
Modified:
    trunk/server/Plugins/Live365/Plugin.pm
    trunk/server/Plugins/Live365/Web.pm

Added: trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/settings/basic.html
URL: http://svn.slimdevices.com/trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/settings/basic.html?rev=10807&view=auto
==============================================================================
--- trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/settings/basic.html (added)
+++ trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/settings/basic.html Thu Nov 30 17:28:12 2006
@@ -1,0 +1,62 @@
+[% PROCESS settings/header.html %]
+
+	<div class="settingSection">
+		<div class="prefHead">[% "SETUP_PLUGIN_LIVE365_USERNAME" | string | upper %]</div>
+		<div class="prefDesc">[% "SETUP_PLUGIN_LIVE365_USERNAME_DESC" | string %]</div>
+
+		<input type="text" class="stdedit" name="plugin_live365_username" id="plugin_live365_username" value="[% prefs.plugin_live365_username %]" size="40">
+	</div>
+
+	<div class="settingSection">
+		<div class="prefHead">[% "SETUP_PLUGIN_LIVE365_PASSWORD" | string | upper %]</div>
+		<div class="prefDesc">[% "SETUP_PLUGIN_LIVE365_PASSWORD_DESC" | string %]</div>
+
+		<input type="password" class="stdedit" name="plugin_live365_password" id="plugin_live365_password" value="[% prefs.plugin_live365_password %]" size="40">
+	</div>
+
+
+	<div class="settingSection">
+		<div class="prefHead">[% "SETUP_PLUGIN_LIVE365_SORT_ORDER" | string | upper %]</div>
+		<div class="prefDesc">[% "SETUP_PLUGIN_LIVE365_SORT_ORDER_DESC" | string %]</div>
+
+		<select name="plugin_live365_sort_order">
+
+			<option value="T:A" [% IF prefs.plugin_live365_sort_order == "T:A" %]selected[% END %]>
+				[% "SETUP_PLUGIN_LIVE365_SORT_TITLE" | string %]
+			</option>
+
+			<option value="B:D" [% IF prefs.plugin_live365_sort_order == "T:A" %]selected[% END %]>
+				[% "SETUP_PLUGIN_LIVE365_SORT_BPS" | string %]
+			</option>
+
+			<option value="R:D" [% IF prefs.plugin_live365_sort_order == "T:A" %]selected[% END %]>
+				[% "SETUP_PLUGIN_LIVE365_SORT_RATING" | string %]
+			</option>
+
+			<option value="L:D" [% IF prefs.plugin_live365_sort_order == "T:A" %]selected[% END %]>
+				[% "SETUP_PLUGIN_LIVE365_SORT_LISTENERS" | string %]
+			</option>
+
+		</select>
+	</div>
+
+	<div class="settingSection">
+		<div class="prefHead">[% "SETUP_PLUGIN_LIVE365_WEB_SHOW_DETAILS" | string | upper %]</div>
+		<div class="prefDesc">[% "SETUP_PLUGIN_LIVE365_WEB_SHOW_DETAILS_DESC" | string %]</div>
+
+		[% "SETUP_PLUGIN_LIVE365_WEB_SHOW_DETAILS" | string %]:&nbsp;	
+
+		<select name="plugin_live365_web_show_details">
+
+			<option value="1" [% IF prefs.plugin_live365_web_show_details == 1 %]selected[% END %]>
+				[% "ON" | string %]
+			</option>
+
+			<option value="0" [% IF prefs.plugin_live365_web_show_details == 0 %]selected[% END %]>
+				[% "OFF" | string %]
+			</option>
+
+		</select>
+	</div>
+
+[% PROCESS settings/footer.html %]

Propchange: trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/settings/basic.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/settings/basic.html
------------------------------------------------------------------------------
    svn:keywords = Id Author LastChangedDate LastChangedBy

Propchange: trunk/server/Plugins/Live365/HTML/EN/plugins/Live365/settings/basic.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Modified: trunk/server/Plugins/Live365/Plugin.pm
URL: http://svn.slimdevices.com/trunk/server/Plugins/Live365/Plugin.pm?rev=10807&r1=10806&r2=10807&view=diff
==============================================================================
--- trunk/server/Plugins/Live365/Plugin.pm (original)
+++ trunk/server/Plugins/Live365/Plugin.pm Thu Nov 30 17:28:12 2006
@@ -29,6 +29,7 @@
 # Need this to include the other modules now that we split up Live365.pm
 use Plugins::Live365::ProtocolHandler;
 use Plugins::Live365::Live365API;
+use Plugins::Live365::Settings;
 use Plugins::Live365::Web;
 
 use constant ROWS_TO_RETRIEVE => 50;
@@ -72,64 +73,6 @@
 
 sub getDisplayName {
 	return 'PLUGIN_LIVE365_MODULE_NAME';
-}
-
-sub setupGroup {
-	my %Group = (
-		PrefOrder => [
-			'plugin_live365_username',
-			'plugin_live365_password',
-			'plugin_live365_sort_order',
-			'plugin_live365_web_show_details'
-		],
-		GroupHead => string( 'SETUP_GROUP_PLUGIN_LIVE365' ),
-		GroupDesc => string( 'SETUP_GROUP_PLUGIN_LIVE365_DESC' ),
-		GroupLine => 1,
-		GroupSub  => 1,
-		Suppress_PrefSub  => 1,
-		Suppress_PrefLine => 1
-	);
-
-	my %sort_options = (
-		'T:A' => string( 'SETUP_PLUGIN_LIVE365_SORT_TITLE' ),
-		'B:D' => string( 'SETUP_PLUGIN_LIVE365_SORT_BPS' ),
-		'R:D' => string( 'SETUP_PLUGIN_LIVE365_SORT_RATING' ),
-		'L:D' => string( 'SETUP_PLUGIN_LIVE365_SORT_LISTENERS' ),
-	);
-
-	my %Prefs = (
-		plugin_live365_username => {
-		},
-
-		plugin_live365_password => { 
-
-			'onChange' => sub {
-				my $encoded = pack( 'u', $_[1]->{plugin_live365_password}->{new} );
-				chomp $encoded;
-				Slim::Utils::Prefs::set( 'plugin_live365_password', $encoded );
-			},
-
-			'inputTemplate' => 'setup_input_passwd.html',
-			'changeMsg' => string('SETUP_PLUGIN_LIVE365_PASSWORD_CHANGED'),
-		},
-
-		plugin_live365_sort_order => {
-			options => \%sort_options
-		},
-
-		plugin_live365_web_show_details => {
-
-			validate => \&Slim::Utils::Validate::trueFalse,
-			options  => {
-				1 => string('ON'),
-				0 => string('OFF')
-			},
-
-			'PrefChoose' => string('SETUP_PLUGIN_LIVE365_WEB_SHOW_DETAILS')
-		}
-	);
-
-	return (\%Group, \%Prefs);
 }
 
 sub playOrAddCurrentStation {
@@ -976,6 +919,8 @@
 
 	Slim::Player::ProtocolHandlers->registerHandler("live365", "Plugins::Live365::ProtocolHandler");
 
+	Plugins::Live365::Settings->new;
+
 	Slim::Buttons::Common::addMode( 'searchMode',      \%searchModeFunctions,  \&setSearchMode,  \&noSearchMode );
 	Slim::Buttons::Common::addMode( 'genreMode',       \%genreModeFunctions,   \&setGenreMode,   \&noGenreMode );
 	Slim::Buttons::Common::addMode( 'ChannelInfo',     \%infoModeFunctions,    \&setInfoMode,    \&noInfoMode );

Added: trunk/server/Plugins/Live365/Settings.pm
URL: http://svn.slimdevices.com/trunk/server/Plugins/Live365/Settings.pm?rev=10807&view=auto
==============================================================================
--- trunk/server/Plugins/Live365/Settings.pm (added)
+++ trunk/server/Plugins/Live365/Settings.pm Thu Nov 30 17:28:12 2006
@@ -1,0 +1,56 @@
+package Plugins::Live365::Settings;
+
+# SlimServer Copyright (C) 2001-2006 Slim Devices Inc.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License,
+# version 2.
+
+use strict;
+use base qw(Slim::Web::Settings);
+
+sub name {
+        return 'PLUGIN_LIVE365_MODULE_NAME';
+}
+
+sub page {
+        return 'plugins/Live365/settings/basic.html';
+}
+
+sub handler {
+        my ($class, $client, $params) = @_;
+
+	my @prefs = qw(
+		plugin_live365_username
+		plugin_live365_password
+		plugin_live365_sort_order
+		plugin_live365_web_show_details
+	);
+
+	for my $pref (@prefs) {
+
+		if ($params->{'submit'}) {
+
+			if ($pref eq 'plugin_live365_password') {
+
+				$params->{$pref} = pack('u', $params->{$pref});
+
+				chomp($params->{$pref});
+			}
+
+			Slim::Utils::Prefs::set($pref, $params->{$pref});
+		}
+
+		# Do we want to display the password?
+		if ($pref eq 'plugin_live365_password') {
+			next;
+		}
+
+		$params->{'prefs'}->{$pref} = Slim::Utils::Prefs::get($pref);
+        }
+
+        return $class->SUPER::handler($client, $params);
+}
+
+1;
+
+__END__

Propchange: trunk/server/Plugins/Live365/Settings.pm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/server/Plugins/Live365/Settings.pm
------------------------------------------------------------------------------
    svn:keywords = Id Author LastChangedDate LastChangedBy

Propchange: trunk/server/Plugins/Live365/Settings.pm
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: trunk/server/Plugins/Live365/Web.pm
URL: http://svn.slimdevices.com/trunk/server/Plugins/Live365/Web.pm?rev=10807&r1=10806&r2=10807&view=diff
==============================================================================
--- trunk/server/Plugins/Live365/Web.pm (original)
+++ trunk/server/Plugins/Live365/Web.pm Thu Nov 30 17:28:12 2006
@@ -1154,7 +1154,7 @@
 	my $end     = scalar @$slist - 1;
 	my $valid   = 1;
 
-	print Data::Dumper::Dumper($slist);
+	#Data::Dump::dump($slist);
 
 	if ($API->getStationSource() eq 'presets') {
 



More information about the checkins mailing list