summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/audioinput
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2009-11-10 03:07:46 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2009-11-10 03:07:46 (GMT)
commit74d3a4bf9654c8bbe9139951cc5c9352015438a6 (patch)
tree63cc04b5546454fcf668125169c6793fcdbdf04c /examples/multimedia/audioinput
parent8df98549a4d84b5877e50318140c2041e17632fb (diff)
downloadQt-74d3a4bf9654c8bbe9139951cc5c9352015438a6.zip
Qt-74d3a4bf9654c8bbe9139951cc5c9352015438a6.tar.gz
Qt-74d3a4bf9654c8bbe9139951cc5c9352015438a6.tar.bz2
Changes to low-level audio API.
QAudioFormat::isNull() -> QAudioFormat::isValid() (inverse logic) QAudio::SuspendState -> QAudio::SuspendedState QAudio::StopState -> QAudio::StoppedState QAudioDeviceInfo::deviceList() -> QAudioDeviceInfo::availableDevices() clock() -> elapsedUSecs() totalTime() -> processedUSecs() QIODevice* start(QIODevice*) -> void start(QIODevice*), QIODevice* start() Reviewed-by:Justin McPherson
Diffstat (limited to 'examples/multimedia/audioinput')
-rw-r--r--examples/multimedia/audioinput/audioinput.cpp10
1 files changed, 5 insertions, 5 deletions
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");