QAudioOutput vs QTimer strange behaviour
-
@mzimmers said in QAudioOutput vs QTimer strange behaviour:
When that's commented out, it seems to work fine, right?
no, HMMM is still there on second click
but i tested only on 5.12.8@abarmotov Why do you think so? You wrote: "then press on button two times". So, as I explained: on the first button press you set slotIsRunning_ to true, so on second button press slotIsRunning_ is true and you print "HMMM". So, nothing is interrupted. Still don't get what the issue is...
-
@abarmotov Why do you think so? You wrote: "then press on button two times". So, as I explained: on the first button press you set slotIsRunning_ to true, so on second button press slotIsRunning_ is true and you print "HMMM". So, nothing is interrupted. Still don't get what the issue is...
-
@abarmotov Why do you think so? You wrote: "then press on button two times". So, as I explained: on the first button press you set slotIsRunning_ to true, so on second button press slotIsRunning_ is true and you print "HMMM". So, nothing is interrupted. Still don't get what the issue is...
-
@abarmotov Why do you think so? You wrote: "then press on button two times". So, as I explained: on the first button press you set slotIsRunning_ to true, so on second button press slotIsRunning_ is true and you print "HMMM". So, nothing is interrupted. Still don't get what the issue is...
@jsulm said in QAudioOutput vs QTimer strange behaviour:
@abarmotov Why do you think so? You wrote: "then press on button two times". So, as I explained: on the first button press you set slotIsRunning_ to true, so on second button press slotIsRunning_ is true and you print "HMMM". So, nothing is interrupted. Still don't get what the issue is...
He sets slotIsRunning_ at the start of the slot, but then sets it to false towards the end.
-
@jsulm said in QAudioOutput vs QTimer strange behaviour:
@abarmotov Why do you think so? You wrote: "then press on button two times". So, as I explained: on the first button press you set slotIsRunning_ to true, so on second button press slotIsRunning_ is true and you print "HMMM". So, nothing is interrupted. Still don't get what the issue is...
He sets slotIsRunning_ at the start of the slot, but then sets it to false towards the end.
-
i found it:
QPulseAudioOutput::~QPulseAudioOutput() { close(); disconnect(m_tickTimer, SIGNAL(timeout())); QCoreApplication::processEvents(); // THAT STRING BREAKS EVENT LOOP }
@abarmotov said in QAudioOutput vs QTimer strange behaviour:
THAT STRING BREAKS EVENT LOOP
It does not "break" event loop, it just tells event loop to check and handle events if there are any.
-
@abarmotov said in QAudioOutput vs QTimer strange behaviour:
THAT STRING BREAKS EVENT LOOP
It does not "break" event loop, it just tells event loop to check and handle events if there are any.
-
@jsulm
but this is the way my slot is called a second time, while that slot in middle on execution
this behavior is not obvious when deleting QAudioOutput@abarmotov Why did you add processEvents at all there?
-
@abarmotov Why did you add processEvents at all there?
-
@abarmotov Ah, right. Would be interesting to know why it was added - doesn't look correct to me and causes the issue you have.