×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    2

    Need to stop QML Audio from cpp code

    Hi,
    I have a qml which has audio playing.I need to pause the audio from QAPPlication ie cpp code.
    *
    QML CODE is as follows
    ***********************************************************
    import Qt 4.7
    import QtMultimediaKit 1.1

    Text { text: “Click Me!”; font.pointSize: 24; width: 150; height: 50; Audio { id: playMusic source: “music.wav” } MouseArea { id: playArea anchors.fill: parent onPressed: { playMusic.play() } } } ************************************************************ When i hide my qml app ,I need to pause the audio playing. This is straight forward pausing in qml file by using signals and slots I need to pause the audio from cpp code .
    The scenario is
    When i get an incoming call , I should pause the media which is playing .
    I want in Qt app context to pause the media.I dont want QML do the pausing of the media
    Please post me if you people have anything

  2. #2
    Regular Contributor
    Join Date
    Feb 2012
    Posts
    124

    Re: Need to stop QML Audio from cpp code

    Quote Originally Posted by srav219 View Post
    Hi,
    When i hide my qml app ,I need to pause the audio playing. This is straight forward pausing in qml file by using signals and slots I need to pause the audio from cpp code .
    The scenario is
    When i get an incoming call , I should pause the media which is playing .
    I want in Qt app context to pause the media.I dont want QML do the pausing of the media
    Please post me if you people have anything
    For the C++ side of things you could try this:
    http://www.developer.nokia.com/Commu...d_when_resumed
    or
    http://www.developer.nokia.com/Commu...Qt_for_Symbian

    Otherwise to detect this event in QML is easy, add this to the file that you want to detect it:
    Code:
    Component.onCompleted:{
    symbian.foregroundChanged.connect(appForegroundChanged)
    }
    Then create a function to do the pausing:
    Code:
    function appForegroundChanged() {
    console.log(symbian.foreground)
    //Pause audio here
    }

  3. #3
    Registered User
    Join Date
    Apr 2013
    Posts
    2

    Re: Need to stop QML Audio from cpp code

    Can you give the fix for Qt 4.7.4 .I dont have symbian extesnions.
    I dont know how to pause the media in hide event of qml app with cpp code

Similar Threads

  1. Stop and Replay audio
    By swaroop55 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2011-05-24, 07:23
  2. Streaming problem: Audio stop before playing
    By unidentify in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2009-12-08, 11:27
  3. How to stop audio player?
    By ManuMies in forum Symbian
    Replies: 7
    Last Post: 2008-09-02, 03:01
  4. How To Stop And Pause Audio File In Midlet
    By mathi77in in forum Mobile Java General
    Replies: 1
    Last Post: 2005-07-18, 15:04
  5. Stop audio playing
    By walterzcm in forum Mobile Java General
    Replies: 0
    Last Post: 2002-12-03, 03:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •