Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8aafd4e
Added ignore of Plugins folder to allow running from git checkout
hickinbottoms Oct 8, 2012
cce5c75
Added additional SB1G fonts
hickinbottoms Oct 8, 2012
0066c56
Merge branch 'feature/my-local-changes' into develop/7.8
hickinbottoms Oct 8, 2012
44d4466
Add shuffle mode to web alarm preference interface
hickinbottoms Oct 8, 2012
f5407c7
Apply the alarm playlist shuffle mode prior to playing
hickinbottoms Oct 8, 2012
1a50f14
Remember and restore pre-alarm shuffle mode after alarm has finished
hickinbottoms Oct 9, 2012
d955f87
Add alarm playlist shuffle setting for old players
hickinbottoms Oct 9, 2012
417231e
Added support for settig alarm playlist shuffle mode for Jive-based p…
hickinbottoms Oct 10, 2012
06ea04c
Merge branch 'feature/alarm-shuffle-settings' into develop/7.8
hickinbottoms Oct 10, 2012
eb4c415
Don't worry about the file extension of media file softlink targets
hickinbottoms Oct 14, 2012
98009ed
Merge branch 'feature/softlink-target-fix' into develop/7.8
hickinbottoms Oct 14, 2012
3ebd90d
Merge branch 'alarm-shuffle-settings' into develop/7.8
hickinbottoms Oct 14, 2012
941a8e6
Merge branch 'public/7.8' of https://github.com/Logitech/slimserver i…
hickinbottoms Oct 26, 2012
672aa6a
Merge remote-tracking branch 'upstream/public/7.8' into develop/7.8
hickinbottoms Nov 24, 2012
8d32d8d
Disable cross-fading between tracks with different sample rates
hickinbottoms Nov 24, 2012
19027d2
Merge branch 'feature/fix-transition-sample-rates2' into develop/7.8
hickinbottoms Nov 24, 2012
1ffee65
Merge branch 'public/7.8' of https://github.com/Logitech/slimserver i…
hickinbottoms Mar 18, 2013
1c1c66e
Merge remote-tracking branch 'upstream/public/7.8' into develop/7.8
hickinbottoms Apr 14, 2013
1c311b4
Merge remote-tracking branch 'upstream/public/7.8' into develop/7.8
hickinbottoms Aug 23, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Plugins/
Binary file added Graphics/thinhuge-caps.2.font.bmp
Binary file not shown.
Binary file added Graphics/thinhuge-mixcaps.2.font.bmp
Binary file not shown.
Binary file added Graphics/thinhuge.2.font.bmp
Binary file not shown.
95 changes: 88 additions & 7 deletions Slim/Player/ReplayGain.pm
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ sub fetchGainMode {
return preventClipping( $track->replay_gain(), $track->replay_peak() );
}

