Re: [SlimDevices: Plugins] Player specific information in MusicInfoSCR

2007-06-13 Thread mherger

I can't reproduce the issue I encountered this afternoon...

Feel free to give this version a try. It hasn't been tested a lot, but
should basically work (trunk only). The key to integrating your data
with MIS is a function called getMusicInfoSCRCustomItems():


Code:

sub getMusicInfoSCRCustomItems {
return {
'BUFFER' => {
'cb' => 
\&Plugins::MusicInfoSCR::Info::getBufferFullness,
'cache' => 0
},
'NOTESYMBOL' => {
'cb' => sub {
my $client = shift;
return $client->symbols('notesymbol');
}
}
};
  }



There are two parameters:
- 'cb': a reference to the function to be called. $client and $song
(the currently playing track object) are passed to that function.

- 'cache' can have one of two values: undef or a number >=0
* undef: update on song change only
* 0: don't cache
* 1+: cache for x seconds (eg. 3600 to update wheather forecast once
an hour)

In the above example you see that the buffer state is updated once a
second, while the notesymbol is updated on song change only (pure
laziness: it could be updated every 99 seconds as well).


+---+
|Filename: SlimStuff-MusicInfoSCR.tar.gz|
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=2973|
+---+

-- 
mherger

Michael

-
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

mherger's Profile: http://forums.slimdevices.com/member.php?userid=50
View this thread: http://forums.slimdevices.com/showthread.php?t=35997

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins


Re: [SlimDevices: Plugins] Player specific information in MusicInfoSCR

2007-06-13 Thread erland

Michael Herger;208609 Wrote: 
> are you already working on the trunk or still 6.5.x? I've got a basic
> version running, allowing plugins to register custom items - but it's
> trunk only for now.I'm still on 6.5.x, I've started to look at 7.0 but 
> haven't actually
converted any plugin yet. But it's not critical for me to get it to
work with 6.5.x, so if you like to keep this as 7.0 only, it will be
fine by me.

Michael Herger;208609 Wrote: 
> And I do encounter a problem with SlimServer itself
> (Slim::Utils::PluginManager->enabledPlugins() not returning anything).
> Would be great if you could at least confirm the latter issue.
> I'll try to get some simple test plugin running and check if
enabledPlugins() returns nothing for me too. I'll get back to you.

If you like me to verify something with the new MusicInfoSCR, just mail
me the new version or post it here.


-- 
erland

