mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:17:43 +02:00
Merge pull request #8270 from davidkelly/dk/audioPlayingFix
NotFinished never should have had its own bit
This commit is contained in:
commit
171b9d8ecc
2 changed files with 6 additions and 16 deletions
|
@ -165,14 +165,10 @@ void AudioInjector::restart() {
|
||||||
if (!_options.localOnly) {
|
if (!_options.localOnly) {
|
||||||
|
|
||||||
if (!injectorManager->restartFinishedInjector(this)) {
|
if (!injectorManager->restartFinishedInjector(this)) {
|
||||||
// TODO: this logic seems to remove the pending delete,
|
|
||||||
// which makes me wonder about the deleteLater calls
|
|
||||||
_state = AudioInjectorState::Finished; // we're not playing, so reset the state used by isPlaying.
|
_state = AudioInjectorState::Finished; // we're not playing, so reset the state used by isPlaying.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: this logic seems to remove the pending delete,
|
|
||||||
// which makes me wonder about the deleteLater calls
|
|
||||||
_state = AudioInjectorState::Finished; // we failed to play, so we are finished again
|
_state = AudioInjectorState::Finished; // we failed to play, so we are finished again
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,11 +34,11 @@ class AudioInjectorManager;
|
||||||
|
|
||||||
|
|
||||||
enum class AudioInjectorState : uint8_t {
|
enum class AudioInjectorState : uint8_t {
|
||||||
NotFinished = 1,
|
NotFinished = 0,
|
||||||
Finished = 2,
|
Finished = 1,
|
||||||
PendingDelete = 4,
|
PendingDelete = 2,
|
||||||
LocalInjectionFinished = 8,
|
LocalInjectionFinished = 4,
|
||||||
NetworkInjectionFinished = 16
|
NetworkInjectionFinished = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
AudioInjectorState operator& (AudioInjectorState lhs, AudioInjectorState rhs);
|
AudioInjectorState operator& (AudioInjectorState lhs, AudioInjectorState rhs);
|
||||||
|
@ -50,12 +50,6 @@ class AudioInjector : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const uint8_t NotFinished = 1;
|
|
||||||
static const uint8_t Finished = 2;
|
|
||||||
static const uint8_t PendingDelete = 4;
|
|
||||||
static const uint8_t LocalInjectionFinished = 8;
|
|
||||||
static const uint8_t NetworkInjectionFinished = 16;
|
|
||||||
|
|
||||||
AudioInjector(QObject* parent);
|
AudioInjector(QObject* parent);
|
||||||
AudioInjector(const Sound& sound, const AudioInjectorOptions& injectorOptions);
|
AudioInjector(const Sound& sound, const AudioInjectorOptions& injectorOptions);
|
||||||
AudioInjector(const QByteArray& audioData, const AudioInjectorOptions& injectorOptions);
|
AudioInjector(const QByteArray& audioData, const AudioInjectorOptions& injectorOptions);
|
||||||
|
@ -90,7 +84,7 @@ public slots:
|
||||||
void setOptions(const AudioInjectorOptions& options);
|
void setOptions(const AudioInjectorOptions& options);
|
||||||
|
|
||||||
float getLoudness() const { return _loudness; }
|
float getLoudness() const { return _loudness; }
|
||||||
bool isPlaying() const { return stateHas(AudioInjectorState::NotFinished); }
|
bool isPlaying() const { return !stateHas(AudioInjectorState::Finished); }
|
||||||
void finish();
|
void finish();
|
||||||
void finishLocalInjection();
|
void finishLocalInjection();
|
||||||
void finishNetworkInjection();
|
void finishNetworkInjection();
|
||||||
|
|
Loading…
Reference in a new issue