Reset playlist on vlc.stop() control...?

About usage, announcement and development of skins for VLC
tvtalkshowshigh
Blank Cone
Blank Cone
Posts: 95
Joined: 13 Jun 2005 12:36
Location: UK

Reset playlist on vlc.stop() control...?

Postby tvtalkshowshigh » 12 Feb 2006 14:52

is there a way to send VLC back to the top of the playlist in skins2?

i'm not actaully showing the playlist on screen, i just want it so that when the stop button is pressed VLC resets the playlist to item 1 rather than just the beginning of the current playlist item. is this possible?

i could work around it if i could have more than one control action from a button - is there syntax for this? i tried this but it vlc just refused to load the skin:

Code: Select all

<Button x="35" y="260" up="stop_up" down="stop_down" over="stop_up" action="vlc.stop()" action="playlist.previous()" tooltiptext="Stop"/>

thanks in advance,

mark.[/code]

ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

Postby ipkiss » 12 Feb 2006 18:21

Extract from http://www.videolan.org/vlc/skins2-create.html#actions:
It is possible to run several actions at once, by separating them with ';'. Example: action="playlist_id.hide(); main_window_id.setLayout(main_layout)"
There is no "playlist.rewind()" action though.
But why do you want to force this uncommon behaviour?

tvtalkshowshigh
Blank Cone
Blank Cone
Posts: 95
Joined: 13 Jun 2005 12:36
Location: UK

Postby tvtalkshowshigh » 12 Feb 2006 19:13

But why do you want to force this uncommon behaviour?
i'm using VLC simply as a CD player. The device will be used by one person and they may leave it half way through the CD and then walk off. The next person who comes to use the system will want to hear the CD from the beginning.

It seemed like a perfectly reasonable thing to want to do, but evidently not...

I'll post full details of the project once we have a working version (a couple of weeks), it's basically a miniITX box with a touch screen interface running vlc. It'll be used to demo music CDs to journalists etc. Once we make some money from it some of it will certainly be winging its way to videolan - you guys rock! :)


thanks for the tip about multiple actions, with this i can just add lots of action="playlist.previous()" commands to the stop button. The playlist.previous action doesn't loop back around the playlist so once it gets to the begginng it will just reset to track 1.

cheers,

mark.
Last edited by tvtalkshowshigh on 12 Feb 2006 19:38, edited 1 time in total.

tvtalkshowshigh
Blank Cone
Blank Cone
Posts: 95
Joined: 13 Jun 2005 12:36
Location: UK

Postby tvtalkshowshigh » 12 Feb 2006 19:37

this is just odd...

my plan to have multiple instances of the playlist.previous() action and then a vlc.stop() action didn't work; vlc just stopped and then next time play was pressed it carried on from the track it was on last.

for some reason this resets to the beggining of the playlist and then carries on playing - how??? surely it should do the same as pressing the stop button and then the play button...?

Code: Select all

action="vlc.stop(); vlc.play()"
in fact, it only does as described above if vlc is playing or paused. if vlc is stopped it just plays from whichever track it was stopped on.

this on the other hand does what would happen if you just pressed the stop button, which is kind of what i expected.

Code: Select all

action="vlc.stop(); vlc.play(); vlc.stop()"
what order does VLC parse the actions in? does it just ignore duplciates?

mark.

ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

Postby ipkiss » 13 Feb 2006 07:48

in fact, it only does as described above if vlc is playing or paused. if vlc is stopped it just plays from whichever track it was stopped on.
It seems that going to the previous or next playlist item does not work when the input is stopped (even with the wxWidgets interface). I think this is a bug in VLC.
what order does VLC parse the actions in? does it just ignore duplciates?
The actions are parsed and executed in the correct order (the definition order in the XML file). Duplicates are not ignored.

BTW, going to the previous playlist item, when the first one is playing, loops and goes to the last playlist item. For me this is another bug, the behaviour should depend on the "Repeat all" preference.

tvtalkshowshigh
Blank Cone
Blank Cone
Posts: 95
Joined: 13 Jun 2005 12:36
Location: UK

Postby tvtalkshowshigh » 13 Feb 2006 09:25

i'd agree with both of those "bugs" ipkiss. the repeat flag should apply to all navigation functions, not just playback.

