Results 1 to 2 of 2

Thread: Playlist data structure: SQL or something else?

  1. #1
    Join Date
    Mar 2016
    Qt products
    Unix/X11 Windows

    Default Playlist data structure: SQL or something else?

    Hi everyone, so I am working on designing a music player using Qt and VLC as a backend. To give you an idea, I am taking a lot of inspiration from MediaMonkey. I have the library potion set up using SQL just fine, but I am not sure how to handle the playlist. The problem is a playlist should have a specific order and SQL has no inherent order.

    I am not sure if keeping a field in each record to maintain that order makes sense, or if I should design an ordered data structure (or if one already exists). Does anyone have any advice on a "standard" solution for this problem? I have tried looking at Amarok source code, but have a hard time following it because it has become such a large and abstracted projected.


  2. #2
    Join Date
    Jan 2008
    Alameda, CA, USA
    Thanked 844 Times in 831 Posts
    Qt products

    Default Re: Playlist data structure: SQL or something else?

    SQL has no inherent order
    SQL does have an order if you specify a sort field as part of your query.

    Does your playlist need to be persistent? That is, do you need to save it on disk between runs of the player? If the playlist is short compared to the entire music library, then you might use XML to store it on disk. If you are already using SQL to store the music library, then it would be simpler to just add another table to the DB to store the playlist, with a column for play order and a reference to the item's key in the main library table(s).

Similar Threads

  1. Replies: 1
    Last Post: 24th February 2016, 17:00
  2. send structure data through drag QMimeData
    By wagmare in forum Qt Programming
    Replies: 1
    Last Post: 6th May 2015, 07:42
  3. Replies: 8
    Last Post: 27th September 2013, 12:28
  4. Drawing of graph(data structure) !
    By Abeer in forum Newbie
    Replies: 1
    Last Post: 23rd May 2010, 21:47
  5. Data Structure help!
    By darshan in forum Newbie
    Replies: 8
    Last Post: 18th February 2009, 12:47

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.