fantasydreaming;322516 Wrote: 
> This is a start, but kinda missing 99% of the functions.
> http://wiki.slimdevices.com/index.php/DeveloperGuide
> 
Unfortunately the developer guide for the plugin API on the wiki hasn't
been updated for SqueezeCenter 7.x, what you see there is still the
SlimServer 6.5 version.

Don't be afraid to ask specific questions if you like help with
something, there are a lot of developers that is able to help you if
you specify exactly what you like to do. I usually post development
questions in the Developer section of the forum as more of the
developers tend to answer on thread there than in the 3rd party plugin
section.

Another tip is that you look at one of the existing plugins, preferably
someone that does someting similar as what you try to accomplish. The
push/pop and INPUT.List/INPUT.Choice stuff happens in most plugins that
have a menu in the player interface, so choose anyone you like. When I
did my first plugin, I first looked at the HelloWorld example but
pretty fast I switched to one of the existing plugins, in my case I
think it was iTunes Update, but that was just because I liked to do
something similar in the TrackStat plugin which was my first. In your
case there might be some other plugin that is more appropriate.
A recommendation is that you choose one of the plugins bundled with
SqueezeCenter as these tend to be more updated according to how "you
are supposed to do things" while some third party plugins isn't always
updated according to the latest changes in the API.

fantasydreaming;322516 Wrote: 
> 
> For instance, what's all this popping and pushing?
> 
> Slim::Buttons::Common::pushMode($client, 'INPUT.List', \%params);
> 
> What does INPUT.list correspond to?
> Basic documentation of the %params allowed to be passed in would be
> neat too.
> 
push = Enter a sub menu
pop = Exit to the parent menu

The functions you are going to use most are:
pushModeLeft = Slide into a sub menu, typically used when the user hits
the right arrow
popMode = Slide out from a sub menu to the parent menu, typically used
when the user hits the left arrow.

You can define your complete own mode which you will need to register
by calling Slim::Buttons::Common::addMode once in initPlugin. With your
own mode, you will need to handle everything yourself.

Or you can use one of the existing modes, this typically means that you
use INPUT.List or INPUT.Choice. To use these you call pushModeLeft with
INPUT.List or Input.Choice as parameter and in the last %params
parameter you specify the menu text, its items and callbacks you like
to be called when the user hits play, add or right.

You will find the documentation in:
Slim/Buttons/Input/List.pm
Slim/Buttons/Input/Choice.pm

I typically use INPUT.Choice in most of my menus in the plugins I've
developed.

fantasydreaming;322516 Wrote: 
> 
> Browsing the source doesn't help much since perl is so unreadable :)
> 
Don't worry, I felt the same way in the beginning, it's getting easier
after a while.

fantasydreaming;322516 Wrote: 
> 
> For instance:  How do I add responding to the volume-up button while
> the 'mode' is in my plugin?  Or respond to uparrow-hold?  I've found
> default.map in the source.
> 

You will need the getFunctions method which should return a hash with
the name of the functions as a string as key and a reference to the
function as a value. For example:


Code:
--------------------
    
  my %functions = (
  'dosomestuff' => \&doMyStuff,
  'dosomeotherstuff' => \&doMyOtherStuff,
  );
  sub getFunctions {
  return \%functions;
  }
  sub doMyStuff {
  # Callback that will be called when 'dosomestuff' is intiated
  }
  sub doMyOtherStuff {
  # Callback that will be called when 'dosomeotherstuff' is initiated
  }
  
--------------------


Next is the button to function mapping which you also need to provide,
this is done by providing the defaultMap function in your plugin.

Code:
--------------------
    
  my %mapping = (
        'arrow_up.hold' => 'dosomestuff',
        'volup.hold' => 'dosomeotherstuff',
  );
  sub defaultMap {
  return \%mapping;
  }
  
--------------------


fantasydreaming;322516 Wrote: 
> 
> Also, any way to reload the plugins without restarting the whole
> server?  My library is big and it for some stupid reindexes sometimes
> when I restart it and lazysearch always reindexes which == about 20
> seconds of max cpu.
> 
You will currently need to restart, you can do changes in web interface
html files without restart, but any change to the *.pm files requires a
SqueezeCenter restart.

Unless you are dependent on LazySearch during development, you can
always disable it temporary in SqueezeCenter Settings/Plugins.


-- 
erland

Erland Isaksson
'My homepage' (http://erland.isaksson.info) 'My download page'
(http://erland.isaksson.info/download)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library and Database Query plugins'
(http://wiki.erland.isaksson.info/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=50185

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to