Adding settings to an existing group

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding settings to an existing group

Henrik Sperre Johansen
Sorry I haven't really had time to learn the settings framework yet,
does anyone know how to do this?

Updating the Sound package, I'd like to add a few to the existing
category Appearance -> sound (strange place for it, btw...) in a package
one can load from the repository.

I tried code like:

quickStartSoundSettingOn: aBuilder
    <systemsettings>
        (aBuilder group: #appearance)    with: [
            (aBuilder setting: #soundEnabled) with: [
                (aBuilder setting: #soundQuickStart)
                    label: 'Play sounds immediately if possible';
                    target: SoundPlayer;
                    targetSelector: #soundQuickStart]]
 
but that's apparently far off the mark...

Cheers,
Henry

Reply | Threaded
Open this post in threaded view
|

Re: Adding settings to an existing group

Alain Plantec-4
-----------------
quickStartSoundSettingOn: aBuilder
     <systemsettings>
     (aBuilder setting: #soundQuickStart)
        parent: #soundEnabled;
         label: 'Play sounds immediately if possible' translated;
         target: SoundPlayer
--------------

should do it if you have
SoundPlayer class>>soundQuickStart
SoundPlayer class>>soundQuickStart: aBoolean

btw:
why this setting ?
If sound is enabled, why would I set this setting to false ?
I guess one always want the sound to start as quick as possible.

Cheers
Alain




Le 21/01/2011 16:06, Henrik Sperre Johansen a écrit :

> Sorry I haven't really had time to learn the settings framework yet,
> does anyone know how to do this?
>
> Updating the Sound package, I'd like to add a few to the existing
> category Appearance ->  sound (strange place for it, btw...) in a package
> one can load from the repository.
>
> I tried code like:
>
> quickStartSoundSettingOn: aBuilder
>      <systemsettings>
>          (aBuilder group: #appearance)    with: [
>              (aBuilder setting: #soundEnabled) with: [
>                  (aBuilder setting: #soundQuickStart)
>                      label: 'Play sounds immediately if possible';
>                      target: SoundPlayer;
>                      targetSelector: #soundQuickStart]]
>
> but that's apparently far off the mark...
>
> Cheers,
> Henry
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Adding settings to an existing group

Henrik Sperre Johansen
On 21.01.2011 17:33, Alain Plantec wrote:

> -----------------
> quickStartSoundSettingOn: aBuilder
> <systemsettings>
>     (aBuilder setting: #soundQuickStart)
>     parent: #soundEnabled;
>         label: 'Play sounds immediately if possible' translated;
>         target: SoundPlayer
> --------------
>
> should do it if you have
> SoundPlayer class>>soundQuickStart
> SoundPlayer class>>soundQuickStart: aBoolean
>

Yeah, I found parent: after awhile :D
Must have added it to instance side, and that's why it didn't show up in
the settings browser... *blush*
> btw:
> why this setting ?
> If sound is enabled, why would I set this setting to false ?
> I guess one always want the sound to start as quick as possible.
>
> Cheers
> Alain
Eeeeh, well...
I'm not too familiar with the sound package, but it ends up calling a
primitive instead of scheduling the sound.
There's code there to schedule instead if the primitive fails, so my
guess is it caused crashes some time in the past and a manual method was
needed to disable it.
I'll could update the comment to "Turn this off if your VM crashes when
playing sound", but I have no idea if that's actually the intended case. :)

Cheers,
Henry

Reply | Threaded
Open this post in threaded view
|

Re: Adding settings to an existing group

Stéphane Ducasse
In reply to this post by Alain Plantec-4

On Jan 21, 2011, at 5:33 PM, Alain Plantec wrote:

> -----------------
> quickStartSoundSettingOn: aBuilder
>    <systemsettings>
>    (aBuilder setting: #soundQuickStart)
> parent: #soundEnabled;
>        label: 'Play sounds immediately if possible' translated;
>        target: SoundPlayer
> --------------
>
> should do it if you have
> SoundPlayer class>>soundQuickStart
> SoundPlayer class>>soundQuickStart: aBoolean
>
> btw:
> why this setting ?
> If sound is enabled, why would I set this setting to false ?
> I guess one always want the sound to start as quick as possible.

:)
No on some platform is was simply crashing the vm.

>
> Cheers
> Alain
>
>
>
>
> Le 21/01/2011 16:06, Henrik Sperre Johansen a écrit :
>> Sorry I haven't really had time to learn the settings framework yet,
>> does anyone know how to do this?
>>
>> Updating the Sound package, I'd like to add a few to the existing
>> category Appearance ->  sound (strange place for it, btw...) in a package
>> one can load from the repository.
>>
>> I tried code like:
>>
>> quickStartSoundSettingOn: aBuilder
>>     <systemsettings>
>>         (aBuilder group: #appearance)    with: [
>>             (aBuilder setting: #soundEnabled) with: [
>>                 (aBuilder setting: #soundQuickStart)
>>                     label: 'Play sounds immediately if possible';
>>                     target: SoundPlayer;
>>                     targetSelector: #soundQuickStart]]
>>
>> but that's apparently far off the mark...
>>
>> Cheers,
>> Henry
>>
>>
>
>