qt - Get meta data from delegated files using QML -
i'm creating music player ubuntu touch in qml , have things appreciate since i'm new qml.
i have list of tracks directory, want show meta data (artist, track name, year, album , on) instead of filename.
using qt.multimedia able meta data playing track, can't find how per file folderlistmodel delegated files.
how that?
this current code:
column { anchors.centerin: parent anchors.fill: parent listview { id: musicfolder folderlistmodel { id: foldermodel folder: musicdir showdirs: false namefilters: ["*.ogg","*.mp3","*.oga","*.wav"] } width: parent.width height: parent.height model: foldermodel delegate: listitem.subtitled { text: filename subtext: "artist: " onclicked: { console.debug('debug: user pressed '+musicdir+filename) playmusic.source = musicdir+filename playmusic.play() trackinfo.text = playmusic.metadata.albumartist+" - "+playmusic.metadata.title // show track meta data } } } }
it seems easiest thing here go c++ library can parse meta data out of these files , use create custom listmodel in c++ populates information onto itself. unfortunately, have done in c++ javascript not have io capabilities read , parse files.
Comments
Post a Comment