javascript - Create multiple elements in QML XmlListModel -



javascript - Create multiple elements in QML XmlListModel -

i trying xml info qml xmllistmodel, i've gotten of working bit lost lastly part multiple category streams.

the xml looks this:

<root> <fullscreen>false</fullscreen> <aspectratio>default</aspectratio> <audiodelay>0</audiodelay> <apiversion>3</apiversion> <currentplid>4</currentplid> <time>1</time> <volume>0</volume> <length>9907</length> <random>false</random> <rate>1</rate> <state>paused</state> <loop>false</loop> <version>2.1.5 rincewind</version> <position>0.00018763827392831</position> <repeat>false</repeat> <subtitledelay>0</subtitledelay> <category name="meta"> <info name="title"> film </info> <info name="filename"> film </info> </category> <category name="stream 0"> <info name="type">video</info> <info name="frame rate">23.976215</info> <info name="decoded format">planar 4:2:0 yuv</info> <info name="codec">h264 - mpeg-4 avc (part 10) (avc1)</info> <info name="language">english</info> <info name="resolution">1024x542</info> </category> <category name="stream 1"> <info name="bitrate">384 kb/s</info> <info name="type">audio</info> <info name="channels">3f2r/lfe</info> <info name="sample rate">48000 hz</info> <info name="language">russian</info> <info name="codec">a52 sound (aka ac3) (a52 )</info> </category><category name="stream 6"><info name="description">full</info> <info name="type">subtitle</info> <info name="language">english</info> <info name="codec">text subtitles various tags (subt)</info> </category><category name="stream 3"><info name="description">forced</info> <info name="type">subtitle</info> <info name="language">russian</info> <info name="codec">text subtitles various tags (subt)</info> </category> <category name="stream 7"> <info name="description">sdh</info> <info name="type">subtitle</info> <info name="language">english</info> <info name="codec">text subtitles various tags (subt)</info> </category><category name="stream 5"><info name="description">forced</info> <info name="type">subtitle</info> <info name="language">english</info> <info name="codec">text subtitles various tags (subt)</info> </category> <category name="stream 4"> <info name="description">full</info> <info name="type">subtitle</info> <info name="language">russian</info> <info name="codec">text subtitles various tags (subt)</info> </category> <category name="stream 2"> <info name="codec">a52 sound (aka ac3) (a52 )</info> <info name="type">audio</info> <info name="language">english</info> <info name="sample rate">48000 hz</info> </category> </information> </root>

and got xmllistmodel working info out:

xmllistmodel{ id: xmlmodel query: "/root" xmlrole{ name: "fullscreen"; query: "fullscreen/string()"} xmlrole{ name: "aspectratio"; query: "aspectratio/string()"} xmlrole{ name: "audiodelay"; query: "audiodelay/string()"} xmlrole{ name: "currentplid"; query: "currentplid/string()"} xmlrole{ name: "time"; query: "time/string()"} xmlrole{ name: "volume"; query: "volume/string()"} xmlrole{ name: "length"; query: "length/string()"} xmlrole{ name: "random"; query: "random/string()"} xmlrole{ name: "rate"; query: "rate/string()"} xmlrole{ name: "state"; query: "state/string()"} xmlrole{ name: "loop"; query: "loop/string()"} xmlrole{ name: "repeat"; query: "repeat/string()"} xmlrole{ name: "subtitledelay"; query: "subtitledelay/string()"} xmlrole{ name: "artist"; query: "information/category/info[@name='artist']/string()"} xmlrole{ name: "album"; query: "information/category/info[@name='album']/string()"} xmlrole{ name: "filename"; query: "information/category/info[@name='filename']/string()"} //stream 0 hard-coded :( xmlrole{ name: "type"; query: "information/category[@name='stream 0']/info[@name='type']/string()"} }

all above info fine can't seem multiple stream information. depending on file there 2 streams or 10 if user has more sound tracks or subtitles. lastly line in xmllistmodel can lookup type of stream 0 needs hard-coded. trying find stream number type is.

is there way info xml using qml of streams?

thanks :)

javascript xml qml vlc

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -