Phonon Notifier wrapper.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Reviewer: Renato Araújo <renato.araujo@openbossa.org>
This commit is contained in:
parent
a7c7c9a76c
commit
acc0ce463c
4 changed files with 65 additions and 5 deletions
|
|
@ -371,6 +371,7 @@ QT_END_HEADER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Phonon
|
// Phonon
|
||||||
|
#include "phonon/pyside_phonon.h"
|
||||||
#include<phonon/abstractaudiooutput.h>
|
#include<phonon/abstractaudiooutput.h>
|
||||||
#include<phonon/abstractmediastream.h>
|
#include<phonon/abstractmediastream.h>
|
||||||
#include<phonon/abstractvideooutput.h>
|
#include<phonon/abstractvideooutput.h>
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumefadereffect_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumefaderinterface_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumefaderinterface_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumeslider_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumeslider_wrapper.cpp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_wrapper.cpp
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_wrapper.cpp
|
||||||
)
|
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendcapabilities_notifierwrapper_wrapper.cpp
|
||||||
|
|
||||||
set(phonon_GLUE_CODE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/glue/phonon_backendcapabilities_notifier_wrapper.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
execute_generator(phonon phonon_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${phonon_SOURCE_DIR}")
|
execute_generator(phonon phonon_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${phonon_SOURCE_DIR}")
|
||||||
|
|
|
||||||
39
PySide/phonon/pyside_phonon.h
Normal file
39
PySide/phonon/pyside_phonon.h
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
#ifndef PYSIDE_PHONON
|
||||||
|
#define PYSIDE_PHONON
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <phonon/backendcapabilities.h>
|
||||||
|
|
||||||
|
namespace Phonon
|
||||||
|
{
|
||||||
|
namespace BackendCapabilities
|
||||||
|
{
|
||||||
|
class NotifierWrapper : public QObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
inline static NotifierWrapper* notifier() {
|
||||||
|
Notifier* notifier = BackendCapabilities::notifier();
|
||||||
|
|
||||||
|
if (notifier != m_notifier) {
|
||||||
|
delete m_instance;
|
||||||
|
m_instance = new NotifierWrapper(notifier);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const QMetaObject* metaObject() const { return m_notifier->metaObject(); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
static NotifierWrapper* m_instance;
|
||||||
|
static Notifier* m_notifier;
|
||||||
|
|
||||||
|
NotifierWrapper(Notifier* notifier) { m_notifier = notifier; }
|
||||||
|
NotifierWrapper() {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -10,17 +10,40 @@
|
||||||
<rejection class="Phonon::Factory"/>
|
<rejection class="Phonon::Factory"/>
|
||||||
<rejection class="Phonon::Experimental"/>
|
<rejection class="Phonon::Experimental"/>
|
||||||
<rejection class="AudioOutputAdaptor"/>
|
<rejection class="AudioOutputAdaptor"/>
|
||||||
|
<rejection class="Phonon::BackendCapabilities::Notifier"/>
|
||||||
<rejection class="*" field-name="k_ptr"/>
|
<rejection class="*" field-name="k_ptr"/>
|
||||||
|
<rejection class="*" field-name="k_func"/>
|
||||||
|
|
||||||
<namespace-type name="Phonon">
|
<namespace-type name="Phonon">
|
||||||
<extra-includes>
|
<extra-includes>
|
||||||
<include file-name="phononnamespace.h" location="global"/>
|
<include file-name="phononnamespace.h" location="global"/>
|
||||||
</extra-includes>
|
</extra-includes>
|
||||||
</namespace-type>
|
</namespace-type>
|
||||||
<namespace-type name="Phonon::BackendCapabilities" />
|
<namespace-type name="Phonon::BackendCapabilities" >
|
||||||
|
<inject-code class="native">
|
||||||
|
Phonon::BackendCapabilities::NotifierWrapper* Phonon::BackendCapabilities::NotifierWrapper::m_instance = 0;
|
||||||
|
Phonon::BackendCapabilities::Notifier* Phonon::BackendCapabilities::NotifierWrapper::m_notifier = 0;
|
||||||
|
</inject-code>
|
||||||
|
|
||||||
|
<add-function signature="notifier()" return-type="Phonon::BackendCapabilities::NotifierWrapper">
|
||||||
|
<inject-code class="target">
|
||||||
|
Phonon::BackendCapabilities::NotifierWrapper *_notifierWrapper = Phonon::BackendCapabilities::NotifierWrapper::notifier();
|
||||||
|
%PYARG_0 = %CONVERTTOPYTHON[Phonon::BackendCapabilities::NotifierWrapper*](_notifierWrapper);
|
||||||
|
</inject-code>
|
||||||
|
</add-function>
|
||||||
|
</namespace-type>
|
||||||
|
|
||||||
<!-- ### causes moc-related linker error -->
|
<!-- ### causes moc-related linker error -->
|
||||||
<!-- <object-type name="Phonon::BackendCapabilities::Notifier"/> -->
|
<!-- <object-type name="Phonon::BackendCapabilities::Notifier"/> -->
|
||||||
|
<object-type name="Phonon::BackendCapabilities::NotifierWrapper" target-lang-name="Notifier">
|
||||||
|
<include file-name="backendcapabilities.h" location="global"/>
|
||||||
|
<include file-name="pyside_phonon.h" location="local"/>
|
||||||
|
|
||||||
|
<modify-function signature="notifier()" remove="all"/>
|
||||||
|
<modify-function signature="Phonon::BackendCapabilities::NotifierWrapper(Phonon::BackendCapabilities::Notifier*)">
|
||||||
|
<access modifier="private"/>
|
||||||
|
</modify-function>
|
||||||
|
</object-type>
|
||||||
|
|
||||||
<enum-type name="Phonon::Category" />
|
<enum-type name="Phonon::Category" />
|
||||||
<enum-type name="Phonon::DiscType"/>
|
<enum-type name="Phonon::DiscType"/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue