diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-01-11 15:50:19 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-01-11 15:50:19 (GMT) |
commit | 1a7234e3a27b592565241e9044919f7842fc5f08 (patch) | |
tree | f1827dc67e43e1a6565709db100aaca37cd82150 /src/3rdparty/phonon/mmf/abstractaudioeffect.h | |
parent | 894bb6e1742b75312feb7a18d043a67a3dba4cb9 (diff) | |
download | Qt-1a7234e3a27b592565241e9044919f7842fc5f08.zip Qt-1a7234e3a27b592565241e9044919f7842fc5f08.tar.gz Qt-1a7234e3a27b592565241e9044919f7842fc5f08.tar.bz2 |
Added a macro to reduce boilerplate code in Phonon MMF backend
Task-number: QTBUG-4659
Reviewed-by: Espen Riskedal
Diffstat (limited to 'src/3rdparty/phonon/mmf/abstractaudioeffect.h')
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractaudioeffect.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index 9e5a6eb..b34ad0d 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -103,6 +103,25 @@ private: } } + +// Macro for defining functions which depend on the native class name +// for each of the effects. Using this reduces repetition of boilerplate +// in the implementations of the backend effect nodes. + +#define PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(Effect) \ + \ +void Effect##::createEffect(AudioPlayer::NativePlayer *player) \ +{ \ + C##Effect *ptr = 0; \ + QT_TRAP_THROWING(ptr = C##Effect::NewL(*player)); \ + m_effect.reset(ptr); \ +} \ + \ +C##Effect* Effect::concreteEffect() \ +{ \ + return static_cast<C##Effect *>(m_effect.data()); \ +} + QT_END_NAMESPACE #endif |