Index: /Users/mh/Documents/workspace/unstable/server/Slim/Player/Client.pm =================================================================== --- /Users/mh/Documents/workspace/unstable/server/Slim/Player/Client.pm (revision 21065) +++ /Users/mh/Documents/workspace/unstable/server/Slim/Player/Client.pm (working copy) @@ -269,8 +269,7 @@ sub init { my $client = shift; - # make sure any preferences unique to this client may not have set are set to the default - $prefs->client($client)->init($defaultPrefs); + $client->initPrefs(); # init display including setting any display specific preferences to default if ($client->display) { @@ -278,6 +277,14 @@ } } +sub initPrefs { + my $client = shift; + + # make sure any preferences unique to this client may not have set are set to the default + $prefs->client($client)->init($defaultPrefs); +} + + =head1 FUNCTIONS Accessors for the list of known clients. These are functions, and do not need @@ -308,7 +315,7 @@ $clientPrefs->remove( keys %{$clientPrefs->all} ); - $client->init(); + $client->initPrefs(); } =head2 clientCount() Index: /Users/mh/Documents/workspace/unstable/server/Slim/Player/Player.pm =================================================================== --- /Users/mh/Documents/workspace/unstable/server/Slim/Player/Player.pm (revision 21065) +++ /Users/mh/Documents/workspace/unstable/server/Slim/Player/Player.pm (working copy) @@ -84,10 +84,6 @@ sub init { my $client = shift; - # make sure any preferences this client may not have set are set to the default - # This should be a method on client! - $prefs->client($client)->init($defaultPrefs); - $client->SUPER::init(); Slim::Hardware::IR::initClient($client); @@ -102,6 +98,16 @@ $client->brightness($prefs->client($client)->get($client->power() ? 'powerOnBrightness' : 'powerOffBrightness')); } +sub initPrefs { + my $client = shift; + + # make sure any preferences this client may not have set are set to the default + # This should be a method on client! + $prefs->client($client)->init($defaultPrefs); + + $client->SUPER::initPrefs(); +} + # usage - float buffer fullness as a fraction sub usage { my $client = shift; Index: /Users/mh/Documents/workspace/unstable/server/Slim/Player/SLIMP3.pm =================================================================== --- /Users/mh/Documents/workspace/unstable/server/Slim/Player/SLIMP3.pm (revision 21065) +++ /Users/mh/Documents/workspace/unstable/server/Slim/Player/SLIMP3.pm (working copy) @@ -63,8 +63,6 @@ sub init { my $client = shift; - $prefs->client($client)->init($defaultPrefs); - $client->SUPER::init(); $client->periodicScreenRefresh(); @@ -70,6 +68,14 @@ $client->periodicScreenRefresh(); } +sub initPrefs { + my $client = shift; + + $prefs->client($client)->init($defaultPrefs); + + $client->SUPER::initPrefs(); +} + # periodic screen refresh sub periodicScreenRefresh { my $client = shift; Index: /Users/mh/Documents/workspace/unstable/server/Slim/Player/SoftSqueeze.pm =================================================================== --- /Users/mh/Documents/workspace/unstable/server/Slim/Player/SoftSqueeze.pm (revision 21065) +++ /Users/mh/Documents/workspace/unstable/server/Slim/Player/SoftSqueeze.pm (working copy) @@ -18,10 +18,10 @@ use Slim::Player::Transporter; use Slim::Utils::Prefs; -sub init { +sub initPrefs { my $client = shift; - $client->SUPER::init(@_); + $client->SUPER::initPrefs(@_); preferences('server')->client($client)->set('autobrightness', 0); } Index: /Users/mh/Documents/workspace/unstable/server/Slim/Player/Squeezebox2.pm =================================================================== --- /Users/mh/Documents/workspace/unstable/server/Slim/Player/Squeezebox2.pm (revision 21065) +++ /Users/mh/Documents/workspace/unstable/server/Slim/Player/Squeezebox2.pm (working copy) @@ -55,7 +55,7 @@ my @WMA_EXTENDED_CONTENT_DESCRIPTION_OBJECT_GUID = (0xd2, 0xd0, 0xa4, 0x40, 0xe3, 0x07, 0x11, 0xd2, 0x97, 0xf0, 0x00, 0xa0, 0xc9, 0x5e, 0xa8, 0x50); my @WMA_STREAM_BITRATE_PROPERTIES_OBJECT_GUID = (0x7b, 0xf8, 0x75, 0xce, 0x46, 0x8d, 0x11, 0xd1, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2); -sub init { +sub initPrefs { my $client = shift; # make sure any preferences unique to this client may not have set are set to the default @@ -61,7 +61,7 @@ # make sure any preferences unique to this client may not have set are set to the default $prefs->client($client)->init($defaultPrefs); - $client->SUPER::init(); + $client->SUPER::initPrefs(); } sub reconnect { Index: /Users/mh/Documents/workspace/unstable/server/Slim/Player/SqueezeSlave.pm =================================================================== --- /Users/mh/Documents/workspace/unstable/server/Slim/Player/SqueezeSlave.pm (revision 21065) +++ /Users/mh/Documents/workspace/unstable/server/Slim/Player/SqueezeSlave.pm (working copy) @@ -53,7 +53,7 @@ return $client; } -sub init { +sub initPrefs { my $client = shift; # make sure any preferences unique to this client may not have set are set to the default @@ -59,7 +59,7 @@ # make sure any preferences unique to this client may not have set are set to the default $prefs->client($client)->init($defaultPrefs); - $client->SUPER::init(); + $client->SUPER::initPrefs(); } sub reconnect { Index: /Users/mh/Documents/workspace/unstable/server/Slim/Player/Transporter.pm =================================================================== --- /Users/mh/Documents/workspace/unstable/server/Slim/Player/Transporter.pm (revision 21065) +++ /Users/mh/Documents/workspace/unstable/server/Slim/Player/Transporter.pm (working copy) @@ -51,7 +51,7 @@ )], }; -sub init { +sub initPrefs { my $client = shift; # make sure any preferences unique to this client may not have set are set to the default @@ -57,7 +57,7 @@ # make sure any preferences unique to this client may not have set are set to the default $prefs->client($client)->init($defaultPrefs); - $client->SUPER::init(); + $client->SUPER::initPrefs(); } sub reconnect {