kopia lustrzana https://gitlab.com/eliggett/wfview
Remove various compiler warnings and tidy up.
rodzic
05fc1677d4
commit
6a103d051f
|
@ -14,6 +14,7 @@ audioHandler::audioHandler(QObject* parent) :
|
|||
isInput(0),
|
||||
chunkAvailable(false)
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
}
|
||||
|
||||
audioHandler::~audioHandler()
|
||||
|
@ -248,6 +249,7 @@ int audioHandler::writeData(void* outputBuffer, void* inputBuffer, unsigned int
|
|||
{
|
||||
Q_UNUSED(outputBuffer);
|
||||
Q_UNUSED(streamTime);
|
||||
Q_UNUSED(status);
|
||||
int sentlen = 0;
|
||||
int nBytes = nFrames * devChannels * 2; // This is ALWAYS 2 bytes per sample
|
||||
const char* data = (const char*)inputBuffer;
|
||||
|
@ -278,27 +280,6 @@ int audioHandler::writeData(void* outputBuffer, void* inputBuffer, unsigned int
|
|||
return 0;
|
||||
}
|
||||
|
||||
qint64 audioHandler::bytesAvailable() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool audioHandler::isSequential() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void audioHandler::notified()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void audioHandler::stateChanged(QAudio::State state)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void audioHandler::incomingAudio(audioPacket inPacket)
|
||||
{
|
||||
|
@ -354,7 +335,7 @@ void audioHandler::incomingAudio(audioPacket inPacket)
|
|||
for (int f = 0; f < inPacket.data.length() / 2; f++)
|
||||
{
|
||||
*in = *in * this->volume;
|
||||
*in++;
|
||||
in++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -405,11 +386,6 @@ int audioHandler::getLatency()
|
|||
return currentLatency;
|
||||
}
|
||||
|
||||
bool audioHandler::isChunkAvailable()
|
||||
{
|
||||
return (chunkAvailable);
|
||||
}
|
||||
|
||||
void audioHandler::getNextAudioChunk(QByteArray& ret)
|
||||
{
|
||||
audioPacket packet;
|
||||
|
@ -452,7 +428,7 @@ void audioHandler::getNextAudioChunk(QByteArray& ret)
|
|||
for (int f = 0; f < outPacket.length()/2; f++)
|
||||
{
|
||||
*out++ = *in++;
|
||||
*in++; // Skip each even channel.
|
||||
in++; // Skip each even channel.
|
||||
}
|
||||
packet.data.clear();
|
||||
packet.data = outPacket; // Copy output packet back to input buffer.
|
||||
|
|
|
@ -50,22 +50,11 @@ public:
|
|||
|
||||
int getLatency();
|
||||
|
||||
bool setDevice(QAudioDeviceInfo deviceInfo);
|
||||
|
||||
void start();
|
||||
void flush();
|
||||
void stop();
|
||||
|
||||
qint64 bytesAvailable() const;
|
||||
bool isSequential() const;
|
||||
void getNextAudioChunk(QByteArray &data);
|
||||
bool isChunkAvailable();
|
||||
|
||||
private slots:
|
||||
bool init(const quint8 bits, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isulaw, const bool isinput, int port, quint8 resampleQuality);
|
||||
void changeLatency(const quint16 newSize);
|
||||
void notified();
|
||||
void stateChanged(QAudio::State state);
|
||||
void setVolume(unsigned char volume);
|
||||
void incomingAudio(const audioPacket data);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue