about Sound and setting :(

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

about Sound and setting :(

Stéphane Ducasse
Hi guys

loadSoundEnabled
                self loadSetting: #soundEnabled withBlock: [SoundService soundEnabled: nil].


since mariano is away and I do not know what was done in Sound, I'm trying but this is not simple when you do not know
what was the intention.


The method is:  

resumePlaying: aSound quickStart: quickStart
        "Start playing the given sound without resetting it; it will resume playing from where it last stopped. If quickStart is true, then try to start playing the given sound immediately."

        | doQuickStart |
        SoundSettings soundsEnabled ifFalse: [^ self].
        doQuickStart := quickStart.
        SoundSettings soundQuickStart ifFalse: [doQuickStart := false].
        PlayerProcess == nil ifTrue: [
                self canStartPlayer ifFalse: [^ self].
                ^self startUpWithSound: aSound].

        PlayerSemaphore critical: [
                (ActiveSounds includes: aSound)
                        ifTrue: [doQuickStart := false]
                        ifFalse: [
                                doQuickStart ifFalse: [ActiveSounds add: aSound]]].

        "quick-start the given sound, unless the sound player has just started"
        doQuickStart ifTrue: [self startPlayingImmediately: aSound].


it refers to SoundSettings and there is no such a thing. There is no implementors of soundsEnabled
So I tried to understand the changes made in Slice-3566

Now the question is do we want SoundService to play the role of a setting provider?
Originally I thought to put it in BaseSoundSystem.

But the code of henrik seems to use SoundService. Now BaseSoundSystem register itself as the default sound service.
So I'm confused!

Help is welcome.

Stef










Reply | Threaded
Open this post in threaded view
|

Re: about Sound and setting :(

Stéphane Ducasse
So here is a part of the answer

        Sound should be self contained so BaseSoundSystem could have

AbstractSoundSystem subclass: #BaseSoundSystem
        instanceVariableNames: ''
        classVariableNames: 'SoundEnabled SoundQuickStart UseThemeSounds'
        poolDictionaries: ''
        category: 'Sound-Synthesis'

and class level accessor

Then we can defined adequate method extension in

Sound-Settings that describe the default value

Then SoundService should not have state but delegate to the current install class player the SoundService supplier.

I hope it makes sense. I will code that.

Stef


Reply | Threaded
Open this post in threaded view
|

Re: about Sound and setting :(

Stéphane Ducasse
If somebody wants to have a look here is my solution:

        - in SoundService I added the possibility to delegate to the registered soundsystem for preferences
        see package: System-Applications in inbox
       
        - I fixed all the references to SoundSettings in Sounds to refer to BaseSoundSystem
        and BaseSoundSystem is not the hold of the preferences.

        see Slice-3482 in the inbox

Stef


On Jan 30, 2011, at 6:59 PM, Stéphane Ducasse wrote:

> So here is a part of the answer
>
> Sound should be self contained so BaseSoundSystem could have
>
> AbstractSoundSystem subclass: #BaseSoundSystem
> instanceVariableNames: ''
> classVariableNames: 'SoundEnabled SoundQuickStart UseThemeSounds'
> poolDictionaries: ''
> category: 'Sound-Synthesis'
>
> and class level accessor
>
> Then we can defined adequate method extension in
>
> Sound-Settings that describe the default value
>
> Then SoundService should not have state but delegate to the current install class player the SoundService supplier.
>
> I hope it makes sense. I will code that.
>
> Stef
>
>


Reply | Threaded
Open this post in threaded view
|

Re: about Sound and setting :(

Henrik Sperre Johansen
In reply to this post by Stéphane Ducasse
Again, you are using the wrong version of Sound, sorry I couldn't tell you sooner.
Work has been busy :(

Remember part2 of my mail of what needed to be done?

"Update MetacelloConfiguration to use PharoSound instead of PharoNonCorePackages"

:)

Cheers,
Henry



On Jan 30, 2011, at 6:29 58PM, Stéphane Ducasse wrote:

> Hi guys
>
> loadSoundEnabled
> self loadSetting: #soundEnabled withBlock: [SoundService soundEnabled: nil].
>
>
> since mariano is away and I do not know what was done in Sound, I'm trying but this is not simple when you do not know
> what was the intention.
>
>
> The method is:  
>
> resumePlaying: aSound quickStart: quickStart
> "Start playing the given sound without resetting it; it will resume playing from where it last stopped. If quickStart is true, then try to start playing the given sound immediately."
>
> | doQuickStart |
> SoundSettings soundsEnabled ifFalse: [^ self].
> doQuickStart := quickStart.
> SoundSettings soundQuickStart ifFalse: [doQuickStart := false].
> PlayerProcess == nil ifTrue: [
> self canStartPlayer ifFalse: [^ self].
> ^self startUpWithSound: aSound].
>
> PlayerSemaphore critical: [
> (ActiveSounds includes: aSound)
> ifTrue: [doQuickStart := false]
> ifFalse: [
> doQuickStart ifFalse: [ActiveSounds add: aSound]]].
>
> "quick-start the given sound, unless the sound player has just started"
> doQuickStart ifTrue: [self startPlayingImmediately: aSound].
>
>
> it refers to SoundSettings and there is no such a thing. There is no implementors of soundsEnabled
> So I tried to understand the changes made in Slice-3566
>
> Now the question is do we want SoundService to play the role of a setting provider?
> Originally I thought to put it in BaseSoundSystem.
>
> But the code of henrik seems to use SoundService. Now BaseSoundSystem register itself as the default sound service.
> So I'm confused!
>
> Help is welcome.
>
> Stef
>
>
>
>
>
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: about Sound and setting :(

Igor Stasenko
On 1 February 2011 12:36, Henrik Johansen <[hidden email]> wrote:
> Again, you are using the wrong version of Sound, sorry I couldn't tell you sooner.
> Work has been busy :(
>
> Remember part2 of my mail of what needed to be done?
>
> "Update MetacelloConfiguration to use PharoSound instead of PharoNonCorePackages"
>

guys lets just clean up/move files between repositories to avoid
future confusion.
I don't know if this can be done easily, but i think that it would be
good that if you moving package to different repository,
then remove/move all versions from old repository at once..
So i prefer to see 'i cannot load package' instead 'i loaded package
and it doesn't works ... yes because you loaded it from wrong place'.
:)


> :)
>
> Cheers,
> Henry
>
>
>
> On Jan 30, 2011, at 6:29 58PM, Stéphane Ducasse wrote:
>
>> Hi guys
>>
>> loadSoundEnabled
>>               self loadSetting: #soundEnabled withBlock: [SoundService soundEnabled: nil].
>>
>>
>> since mariano is away and I do not know what was done in Sound, I'm trying but this is not simple when you do not know
>> what was the intention.
>>
>>
>> The method is:
>>
>> resumePlaying: aSound quickStart: quickStart
>>       "Start playing the given sound without resetting it; it will resume playing from where it last stopped. If quickStart is true, then try to start playing the given sound immediately."
>>
>>       | doQuickStart |
>>       SoundSettings soundsEnabled ifFalse: [^ self].
>>       doQuickStart := quickStart.
>>       SoundSettings soundQuickStart ifFalse: [doQuickStart := false].
>>       PlayerProcess == nil ifTrue: [
>>               self canStartPlayer ifFalse: [^ self].
>>               ^self startUpWithSound: aSound].
>>
>>       PlayerSemaphore critical: [
>>               (ActiveSounds includes: aSound)
>>                       ifTrue: [doQuickStart := false]
>>                       ifFalse: [
>>                               doQuickStart ifFalse: [ActiveSounds add: aSound]]].
>>
>>       "quick-start the given sound, unless the sound player has just started"
>>       doQuickStart ifTrue: [self startPlayingImmediately: aSound].
>>
>>
>> it refers to SoundSettings and there is no such a thing. There is no implementors of soundsEnabled
>> So I tried to understand the changes made in Slice-3566
>>
>> Now the question is do we want SoundService to play the role of a setting provider?
>> Originally I thought to put it in BaseSoundSystem.
>>
>> But the code of henrik seems to use SoundService. Now BaseSoundSystem register itself as the default sound service.
>> So I'm confused!
>>
>> Help is welcome.
>>
>> Stef
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.