Re: When to use CopyFromStorage/WriteToStorage?
Re: When to use CopyFromStorage/WriteToStorage?
- Subject: Re: When to use CopyFromStorage/WriteToStorage?
- From: Eric Gorouben <email@hidden>
- Date: Mon, 17 Mar 2014 23:26:19 +0100
Hi Jeff
This make sense!
Thanks
Eric
Le 17 mars 2014 à 21:56, Jeff Moore <email@hidden> a écrit :
> Isn’t this just a simple matter of delaying the call of Activate() until the plug-in’s Initialize() method is called? There is nothing written in stone about when the SA_PlugIn object’s Activate() is called. It can be moved to whenever is convenient for your driver, including to when the Initialize() method is called if that’s what you need to have happen.
>
> Alternately, you could delay the initialization that needs the settings to take place after Initialize() is called().
>
> Basically, you have a lot of choices. What you do depends on what you want to have happen.
>
> --
>
> Jeff Moore
> Core Audio
> Apple
>
>
> On Mar 17, 2014, at 1:20 PM, Ploytec <email@hidden> wrote:
>
>> Hi,
>>
>> I'm trying to manage my prefs using CopyFromStorage/WriteToStorage.
>>
>> I need to read them at least when I activate my device, and write them when I deactivate my device (as it's a USB device, it means at plug/unplug time).
>>
>> I started from the samples, and used the Activate and Deactivate methods.
>> However, at startup, or when coreaudiod restarts, the Activate method (called in this situation by the "CFPlugIn factory function") comes before the Initialize method of AudioServerPlugInDriverInterface.
>> Since Initialize is the method where the AudioServerPlugInHostRef, that is needed to access the storage, is passed to the driver, this is impossible to read prefs from storage in the Activate method when coroaudiod starts up.
>>
>> What is the correct way to achieve this?
>>
>> Thanks
>> Eric Goroubben
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden