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. [QtMultimedia] How to read metaData from all mediaObject in QMediaPlayList ?
Qt 6.11 is out! See what's new in the release blog

[QtMultimedia] How to read metaData from all mediaObject in QMediaPlayList ?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.3k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    superbobnoob
    wrote on last edited by
    #1

    Hey. I read metaData in SLOT
    @connect(&musicPlayer, SIGNAL(metaDataAvailableChanged(bool)), this, SLOT(updateInfo()));

    void PlayerWindow::updateInfo()
    {
    QString author = musicPlayer.metaData("Author").toString();

    QString title = musicPlayer.metaData("Title").toString();
    
    qDebug() << author << " - " <&lt; title;
    
    musicPlayList.next();
    

    }@

    and load files to playList
    @void PlayerWindow::on_pushButton_clicked()
    {
    static QString path = QDir::homePath();
    QStringList filePaths = QFileDialog::getOpenFileNames(this, tr("Open File"), path, tr("MP3 files (.mp3);;All files (.*)"));

    if(!filePaths.empty())
    {
        for(int i = 0; i&lt;filePaths.size(); i++)
        {
            musicPlayList.addMedia(QUrl::fromLocalFile&#40;filePaths[i]&#41;);
        }
        musicPlayList.setCurrentIndex(0);
    }
    

    }@

    And this is too slow i think becouse it read metaData only for every second file.

    So my question is how to do this right to get metaData of all files in QMediaPlayList

    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