Jump to content
Mumble forums

Question about AudioOutput::qmOutputs as QMultiHash


scott.rankin
 Share

Recommended Posts

Hello,

Please forgive my novice question. I'm not super versed with Qt.


I was looking at the use of AudioOutput::qmOutputs specifically with respect to it's use in AudioOutputSpeech.cpp and wondered why it was a QMultiHash?


It seems to me that in AudioOutput::addFrameToBuffer that it just fishes out the first one the map finds with this call?

AudioOutputSpeech *aop = qobject_cast(qmOutputs.value(user));


Cheers,

Scott

Link to comment
Share on other sites

  • Administrators

Hi. AudioOutputSample instances do not have a user assigned to them and hence are all added with "NULL" into the output list:

AudioOutputSample *AudioOutput::playSample(const QString &filename, bool loop) {
...
AudioOutputSample *aos = new AudioOutputSample(filename, handle, loop, iMixerFreq);
qmOutputs.insert(NULL, aos);
...
}

(see line 227ff. in AudioOutput.cpp). This means to allow playback of multiple sample files at the same time qmOutputs needs to be a multi hash. addFrameToBuffer isn't used there as the samples do not come from the network into the buffer but come directly from a sound file.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...