Delete obsolete class methods and update related code
Delete obsolete methods from QAudioFormat and QAudioDeviceInfo and update code that relied on the obsolete methods. Change-Id: I007e36375a45399b1d5a289341bc5d5a05dc68cc Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
952bd004be
commit
53fdcca366
@@ -362,7 +362,7 @@ void tst_QAudioDecoder::nullControl()
|
||||
QVERIFY(d.sourceDevice() == 0);
|
||||
|
||||
QAudioFormat format;
|
||||
format.setChannels(2);
|
||||
format.setChannelCount(2);
|
||||
QVERIFY(!d.audioFormat().isValid());
|
||||
d.setAudioFormat(format);
|
||||
QVERIFY(!d.audioFormat().isValid());
|
||||
@@ -403,7 +403,7 @@ void tst_QAudioDecoder::nullService()
|
||||
QVERIFY(d.sourceDevice() == 0);
|
||||
|
||||
QAudioFormat format;
|
||||
format.setChannels(2);
|
||||
format.setChannelCount(2);
|
||||
QVERIFY(!d.audioFormat().isValid());
|
||||
d.setAudioFormat(format);
|
||||
QVERIFY(!d.audioFormat().isValid());
|
||||
|
||||
@@ -58,7 +58,6 @@ public:
|
||||
|
||||
private slots:
|
||||
void checkNull();
|
||||
void checkFrequency();
|
||||
void checkSampleSize();
|
||||
void checkCodec();
|
||||
void checkByteOrder();
|
||||
@@ -82,21 +81,14 @@ void tst_QAudioFormat::checkNull()
|
||||
QAudioFormat audioFormat1(audioFormat0);
|
||||
QVERIFY(!audioFormat1.isValid());
|
||||
|
||||
audioFormat0.setFrequency(44100);
|
||||
audioFormat0.setChannels(2);
|
||||
audioFormat0.setSampleRate(44100);
|
||||
audioFormat0.setChannelCount(2);
|
||||
audioFormat0.setSampleSize(16);
|
||||
audioFormat0.setCodec("audio/pcm");
|
||||
audioFormat0.setSampleType(QAudioFormat::SignedInt);
|
||||
QVERIFY(audioFormat0.isValid());
|
||||
}
|
||||
|
||||
void tst_QAudioFormat::checkFrequency()
|
||||
{
|
||||
QAudioFormat audioFormat;
|
||||
audioFormat.setFrequency(44100);
|
||||
QVERIFY(audioFormat.frequency() == 44100);
|
||||
}
|
||||
|
||||
void tst_QAudioFormat::checkSampleSize()
|
||||
{
|
||||
QAudioFormat audioFormat;
|
||||
@@ -161,15 +153,15 @@ void tst_QAudioFormat::checkEquality()
|
||||
QVERIFY(!(audioFormat0 != audioFormat1));
|
||||
|
||||
// on filled formats
|
||||
audioFormat0.setFrequency(8000);
|
||||
audioFormat0.setChannels(1);
|
||||
audioFormat0.setSampleRate(8000);
|
||||
audioFormat0.setChannelCount(1);
|
||||
audioFormat0.setSampleSize(8);
|
||||
audioFormat0.setCodec("audio/pcm");
|
||||
audioFormat0.setByteOrder(QAudioFormat::LittleEndian);
|
||||
audioFormat0.setSampleType(QAudioFormat::UnSignedInt);
|
||||
|
||||
audioFormat1.setFrequency(8000);
|
||||
audioFormat1.setChannels(1);
|
||||
audioFormat1.setSampleRate(8000);
|
||||
audioFormat1.setChannelCount(1);
|
||||
audioFormat1.setSampleSize(8);
|
||||
audioFormat1.setCodec("audio/pcm");
|
||||
audioFormat1.setByteOrder(QAudioFormat::LittleEndian);
|
||||
@@ -178,7 +170,7 @@ void tst_QAudioFormat::checkEquality()
|
||||
QVERIFY(audioFormat0 == audioFormat1);
|
||||
QVERIFY(!(audioFormat0 != audioFormat1));
|
||||
|
||||
audioFormat0.setFrequency(44100);
|
||||
audioFormat0.setSampleRate(44100);
|
||||
QVERIFY(audioFormat0 != audioFormat1);
|
||||
QVERIFY(!(audioFormat0 == audioFormat1));
|
||||
}
|
||||
@@ -188,8 +180,8 @@ void tst_QAudioFormat::checkAssignment()
|
||||
QAudioFormat audioFormat0;
|
||||
QAudioFormat audioFormat1;
|
||||
|
||||
audioFormat0.setFrequency(8000);
|
||||
audioFormat0.setChannels(1);
|
||||
audioFormat0.setSampleRate(8000);
|
||||
audioFormat0.setChannelCount(1);
|
||||
audioFormat0.setSampleSize(8);
|
||||
audioFormat0.setCodec("audio/pcm");
|
||||
audioFormat0.setByteOrder(QAudioFormat::LittleEndian);
|
||||
@@ -219,15 +211,15 @@ void tst_QAudioFormat::checkChannelCount()
|
||||
// they should always be equal
|
||||
QAudioFormat audioFormat;
|
||||
QVERIFY(audioFormat.channelCount() == -1);
|
||||
QVERIFY(audioFormat.channels() == -1);
|
||||
QVERIFY(audioFormat.channelCount() == -1);
|
||||
|
||||
audioFormat.setChannelCount(123);
|
||||
QVERIFY(audioFormat.channelCount() == 123);
|
||||
QVERIFY(audioFormat.channels() == 123);
|
||||
QVERIFY(audioFormat.channelCount() == 123);
|
||||
|
||||
audioFormat.setChannels(5);
|
||||
audioFormat.setChannelCount(5);
|
||||
QVERIFY(audioFormat.channelCount() == 5);
|
||||
QVERIFY(audioFormat.channelCount() == 5);
|
||||
QVERIFY(audioFormat.channels() == 5);
|
||||
}
|
||||
|
||||
void tst_QAudioFormat::debugOperator_data()
|
||||
|
||||
@@ -71,9 +71,9 @@ public:
|
||||
, mPosition(-1)
|
||||
, mSerial(0)
|
||||
{
|
||||
mFormat.setChannels(1);
|
||||
mFormat.setChannelCount(1);
|
||||
mFormat.setSampleSize(8);
|
||||
mFormat.setFrequency(1000);
|
||||
mFormat.setSampleRate(1000);
|
||||
mFormat.setCodec("audio/x-raw");
|
||||
mFormat.setSampleType(QAudioFormat::UnSignedInt);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
|
||||
qint64 duration() const
|
||||
{
|
||||
return (sizeof(mSerial) * MOCK_DECODER_MAX_BUFFERS * qint64(1000)) / (mFormat.sampleRate() * mFormat.channels());
|
||||
return (sizeof(mSerial) * MOCK_DECODER_MAX_BUFFERS * qint64(1000)) / (mFormat.sampleRate() * mFormat.channelCount());
|
||||
}
|
||||
|
||||
private slots:
|
||||
@@ -198,7 +198,7 @@ private slots:
|
||||
if (mBuffers.length() < 3) {
|
||||
QByteArray b(sizeof(mSerial), 0);
|
||||
memcpy(b.data(), &mSerial, sizeof(mSerial));
|
||||
qint64 position = (sizeof(mSerial) * mSerial * qint64(1000000)) / (mFormat.sampleRate() * mFormat.channels());
|
||||
qint64 position = (sizeof(mSerial) * mSerial * qint64(1000000)) / (mFormat.sampleRate() * mFormat.channelCount());
|
||||
mSerial++;
|
||||
mBuffers.push_back(QAudioBuffer(b, mFormat, position));
|
||||
emit bufferReady();
|
||||
|
||||
@@ -184,7 +184,7 @@ void tst_QWaveDecoder::file()
|
||||
QVERIFY(waveDecoder.duration() == 250);
|
||||
QAudioFormat format = waveDecoder.audioFormat();
|
||||
QVERIFY(format.isValid());
|
||||
QVERIFY(format.channels() == channels);
|
||||
QVERIFY(format.channelCount() == channels);
|
||||
QVERIFY(format.sampleSize() == samplesize);
|
||||
QVERIFY(format.sampleRate() == samplerate);
|
||||
if (format.sampleSize() != 8) {
|
||||
@@ -247,7 +247,7 @@ void tst_QWaveDecoder::http()
|
||||
QVERIFY(waveDecoder.duration() == 250);
|
||||
QAudioFormat format = waveDecoder.audioFormat();
|
||||
QVERIFY(format.isValid());
|
||||
QVERIFY(format.channels() == channels);
|
||||
QVERIFY(format.channelCount() == channels);
|
||||
QVERIFY(format.sampleSize() == samplesize);
|
||||
QVERIFY(format.sampleRate() == samplerate);
|
||||
if (format.sampleSize() != 8) {
|
||||
|
||||
Reference in New Issue
Block a user