Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Proposed Function Additions to Plugins

Re: Proposed Function Additions to Plugins

From: Wilgus William via rockbox-dev <rockbox-dev_at_cool.haxx.se>
Date: Wed, 23 Aug 2017 23:54:00 -0400

On Wed, Aug 23, 2017 at 6:18 PM, Amaury Pouly <amaury.pouly_at_gmail.com>
wrote:

>
>
>
>> *sound_current(int setting)*
>>
>> * returns the current sound setting from global_settings*
>> * complements sound_max, sound_min and sound_default*
>>
>> ^This will allow current sound setting to be read consistent with how the
>> current functions allow min, max and default to be read from a plugin
>>
>
> Sounds okay to me, to be honest I always found it surprising that we can
> set but not get the current value.
>
>
>>
>>
>> * set_sleeptimer_duration(int minutes)*
>> * get_sleep_timer(void)*
>>
>> ^I'd like to add this to allow sleep timer to be read/set/reset from
>> plugins
>>
>
> No opinion, I know nothing about the sleep timer.
>
>
>>
>>
>> * set_speaker_mode(int speaker_mode)*
>> * get_speaker_mode(void)*
>>
>> That sounds okay to me on principle, however I would be curious to know
> the application and also what is the intention:
> will this change the current mode AND the setting on disk (ie it's a
> permanent change until the setting is changed by user or API) ?
>
>>
>>
>> I'd also like to get g#1566 Committed for lua to have access to the
>> version
>>
>> *'PLUGIN_API_VERSION'*
>> *'PLUGIN_MIN_API_VERSION'*
>>
>> Can you elaborate how this would be useful? I understand that at the
> moment the C plugins have a strict version handling whereas the lua ones do
> not.
> However having access to those does not immediately solve the problem
> unless you manually track the minimum version required which is something
> easily broken/forgotten.
> I do not have a good solution for this at the moment I admit, I will think
> about it.
>

Concerning *set_speaker_mode *I really don't have any major desire to
include it this was a favor for chrisjj back when I did it and therefore I
don't really have a use case for it, currently it writes the
global_settings.speaker_mode
and calls audio_enable_speaker() with the value so in theory it would
write the setting to disk, although that can be changed pretty easily to
make it temporary in nature

Although __builtin and I discussed this today and he feels its easy enough
to leave this stuff out until a plugin author needs it and then they can
cherry pick it into their commit I'm inclined to agree on set_speaker mode
so I will probably split it into 3 separate commits

As for the api version variable in lua I noticed writing a few scripts that
there is no versioning so you have to check everything against nil before
you use it although that is good practice I think it'd be nice to know
immediately that a function is not available although it's probably just as
much work to check the version anyways
Received on 2017-08-24

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy