[Patch] Phonon: add 2 methods to Path

Tanguy Krotoff tkrotoff at gmail.com
Wed Sep 17 15:17:21 CEST 2008


Hello again

Here is a very small patch that adds 2 methods to Phonon::Path:
MediaNode *Path::sourceNode() const
MediaNode *Path::sinkNode() const

This is useful when manipulating several MediaObject/AudioOutput/...,
then you don't need to keep track of everything yourself, Path does it
for you:

	Phonon::MediaObject * mediaObject = new Phonon::MediaObject(this);

	QList<Phonon::Path> outputPaths = mediaObject->outputPaths();
	foreach (Phonon::Path outputPath, outputPaths) {
		Phonon::AudioOutput * audioOutput = dynamic_cast<Phonon::AudioOutput
*>(outputPath.sinkNode());
		if (audioOutput) {
			//blabla
		}
	}

I don't really understand why this 2 methods where not already there.

So if someone could simply tell me if it is OK or not...

Thanks in advance

-- 
Tanguy Krotoff <tkrotoff at gmail.com>
+33 6 68 42 70 24
-------------- next part --------------
A non-text attachment was scrubbed...
Name: path_source_sink_node.diff
Type: text/x-patch
Size: 1018 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/phonon-backends/attachments/20080917/0fd308c6/attachment.diff 


More information about the Phonon-backends mailing list