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. Best approach to create a media library
Forum Updated to NodeBB v4.3 + New Features

Best approach to create a media library

Scheduled Pinned Locked Moved Solved General and Desktop
qtmultimediasqldatabasemusic
3 Posts 2 Posters 1.4k Views 2 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.
  • E Offline
    E Offline
    Euclide
    wrote on 24 Mar 2018, 01:53 last edited by
    #1

    Hello,

    I started a project some days ago in order to challenge myself on what I have learned about Qt until here. I aim to build a music player that also provide a library interface to browse music by title, album, artist, genre, etc. But I have some problems constructing the music library.

    • I don't know if I should use a database manager like SQL to store the music library.
      Since I want the loading process to be as fast as possible I thought I should store information like album list and artist list in and external file. To do this I would create specific lists like the following and save them. I wonder however if a database wouldn't be better. What do you think about?
    QList<Album> albums; //List of all albums
    
    class Album
    {
        ...
        QString name;
        QStringList musicPaths;
        ...
    }
    
    • I wonder if the Qt Multimedia module is a good choice to read metadata.
      I find that Qt Multimedia only provide access to metadata through a QMediaObject. In my case I must fist set the media to the QMediaPlayer and use de method metadata() to retrieve the metadata. But I want to be able to read the metadata directly from the a the file when supplying the music library. What would you suggest me?

    Thank you for your advices and suggestions.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 24 Mar 2018, 09:00 last edited by
      #2

      Hi

      • I don't know if I should use a database manager like SQL to store the music library.

      Well using a dbms gives easy way to sort / select from the data with no extra coding.
      And if this is also a challenge, i would recommend using sqlite for the data.
      However, if you have not used Qt view / models yet. maybe its a bit involved.
      But very useful to learn about though. and you can get to play with
      http://doc.qt.io/qt-5/qsqlrelationaltablemodel.html also.

      • I wonder if the Qt Multimedia module is a good choice to read metadata.
        Well if you wish for more direct access, then maybe a tag lib might work better
        http://taglib.org/.
      E 1 Reply Last reply 24 Mar 2018, 18:50
      3
      • M mrjj
        24 Mar 2018, 09:00

        Hi

        • I don't know if I should use a database manager like SQL to store the music library.

        Well using a dbms gives easy way to sort / select from the data with no extra coding.
        And if this is also a challenge, i would recommend using sqlite for the data.
        However, if you have not used Qt view / models yet. maybe its a bit involved.
        But very useful to learn about though. and you can get to play with
        http://doc.qt.io/qt-5/qsqlrelationaltablemodel.html also.

        • I wonder if the Qt Multimedia module is a good choice to read metadata.
          Well if you wish for more direct access, then maybe a tag lib might work better
          http://taglib.org/.
        E Offline
        E Offline
        Euclide
        wrote on 24 Mar 2018, 18:50 last edited by
        #3

        @mrjj Many thanks mrjj for your answer. I'll make more researches about SQLite and Taglib.

        1 Reply Last reply
        0

        2/3

        24 Mar 2018, 09:00

        • Login

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