VSV as Playlist Format(research and development phase)
File extension: *.vpl
Criteria- simple, yet extensible
- basic features, incl. file, title, artist, duration
- advanced features, incl. repeat amount, gain, media start and end times, resume from last media played, associated files (such as subtitle or lyrics)
- optional metadata and general options
SectionsA playlist file is divided into sections marked by headers (which are not case sensitive). All sections are optional. If a file begins with no headers, it is implied to begin in the Main section. A section type can appear multiple times in the same file.
The [[Main]] section holds the list of media, including their filenames and other specific data.
The [[General]] section holds the metadata and general options.
Playlist dataData rows in the main section hold the playlist data. The general layout is a file row, followed by one or more rows that describe a file, including title, artist, duration, and additional optional properties, such as style and class. That means a file row signals the beginning of a new file subsection.
Some properties will hold data that will be applied for all subsequent files. So that one may apply the same title and artist for many files without the need to repeat. See below for these properties.
----
The 'f' property means file name, and is followed by a field that refers to a video file or another playlist file. The file can point to a local computer or remote address, such that the media player can access that file. As such, the file can be relative path, absolute path, or URL that can be handled by the media player.
If 'pathAll' is defined, every subsequent file is affixed by that property. The first data is prefix (will precede the file name), and second data is suffix (will follow the file name).
Ex.
`f`video-01.mp4
`f`video-02.mp4
`f`video-03.mp4
`f`video-04.mp4
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.02.rmvb
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.03.rmvb
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.04.rmvb
'pathAll'file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/'.rmvb
`f`Cooking.Beauties.01
`f`Cooking.Beauties.02
`f`Cooking.Beauties.03
`f`Cooking.Beauties.04
----
The 'fn' property creates a list of files using sequential numbers. The fields are the starting and ending numbers. If 1st field is omitted, starting number set to 1. If 2nd field is omitted or less than starting number, end number set to starting number. If you need to pad numbers with leading 0s, use 'pad' property before 'fn'
Ex.
-fn-1-154
This creates all the files from between 1 and 154. If pathAll property is also defined, numbers are inserted accordingly.
Ex.
,pathAll,file:///f:/media/anime/Major/Major ,.mp4
-pad-3
-fn--154
The file names that will be added to the playlist are:
file:///f:/media/anime/Major/Major 001,.mp4
file:///f:/media/anime/Major/Major 002,.mp4
file:///f:/media/anime/Major/Major 003,.mp4
...
file:///f:/media/anime/Major/Major 154,.mp4
Because of pad 3, the numbers are actually 001, 002, ... , 099, 100, ... , 154. Without pad, the numbers will be 1, 2, 3, ... 98, 99, 100.
----
The 'pad' property pads numbers with leading 0s for 'fn' property. That is, if the amount of digits in a number are shorter than pad, then extra 0s are added to the left until the number has that many digits.
See example above, in 'fn' property.
----
The 's' property means subtitle file, and is followed by a field that refers to a subtitle file or lyrics file.
Unfortunately, VLC only accepts local OS format to the subtitle file's path.
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`s`f:\media/Chinese\-Variety\Cooking Beauties 2018\Cooking.Beauties.01.vst
Note difference in file path format for VLC.
----
The 'd' property means duration. Format depends on media player. VLC supports seconds.
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`d`2700
----
The 't' property means title that will be displayed on the playlist panel or window, if supported by the media player.
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`t`Cooking Beauties 2018 - EP 01
----
The 'a' property means artist.
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`a`TVB
----
The 'p' property means publisher.
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`p`TVB
----
The 'desc' property means description. A blurb to describe the media.
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`desc`Beautiful women celebrities compete in cooking contest. But will their cooking be delicious or horrendous?
----
The 'id' property sets the track's id. Usage depends on whether in 'idAuto' or 'idManual' mode.
The 'idAuto' property sets id assignment to auto. This is default mode, and doesn't have to used unless you want to return to auto mode from 'idManual'.
The 'idManual' property sets id assignment to manual.
In auto mode, each file on the playlist is automatically assgined an id, starting at 1 and incremented by 1 as new files are added. Use the 'id' property to assign a file's id to that value and start counting from there for subsequent files.
In manual mode, each file has id 0 unless set with 'id' property.
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`id`1
----
The 'startPlayId' property picks the id of the file to start playing when the playlist is first loaded. In the id auto mode, the id starts at 1 to the maximum number of files on the list. The default value for startPlayId is 1--the first item on the playlist; a value that doesn't match any id will start playing at first file.
`startPlayId`3
`f`video-01.mp4
`f`video-02.mp4
`f`video-03.mp4
`f`video-04.mp4
will start playing at video-03.mp4.
----
The 'startPlayFile' property matches the filename to start playing when the playlist is first loaded. The data supplied can be a partial file name.
'startPlayFile' is not processed if 'startPlayId' is also supplied.
`startPlayFile`video-04
`f`video-01.mp4
`f`video-02.mp4
`f`video-03.mp4
`f`video-04.mp4
will start playing at video-04.mp4.
----
The 'startHere' property sets the current file id as the first file to be played. The last command found in the playlist between 'startHere' or 'startPlayId' will take priority; either of these commands will take priority before 'startPlayFile'.
`f`video-01.mp4
`f`video-02.mp4
`f`video-03.mp4
'startHere
`f`video-04.mp4
----
The 'func' properties allows passing special commands to the media player, including vendor specific options.
----
Global properties
The following properties apply the same data to all subsequent files if not specifically set for those files, until that property is invoked again to assign new data. Basically a fast way to assign the same data to an entire group of files, without repetitive text cluttering the playlist file, nor repetitive cut and paste.
Global properties are immediately assigned to any new file declared by 'f'.
'tAll' : same title
'aAll': same artist
'pAll': same publisher
'dAll': same duration
'descAll': same description
'pathAll': same path affixes
----
Substitution
Data can also be substituted into other data by enclosing the corresponding property name inside double brackets (any of the header brackets are valid).
Replacements should be defined beforehand.
{{f}}: substitute file (full path)
{{s}}: substitute subtitle file (full path)
{{t}}: substitute title
{{a}}: substitute artist
{{p}}: substitute publisher
{{d}}: substitute duration
{{id}}: substitute id
{{desc}}: substitute description
{{tAll}}: substitute global title
{{aAll}}: substitute global artist
{{pAll}}: substitute global publisher
{{descAll}}: substitute global description
`tAll`Cooking Beauties
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`t`{{tAll}}`part 01
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.02.rmvb
`t`{{tAll}}`part 02
will become:
Cooking Beauties - part 01
Cooking Beauties - part 02
`f`...
`a`S.H.E
`desc`Enjoy new hit single by {{a}}
In this case, `a` should be defined before `desc` can substitute it in. Else {{a}} will just be empty. You can also define global properties instead, also beforehand. So the following will also work:
`aAll`S.H.E
`f`...
`desc`Enjoy new hit single by {{a}}
In this case, `f` will immediately receive global properties, such as `aAll` before it. This implicitly defines `a` for this file. Thus, {{a}} will be available for substitution.
To represent a property that will be substituted later, enclose the substitution in another layer of double enclosed brackets.
`tAll`Cooking Beauties`{{{{id}}}}
`f`Cooking.Beauties.01.rmvb
`f`Cooking.Beauties.02.rmvb
will become:
Cooking Beauties - 1
Cooking Beauties - 2
In this case, 'tAll' has a code {{{{id}}}}. When this line is processed, this will reduce it to just {{id}}. When 'f' is processed, 'tAll' is passed down and also processed, but now with just {{id}}, which of course refers to the current file's id.
----
Variables
The 'var' property sets custom variables that can be substituted into other data by enclosing semicolon : and variable name in double brackets.
:var:baseTitle:Cooking Beauties
'tAll'{{:baseTitle}}'{{{{id}}}}
'desc'{{:baseTitle}} features {{a}}
----
Full ExamplesSimple playlists`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.02.rmvb
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.03.rmvb
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.04.rmvb
Complex playlists`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`t`Cooking Beauties 2018 - EP 01
`d`2700
`a`TVB
`p`TVB
`desc`Beautiful women celebrities compete in cooking contest. But will their cooking be delicious or horrendous?
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.02.rmvb
`t`Cooking Beauties 2018 - EP 02
`d`2700
`a`TVB
`p`TVB
`desc`Beautiful women celebrities compete in cooking contest. But will their cooking be delicious or horrendous?
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.03.rmvb
`t`Cooking Beauties 2018 - EP 03
`d`2700
`a`TVB
`p`TVB
`desc`Beautiful women celebrities compete in cooking contest. But will their cooking be delicious or horrendous?
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.04.rmvb
`t`Cooking Beauties 2018 - EP 04
`d`2700
`a`TVB
`p`TVB
`desc`Beautiful women celebrities compete in cooking contest. But will their cooking be delicious or horrendous?
Neater with *All properties and fn:
:var:baseTitle:Cooking Beauties 2018
,tAll,{{:baseTitle}},{{{{id}}}}
`aAll`TVB
,pAll,TVB
`descAll`Beautiful women celebrities compete in cooking contest. But will their cooking be delicious or horrendous?
`commentAll`Beautiful Cooking returns to a third season after nine years of hiatus.
'pathAll'file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.'.rmvb
-pad-2
-fn-1-21
,startPlayId,2
,tAll,Asheron's Call 2 Livestream ft. Shena'Fu,part {{{{id}}}}
,pathAll,https://www.youtube.com/watch?v=
`f`EZfbsT8FAQ4
`f`RysXIquKQwY
`f`iG-s9QhaQZQ
`f`NySeXRmeAEg
Multiple levels of substitution:
{{Main}}
`tAll`Cooking Beauties 2018`{{{{id}}}}
`aAll`TVB
,pAll,TVB
`descAll`Beautiful women celebrities compete in cooking contest. But will their cooking be delicious or horrendous?``{{{{t}}}} features {{{{a}}}}.
`commentAll`Beautiful Cooking returns to a third season after nine years of hiatus.
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.01.rmvb
`d`2700
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.02.rmvb
`d`2700
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.03.rmvb
`d`2700
`f`file:///f:/media/Chinese/-Variety/Cooking Beauties 2018/Cooking.Beauties.04.rmvb
`a`[[aAll]]`beauties
`p`[[pAll]]`partners
`d`2700
----
TBD: append supplementary playlists; should also append indexes
TBD: auto-generated files, i.e. 'smart' playlists. e.g. generate incremented ids in filenames (done); get all files in directory based on criteria
TBD: plugins for media players: Winamp
PluginsVPL playlist can be loaded in VLC via Lua extension:
https://bitbucket.org/Shenafu/vsv/src/master/playlist/