summaryrefslogtreecommitdiffstats
path: root/examples/multimedia
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia')
-rw-r--r--examples/multimedia/audiodevices/audiodevices.cpp2
-rw-r--r--examples/multimedia/audioinput/audioinput.cpp10
-rw-r--r--examples/multimedia/audiooutput/audiooutput.cpp12
3 files changed, 12 insertions, 12 deletions
diff --git a/examples/multimedia/audiodevices/audiodevices.cpp b/examples/multimedia/audiodevices/audiodevices.cpp
index e205e03..4198605 100644
--- a/examples/multimedia/audiodevices/audiodevices.cpp
+++ b/examples/multimedia/audiodevices/audiodevices.cpp
@@ -148,7 +148,7 @@ void AudioTest::modeChanged(int idx)
mode=QAudio::AudioOutput;
deviceBox->clear();
- foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(mode))
+ foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(mode))
deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo));
}
diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp
index 62afd73..3d537a2 100644
--- a/examples/multimedia/audioinput/audioinput.cpp
+++ b/examples/multimedia/audioinput/audioinput.cpp
@@ -170,7 +170,7 @@ InputTest::InputTest()
layout->addWidget(canvas);
deviceBox = new QComboBox(this);
- QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::availableDevices(QAudio::AudioInput);
+ QList<QAudioDeviceInfo> devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput);
for(int i = 0; i < devices.size(); ++i) {
deviceBox->addItem(devices.at(i).deviceName(), qVariantFromValue(devices.at(i)));
}
@@ -216,7 +216,7 @@ InputTest::~InputTest() {}
void InputTest::status()
{
- qWarning()<<"bytesReady = "<<audioInput->bytesReady()<<" bytes, elapsedUSecs = "<<audioInput->elapsedUSecs()<<", processedUSecs = "<<audioInput->processedUSecs();
+ qWarning()<<"bytesReady = "<<audioInput->bytesReady()<<" bytes, clock = "<<audioInput->clock()/1000<<"ms, totalTime = "<<audioInput->totalTime()/1000<<"ms";
}
void InputTest::readMore()
@@ -239,7 +239,7 @@ void InputTest::toggleMode()
if (pullMode) {
button->setText(tr("Click for Pull Mode"));
- input = audioInput->start();
+ input = audioInput->start(0);
connect(input,SIGNAL(readyRead()),SLOT(readMore()));
pullMode = false;
} else {
@@ -252,7 +252,7 @@ void InputTest::toggleMode()
void InputTest::toggleSuspend()
{
// toggle suspend/resume
- if(audioInput->state() == QAudio::SuspendedState) {
+ if(audioInput->state() == QAudio::SuspendState) {
qWarning()<<"status: Suspended, resume()";
audioInput->resume();
button2->setText("Click To Suspend");
@@ -260,7 +260,7 @@ void InputTest::toggleSuspend()
qWarning()<<"status: Active, suspend()";
audioInput->suspend();
button2->setText("Click To Resume");
- } else if (audioInput->state() == QAudio::StoppedState) {
+ } else if (audioInput->state() == QAudio::StopState) {
qWarning()<<"status: Stopped, resume()";
audioInput->resume();
button2->setText("Click To Suspend");
diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp
index 244840d..c92bbaf 100644
--- a/examples/multimedia/audiooutput/audiooutput.cpp
+++ b/examples/multimedia/audiooutput/audiooutput.cpp
@@ -134,7 +134,7 @@ AudioTest::AudioTest()
QVBoxLayout* layout = new QVBoxLayout;
deviceBox = new QComboBox(this);
- foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput))
+ foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::deviceList(QAudio::AudioOutput))
deviceBox->addItem(deviceInfo.deviceName(), qVariantFromValue(deviceInfo));
connect(deviceBox,SIGNAL(activated(int)),SLOT(deviceChanged(int)));
layout->addWidget(deviceBox);
@@ -200,7 +200,7 @@ void AudioTest::deviceChanged(int idx)
void AudioTest::status()
{
- qWarning()<<"byteFree = "<<audioOutput->bytesFree()<<" bytes, elapsedUSecs = "<<audioOutput->elapsedUSecs()<<", processedUSecs = "<<audioOutput->processedUSecs();
+ qWarning()<<"byteFree = "<<audioOutput->bytesFree()<<" bytes, clock = "<<audioOutput->clock()/1000<<"ms, totalTime = "<<audioOutput->totalTime()/1000<<"ms";
}
void AudioTest::writeMore()
@@ -208,7 +208,7 @@ void AudioTest::writeMore()
if(!audioOutput)
return;
- if(audioOutput->state() == QAudio::StoppedState)
+ if(audioOutput->state() == QAudio::StopState)
return;
int l;
@@ -234,7 +234,7 @@ void AudioTest::toggle()
if (pullMode) {
button->setText("Click for Pull Mode");
- output = audioOutput->start();
+ output = audioOutput->start(0);
pullMode = false;
timer->start(20);
} else {
@@ -247,7 +247,7 @@ void AudioTest::toggle()
void AudioTest::togglePlay()
{
// toggle suspend/resume
- if(audioOutput->state() == QAudio::SuspendedState) {
+ if(audioOutput->state() == QAudio::SuspendState) {
qWarning()<<"status: Suspended, resume()";
audioOutput->resume();
button2->setText("Click To Suspend");
@@ -255,7 +255,7 @@ void AudioTest::togglePlay()
qWarning()<<"status: Active, suspend()";
audioOutput->suspend();
button2->setText("Click To Resume");
- } else if (audioOutput->state() == QAudio::StoppedState) {
+ } else if (audioOutput->state() == QAudio::StopState) {
qWarning()<<"status: Stopped, resume()";
audioOutput->resume();
button2->setText("Click To Suspend");