QFeedbackFileEffect Class ReferenceThe QFeedbackFileEffect class allows to play feedback from a file. More... #include <QFeedbackFileEffect> Inherits QFeedbackEffect. 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.
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().
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.
Reimplemented from QFeedbackEffect::setState().
See also state().
Reimplemented from QFeedbackEffect::state().
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.