[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Phonon.AudioOutput is NOT a subclass of Phonon.MediaNode
From:       Jan Holthuis <jan () holmek ! de>
Date:       2008-11-30 12:58:52
Message-ID: 200811301358.59997.jan () holmek ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hello!
In Qt4, Phonon's AudioOutput-class inherits QObject and MediaNode:
http://doc.trolltech.com/4.4/phonon-audiooutput.html
In PyKDE4, AudioOutput does NOT inherit MediaNode, as you can easily
find out is you try something like this:

from PyKDE4.phonon import *
audiooutput = Phonon.AudioOutput(Phonon.MusicCategory)
print audiooutput.isValid()

This will throw an "AttributeError: isValid", but AudioOutput should have
inherited the isValid()-method from MediaNode. Because AudioOutput is
not a subclass of MediaNode, It's not possible to do something like this:

m_media = Phonon.MediaObject()
audioOutput = Phonon.AudioOutput(Phonon.MusicCategory)
Phonon.createPath(m_media,audioOutput)

The code above doesn't work. There is a "TypeError: argument 2 of
createPath() has an invalid type", because both arguments need to
be a (sub)class of MediaNode. MediaObject is, but AudioOutput isn't.

I'm fairly sure this is a bug and it needs to be fixed, but is there any
way to get around this problem at the moment?

I tried subclassing them:

class AudioOutput2(Phonon.AudioOutput,Phonon.MediaNode):
	def __init__(self,category=None,parent=None):
		Phonon.AudioOutput.__init__(self,category,parent)
		Phonon.MediaNode.__init__(self)

But now i'm getting something like this:

    Phonon.createPath(m_media,audioOutput)
SystemError: error return without exception set

Can anyone help me?

Thanks in advance,
Jan Holthuis

["signature.asc" (application/pgp-signature)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic