mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:01:06 +02:00
Fixed some bad logic
When I "fixed" my or instead of and issue, I did it in the wrong direction. But it looked right :) Now it is. Sigh. Long story how it got there, but it seems good now.
This commit is contained in:
parent
fb99828e30
commit
8c0eb1e4d2
2 changed files with 8 additions and 8 deletions
|
@ -32,8 +32,8 @@ AudioInjectorState operator& (AudioInjectorState lhs, AudioInjectorState rhs) {
|
||||||
return static_cast<AudioInjectorState>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
|
return static_cast<AudioInjectorState>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
|
||||||
};
|
};
|
||||||
|
|
||||||
AudioInjectorState& operator&= (AudioInjectorState& lhs, AudioInjectorState rhs) {
|
AudioInjectorState& operator|= (AudioInjectorState& lhs, AudioInjectorState rhs) {
|
||||||
lhs = static_cast<AudioInjectorState>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
|
lhs = static_cast<AudioInjectorState>(static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
|
||||||
return lhs;
|
return lhs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ void AudioInjector::setOptions(const AudioInjectorOptions& options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioInjector::finishNetworkInjection() {
|
void AudioInjector::finishNetworkInjection() {
|
||||||
_state &= AudioInjectorState::NetworkInjectionFinished;
|
_state |= AudioInjectorState::NetworkInjectionFinished;
|
||||||
|
|
||||||
// if we are already finished with local
|
// if we are already finished with local
|
||||||
// injection, then we are finished
|
// injection, then we are finished
|
||||||
|
@ -80,14 +80,14 @@ void AudioInjector::finishNetworkInjection() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioInjector::finishLocalInjection() {
|
void AudioInjector::finishLocalInjection() {
|
||||||
_state &= AudioInjectorState::LocalInjectionFinished;
|
_state |= AudioInjectorState::LocalInjectionFinished;
|
||||||
if(_options.localOnly || stateHas(AudioInjectorState::NetworkInjectionFinished)) {
|
if(_options.localOnly || stateHas(AudioInjectorState::NetworkInjectionFinished)) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioInjector::finish() {
|
void AudioInjector::finish() {
|
||||||
_state &= AudioInjectorState::Finished;
|
_state |= AudioInjectorState::Finished;
|
||||||
|
|
||||||
emit finished();
|
emit finished();
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ void AudioInjector::triggerDeleteAfterFinish() {
|
||||||
if (_state == AudioInjectorState::Finished) {
|
if (_state == AudioInjectorState::Finished) {
|
||||||
stopAndDeleteLater();
|
stopAndDeleteLater();
|
||||||
} else {
|
} else {
|
||||||
_state &= AudioInjectorState::PendingDelete;
|
_state |= AudioInjectorState::PendingDelete;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,7 +459,7 @@ AudioInjector* AudioInjector::playSoundAndDelete(const QByteArray& buffer, const
|
||||||
AudioInjector* sound = playSound(buffer, options, localInterface);
|
AudioInjector* sound = playSound(buffer, options, localInterface);
|
||||||
|
|
||||||
if (sound) {
|
if (sound) {
|
||||||
sound->_state &= AudioInjectorState::PendingDelete;
|
sound->_state |= AudioInjectorState::PendingDelete;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sound;
|
return sound;
|
||||||
|
|
|
@ -42,7 +42,7 @@ enum class AudioInjectorState : uint8_t {
|
||||||
};
|
};
|
||||||
|
|
||||||
AudioInjectorState operator& (AudioInjectorState lhs, AudioInjectorState rhs);
|
AudioInjectorState operator& (AudioInjectorState lhs, AudioInjectorState rhs);
|
||||||
AudioInjectorState& operator&= (AudioInjectorState& lhs, AudioInjectorState rhs);
|
AudioInjectorState& operator|= (AudioInjectorState& lhs, AudioInjectorState rhs);
|
||||||
|
|
||||||
// In order to make scripting cleaner for the AudioInjector, the script now holds on to the AudioInjector object
|
// In order to make scripting cleaner for the AudioInjector, the script now holds on to the AudioInjector object
|
||||||
// until it dies.
|
// until it dies.
|
||||||
|
|
Loading…
Reference in a new issue