Hi
The PhoneBook plugin hasn't been updated for v7 so I thought I would give it a try. I cannot get the lines from the phonebook text file to appear on the screen although I know it is reading thru the file. I've attached the plugin with my updates. I'm really not sure what is Perl and what is required for SqueezeCenter to act on. Things like '$client->update();' are a mystery as I don't know what is happening in the background. Basically I'm confused!
Any help would be appreciated. Look out for the code I've added/changed as it may well be incorrect!!
Thanks
Steve
Results 1 to 10 of 12
-
2008-04-29, 14:43 #1Member
- Join Date
- Jan 2007
- Location
- Glasgow, UK
- Posts
- 64
Help required to update Phonebook plugin
-
2008-05-07, 16:51 #2
Same club :(
Hi Steve
Did you get any further with this? I'm writing a plugin and stuck in the same place with the display code stuff.
All searches seem to lead back to the Helloworld script for reference, but what would be helpful is if someone extended the Helloworld plugin so it updated the display every minute with different text so you could see how it constructs and displays the text.
Seems to be a lack of tech info on the display code front, well that I can understand anyway :s
Cheerswww.spicefly.com - ** Spicefly SugarCube ** - A hassle free acoustic journey through your music library using MusicIP. Plus the finest MusicIP installation guides, enhanced MIP Interface and SpyGlass MIP the Windows Automated MusicIP Headless Installer.
-
2008-05-08, 05:27 #3Member
- Join Date
- Jan 2007
- Location
- Glasgow, UK
- Posts
- 64
Help re screen display
Hi
Sorry no further on. I've tried various changes to no avail. I've looked at the Perl website but I can't relate any info to my issue. I'm really only attempting to get the plugin working for v7 and don't want to learn Perl to do it. An idiots guide, e.g. to Helloworld, describing each line would help me. I just don't understand the syntax and what is happening or the error messages I get. Your suggestion re 'display every minute with different text so you could see how it constructs and displays the text' sounds like my solution also.
Lets hope some nice person reads this and can HELP!
Cheers
Steve
-
2008-05-10, 04:55 #4
Hi,
Well I got some success using this code. It displays the @message on the display. Not sure quite how it works :s
I tried the info in the plugin wiki for ShowBriefly but the example doesnt work so this is the best I've done so far, based on a number of hours of trying other peoples code and general playing around.
Seems a lot of code around doesnt work on v7 and there arent many working examples about to try and break down.
my $client = shift;
my @message = "Show Me on Display";
my %params = (
'header' => '',
'listRef' => \@message,
'callback' => '',
);
Slim::Buttons::Common:
ushMode($client, 'INPUT.List', \%params);
$client->update;
Good luck!
www.spicefly.com - ** Spicefly SugarCube ** - A hassle free acoustic journey through your music library using MusicIP. Plus the finest MusicIP installation guides, enhanced MIP Interface and SpyGlass MIP the Windows Automated MusicIP Headless Installer.
-
2008-05-10, 05:18 #5Senior Member
- Join Date
- Apr 2005
- Posts
- 6,932
The api for the display code is documented as under Help - Technical Information - Display API from the web interface.
To show information on the player interface briefly:
$client->showBriefly({ line => ['text for top line', 'text for lower line'] });
-
2008-05-10, 05:25 #6
my $client=shift;
my $display=$client->curLines();
$display->{'line1'} = string('PLUGIN_SPICEFLY_TEST');
$client->showBriefly($display);
Thanks for the steer Triode
I also got the above code to work, pulls the responding text from the strings.txt file. Though you must be careful of white space and tabs otherwise it wont work! I'll read up on the =shift line as this seems critical to success otherwise it just all seems to go wrong :s
Steve, if you start squeezecenter like this from the start menu->run, it will output debug code which may help you debug your code.
"C:\program Files\squeezeCenter\server\squeezecenter.exe" -debugwww.spicefly.com - ** Spicefly SugarCube ** - A hassle free acoustic journey through your music library using MusicIP. Plus the finest MusicIP installation guides, enhanced MIP Interface and SpyGlass MIP the Windows Automated MusicIP Headless Installer.
-
2008-05-13, 15:18 #7Member
- Join Date
- Jan 2007
- Location
- Glasgow, UK
- Posts
- 64
I tried in 'sub lines' :-
return( { 'line'=> ['Line1 text','Line2 text'] } );
with
$client->update();
in 'sub setMode' but got this:-
Slim::Buttons::Common:
ushMode (1718) Error: Couldn't push into new mode: [Plugins::PhoneBook::Plugin] !: Can't locate object method "update" via package "Plugins::PhoneBook::Plugin" at C:/program Files/squeezeCenter/server/Plugins/PhoneBook/Plugin.pm line 219.
Don't know what this means.
Haven't tried the @message yet or the $display in your 2nd message of 10th. Where have you placed these in your code?
Steve
-
2008-05-13, 15:52 #8
the setMode function is the old format. Plugins are now classes, so it needs $class as the first arg, like so:
sub setMode {
my $class = shift;
my $client = shift;
my $method = shift;
also:
where the $client is available, string() should be $client->string()
-kdf
-
2008-05-16, 13:56 #9Member
- Join Date
- Jan 2007
- Location
- Glasgow, UK
- Posts
- 64
Thanks kdf, that was it. Now displaying on screen as before.
Another issue though is the path to the text file. The old format was:
my $phonebook_location = catdir(Slim::Utils::Prefs:
referencesPath(),'phonebook.txt');
Doesn't like 'preferencesPath' so what should I replace it with?
Hi cparker, how are you getting on?
Steve
-
2008-05-20, 07:53 #10
Hi Steve
Glad you are still persevering
I've been on holiday recently so havent done much in the last few weeks.
I've got the AsyncHttp working nicely to pull info from a website and the basic framework with timers to update the display every few seconds.
Main sticking point now, is that I want to display some graphics and three lines of text on the display. Struggling on this, spent ages looking at other peoples code but cant get it to work at all :s
If anybody has some simple examples that would be great
If only you could program it, in visual basic LOL
www.spicefly.com - ** Spicefly SugarCube ** - A hassle free acoustic journey through your music library using MusicIP. Plus the finest MusicIP installation guides, enhanced MIP Interface and SpyGlass MIP the Windows Automated MusicIP Headless Installer.

Reply With Quote
