Index: strings.txt =================================================================== RCS file: /home/cvs/cvsroot/slim/server/strings.txt,v retrieving revision 1.41 diff -u -p -B -r1.41 strings.txt --- strings.txt 19 Dec 2003 01:32:03 -0000 1.41 +++ strings.txt 20 Dec 2003 10:41:10 -0000 @@ -1105,6 +1105,46 @@ SETUP_SCREENSAVER_DESC EN Choose your custom screensaver FR Choisissez un écran de veille +SETUP_ALARM + DE Wecker + DK Alarm + EN Alarm Clock + FR Réveil + NL Wekker + NO Alarm + PT Alarme + SE Väckarklocka + +SETUP_ALARMTIME + DE Stellen der Weckzeit + DK Indstil alarmtid + EN Set Alarm Time + FR Heure de réveil + NL Wektijd instellen + NO Sett Alarm Tid + PT Acertar Alarme + SE Ställ väckningstid + +SETUP_ALARMPLAYLIST + DE Wählen Sie eine Playlist für den Wecker + DK Vælg playliste for alarmen + EN Select Playlist for Alarm + FR Sélection de la playlist pour le réveil + NL Kies een playlist voor de wekker + NO Velg Spilleliste for Alarm + PT Escolha a Playlist para o Alarme + SE Välj spellista för väckning + +SETUP_ALARMVOLUME + DE Stellen Sie die Lautstärke für den Wecker + DK Indstil volume for alarmen + EN Set Alarm Volume + FR Réglage du volume de réveil + NL Kies het wekvolume + NO Sett Alarm volum + PT Mudar Volume do Alarme + SE Välj volym för väckning + SETUP_PLAYINGDISPLAYMODE DE Abspielen im Anzeigemodus DK Display ved afspilning Index: Slim/Web/Setup.pm =================================================================== RCS file: /home/cvs/cvsroot/slim/server/Slim/Web/Setup.pm,v retrieving revision 1.27 diff -u -p -B -r1.27 Setup.pm --- Slim/Web/Setup.pm 19 Dec 2003 01:32:03 -0000 1.27 +++ Slim/Web/Setup.pm 20 Dec 2003 10:41:15 -0000 @@ -298,17 +298,20 @@ sub initSetupConfig { ,'isClient' => 1 ,'preEval' => sub { my ($client,$paramref,$pageref) = @_; + my $playlistRef = playlists(); + $pageref->{'Prefs'}{'alarmplaylist'}{'options'} = $playlistRef; + $pageref->{'Prefs'}{'alarmplaylist'}{'validateArgs'} = [$playlistRef]; if (scalar(keys %{Slim::Buttons::Common::hash_of_savers()}) > 0) { - $pageref->{'Groups'}{'Default'}{'PrefOrder'}[3] = 'screensaver'; + $pageref->{'Groups'}{'Default'}{'PrefOrder'}[7] = 'screensaver'; $pageref->{'Prefs'}{'screensaver'}{'options'} = Slim::Buttons::Common::hash_of_savers(); } else { - $pageref->{'Groups'}{'Default'}{'PrefOrder'}[3] = undef; + $pageref->{'Groups'}{'Default'}{'PrefOrder'}[7] = undef; } if (scalar(keys %{Slim::Hardware::IR::mapfiles()}) > 1) { - $pageref->{'GroupOrder'}[4] = 'IRMap'; + $pageref->{'GroupOrder'}[2] = 'IRMap'; $pageref->{'Prefs'}{'irmap'}{'options'} = Slim::Hardware::IR::mapfiles(); } else { - $pageref->{'GroupOrder'}[4] = undef; + $pageref->{'GroupOrder'}[2] = undef; } my $i = 0; my %irsets = map {$_ => 1} Slim::Utils::Prefs::clientGetArray($client,'disabledirsets'); @@ -347,7 +350,7 @@ sub initSetupConfig { # if more than one ir map exists the undef will be replaced by 'Default' ,'Groups' => { 'Default' => { - 'PrefOrder' => ['autobrightness','scrollPause','screensavertimeout'] + 'PrefOrder' => ['autobrightness','scrollPause','alarm','alarmtime','alarmvolume','alarmplaylist','screensavertimeout'] } ,'IRSets' => { 'PrefOrder' => ['irsetlist'] @@ -406,10 +409,47 @@ sub initSetupConfig { return $value; } } - } + }, + 'alarmtime' => { + 'validate' => \&validateAcceptAll + ,'validateArgs' => [0,undef] + ,'currentValue' => sub { + my $client = shift; + my ($h0, $h1, $m0, $m1, $p) = Slim::Buttons::AlarmClock::timeDigits($client); + my $timestring = ((defined($p) && $h0 == 0) ? ' ' : $h0) . $h1 . ":" . $m0 . $m1 . " " . (defined($p) ? $p : ''); + return $timestring; + } + ,'onChange' => sub { + my ($client,$changeref,$paramref,$pageref) = @_; + my $time = $changeref->{'alarmtime'}{'new'}; + my $newtime = 0; + $time =~ s{ + ^(0?[0-9]|1[0-9]|2[0-4]):([0-5][0-9]).(P|PM)?$ + }{ + $newtime = $1 * 60 * 60 + $2 * 60 + ((defined($3))?(12 * 60 * 60):0); + }iegsx; + Slim::Utils::Prefs::clientSet($client,'alarmtime',$newtime); + } + }, + 'alarmvolume' => { + 'validate' => \&validateNumber + ,'validateArgs' => [0,$Slim::Player::Client::maxVolume,1,1] + }, + 'alarmplaylist' => { + 'validate' => \&validateInHash + ,'validateArgs' => [] #[\&playlists] + ,'options' => {} #{playlists()} + }, + 'alarm' => { + 'validate' => \&validateTrueFalse + ,'options' => { + '1' => string('ON') + ,'0' => string('OFF') + } + }, } } # end of setup{'ADDITIONAL_PLAYER'} hash - + ,'server' => { 'children' => ['interface','behavior', # 'formats', @@ -1655,6 +1694,20 @@ sub removeExtraArrayEntries { delete $paramref->{$array . $i}; } } +} + +sub playlists { + my %list_hash; + my @list; + Slim::Utils::Scan::addToList(\@list, Slim::Utils::Prefs::get('playlistdir'), 0); + if (Slim::Music::iTunes::useiTunesLibrary()) { + push @list, @{Slim::Music::iTunes::playlists()}; + } + foreach my $item ( @list) { + $list_hash{$item} = Slim::Music::Info::standardTitle(undef, $item); + print Slim::Music::Info::standardTitle(undef, $item); + } + return \%list_hash; } sub skins {