Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/multimedia/audio/qaudioinput.cpp

    r651 r769  
    9696      format.setSampleType(QAudioFormat::UnSignedInt);
    9797
    98       if (QAudioDeviceInfo info(QAudioDeviceInfo::defaultInputDevice());
     98      QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
    9999      if (!info.isFormatSupported(format)) {
    100100          qWarning()<<"default format not supported try to use nearest";
     
    147147
    148148    \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.
    149163*/
    150164
     
    191205     All that is required is to open the QIODevice.
    192206
     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
    193220     \sa QIODevice
    194221*/
     
    196223void QAudioInput::start(QIODevice* device)
    197224{
    198     /*
    199        -If currently not StoppedState, stop
    200        -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     */
    205225    d->start(device);
    206226}
     
    211231    directly.
    212232
     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
    213246    \sa QIODevice
    214247*/
     
    216249QIODevice* QAudioInput::start()
    217250{
    218     /*
    219     -If currently not StoppedState, stop
    220     -If no internal QIODevice, create one.
    221     -open audio input.
    222     -If ok, NoError and IdleState, else OpenError and StoppedState
    223     -emit stateChanged()
    224     -return internal QIODevice
    225     */
    226251    return d->start(0);
    227252}
     
    237262
    238263/*!
    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.
    240268*/
    241269
    242270void QAudioInput::stop()
    243271{
    244     /*
    245     -If StoppedState, return
    246     -set to StoppedState
    247     -detach from audio device
    248     -emit stateChanged()
    249     */
    250272    d->stop();
    251273}
     
    257279void QAudioInput::reset()
    258280{
    259     /*
    260     -drop all buffered audio, set buffers to zero.
    261     -call stop()
    262     */
    263281    d->reset();
    264282}
     
    266284/*!
    267285    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.
    268291*/
    269292
    270293void QAudioInput::suspend()
    271294{
    272     /*
    273     -If not ActiveState|IdleState, return
    274     -stop processing audio, saving all buffered audio data
    275     -set NoError and SuspendedState
    276     -emit stateChanged()
    277     */
    278295    d->suspend();
    279296}
     
    281298/*!
    282299    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.
    283305*/
    284306
    285307void QAudioInput::resume()
    286308{
    287     /*
    288     -If SuspendedState, return
    289     -resume audio
    290     -(PULL MODE): set ActiveState, NoError
    291     -(PUSH MODE): set IdleState, NoError
    292     -kick start audio if needed
    293     -emit stateChanged()
    294     */
    295309     d->resume();
    296310}
    297311
    298312/*!
    299     Sets the audio buffer size to \a value milliseconds.
     313    Sets the audio buffer size to \a value bytes.
    300314
    301315    Note: This function can be called anytime before start(), calls to this
     
    312326
    313327/*!
    314     Returns the audio buffer size in milliseconds.
     328    Returns the audio buffer size in bytes.
    315329
    316330    If called before start(), returns platform default value.
     
    328342/*!
    329343    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.
    330347*/
    331348
     
    353370    Sets the interval for notify() signal to be emitted.
    354371    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.
    356376*/
    357377
Note: See TracChangeset for help on using the changeset viewer.