Bug 188315

Summary: Python: Phonon: VideoWidget and AudioOutput are missing base classes (breaks createPath)
Product: [Developer tools] bindings Reporter: Carlos Corbacho <carlos>
Component: generalAssignee: kde-bindings
Status: RESOLVED FIXED    
Severity: normal CC: simon
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Fix PyKDE4 Phonon Python bindings

Description Carlos Corbacho 2009-03-28 12:10:48 UTC
Version:            (using KDE 4.2.1)
Compiler:          GCC 4.3.3 
OS:                Linux
Installed from:    Slackware Packages

Steps to reproduce:

Trying to do something simple like the following (I've cut out the rest of the relevant PyQT4/ PyKDE4 imports):

from PyKDE4.phonon import Phonon

class MyVideoPlayer(kdeui.KMainWindow):

    def __init__(self, parent=None):
        self.video_widget = phonon.Phonon.VideoWidget()
        self.media_object = phonon.Phonon.MediaObject()
        phonon.Phonon.createPath(self.media_object, self.video_widget)

Expected:

It works

Actual:

createPath() throws:

TypeError: argument 2 of createPath() has an invalid type

VideoWidget and AudioOutput in the Python bindings are missing base classes, so do not inherit 
from MediaNode. If you look at the C++ documentation, VideoWidget needs 
to inherit from Phonon::AbstractVideoOutput as well as QWidget, and 
AudioOutput needs to inherit from Phonon::AbstractAudioOutput (and PyKDE4 doesn't even have a binding for AbstractAudiOutput yet).

The patch is trivial (to follow).

This bug is still present in trunk as well as 4.2.1 - it would be nice to fix 
this on the 4.2 branch as well for the next 4.2 release, but fixing it on 
trunk would be enough.
Comment 1 Carlos Corbacho 2009-03-28 12:12:30 UTC
Created attachment 32444 [details]
Fix PyKDE4 Phonon Python bindings

This patch adds a binding for Phonon::AbstractAudioOutput, and adds the missing base classes to the AudioOutput and VideoWidget bindings.
Comment 2 Carlos Corbacho 2009-08-29 13:15:40 UTC
Simon,

I'm adding you to CC: here as I believe the Python bindings are your territory?

However, this might be a bug in twine - the sime_pykde4{2,3}.prj files appear to do strange things with these files & classes, so the real issue might be there (I don't understand the project files or Twine enough to know what it's trying to do here).
Comment 3 Luca Beltrame 2011-04-16 10:20:05 UTC
SVN commit 1228245 by lbeltrame:

Unbreak Python Phonon bindings. Now it is possible to use a VideoWidget again with a MediaSource object, which would throw a TypeError earlier (this was due to a missing inheritance of a class). My testing confirms that it now works.
Original patch by Carlos Corbacho (with minimal changes on my part). Thanks!

BUG: 188315



 M  +1 -1      audiooutput.sip  
 M  +4 -1      videowidget.sip  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1228245
Comment 4 Luca Beltrame 2011-04-16 10:25:24 UTC
Git commit a5db3ab2ccf05bd70649e831386fe2320319a336 by Luca Beltrame.
Committed on 16/04/2011 at 10:30.
Pushed by lbeltrame into branch 'master'.

Forward port SVN r1228245 to PyKDE4 git master:

Unbreak Python Phonon bindings. Now it is possible to use a VideoWidget again with a MediaSource object, which would throw a TypeError earlier (this was dueto a missing inheritance of a class). My testing confirms that it now  works.
Original patch by Carlos Corbacho (with minimal changes on my part).
Thanks!

CCBUG: 188315

M  +1    -1    sip/phonon/audiooutput.sip     
M  +4    -1    sip/phonon/videowidget.sip     

http://commits.kde.org/pykde4/a5db3ab2ccf05bd70649e831386fe2320319a336