Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 21st, 2012, 02:15 PM
JeffHoogland JeffHoogland is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 1 JeffHoogland User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 43 sec
Reputation Power: 0
Trouble with VLC Binding's event_attach

I'm using the VLC python bindings found here -> http://wiki.videolan.org/Python_bindings

I've also been reading over the excellent API documentation found here -> http://liris.cnrs.fr/advene//download/python-ctypes/doc/

The thing that is currently escaping me though - how do I have an event fire when a song ends? I'm assuming it has to do with EventType.MediaPlayerEndReached - but could anyone out there provide a small example on how to utilize this event? The proper syntax escapes me.

For reference a small bit of code I am trying that is failing:

Code:
>>> mymedia = MediaList()
>>> mymedia.add_media("/path/to/mediafile1")
0
>>> mymedia.add_media("/path/to/mediafile2")
0
>>> player = MediaListPlayer()
>>> player.set_media_list(mymedia)
>>> pevent = player.event_manager()
>>> def event_cb( ev ):
	print "Hey look an event..."
>>> pevent.event_attach(EventType().MediaPlayerMediaChanged, event_cb)
-1


When I tell my player to play the media comes up just fine - but the event doesn't fire when I change tracks. I'm assuming it has to do with the returning -1 from the event_attach - what am I doing wrong?

Regards,
~Jeff

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Trouble with VLC Binding's event_attach

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap