mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 03:53:52 +02:00
This commit is contained in:
parent
62fca613a6
commit
2d277a2abd
2 changed files with 6 additions and 1 deletions
|
@ -93,6 +93,7 @@ void AudioInjector::injectAudio() {
|
|||
}
|
||||
|
||||
void AudioInjector::restart() {
|
||||
_isPlaying = true;
|
||||
connect(this, &AudioInjector::finished, this, &AudioInjector::restartPortionAfterFinished);
|
||||
if (!_isStarted || _isFinished) {
|
||||
emit finished();
|
||||
|
@ -270,6 +271,7 @@ void AudioInjector::injectToMixer() {
|
|||
}
|
||||
|
||||
setIsFinished(true);
|
||||
_isPlaying = !_isFinished; // Which can be false if a restart was requested
|
||||
}
|
||||
|
||||
void AudioInjector::stop() {
|
||||
|
@ -277,6 +279,7 @@ void AudioInjector::stop() {
|
|||
|
||||
if (_options.localOnly) {
|
||||
// we're only a local injector, so we can say we are finished right away too
|
||||
_isPlaying = false;
|
||||
setIsFinished(true);
|
||||
}
|
||||
}
|
||||
|
@ -334,6 +337,7 @@ AudioInjector* AudioInjector::playSound(const QByteArray& buffer, const AudioInj
|
|||
injectorThread->setObjectName("Audio Injector Thread");
|
||||
|
||||
AudioInjector* injector = new AudioInjector(buffer, options);
|
||||
injector->_isPlaying = true;
|
||||
injector->setLocalAudioInterface(localInterface);
|
||||
|
||||
injector->moveToThread(injectorThread);
|
||||
|
|
|
@ -62,7 +62,7 @@ public slots:
|
|||
|
||||
void setCurrentSendPosition(int currentSendPosition) { _currentSendPosition = currentSendPosition; }
|
||||
float getLoudness() const { return _loudness; }
|
||||
bool isPlaying() const { return !_isFinished; }
|
||||
bool isPlaying() const { return _isPlaying; }
|
||||
void restartPortionAfterFinished();
|
||||
|
||||
signals:
|
||||
|
@ -78,6 +78,7 @@ private:
|
|||
AudioInjectorOptions _options;
|
||||
bool _shouldStop = false;
|
||||
float _loudness = 0.0f;
|
||||
bool _isPlaying = false;
|
||||
bool _isStarted = false;
|
||||
bool _isFinished = false;
|
||||
bool _shouldDeleteAfterFinish = false;
|
||||
|
|
Loading…
Reference in a new issue