Implement "loop" command.

This command allows looping the playlist by just passing the command "loop on". Respectively, "loop off" turns off looping again.
develop
Icedream 2015-10-27 23:54:01 +01:00
parent 0762d6d0bd
commit d82721128f
1 changed files with 18 additions and 0 deletions

View File

@ -205,6 +205,24 @@ ts3clientService.on "started", (ts3proc) =>
# play it in VLC # play it in VLC
vlc.play info.url vlc.play info.url
when "loop"
inputBB = paramline
input = null
switch (removeBB paramline).toLowerCase().trim()
when ""
# just show current mode
ts3query.sendtextmessage args.targetmode, invoker.id, "Playlist looping is #{if vlc.playlist.mode == vlc.playlist.Loop then "on" else "off"}."
when "on"
# enable looping
vlc.playlist.mode = vlc.playlist.Loop
ts3query.sendtextmessage args.targetmode, invoker.id, "Playlist looping is now on."
when "off"
# disable looping
vlc.playlist.mode = vlc.playlist.Normal
ts3query.sendtextmessage args.targetmode, invoker.id, "Playlist looping is now off."
else
ts3query.sendtextmessage args.targetmode, invoker.id, "[B]#{name} on|off[/B] - Turns playlist looping on or off"
return
when "next" when "next"
vlc.playlist.next() vlc.playlist.next()
when "prev", "previous" when "prev", "previous"