# Based on code from James Sutula's Dynamic Transition Updater plugin,
# this method determines whether tracks at a given offset from each
# other in the playlist are similarly adjacent within the same album.
sub trackAlbumMatch {
sub findTracksByIndex {
my $class = shift;
my $client = shift;
my $offset = shift;
Expand Down Expand Up @@ -114,10 +111,24 @@ sub trackAlbumMatch {
# Get the track objects
my $current_url = Slim::Player::Playlist::song($client, $current_index);
my $current_track = Slim::Schema->objectForUrl({ 'url' => $current_url, 'create' => 1, 'readTags' => 1 });

my $compare_url = Slim::Player::Playlist::song($client, $compare_index);
my $compare_track = Slim::Schema->objectForUrl({ 'url' => $compare_url, 'create' => 1, 'readTags' => 1 });

return ($current_track, $compare_track);
}

# Based on code from James Sutula's Dynamic Transition Updater plugin,
# this method determines whether tracks at a given offset from each
# other in the playlist are similarly adjacent within the same album.
sub trackAlbumMatch {
my $class = shift;
my $client = shift;
my $offset = shift;

my ($current_track, $compare_track) = $class->findTracksByIndex($client, $offset);
return if (!$current_track || !$compare_track);

if (!blessed($current_track) || !blessed($compare_track)) {

logError("Couldn't find object for track: [$current_track] or [$compare_track] !");
Expand Down Expand Up @@ -178,18 +189,88 @@ sub trackAlbumMatch {
return 0;
}

# Identify whether the sample rates match between two tracks in a
# client playlist. This is modelled after the trackAlbumMatch function
# above.
sub trackSampleRateMatch {
my $class = shift;
my $client = shift;
my $offset = shift;

my ($current_track, $compare_track) = $class->findTracksByIndex($client, $offset);
return if (!$current_track || !$compare_track);

if (!blessed($current_track) || !blessed($compare_track)) {

logError("Couldn't find object for track: [$current_track] or [$compare_track] !");

return 0;
}

if (!$current_track->can('samplerate') || !$compare_track->can('samplerate')) {

logError("Couldn't a find valid object for track: [$current_track] or [$compare_track] !");

return 0;
}

# For remote tracks, get metadata from the protocol handler
if ( $current_track->remote ) {
if ( !$compare_track->remote ) {
# Other track is not remote, fail
return;
}

my $current_meta = {};
my $compare_meta = {};

my $current_handler = Slim::Player::ProtocolHandlers->handlerForURL( $current_track->url );
my $compare_handler = Slim::Player::ProtocolHandlers->handlerForURL( $compare_track->url );

if ( $current_handler && $current_handler->can('getMetadataFor') ) {
$current_meta = $current_handler->getMetadataFor( $client, $current_track->url );
}

if ( $compare_handler && $compare_handler->can('getMetadataFor') ) {
$compare_meta = $compare_handler->getMetadataFor( $client, $compare_track->url );
}

if ( $current_meta->{samplerate}
&& $compare_meta->{samplerate}
&& $current_meta->{samplerate} eq $compare_meta->{samplerate}
) {
# Sample rate metadata matches
return 1;
}
else {
return;
}
}

# Check sample rates match
my $compare_rate = $compare_track->samplerate;
my $current_rate = $current_track->samplerate;
if ($compare_rate && $current_rate &&
($compare_rate == $current_rate)) {

return 1;
}

return 0;
}

# Bug 5119
# Reduce the gain value if necessary to avoid clipping
sub preventClipping {
my ( $gain, $peak ) = @_;

if ( defined $peak && defined $gain && $peak > 0 ) {
my $noclip = -20 * ( log($peak) / log(10) );
if ( $noclip < $gain ) {
return $noclip;
}
}

return $gain;
}

Expand Down
17 changes: 14 additions & 3 deletions Slim/Player/Squeezebox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -994,19 +994,30 @@ sub stream_s {
}
}

# Don't do transitions if the sample rates of the two
# songs differ. This avoids some unpleasant white
# noise from (at least) the Squeezebox Touch when
# using the analogue outputs. This might be bug#1884.
if (!Slim::Player::ReplayGain->trackSampleRateMatch($master, -1)
||
!Slim::Player::ReplayGain->trackSampleRateMatch($master, 1)) {
main::INFOLOG && $log->info('Overriding transition due to differing sample rates');
$transitionType = 0;
}

}

if ($transitionDuration > $client->maxTransitionDuration()) {
$transitionDuration = $client->maxTransitionDuration();
}

if ( main::INFOLOG && $log->is_info ) {
$log->info(sprintf(
"Starting decoder with format: %s flags: 0x%x autostart: %s buffer threshold: %s output threshold: %s samplesize: %s samplerate: %s endian: %s channels: %s",
$formatbyte, $flags, $autostart, $bufferThreshold, $outputThreshold, $pcmsamplesize, $pcmsamplerate, $pcmendian, $pcmchannels,
));
}

my $frame = pack 'aaaaaaaCCCaCCCNnN', (
's', # command
$autostart,
Expand Down
8 changes: 0 additions & 8 deletions Slim/Utils/Misc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -852,15 +852,7 @@ sub fileFilter {
elsif ($validRE && -f _) {
return 0 if $item !~ $validRE;
}
elsif ($validRE && -l _ && defined ($target = readlink($fullpath))) {
# fix relative/absolute path
$target = ($target =~ /^\// ? $target : catdir($dirname, $target));

if (-f $target) {
return 0 if $target !~ $validRE;
}
}

return 1;
}

Expand Down