Changeset 769 for trunk/src/multimedia/audio/qaudioinput.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/multimedia/audio/qaudioinput.cpp
r651 r769 96 96 format.setSampleType(QAudioFormat::UnSignedInt); 97 97 98 if (QAudioDeviceInfo info(QAudioDeviceInfo::defaultInputDevice());98 QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice(); 99 99 if (!info.isFormatSupported(format)) { 100 100 qWarning()<<"default format not supported try to use nearest"; … … 147 147 148 148 \sa QAudioOutput, QAudioDeviceInfo 149 150 \section1 Symbian Platform Security Requirements 151 152 On Symbian, processes which use this class must have the 153 \c UserEnvironment platform security capability. If the client 154 process lacks this capability, calls to either overload of start() 155 will fail. 156 This failure is indicated by the QAudioInput object setting 157 its error() value to \l{QAudio::OpenError} and then emitting a 158 \l{stateChanged()}{stateChanged}(\l{QAudio::StoppedState}) signal. 159 160 Platform security capabilities are added via the 161 \l{qmake-variable-reference.html#target-capability}{TARGET.CAPABILITY} 162 qmake variable. 149 163 */ 150 164 … … 191 205 All that is required is to open the QIODevice. 192 206 207 If able to successfully get audio data from the systems audio device the 208 state() is set to either QAudio::ActiveState or QAudio::IdleState, 209 error() is set to QAudio::NoError and the stateChanged() signal is emitted. 210 211 If a problem occurs during this process the error() is set to QAudio::OpenError, 212 state() is set to QAudio::StoppedState and stateChanged() signal is emitted. 213 214 In either case, the stateChanged() signal may be emitted either synchronously 215 during execution of the start() function or asynchronously after start() has 216 returned to the caller. 217 218 \sa {Symbian Platform Security Requirements} 219 193 220 \sa QIODevice 194 221 */ … … 196 223 void QAudioInput::start(QIODevice* device) 197 224 { 198 /*199 -If currently not StoppedState, stop200 -If previous start was push mode, delete internal QIODevice.201 -open audio input.202 If ok, NoError and ActiveState, else OpenError and StoppedState.203 -emit stateChanged()204 */205 225 d->start(device); 206 226 } … … 211 231 directly. 212 232 233 If able to access the systems audio device the state() is set to 234 QAudio::IdleState, error() is set to QAudio::NoError 235 and the stateChanged() signal is emitted. 236 237 If a problem occurs during this process the error() is set to QAudio::OpenError, 238 state() is set to QAudio::StoppedState and stateChanged() signal is emitted. 239 240 In either case, the stateChanged() signal may be emitted either synchronously 241 during execution of the start() function or asynchronously after start() has 242 returned to the caller. 243 244 \sa {Symbian Platform Security Requirements} 245 213 246 \sa QIODevice 214 247 */ … … 216 249 QIODevice* QAudioInput::start() 217 250 { 218 /*219 -If currently not StoppedState, stop220 -If no internal QIODevice, create one.221 -open audio input.222 -If ok, NoError and IdleState, else OpenError and StoppedState223 -emit stateChanged()224 -return internal QIODevice225 */226 251 return d->start(0); 227 252 } … … 237 262 238 263 /*! 239 Stops the audio input. 264 Stops the audio input, detaching from the system resource. 265 266 Sets error() to QAudio::NoError, state() to QAudio::StoppedState and 267 emit stateChanged() signal. 240 268 */ 241 269 242 270 void QAudioInput::stop() 243 271 { 244 /*245 -If StoppedState, return246 -set to StoppedState247 -detach from audio device248 -emit stateChanged()249 */250 272 d->stop(); 251 273 } … … 257 279 void QAudioInput::reset() 258 280 { 259 /*260 -drop all buffered audio, set buffers to zero.261 -call stop()262 */263 281 d->reset(); 264 282 } … … 266 284 /*! 267 285 Stops processing audio data, preserving buffered audio data. 286 287 Sets error() to QAudio::NoError, state() to QAudio::SuspendedState and 288 emit stateChanged() signal. 289 290 Note: signal will always be emitted during execution of the resume() function. 268 291 */ 269 292 270 293 void QAudioInput::suspend() 271 294 { 272 /*273 -If not ActiveState|IdleState, return274 -stop processing audio, saving all buffered audio data275 -set NoError and SuspendedState276 -emit stateChanged()277 */278 295 d->suspend(); 279 296 } … … 281 298 /*! 282 299 Resumes processing audio data after a suspend(). 300 301 Sets error() to QAudio::NoError. 302 Sets state() to QAudio::ActiveState if you previously called start(QIODevice*). 303 Sets state() to QAudio::IdleState if you previously called start(). 304 emits stateChanged() signal. 283 305 */ 284 306 285 307 void QAudioInput::resume() 286 308 { 287 /*288 -If SuspendedState, return289 -resume audio290 -(PULL MODE): set ActiveState, NoError291 -(PUSH MODE): set IdleState, NoError292 -kick start audio if needed293 -emit stateChanged()294 */295 309 d->resume(); 296 310 } 297 311 298 312 /*! 299 Sets the audio buffer size to \a value milliseconds.313 Sets the audio buffer size to \a value bytes. 300 314 301 315 Note: This function can be called anytime before start(), calls to this … … 312 326 313 327 /*! 314 Returns the audio buffer size in milliseconds.328 Returns the audio buffer size in bytes. 315 329 316 330 If called before start(), returns platform default value. … … 328 342 /*! 329 343 Returns the amount of audio data available to read in bytes. 344 345 NOTE: returned value is only valid while in QAudio::ActiveState or QAudio::IdleState 346 state, otherwise returns zero. 330 347 */ 331 348 … … 353 370 Sets the interval for notify() signal to be emitted. 354 371 This is based on the \a ms of audio data processed 355 not on actual real-time. The resolution of the timer is platform specific. 372 not on actual real-time. 373 The minimum resolution of the timer is platform specific and values 374 should be checked with notifyInterval() to confirm actual value 375 being used. 356 376 */ 357 377
Note:
See TracChangeset
for help on using the changeset viewer.