QFeedbackFileEffect Class ReferenceThe QFeedbackFileEffect class allows to play feedback from a file. More... #include <QFeedbackFileEffect> Inherits: QFeedbackEffect. This class was introduced in Qt Mobility 1.1. Properties
Public Functions
Reimplemented Public Functions
Static Public Members
Reimplemented Protected Functions
Additional Inherited Members
Detailed DescriptionThe QFeedbackFileEffect class allows to play feedback from a file. Several different mime types may be supported on a system, including both haptic data files, and audio files. The files containing haptics data are usually suffixed .ifr. The feedback is usually varying in intensity(), and is for that reason often referred to as a "haptic tune". They are created, for instance, from music files where the feedback is based on a specific feature in the audio data. For example, you could have a phone vibrating along with the bass of a rock song. Although Qt Mobility does not let you record .ifr files, it lets you play them back using the QFeedbackFileEffect class. Setting up a QFeedbackFileEffect and starting it is done as follows: QFeedbackFileEffect hapticTune; hapticTune.setSource(QUrl::fromLocalFile("mySavedRumble.ifr")); hapticTune.load(); hapticTune.start(); As with other QFeedbackEffects, QFeedbackFileEffect is at any given time in one of four states: Loading, Running, Paused, or Stopped. You request state changes with start(), pause(), and stop(). You can load() and unload() the file at will to free resources or be as fast as possible. The file must be loaded before it can be started, and it cannot be unloaded while playing. After the file is loaded, you can query its duration(). Some mime types may not support duration information - in these cases, 0 will be returned. QFeedbackFileEffect reports errors through the error() signal. See also QFeedbackHapticsEffect. Property Documentation
|
bool | isLoaded () const |
void | setLoaded ( bool ) |
This property holds the url of the file that is loaded.
Setting that property will automatically unload the previous file (if any) and load the new one. Some backends may not support all URL schemes - for example, they may only support local files.
You can only change the source of an effect when it is stopped.
This property was introduced in Qt Mobility 1.1.
Access functions:
QUrl | source () const |
void | setSource ( const QUrl & ) |
Constructs the QFeedbackFileEffect class, and passes parent to QObject's constructor.
Stops the feedback and unloads the file if necessary.
Reimplemented from QFeedbackEffect::duration().
This function was introduced in Qt Mobility 1.1.
Makes sure that the file associated with the feedback object is loaded. It will be automatically loaded when the setSource() or start() functions are called.
This function was introduced in Qt Mobility 1.1.
Reimplemented from QFeedbackEffect::setState().
This function was introduced in Qt Mobility 1.1.
See also state().
Reimplemented from QFeedbackEffect::state().
This function was introduced in Qt Mobility 1.1.
See also setState().
returns the MIME types supported for playing effects from file.
makes sure that the file associated with the feedback object is unloaded. It will be automatically unloaded when the setSource function is called with another file or the object is destroyed.
This function was introduced in Qt Mobility 1.1.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt qtmobility-1.2 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com