Check _currentSendPosition instead of overriding

This commit is contained in:
Atlante45 2014-09-26 19:47:26 -07:00
parent dfe70ed2e3
commit 5a8b9082b2
2 changed files with 7 additions and 4 deletions

View file

@ -44,11 +44,14 @@ void AudioInjector::setOptions(AudioInjectorOptions& options) {
const uchar MAX_INJECTOR_VOLUME = 0xFF;
void AudioInjector::injectAudio(int startingPosition) {
_currentSendPosition = startingPosition;
void AudioInjector::injectAudio() {
QByteArray soundByteArray = _sound->getByteArray();
if (_currentSendPosition < 0 ||
_currentSendPosition >= soundByteArray.size()) {
_currentSendPosition = 0;
}
// make sure we actually have samples downloaded to inject
if (soundByteArray.size()) {
// give our sample byte array to the local audio interface, if we have it, so it can be handled locally

View file

@ -29,7 +29,7 @@ public:
int getCurrentSendPosition() const { return _currentSendPosition; }
public slots:
void injectAudio(int startingPosition = 0);
void injectAudio();
void stop() { _shouldStop = true; }
void setOptions(AudioInjectorOptions& options);
void setCurrentSendPosition(int currentSendPosition) { _currentSendPosition = currentSendPosition; }