Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT Phonon Tick Slot not triggering, please help.
Forum Update on Monday, May 27th 2025

QT Phonon Tick Slot not triggering, please help.

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.2k Views
  • 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 Offline
    B Offline
    Bastiaan
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved