diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-09-14 02:33:37 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-09-14 02:33:37 (GMT) |
commit | f3e2ccf63de242feeba10e75fd00ffd43fc038b0 (patch) | |
tree | e202fecb0507aafc837ef169605c3389f4649526 /examples | |
parent | 9fe43c999d3d9b21836345522bb67bab38e661af (diff) | |
download | Qt-f3e2ccf63de242feeba10e75fd00ffd43fc038b0.zip Qt-f3e2ccf63de242feeba10e75fd00ffd43fc038b0.tar.gz Qt-f3e2ccf63de242feeba10e75fd00ffd43fc038b0.tar.bz2 |
AudioDevices demo doesn't do anything on Windows
-put example audiodevices in layout.
-added more checking to testSettings() in win32 implementation.
-disabled objects in example audiodevices that are not editable.
-added more checking to alsa implementation for preferredFormat().
-changed internal strings from tr to QLatin1String.
Reviewed-by:Justin Mcpherson
Diffstat (limited to 'examples')
-rw-r--r-- | examples/multimedia/audio/audiodevices/audiodevices.cpp | 12 | ||||
-rw-r--r-- | examples/multimedia/audio/audiodevices/audiodevicesbase.ui | 444 |
2 files changed, 222 insertions, 234 deletions
diff --git a/examples/multimedia/audio/audiodevices/audiodevices.cpp b/examples/multimedia/audio/audiodevices/audiodevices.cpp index 52aa4db..0d305ff 100644 --- a/examples/multimedia/audio/audiodevices/audiodevices.cpp +++ b/examples/multimedia/audio/audiodevices/audiodevices.cpp @@ -58,6 +58,14 @@ AudioDevicesBase::~AudioDevicesBase() {} AudioTest::AudioTest( QMainWindow *parent, Qt::WFlags f ) : AudioDevicesBase( parent, f ) { + nearestFreq->setDisabled(true); + nearestChannel->setDisabled(true); + nearestCodec->setDisabled(true); + nearestSampleSize->setDisabled(true); + nearestSampleType->setDisabled(true); + nearestEndian->setDisabled(true); + logOutput->setDisabled(true); + mode = QAudio::AudioOutput; modeBox->addItem("Input"); modeBox->addItem("Output"); @@ -87,6 +95,8 @@ AudioTest::~AudioTest() void AudioTest::test() { // tries to set all the settings picked. + logOutput->clear(); + logOutput->append("NOTE: an invalid codec audio/test exists for testing, to get a fail condition."); if(device) { if(device->isFormatSupported(settings)) { @@ -179,7 +189,7 @@ void AudioTest::deviceChanged(int idx) if(codecz.size()) settings.setCodec(codecz.at(0)); // Add false to create failed condition! - codecsBox->addItem("audio/mpeg"); + codecsBox->addItem("audio/test"); sampleSizesBox->clear(); QList<int> sampleSizez = device->supportedSampleSizes(); diff --git a/examples/multimedia/audio/audiodevices/audiodevicesbase.ui b/examples/multimedia/audio/audiodevices/audiodevicesbase.ui index 674f201..5207338 100644 --- a/examples/multimedia/audio/audiodevices/audiodevicesbase.ui +++ b/examples/multimedia/audio/audiodevices/audiodevicesbase.ui @@ -1,7 +1,8 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>AudioDevicesBase</class> - <widget class="QMainWindow" name="AudioDevicesBase" > - <property name="geometry" > + <widget class="QMainWindow" name="AudioDevicesBase"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> @@ -9,246 +10,223 @@ <height>702</height> </rect> </property> - <property name="windowTitle" > + <property name="windowTitle"> <string>AudioDevicesBase</string> </property> - <widget class="QWidget" name="centralwidget" > - <property name="geometry" > - <rect> - <x>0</x> - <y>28</y> - <width>504</width> - <height>653</height> - </rect> - </property> - <widget class="QWidget" name="layoutWidget" > - <property name="geometry" > - <rect> - <x>40</x> - <y>21</y> - <width>321</width> - <height>506</height> - </rect> - </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" > - <widget class="QLabel" name="deviceLabel" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > - <horstretch>1</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Device</string> - </property> - </widget> - </item> - <item row="0" column="1" > - <widget class="QLabel" name="modeLabel" > - <property name="text" > - <string>Mode</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QComboBox" name="deviceBox" /> - </item> - <item row="1" column="1" > - <widget class="QComboBox" name="modeBox" /> - </item> - <item row="2" column="0" > - <widget class="QLabel" name="actualLabel" > - <property name="frameShape" > - <enum>QFrame::Panel</enum> - </property> - <property name="frameShadow" > - <enum>QFrame::Raised</enum> - </property> - <property name="text" > - <string>Actual Settings</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="2" column="1" > - <widget class="QLabel" name="nearestLabel" > - <property name="frameShape" > - <enum>QFrame::Panel</enum> - </property> - <property name="frameShadow" > - <enum>QFrame::Raised</enum> - </property> - <property name="text" > - <string>Nearest Settings</string> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="QLabel" name="actualFreqLabel" > - <property name="text" > - <string>Frequency</string> - </property> - </widget> - </item> - <item row="3" column="1" > - <widget class="QLabel" name="nearestFreqLabel" > - <property name="text" > - <string>Frequency</string> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QComboBox" name="frequencyBox" /> - </item> - <item row="4" column="1" > - <widget class="QLineEdit" name="nearestFreq" /> - </item> - <item row="5" column="0" > - <widget class="QLabel" name="actualChannelsLabel" > - <property name="text" > - <string>Channels</string> - </property> - </widget> - </item> - <item row="5" column="1" > - <widget class="QLabel" name="nearestChannelLabel" > - <property name="text" > - <string>Channel</string> - </property> - </widget> - </item> - <item row="6" column="0" > - <widget class="QComboBox" name="channelsBox" /> - </item> - <item row="6" column="1" > - <widget class="QLineEdit" name="nearestChannel" /> - </item> - <item row="7" column="0" > - <widget class="QLabel" name="actualCodecLabel" > - <property name="text" > - <string>Codecs</string> - </property> - </widget> - </item> - <item row="7" column="1" > - <widget class="QLabel" name="nearestCodecLabel" > - <property name="text" > - <string>Codec</string> - </property> - </widget> - </item> - <item row="8" column="0" > - <widget class="QComboBox" name="codecsBox" /> - </item> - <item row="8" column="1" > - <widget class="QLineEdit" name="nearestCodec" /> - </item> - <item row="9" column="0" > - <widget class="QLabel" name="actualSampleSizeLabel" > - <property name="text" > - <string>SampleSize</string> - </property> - </widget> - </item> - <item row="9" column="1" > - <widget class="QLabel" name="nearestSampleSizeLabel" > - <property name="text" > - <string>SampleSize</string> - </property> - </widget> - </item> - <item row="10" column="0" > - <widget class="QComboBox" name="sampleSizesBox" /> - </item> - <item row="10" column="1" > - <widget class="QLineEdit" name="nearestSampleSize" /> - </item> - <item row="11" column="0" > - <widget class="QLabel" name="actualSampleTypeLabel" > - <property name="text" > - <string>SampleType</string> - </property> - </widget> - </item> - <item row="11" column="1" > - <widget class="QLabel" name="nearestSampleTypeLabel" > - <property name="text" > - <string>SampleType</string> - </property> - </widget> - </item> - <item row="12" column="0" > - <widget class="QComboBox" name="sampleTypesBox" /> - </item> - <item row="12" column="1" > - <widget class="QLineEdit" name="nearestSampleType" /> - </item> - <item row="13" column="0" > - <widget class="QLabel" name="actualEndianLabel" > - <property name="text" > - <string>Endianess</string> - </property> - </widget> - </item> - <item row="13" column="1" > - <widget class="QLabel" name="nearestEndianLabel" > - <property name="text" > - <string>Endianess</string> - </property> - </widget> - </item> - <item row="14" column="0" > - <widget class="QComboBox" name="endianBox" /> - </item> - <item row="14" column="1" > - <widget class="QLineEdit" name="nearestEndian" /> - </item> - <item row="15" column="0" colspan="2" > - <widget class="QTextEdit" name="logOutput" > - <property name="minimumSize" > - <size> - <width>0</width> - <height>40</height> - </size> - </property> - </widget> - </item> - <item row="16" column="0" colspan="2" > - <widget class="QPushButton" name="testButton" > - <property name="text" > - <string>Test</string> - </property> - </widget> - </item> - </layout> - </widget> + <widget class="QWidget" name="centralwidget"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="deviceLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Device</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="modeLabel"> + <property name="text"> + <string>Mode</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QComboBox" name="deviceBox"/> + </item> + <item row="1" column="1"> + <widget class="QComboBox" name="modeBox"/> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="actualLabel"> + <property name="frameShape"> + <enum>QFrame::Panel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>Actual Settings</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="nearestLabel"> + <property name="frameShape"> + <enum>QFrame::Panel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <property name="text"> + <string>Nearest Settings</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="actualFreqLabel"> + <property name="text"> + <string>Frequency</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLabel" name="nearestFreqLabel"> + <property name="text"> + <string>Frequency</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QComboBox" name="frequencyBox"/> + </item> + <item row="4" column="1"> + <widget class="QLineEdit" name="nearestFreq"/> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="actualChannelsLabel"> + <property name="text"> + <string>Channels</string> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QLabel" name="nearestChannelLabel"> + <property name="text"> + <string>Channel</string> + </property> + </widget> + </item> + <item row="6" column="0"> + <widget class="QComboBox" name="channelsBox"/> + </item> + <item row="6" column="1"> + <widget class="QLineEdit" name="nearestChannel"/> + </item> + <item row="7" column="0"> + <widget class="QLabel" name="actualCodecLabel"> + <property name="text"> + <string>Codecs</string> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QLabel" name="nearestCodecLabel"> + <property name="text"> + <string>Codec</string> + </property> + </widget> + </item> + <item row="8" column="0"> + <widget class="QComboBox" name="codecsBox"/> + </item> + <item row="8" column="1"> + <widget class="QLineEdit" name="nearestCodec"/> + </item> + <item row="9" column="0"> + <widget class="QLabel" name="actualSampleSizeLabel"> + <property name="text"> + <string>SampleSize</string> + </property> + </widget> + </item> + <item row="9" column="1"> + <widget class="QLabel" name="nearestSampleSizeLabel"> + <property name="text"> + <string>SampleSize</string> + </property> + </widget> + </item> + <item row="10" column="0"> + <widget class="QComboBox" name="sampleSizesBox"/> + </item> + <item row="10" column="1"> + <widget class="QLineEdit" name="nearestSampleSize"/> + </item> + <item row="11" column="0"> + <widget class="QLabel" name="actualSampleTypeLabel"> + <property name="text"> + <string>SampleType</string> + </property> + </widget> + </item> + <item row="11" column="1"> + <widget class="QLabel" name="nearestSampleTypeLabel"> + <property name="text"> + <string>SampleType</string> + </property> + </widget> + </item> + <item row="12" column="0"> + <widget class="QComboBox" name="sampleTypesBox"/> + </item> + <item row="12" column="1"> + <widget class="QLineEdit" name="nearestSampleType"/> + </item> + <item row="13" column="0"> + <widget class="QLabel" name="actualEndianLabel"> + <property name="text"> + <string>Endianess</string> + </property> + </widget> + </item> + <item row="13" column="1"> + <widget class="QLabel" name="nearestEndianLabel"> + <property name="text"> + <string>Endianess</string> + </property> + </widget> + </item> + <item row="14" column="0"> + <widget class="QComboBox" name="endianBox"/> + </item> + <item row="14" column="1"> + <widget class="QLineEdit" name="nearestEndian"/> + </item> + <item row="15" column="0" colspan="2"> + <widget class="QTextEdit" name="logOutput"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>40</height> + </size> + </property> + </widget> + </item> + <item row="16" column="0" colspan="2"> + <widget class="QPushButton" name="testButton"> + <property name="text"> + <string>Test</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> - <widget class="QMenuBar" name="menubar" > - <property name="geometry" > + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>504</width> - <height>28</height> - </rect> - </property> - </widget> - <widget class="QStatusBar" name="statusbar" > - <property name="geometry" > - <rect> - <x>0</x> - <y>681</y> - <width>504</width> - <height>21</height> + <height>19</height> </rect> </property> </widget> + <widget class="QStatusBar" name="statusbar"/> </widget> <resources/> <connections/> |