Programmatically controlling VLC (via C# and/or Telnet)

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
jakewharton
New Cone
New Cone
Posts: 1
Joined: 09 Sep 2006 09:40
Contact:

Programmatically controlling VLC (via C# and/or Telnet)

Postby jakewharton » 09 Sep 2006 09:46

I have an application which manages an audio/video library and a playlist. Currently I run VLC via a Process with arguments to play a playlist of the file and "vlc:quit" to close the application when the file has ended. The problem is the Exiting event does not fire when vlc closes itself so I do not know when to start the next file. I began to dabble in the telnet interface but lacking a decent guide I couldn't get it to work. If anyone has any suggestions regarding either of these two methods or perhaps a better method, it would be greatly appreciated.

Rozis
Blank Cone
Blank Cone
Posts: 14
Joined: 07 Sep 2006 23:21
Contact:

Postby Rozis » 12 Sep 2006 01:41

I'm doing much the same thing, so maybe i can help if your're using Windows. Then i would expect you called Vlc via the Windows API-function Createproccess(), You could wait for Vlc to stop using waitforsingleobject(). Although i program all my code in Visual Objects here is the source:

method wait(floatseconds,lkill) class runapp
local dwresult,dwhowlong as dword
dwhowlong:=if(IsNil(floatseconds),infinite,floatseconds*1000)
dwresult:=waitforsingleobject(self:phandle,dwhowlong)
if dwresult=wait_timeout
if lkill
return self:kill() //Program takes too much time: kill it
endif
else
if self:houtput!=null_ptr // if output was redirected restore it
CloseHandle(self:houtput)
self:houtput:=null_ptr
endif
if self:hinput!=null_ptr // if input was redirected restore it
CloseHandle(self:hinput)
self:hinput:=null_ptr
endif
endif
return .t.

Just give me a yell if you need more help...

Rozis


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 64 guests