diff -upBr slim-old/Slim/Player/Player.pm slim/server/Slim/Player/Player.pm --- slim-old/Slim/Player/Player.pm 2004-10-20 03:09:00.000000000 -0700 +++ slim/server/Slim/Player/Player.pm 2004-11-17 09:26:27.781250000 -0800 @@ -40,6 +40,7 @@ my $defaultPrefs = { 'PLUGINS', ] ,'mp3SilencePrelude' => 0 + ,'lameQuality' => 9 ,'offDisplaySize' => 0 ,'pitch' => 100 ,'playingDisplayMode' => 0 diff -upBr slim-old/Slim/Player/Source.pm slim/server/Slim/Player/Source.pm --- slim-old/Slim/Player/Source.pm 2004-11-08 02:52:00.000000000 -0800 +++ slim/server/Slim/Player/Source.pm 2004-11-17 10:10:12.921875000 -0800 @@ -886,9 +886,11 @@ sub openSong { } else { my $maxRate = Slim::Utils::Prefs::maxRate($client); + my $quality = Slim::Utils::Prefs::clientGet($client,'lameQuality'); + $command = tokenizeConvertCommand($command, $type, '-', $fullpath, 0 , $maxRate, - 1); + 1, $quality); $::d_source && msg("tokenized command $command\n"); my $pipeline = Slim::Player::Pipeline->new($sock, $command); @@ -1054,7 +1056,8 @@ sub openSong { } else { - $command = tokenizeConvertCommand($command, $type, $filepath, $fullpath, $samplerate, $maxRate); + my $quality = Slim::Utils::Prefs::clientGet($client,'lameQuality'); + $command = tokenizeConvertCommand($command, $type, $filepath, $fullpath, $samplerate, $maxRate,undef,$quality); $client->audioFilehandle( FileHandle->new() ); $client->audioFilehandle->open($command); @@ -1289,7 +1292,7 @@ sub getConvertCommand { } sub tokenizeConvertCommand { - my ($command, $type, $filepath, $fullpath, $samplerate, $maxRate, $nopipe) = @_; + my ($command, $type, $filepath, $fullpath, $samplerate, $maxRate, $nopipe,$quality) = @_; # XXX what is this? my $swap = (unpack('n', pack('s', 1)) == 1) ? "" : "-x"; @@ -1322,6 +1325,7 @@ sub tokenizeConvertCommand { $command =~ s/\$FILE\$/"$filepath"/g; $command =~ s/\$URL\$/"$fullpath"/g; $command =~ s/\$RATE\$/$samplerate/g; + $command =~ s/\$QUALITY\$/$quality/g; $command =~ s/\$BITRATE\$/$maxRate/g; $command =~ s/\$-x\$/$swap/g; diff -upBr slim-old/Slim/Web/Setup.pm slim/server/Slim/Web/Setup.pm --- slim-old/Slim/Web/Setup.pm 2004-11-04 20:24:00.000000000 -0800 +++ slim/server/Slim/Web/Setup.pm 2004-11-17 10:31:02.640625000 -0800 @@ -835,11 +835,11 @@ sub initSetupConfig { my ($client,$paramref,$pageref) = @_; return if (!defined($client)); playerChildren($client, $pageref); - $pageref->{'GroupOrder'}[1] = 'Display'; + if ($client && $client->hasDigitalOut()) { - $pageref->{'GroupOrder'}[2] = 'Digital'; + $pageref->{'GroupOrder'}[3] = 'Digital'; } else { - $pageref->{'GroupOrder'}[2] = undef; + $pageref->{'GroupOrder'}[3] = undef; } my @formats = $client->formats(); if ($formats[0] ne 'mp3') { @@ -849,15 +849,20 @@ sub initSetupConfig { delete $pageref->{'Prefs'}{'maxBitrate'}{'options'}{'0'}; $pageref->{'Groups'}{'Format'}{'GroupDesc'} = string('SETUP_MP3BITRATE_DESC'); } - $pageref->{'Prefs'}{'lame'}{'PrefDesc'} = Slim::Utils::Misc::findbin('lame') ? string('SETUP_LAME_FOUND') : string('SETUP_LAME_NOT_FOUND'); - + if (Slim::Utils::Misc::findbin('lame')) { + $pageref->{'Prefs'}{'lame'}{'PrefDesc'} = string('SETUP_LAME_FOUND'); + $pageref->{'GroupOrder'}[1] = 'Quality'; + } else { + $pageref->{'Prefs'}{'lame'}{'PrefDesc'} = string('SETUP_LAME_NOT_FOUND'); + $pageref->{'GroupOrder'}[1] = undef; + } if (Slim::Player::Sync::isSynced($client) || (scalar(Slim::Player::Sync::canSyncWith($client)) > 0)) { - $pageref->{'GroupOrder'}[1] = 'Synchronize'; + $pageref->{'GroupOrder'}[2] = 'Synchronize'; my $syncGroupsRef = syncGroups($client); $pageref->{'Prefs'}{'synchronize'}{'options'} = $syncGroupsRef; $pageref->{'Prefs'}{'synchronize'}{'validateArgs'} = [$syncGroupsRef]; } else { - $pageref->{'GroupOrder'}[1] = undef; + $pageref->{'GroupOrder'}[2] = undef; } } ,'postChange' => sub { @@ -876,7 +881,7 @@ sub initSetupConfig { } $client->update(); } - ,'GroupOrder' => ['Format',undef,'Digital'] + ,'GroupOrder' => ['Format',undef,undef,'Digital'] ,'Groups' => { 'Format' => { 'PrefOrder' => ['lame','maxBitrate'] @@ -887,6 +892,9 @@ sub initSetupConfig { ,'GroupLine' => 1 ,'GroupSub' => 1 } + ,'Quality' => { + 'PrefOrder' => ['lameQuality'] + } ,'Synchronize' => { 'PrefOrder' => ['synchronize','syncVolume','syncPower'] } @@ -919,6 +927,23 @@ sub initSetupConfig { ,'dontSet' => 1 ,'inputTemplate' => undef } + ,'lameQuality' => { + 'validate' => \&validateInt + ,'validateArgs' => [0,9,1,1] + ,'optionSort' => 'V' + ,'options' => { + '0' => '0 '.string('LAME0') + ,'1' => '1' + ,'2' => '2' + ,'3' => '3' + ,'4' => '4' + ,'5' => '5' + ,'6' => '6' + ,'7' => '7' + ,'8' => '8' + ,'9' => '9 '.string('LAME9') + } + } ,'synchronize' => { 'dontSet' => 1 ,'options' => {} #filled by preEval diff -upBr slim-old/convert.conf slim/server/convert.conf --- slim-old/convert.conf 2004-10-28 23:49:00.000000000 -0700 +++ slim/server/convert.conf 2004-11-17 10:29:53.281250000 -0800 @@ -28,42 +28,43 @@ # $FILE$ is the absolute path to the source file # $RATE$ is the sample rate of the source file (in kS/sec) # $BITRATE$ is the bandwidth of the output stream in kb/s +# $QUALITY$ is the quality setting for lame conversion, 0 is best, 9 is fastest # [bin] is the executable binary for the encoder or decoder # - is a special command line that implies passthrough of data # specific combinations match before wildcards mov mp3 * * - [mov123] $FILE$ | [lame] --resample 44100 --silent -q 9 -b $BITRATE$ -r - - + [mov123] $FILE$ | [lame] --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ -r - - ogg mp3 * * - [oggdec] -Q -o - -R $FILE$ | [lame] --resample 44100 --silent -b $BITRATE$ -r -x - - + [oggdec] -Q -o - -R $FILE$ | [lame] --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ -r -x - - wav mp3 * * - [lame] --resample 44100 --silent -q 9 -b $BITRATE$ $FILE$ - + [lame] --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ $FILE$ - aif mp3 * * - [lame] --resample 44100 --silent -q 9 -b $BITRATE$ $FILE$ - + [lame] --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ $FILE$ - shn mp3 * * - [shorten] -x $FILE$ - | [lame] --resample 44100 --silent -q 9 -b $BITRATE$ - - + [shorten] -x $FILE$ - | [lame] --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ - - #flc mp3 * * -# [flac] -dcs $FILE$ | [lame] --resample 44100 --silent -q 9 -b $BITRATE$ - - +# [flac] -dcs $FILE$ | [lame] --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ - - # Comment out previous entry and uncomment this entry to use cuesheets with FLAC files # This is buggy with FLAC 1.1 or earlier flc mp3 * * - [flac] -dcs --skip=$START$ --until=$END$ $FILE$ | [lame] --resample 44100 --silent -q 9 -b $BITRATE$ - - + [flac] -dcs --skip=$START$ --until=$END$ $FILE$ | [lame] --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ - - wma mp3 * * - [wmadec] -r 44100 -b 16 -n 2 $FILE$ | [lame] -x --resample 44100 --silent -q 9 -b $BITRATE$ - - + [wmadec] -r 44100 -b 16 -n 2 $FILE$ | [lame] -x --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ - - mpc mp3 * * - [mppdec] --raw-le --silent --prev --gain 3 $FILE$ - | [lame] -x --resample 44100 --silent -q 9 -b $BITRATE$ - - + [mppdec] --raw-le --silent --prev --gain 3 $FILE$ - | [lame] -x --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ - - ape mp3 * * - [mac] $FILE$ - -d | [lame] --resample 44100 -x --silent -q 9 -b $BITRATE$ - - + [mac] $FILE$ - -d | [lame] --resample 44100 -x --silent -q $QUALITY$ -b $BITRATE$ - - mp3 mp3 * * - @@ -108,7 +109,7 @@ mov aif * * # special case for smart bitrates on mp3 input mp3 lame * * - [lame] --resample 44100 --silent -b $BITRATE$ $FILE$ - + [lame] --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ $FILE$ - # This example transcodes MP3s to MP3s, if the target machine has the diff -upBr slim-old/strings.txt slim/server/strings.txt --- slim-old/strings.txt 2004-10-28 09:06:00.000000000 -0700 +++ slim/server/strings.txt 2004-11-17 10:13:14.687500000 -0800 @@ -1619,6 +1619,18 @@ SETUP_LAME_FOUND FR LAME semble être installé correctement sur votre système. SE LAME verkar vara korrekt installerad i ditt system. +LAME0 + EN Highest Quality, very slow + +LAME9 + EN Poor Quality, but fast + +SETUP_LAMEQUALITY + EN LAME Quality Level + +SETUP_LAMEQUALITY_DESC + EN Conversion to MP3 using LAME may be set for varying quality. A setting of 9 is the default, providing a fast conversion but poor quality. 0 is the highest quality but is much slower and may not be able to keep up playback on some systems. + SETUP_MP3SILENCEPRELUDE DE Audio Startzeit EN Audio Startup Time