Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QML SoundEffect Element

The SoundEffect element provides a way to play sound effects in QML. More...

  • List of all members, including inherited members
  • Properties

    Signals

    Methods

    Detailed Description

    This element is part of the QtMultimediaKit 1.1 module.

    The following example plays a WAV file on mouse click.

     import Qt 4.7
     import QtMultimediaKit 1.1
    
     Text {
         text: "Click Me!";
         font.pointSize: 24;
         width: 150; height: 50;
    
         SoundEffect {
             id: playSound
             source: "soundeffect.wav"
         }
         MouseArea {
             id: playArea
             anchors.fill: parent
             onPressed: { playSound.play() }
         }
     }

    Property Documentation

    loops : int

    This property provides a way to control the number of times to repeat the sound on each play().

    Set to -1 (infinite) to enable infinite loop.

    This documentation was introduced in Qt Mobility 1.0.


    muted : bool

    This property provides a way to control muting.

    This documentation was introduced in Qt Mobility 1.0.


    read-onlyplaying : bool

    This property indicates if the soundeffect is playing or not.

    This documentation was introduced in Qt Mobility 1.1.


    source : url

    This property provides a way to control the sound to play.

    This documentation was introduced in Qt Mobility 1.0.


    read-onlystatus : int

    This property indicates the following status of the soundeffect.

    Null: no source has been set or is null. Loading: the soundeffect is trying to load the source. Ready: the source is loaded and ready for play. Error: some error happened during operation, such as failure of loading the source.

    This documentation was introduced in Qt Mobility 1.0.


    volume : qreal

    This property holds the volume of the playback, from 0.0 (silent) to 1.0 (maximum volume). Note: Currently this has no effect on Mac OS X and Symbian.

    This documentation was introduced in Qt Mobility 1.0.


    Signal Documentation

    SoundEffect::loopsChanged ()

    This handler is called when the number of loops has changed.

    This documentation was introduced in Qt Mobility 1.0.


    SoundEffect::mutedChanged ()

    This handler is called when the mute state has changed.

    This documentation was introduced in Qt Mobility 1.0.


    SoundEffect::playingChanged ()

    This handler is called when the playing property has changed.

    This documentation was introduced in Qt Mobility 1.0.


    SoundEffect::sourceChanged ()

    This handler is called when the source has changed.

    This documentation was introduced in Qt Mobility 1.0.


    SoundEffect::statusChanged ()

    This handler is called when the status property has changed.

    This documentation was introduced in Qt Mobility 1.0.


    SoundEffect::volumeChanged ()

    This handler is called when the volume has changed.

    This documentation was introduced in Qt Mobility 1.0.


    Method Documentation

    SoundEffect::play ()

    Start playback of the sound effect, looping the effect for the number of times as specificed in the loops property.

    This is the default method for SoundEffect.

     SoundEffect {
         id: playSound
         source: "soundeffect.wav"
     }
     MouseArea {
         id: playArea
         anchors.fill: parent
         onPressed: { playSound.play() }
     }

    This documentation was introduced in Qt Mobility 1.0.


    SoundEffect::stop ()

    Stop current playback. Note that if the backend is PulseAudio, due to the limitation of the underlying API, tis stop will only prevent next looping but will not be able to stop current playback immediately.

    This documentation was introduced in Qt Mobility 1.0.


    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 !
     
     
     
     
    Partenaires

    Hébergement Web