Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    QT Phonon Tick Slot not triggering, please help.

    General and Desktop
    1
    1
    1096
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Bastiaan last edited by

      Hello Everybody,

      I have a problem with using Phonon inside QT. I am trying to connect the tick signal to a tick slot. But when a media file is playing.. the tick slot is never called. This very simple example doesn't work. I see in my output window from the debug call that the Player is started, also i hear the musicl. But i dont see the tick slot getting triggered. What am i doing wrong??

      Please help.

      Best Regards,

      Bastiaan

      Here is my header (musicplayer.h)

      @#include <QMainWindow>
      #include <phonon/audiooutput.h>
      #include <phonon/seekslider.h>
      #include <phonon/mediaobject.h>
      #include <phonon/volumeslider.h>
      #include <phonon/backendcapabilities.h>
      #include <QList>

      class QTime;

      class musicplayer : public QObject
      {
      Q_OBJECT

      public:
      explicit musicplayer(QObject *parent = 0);

      void Init();
      

      private slots:
      void tick(qint64 iTime);

      };

      #endif // MUSICPLAYER_H@

      Here is my class (musicplayer.c)

      @#include "musicplayer.h"
      #include <QtDebug>

      musicplayer::musicplayer(QObject *parent) : QObject(parent)
      {
      }

      void musicplayer::Init()
      {
      Phonon::MediaObject *mediaObject = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource("test.mp3"));

      mediaObject->setTickInterval(500);
      connect(mediaObject, SIGNAL(tick(qint64)),this, SLOT(tick(qint64)));
      
      mediaObject->play();
      
      qDebug() << "Player started";
      

      }

      void musicplayer::tick(qint64 iTime)
      {
      qDebug() << iTime;
      }@

      1 Reply Last reply Reply Quote 0
      • First post
        Last post