Erland Isaksson
'My homepage' (http://erland.homeip.net) 'My download page'
(http://erland.homeip.net/download)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library and RandomPlayList plugins'
(http://wiki.erland.homeip.net/index.php/Category:SlimServer))

erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=35997

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins


Re: [SlimDevices: Plugins] Player specific information in MusicInfoSCR

2007-06-13 Thread Michael Herger
Erland,

are you already working on the trunk or still 6.5.x? I've got a basic  
version running, allowing plugins to register custom items - but it's  
trunk only for now.

And I do encounter a problem with SlimServer itself  
(Slim::Utils::PluginManager->enabledPlugins() not returning anything).  
Would be great if you could at least confirm the latter issue.

-- 

Michael

-
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins


Re: [SlimDevices: Plugins] Player specific information in MusicInfoSCR

2007-06-11 Thread erland

Michael Herger;208130 Wrote: 
> 
> Looking at your code I see one thing I think should have to be changed:
> 
> caching. Who should do the caching? While MIP does some caching anyway,
> 
> the providing plugin knows much better how long a given value is valid.
> 
> Let's take your example: when does the collection name change? I guess 
> 
> _never_ within a playlist. If MIP checked for every song this would be
> a  
> waste of CPU cycles. I'd therefore rather leave it to the information 
> 
> provider or add a parameter which will tell MIP whether to cache or not
> a  
> value. Eg.
> 
> 0: don't cache
> -1: cache for the song's duration
> > =1: update every x seconds
> 
> What do you think?
> An extra parameter as you describe sounds good. In my situation I think
I will be able to cache it in the plugin, but the extra parameter is
good if other plugins can't cache it.

I also found something that I think is the 2.20 release on my
harddrive, I have attached it to this post if you want it.


+---+
|Filename: MusicInfoSCR.pm  |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=2954|
+---+

-- 
erland

Erland Isaksson
'My homepage' (http://erland.homeip.net) 'My download page'
(http://erland.homeip.net/download)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library and RandomPlayList plugins'
(http://wiki.erland.homeip.net/index.php/Category:SlimServer))

erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=35997

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins


Re: [SlimDevices: Plugins] Player specific information in MusicInfoSCR

2007-06-11 Thread Michael Herger
> It might be the hook I gave you a patch for some time ago, I still have
> the patch on my download page up to the 2.10 release of MusicInfoSCR,
> so I think you introduced it officially in the 2.20 release and removed
> it a bit later.

Exactly:

# Changelog
# 2.30- remove that support again, as addFormat() should do the same...
# 2.20- add support for third party plugins (thanks a lot Erland Isaksson!)

And you know what? I _never_ checked in neither 2.10 nor 2.20... All I  
have in my SVN repository is 2.05 and 2.30 :-(.

> It looks like the patch took both the $client and $item as
> in-parameters which would suggest that the information might be player
> specific.

I'll give it another try. I'm glad you still have it...

Looking at your code I see one thing I think should have to be changed:  
caching. Who should do the caching? While MIP does some caching anyway,  
the providing plugin knows much better how long a given value is valid.  
Let's take your example: when does the collection name change? I guess  
_never_ within a playlist. If MIP checked for every song this would be a  
waste of CPU cycles. I'd therefore rather leave it to the information  
provider or add a parameter which will tell MIP whether to cache or not a  
value. Eg.

0: don't cache
-1: cache for the song's duration
> =1: update every x seconds

What do you think?

-- 

Michael

-
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins


Re: [SlimDevices: Plugins] Player specific information in MusicInfoSCR

2007-06-11 Thread erland

Michael Herger;208103 Wrote: 
> > So, is there some way to do this through MusicInfoSCR ?
> 
> No, no more. Or not yet? I thought I once had some kind of plugin  
> support... Will dig through the changelog.
> It might be the hook I gave you a patch for some time ago, I still have
the patch on my download page up to the 2.10 release of MusicInfoSCR,
so I think you introduced it officially in the 2.20 release and removed
it a bit later.

It looks like the patch took both the $client and $item as
in-parameters which would suggest that the information might be player
specific.


-- 
erland

Erland Isaksson
'My homepage' (http://erland.homeip.net) 'My download page'
(http://erland.homeip.net/download)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library and RandomPlayList plugins'
(http://wiki.erland.homeip.net/index.php/Category:SlimServer))

erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=35997

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins


Re: [SlimDevices: Plugins] Player specific information in MusicInfoSCR

2007-06-11 Thread Michael Herger
> So, is there some way to do this through MusicInfoSCR ?

No, no more. Or not yet? I thought I once had some kind of plugin  
support... Will dig through the changelog.

> Michael, if it isn't possible, do you have any idea how it should be
> done and if it is suitable ?

As the subject had been discussed before I guess I'll have to add some  
kind of hook to support this.

> The thing I like to this display is the currently active library from
> the MultiLibrary plugin. The user can select different a  library on
> each player. I like it to be displayed on the "Now Playing" screen.

There have been other use cases before, which makes this a reasonable  
request.

-- 

Michael

-
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins


[SlimDevices: Plugins] Player specific information in MusicInfoSCR

2007-06-10 Thread erland

Is there someway for a plugin to show player specific information
through the MusicInfoSCR screensaver ?

It can't be done through standard title formats, since these aren't
specific for each player. The plugin doesn't get any $client in the
callback when it shall return the title format value. See this thread
for an earlier discussion:
http://forums.slimdevices.com/showthread.php?t=35402

So, is there some way to do this through MusicInfoSCR ?

Michael, if it isn't possible, do you have any idea how it should be
done and if it is suitable ? 

The thing I like to this display is the currently active library from
the MultiLibrary plugin. The user can select different a  library on
each player. I like it to be displayed on the "Now Playing" screen.


-- 
erland

Erland Isaksson
'My homepage' (http://erland.homeip.net) 'My download page'
(http://erland.homeip.net/download)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library and RandomPlayList plugins'
(http://wiki.erland.homeip.net/index.php/Category:SlimServer))

erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=35997

___
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins