|
From: Vladimir S. <ha...@so...> - 2004-06-22 00:49:23
|
Hi Rui,
Looks like you are trying to create an audio device at runtime but why
do you care if one of that type already exists or not? What about the
parameters? Two alsa devices for example can have completely different
parameters such as output cards, etc, etc. I'm not sure what the desired
effect would be . . . if we are trying to simulate single channel
shouldn't we just delete all audio ouputs before creating a new one? :)
Just kidding.
You could try playing with <typeinfo> but it will probably be easier to
just add a pure virtual into AudioOutputDevice base and implementations
for that into Alsa and Jack classes respectively and that will probably
be the easiest way to get that kind of info. Basically like we do with
versions and descriptions.
If this is purely for backward compatibilty you might as well just
always create a new audio device . . . since parameters are not going to
be correct anyways it will work just as good :)
I think backward compatibility is important once we actually
ship/release something. Once we have an installbase/userbase, etc. For
right now, we are developing, not using :) We already are at 11th
version of the spec . . . chances are we'll have to first implement
protocol FULLY, then we'll reallize some things are still missing or
suboptimal, etc, etc. THEN we'll fix and polish those things in both
spec and software and then some alpha/beta folks will hopefully give
this combination some testing and based on their feedback we'll correct
things again. Hopefully releasing the whole thing soon after that step.
In other words, we are not "code complete" yet, we are still in development.
So we are not there yet and i'm not too worried about the backwards
compatibility just yet :)
BTW, i've just checked in a SET command to map channels to audio output.
Still plenty of stuff to fix though. I'm hoping to get to input next and
then it might sort of start working again (a little bit :)
Regards,
Vladimir.
PS: Are you serious about backwards compatibility or are just just
kidding? I can't tell when you are kidding or not because you seem to
always be happy :)
Rui Nuno Capela wrote:
>Hi,
>
>In my own trials to re-implement SET CHANNEL AUDIO_OUTPUT_TYPE command,
>I've stumbled in a precise question which I hope the LS engine designer(s)
>would answer:
>
>How can I determine the driver type of an AudioOutputDevice class
>instance? That is, whether it inherits from AudioOutputDeviceAlsa ("Alsa")
>or AudioOutputDeviceJack ("Jack").
>
>OTOH, that driver name is supposed to be included in the resultset of GET
>AUDIO_OUTPUT_DEVICE INFO command, but isn't so, at least in the current
>implementation.
>
>I'd rather have someone giving some hints on how to get this, before I do
>something really hackish ;)
>
>My idea to recreate the LSCPSErver::SetAudioOutputType(String sDriver)
>method goes almost like this:
>{
> // Check if there's one audio device already created
> // of the intended type (sDriver)...
> AudioOutputDevice *pDevice = NULL;
> std::map<uint, AudioOutputDevice*> devices =
>pSampler->GetAudioOutputDevices();
> std::map<uint, AudioOutputDevice*>::iterator iter = devices.begin();
> for (; iter != devices.end(); iter++) {
> if (iter->second is of sDriver type) { // HOW?
> pDevice = iter->second;
> }
> }
>
> // If it doesn't exist, create a new one with default parameters...
> if (pDevice == NULL)
> pDevice = pSampler->CreateAudioOutputDevice(sDriver);
>
> // Set it as the current channel device...
> pSampler->SetAudioOutputDevice(pDevice);
>}
>
>Obviously, my question is summarized on how to write the pseudo-code on
>the line with the HOW? comment.
>
>Christian?
>Vladimir?
>Benno?
>Anyone? :)
>
>
|