this is the xml i've used to acheive the functionality i'm after. I've set my on-screen display of trackname and time etc to only be visible when vlc.isPlaying so it disapears when "stop" (pause) is pressed. The only problem with this is that i can't have a pause button - at the moment we don't need this anyway though.

Code: Select all

<Button x="35" y="260" up="stop_up" down="stop_down" over="stop_up" action="vlc.pause()" /> <Button x="70" y="360" up="play_up" down="play_down" over="play_up" action="vlc.stop(); vlc.play()" />

i've have another play tonight and see if i can get it to skip to the previous track and then stop, because at the moment any combination of playlist.previous() and vlc.stop() just has the effect of stopping playback and doesn't change track at all.

cheers,

mark.

tonsofpcs
Cone that earned his stripes
Cone that earned his stripes
Posts: 363
Joined: 04 Jan 2006 10:03
Location: Binghamton, NY, USA
Contact:

Postby tonsofpcs » 14 Feb 2006 19:26

Why does your stop button call pause, and why does your play button call stop then pause? Anyway, try going back two tracks when 'stopped' (paused) and then play to go back one.

tvtalkshowshigh
Blank Cone
Blank Cone
Posts: 95
Joined: 13 Jun 2005 12:36
Location: UK

Postby tvtalkshowshigh » 14 Feb 2006 21:27

Why does your stop button call pause, and why does your play button call stop then pause?
because if i set stop to call stop and play to call play then pressing stop and then play would just restart the track rather than restarting the entire playlist.

with the xml as it's shown above pressing stop has the effect (as far as the user is concerned) of stopping playback. When play is pressed it restarts the playlist - i should probably rename that play button as "restart" or something like that. The idea is to use VLC to drive a touch-screen kiosk cd player so pause is unlikely to be needed.

Code: Select all

<Button x="35" y="260" up="stop_up" down="stop_down" over="stop_up" action="playlist.previous(); playlist.previous(); vlc.pause()" /> <Button x="70" y="360" up="play_up" down="play_down" over="play_up" action="vlc.play()" />
more strange behaviour with the xml above... pushing "stop" now skips back 1 track and plays - this is particularly interesting since vlc.isPaused thinks it's true!!! (my track name info dissapears)

tonsofpcs
Cone that earned his stripes
Cone that earned his stripes
Posts: 363
Joined: 04 Jan 2006 10:03
Location: Binghamton, NY, USA
Contact:

Postby tonsofpcs » 15 Feb 2006 06:05

I suggested the double 'go previous' to go back a single track in the playlist because, as most media players work, when you are in a playback mode on a track (ie: not stopped), you need to press back once to go to the beginning of the track, and then again to go to the previous track. Go try this out on your regular CD player.

Anyway, as for your restart, since this will be a fixed kiosk, why not set the restart button to playlistClear then re-add the media? This would also be useful to cause it to reload a disc if an update needs to occur.

tvtalkshowshigh
Blank Cone
Blank Cone
Posts: 95
Joined: 13 Jun 2005 12:36
Location: UK

Postby tvtalkshowshigh » 15 Feb 2006 09:02

I suggested the double 'go previous' to go back a single track in the playlist because, as most media players work, when you are in a playback mode on a track (ie: not stopped), you need to press back once to go to the beginning of the track, and then again to go to the previous track. Go try this out on your regular CD player.
oh, i see. sorry. that's obvious now but i missed it when reading your post before. The skip forward and backward buttons work fine - unlike a normal CD player VLC does actually skip back to the previous track rather than the beginning of the current track.

I'll have a go at reloading the whole playlist - i presume this is done with the playlist.del and playlist.add controls, but what's the syntax? playlist.del(myplaylist.m3u) doesn't seem to do anything or give any errors...

mark.

tonsofpcs
Cone that earned his stripes
Cone that earned his stripes
Posts: 363
Joined: 04 Jan 2006 10:03
Location: Binghamton, NY, USA
Contact:

Postby tonsofpcs » 16 Feb 2006 00:48

I'm not exactly sure, I usually deal with the ActiveX stuff, and there it is playlistClear and addTarget


Return to “Skins”

Who is online

Users browsing this forum: No registered users and 80 guests