activeX in .net - playlist problems
Posted: 01 Aug 2009 13:48
I'm not entirely sure what version of the activeX object I'm using (the object declaration is: Dim vlc As AxAXVLC.AxVLCPlugin2 = AxVLCPlugin21)
I'm trying to create a REALLY simple player that is completely controlled by backend code. I have a serial port connection that is firing in playlist items and the code for all this works fine, I can add items (from a directory on the pc) to the playlist and then play them all via my serial command line. No problems.
However, where I've now run into problems is when I want to simply append items to the playlist. All my code does is sit there waiting for an item reference to be passed. It then uses the passed filename and adds it to the playlist via vlc.playlist.add(item filename...). First problem I then ran into was that if I try to do a "if vlc.playlist.isplaying" check, I get an error, so I got around this by putting in a "first time" flag that does a "playlist.play()" command on the first item arriving and not again thereafter.
Basically then:
..and that's it. I add an item, it starts playing in the play window, all is fine. My "playlist count" increments by 1. I then pass another item (the first item is still playing... the playlist count goes up to two...) and nothing happens. The first item finishes playing and... nothing. Even though the playlist count is now 2 and I can see the items queued up, it just stops after playing the first item when I want it to simply run on and play the next item.
This seems such a basic and simple thing to do, I can only assume I've done something wrong in my coding, although I really cannot see what!
I'm trying to create a REALLY simple player that is completely controlled by backend code. I have a serial port connection that is firing in playlist items and the code for all this works fine, I can add items (from a directory on the pc) to the playlist and then play them all via my serial command line. No problems.
However, where I've now run into problems is when I want to simply append items to the playlist. All my code does is sit there waiting for an item reference to be passed. It then uses the passed filename and adds it to the playlist via vlc.playlist.add(item filename...). First problem I then ran into was that if I try to do a "if vlc.playlist.isplaying" check, I get an error, so I got around this by putting in a "first time" flag that does a "playlist.play()" command on the first item arriving and not again thereafter.
Basically then:
Code: Select all
dim firsttime as boolean = true
vlc.playlist.add(filename...)
if (firsttime) then
vlc.playlist.play()
firsttime=false
end if
This seems such a basic and simple thing to do, I can only assume I've done something wrong in my coding, although I really cannot see what!