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. [Solved] Accessing "tags" from the "now" playing song in QMediaPlayer

[Solved] Accessing "tags" from the "now" playing song in QMediaPlayer

Scheduled Pinned Locked Moved General and Desktop
4 Posts 1 Posters 1.9k 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.
  • I Offline
    I Offline
    inblueswithu
    wrote on last edited by
    #1

    Hi,

    I 'm trying to access tags of the current song playing to display in my custom Media Player App.
    I'm using this in media player to connect to a method to update the info.
    @QObject::connect(this->playlist(), SIGNAL(currentMediaChanged(QMediaContent)),
    this, SLOT(updateSongInfo()));@
    updateSongInfo() Method:

    @gui->setProperty("songName", this->metaData("Title"));
    gui->setProperty("albumName", this->metaData("AlbumTitle"));@

    Now, my issue is: I'm getting the song info of the previous song!!
    I tried in many ways but I dn't find any solution for this.
    Can any one help me how to get the current song info.

    EDIT: the details are from the previous song not from the next

    Thanks in Advance,
    inblueswithu

    1 Reply Last reply
    0
    • I Offline
      I Offline
      inblueswithu
      wrote on last edited by
      #2

      Bump!!

      1 Reply Last reply
      0
      • I Offline
        I Offline
        inblueswithu
        wrote on last edited by
        #3

        Bump!!!

        1 Reply Last reply
        0
        • I Offline
          I Offline
          inblueswithu
          wrote on last edited by
          #4

          I resolved this issue.
          Rather than asking currentMediaChanged() signal metaDataChanged() is more significant & reliable. I did this as following:

          @QObject::connect(this, SIGNAL(durationChanged(qint64)), this, SLOT(updateSongInfo()));
          QObject::connect(this, SIGNAL(metaDataChanged()), this, SLOT(updateSongInfo()));@

          I'm not sure why the currentMediaChanged() did not work!
          I even tried to pause the updateSongInfo() function to wait for few seconds to check if the player is not yet ready with the info. It didnt work.

          Thankyou :)

          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