Code Monkey home page Code Monkey logo

Comments (5)

wang-bin avatar wang-bin commented on June 12, 2024

you have to emit signals yourself in the callback. see https://github.com/wang-bin/qtmultimedia-plugins-mdk/blob/master/mediaplayercontrol.cpp#L44 https://github.com/wang-bin/qtmultimedia-plugins-mdk/blob/master/mediaplayercontrol.cpp#L47

from mdk-sdk.

PeterAkakpo avatar PeterAkakpo commented on June 12, 2024

i have tried the following from the above link, but its still not working

_player->onStateChanged([this](State value){
Q_EMIT stateChanged(value);
});
_player->onMediaStatusChanged([this](MediaStatus value){
Q_EMIT mediaStatusChanged(value);
return true;
});

from mdk-sdk.

wang-bin avatar wang-bin commented on June 12, 2024

how do you connect signals?

from mdk-sdk.

PeterAkakpo avatar PeterAkakpo commented on June 12, 2024

i tried this first but it didn't work
connect(player,&MediaPlayer::mediaStatusChanged,this,&MainWindow::mediaStatusChanged);

then i tried this, it also didn't work connect(player,SIGNAL(mediaStatusChanged()),this,SLOT(mediaStatusChanged()),Qt::DirectConnection);

from mdk-sdk.

wang-bin avatar wang-bin commented on June 12, 2024

connect(player,&MediaPlayer::mediaStatusChanged,this,&MainWindow::mediaStatusChanged);

It's a queued connection, signal parameter type MediaStatus must be known to qt metatype system.

    Q_DECLARE_METATYPE(mdk::MediaStatus) // declare in global scope

   qRegisterMetaType<MediaStatus>(); // in a function

connect(player,SIGNAL(mediaStatusChanged()),this,SLOT(mediaStatusChanged()),Qt::DirectConnection);

forgot signal parameter? qRegisterMetaType too.

other options can be

    connect(this, & MediaPlayer::mediaStatusChanged, []{});

from mdk-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.