Use Q_CONSTRUCTOR_FUNCTION macro to register multimedia meta types.

Task-number: QTBUG-39131
Change-Id: I2493c9e3e6f0065d0441a74ff240d7d91fbe059c
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
Yoann Lopes
2014-05-26 16:20:49 +02:00
committed by The Qt Project
parent 5a0e49369d
commit efa4628e74
25 changed files with 147 additions and 268 deletions

View File

@@ -45,23 +45,15 @@
QT_BEGIN_NAMESPACE
namespace QAudio
static void qRegisterAudioMetaTypes()
{
class RegisterMetaTypes
{
public:
RegisterMetaTypes()
{
qRegisterMetaType<QAudio::Error>();
qRegisterMetaType<QAudio::State>();
qRegisterMetaType<QAudio::Mode>();
}
} _register;
qRegisterMetaType<QAudio::Error>();
qRegisterMetaType<QAudio::State>();
qRegisterMetaType<QAudio::Mode>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioMetaTypes)
/*!
\namespace QAudio
\brief The QAudio namespace contains enums used by the audio classes.

View File

@@ -47,18 +47,14 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterAudioBufferMetaTypes()
{
class QAudioBufferPrivateRegisterMetaTypes
{
public:
QAudioBufferPrivateRegisterMetaTypes()
{
qRegisterMetaType<QAudioBuffer>();
}
} _registerMetaTypes;
qRegisterMetaType<QAudioBuffer>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioBufferMetaTypes)
class QAudioBufferPrivate : public QSharedData
{

View File

@@ -72,19 +72,14 @@ QT_BEGIN_NAMESPACE
\sa QAudioBuffer
*/
namespace
static void qRegisterAudioDecoderMetaTypes()
{
class AudioDecoderRegisterMetaTypes
{
public:
AudioDecoderRegisterMetaTypes()
{
qRegisterMetaType<QAudioDecoder::State>("QAudioDecoder::State");
qRegisterMetaType<QAudioDecoder::Error>("QAudioDecoder::Error");
}
} _registerPlayerMetaTypes;
qRegisterMetaType<QAudioDecoder::State>("QAudioDecoder::State");
qRegisterMetaType<QAudioDecoder::Error>("QAudioDecoder::Error");
}
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioDecoderMetaTypes)
class QAudioDecoderPrivate : public QMediaObjectPrivate
{
Q_DECLARE_NON_CONST_PUBLIC(QAudioDecoder)

View File

@@ -47,18 +47,13 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterAudioDeviceInfoMetaTypes()
{
class QAudioInfoPrivateRegisterMetaTypes
{
public:
QAudioInfoPrivateRegisterMetaTypes()
{
qRegisterMetaType<QAudioDeviceInfo>();
}
} _registerMetaTypes;
qRegisterMetaType<QAudioDeviceInfo>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioDeviceInfoMetaTypes)
class QAudioDeviceInfoPrivate : public QSharedData
{
public:

View File

@@ -44,20 +44,14 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterAudioFormatMetaTypes()
{
class QAudioFormatPrivateRegisterMetaTypes
{
public:
QAudioFormatPrivateRegisterMetaTypes()
{
qRegisterMetaType<QAudioFormat>();
qRegisterMetaType<QAudioFormat::SampleType>();
qRegisterMetaType<QAudioFormat::Endian>();
}
} _registerMetaTypes;
qRegisterMetaType<QAudioFormat>();
qRegisterMetaType<QAudioFormat::SampleType>();
qRegisterMetaType<QAudioFormat::Endian>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterAudioFormatMetaTypes)
class QAudioFormatPrivate : public QSharedData
{

View File

@@ -56,26 +56,21 @@
#include <QDebug>
namespace
QT_BEGIN_NAMESPACE
static void qRegisterCameraMetaTypes()
{
class CameraRegisterMetaTypes
{
public:
CameraRegisterMetaTypes()
{
qRegisterMetaType<QCamera::Error>("QCamera::Error");
qRegisterMetaType<QCamera::State>("QCamera::State");
qRegisterMetaType<QCamera::Status>("QCamera::Status");
qRegisterMetaType<QCamera::CaptureModes>("QCamera::CaptureModes");
qRegisterMetaType<QCamera::LockType>("QCamera::LockType");
qRegisterMetaType<QCamera::LockStatus>("QCamera::LockStatus");
qRegisterMetaType<QCamera::LockChangeReason>("QCamera::LockChangeReason");
qRegisterMetaType<QCamera::Position>("QCamera::Position");
}
} _registerCameraMetaTypes;
qRegisterMetaType<QCamera::Error>("QCamera::Error");
qRegisterMetaType<QCamera::State>("QCamera::State");
qRegisterMetaType<QCamera::Status>("QCamera::Status");
qRegisterMetaType<QCamera::CaptureModes>("QCamera::CaptureModes");
qRegisterMetaType<QCamera::LockType>("QCamera::LockType");
qRegisterMetaType<QCamera::LockStatus>("QCamera::LockStatus");
qRegisterMetaType<QCamera::LockChangeReason>("QCamera::LockChangeReason");
qRegisterMetaType<QCamera::Position>("QCamera::Position");
}
QT_BEGIN_NAMESPACE
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraMetaTypes)
/*!
\class QCamera

View File

@@ -65,20 +65,14 @@ QT_BEGIN_NAMESPACE
//#define DEBUG_EXPOSURE_CHANGES 1
namespace
static void qRegisterCameraExposureMetaTypes()
{
class CameraExposureRegisterMetaTypes
{
public:
CameraExposureRegisterMetaTypes()
{
qRegisterMetaType<QCameraExposure::ExposureMode>("QCameraExposure::ExposureMode");
qRegisterMetaType<QCameraExposure::FlashModes>("QCameraExposure::FlashModes");
qRegisterMetaType<QCameraExposure::MeteringMode>("QCameraExposure::MeteringMode");
}
} _registerCameraExposureMetaTypes;
qRegisterMetaType<QCameraExposure::ExposureMode>("QCameraExposure::ExposureMode");
qRegisterMetaType<QCameraExposure::FlashModes>("QCameraExposure::FlashModes");
qRegisterMetaType<QCameraExposure::MeteringMode>("QCameraExposure::MeteringMode");
}
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraExposureMetaTypes)
class QCameraExposurePrivate

View File

@@ -55,19 +55,15 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterCameraFocusMetaTypes()
{
class CameraFocusRegisterMetaTypes
{
public:
CameraFocusRegisterMetaTypes()
{
qRegisterMetaType<QCameraFocus::FocusModes>("QCameraFocus::FocusModes");
qRegisterMetaType<QCameraFocus::FocusPointMode>("QCameraFocus::FocusPointMode");
}
} _registerCameraFocusMetaTypes;
qRegisterMetaType<QCameraFocus::FocusModes>("QCameraFocus::FocusModes");
qRegisterMetaType<QCameraFocus::FocusPointMode>("QCameraFocus::FocusPointMode");
}
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraFocusMetaTypes)
class QCameraFocusFakeZoomControl : public QCameraZoomControl
{
public:

View File

@@ -83,20 +83,15 @@ QT_BEGIN_NAMESPACE
\value CaptureToBuffer Capture the image to a buffer for further processing.
*/
namespace
static void qRegisterCameraImageCaptureMetaTypes()
{
class MediaRecorderRegisterMetaTypes
{
public:
MediaRecorderRegisterMetaTypes()
{
qRegisterMetaType<QCameraImageCapture::Error>("QCameraImageCapture::Error");
qRegisterMetaType<QCameraImageCapture::CaptureDestination>("QCameraImageCapture::CaptureDestination");
qRegisterMetaType<QCameraImageCapture::CaptureDestinations>("QCameraImageCapture::CaptureDestinations");
}
} _registerRecorderMetaTypes;
qRegisterMetaType<QCameraImageCapture::Error>("QCameraImageCapture::Error");
qRegisterMetaType<QCameraImageCapture::CaptureDestination>("QCameraImageCapture::CaptureDestination");
qRegisterMetaType<QCameraImageCapture::CaptureDestinations>("QCameraImageCapture::CaptureDestinations");
}
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraImageCaptureMetaTypes)
class QCameraImageCapturePrivate
{

View File

@@ -52,20 +52,15 @@
#include <QtCore/QDebug>
namespace
{
class QCameraImageProcessingPrivateRegisterMetaTypes
{
public:
QCameraImageProcessingPrivateRegisterMetaTypes()
QT_BEGIN_NAMESPACE
static void qRegisterCameraImageProcessingMetaTypes()
{
qRegisterMetaType<QCameraImageProcessing::WhiteBalanceMode>();
}
} _registerMetaTypes;
}
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraImageProcessingMetaTypes)
QT_BEGIN_NAMESPACE
/*!
\class QCameraImageProcessing

View File

@@ -44,18 +44,13 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterCameraImageProcessingControlMetaTypes()
{
class QCameraImageProcessingControlPrivateRegisterMetaTypes
{
public:
QCameraImageProcessingControlPrivateRegisterMetaTypes()
{
qRegisterMetaType<QCameraImageProcessingControl::ProcessingParameter>();
}
} _registerMetaTypes;
qRegisterMetaType<QCameraImageProcessingControl::ProcessingParameter>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterCameraImageProcessingControlMetaTypes)
/*!
\class QCameraImageProcessingControl
\inmodule QtMultimedia

View File

@@ -44,18 +44,14 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterMediaStreamControlMetaTypes()
{
class QMediaStreamsControlPrivateRegisterMetaTypes
{
public:
QMediaStreamsControlPrivateRegisterMetaTypes()
{
qRegisterMetaType<QMediaStreamsControl::StreamType>();
}
} _registerMetaTypes;
qRegisterMetaType<QMediaStreamsControl::StreamType>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaStreamControlMetaTypes)
/*!
\class QMediaStreamsControl
\inmodule QtMultimedia

View File

@@ -48,18 +48,13 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterMediaContentMetaTypes()
{
class QMediaContentPrivateRegisterMetaTypes
{
public:
QMediaContentPrivateRegisterMetaTypes()
{
qRegisterMetaType<QMediaContent>();
}
} _registerMetaTypes;
qRegisterMetaType<QMediaContent>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaContentMetaTypes)
class QMediaContentPrivate : public QSharedData
{

View File

@@ -90,20 +90,16 @@ QT_BEGIN_NAMESPACE
\sa QMediaObject, QMediaService, QVideoWidget, QMediaPlaylist
*/
namespace
static void qRegisterMediaPlayerMetaTypes()
{
class MediaPlayerRegisterMetaTypes
{
public:
MediaPlayerRegisterMetaTypes()
{
qRegisterMetaType<QMediaPlayer::State>("QMediaPlayer::State");
qRegisterMetaType<QMediaPlayer::MediaStatus>("QMediaPlayer::MediaStatus");
qRegisterMetaType<QMediaPlayer::Error>("QMediaPlayer::Error");
}
} _registerPlayerMetaTypes;
qRegisterMetaType<QMediaPlayer::State>("QMediaPlayer::State");
qRegisterMetaType<QMediaPlayer::MediaStatus>("QMediaPlayer::MediaStatus");
qRegisterMetaType<QMediaPlayer::Error>("QMediaPlayer::Error");
}
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaPlayerMetaTypes)
#define MAX_NESTED_PLAYLISTS 16
class QMediaPlayerPrivate : public QMediaObjectPrivate

View File

@@ -61,19 +61,14 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, playlistIOLoader,
(QMediaPlaylistIOInterface_iid, QLatin1String("playlistformats"), Qt::CaseInsensitive))
namespace
static void qRegisterMediaPlaylistMetaTypes()
{
class QMediaPlaylistPrivateRegisterMetaTypes
{
public:
QMediaPlaylistPrivateRegisterMetaTypes()
{
qRegisterMetaType<QMediaPlaylist::Error>();
qRegisterMetaType<QMediaPlaylist::PlaybackMode>();
}
} _registerMetaTypes;
qRegisterMetaType<QMediaPlaylist::Error>();
qRegisterMetaType<QMediaPlaylist::PlaybackMode>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaPlaylistMetaTypes)
/*!
\class QMediaPlaylist

View File

@@ -47,19 +47,15 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterMediaResourceMetaTypes()
{
class QMediaResourcePrivateRegisterMetaTypes
{
public:
QMediaResourcePrivateRegisterMetaTypes()
{
qRegisterMetaType<QMediaResource>();
qRegisterMetaType<QMediaResourceList>();
}
} _registerMetaTypes;
qRegisterMetaType<QMediaResource>();
qRegisterMetaType<QMediaResourceList>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaResourceMetaTypes)
/*!
\class QMediaResource

View File

@@ -41,21 +41,17 @@ QT_BEGIN_NAMESPACE
*/
namespace
static void qRegisterMultimediaMetaTypes()
{
class QMultimediaNamespacePrivateRegisterMetaTypes
{
public:
QMultimediaNamespacePrivateRegisterMetaTypes()
{
qRegisterMetaType<QMultimedia::AvailabilityStatus>();
qRegisterMetaType<QMultimedia::SupportEstimate>();
qRegisterMetaType<QMultimedia::EncodingMode>();
qRegisterMetaType<QMultimedia::EncodingQuality>();
}
} _registerMetaTypes;
qRegisterMetaType<QMultimedia::AvailabilityStatus>();
qRegisterMetaType<QMultimedia::SupportEstimate>();
qRegisterMetaType<QMultimedia::EncodingMode>();
qRegisterMetaType<QMultimedia::EncodingQuality>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterMultimediaMetaTypes)
/*!
\enum QMultimedia::SupportEstimate

View File

@@ -50,20 +50,15 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterRadioDataMetaTypes()
{
class QRadioDataPrivateRegisterMetaTypes
{
public:
QRadioDataPrivateRegisterMetaTypes()
{
qRegisterMetaType<QRadioData::Error>();
qRegisterMetaType<QRadioData::ProgramType>();
}
} _registerMetaTypes;
qRegisterMetaType<QRadioData::Error>();
qRegisterMetaType<QRadioData::ProgramType>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterRadioDataMetaTypes)
/*!
\class QRadioData
\brief The QRadioData class provides interfaces to the RDS functionality of the system radio.

View File

@@ -52,22 +52,17 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterRadioTunerMetaTypes()
{
class QRadioTunerPrivateRegisterMetaTypes
{
public:
QRadioTunerPrivateRegisterMetaTypes()
{
qRegisterMetaType<QRadioTuner::Band>();
qRegisterMetaType<QRadioTuner::Error>();
qRegisterMetaType<QRadioTuner::SearchMode>();
qRegisterMetaType<QRadioTuner::State>();
qRegisterMetaType<QRadioTuner::StereoMode>();
}
} _registerMetaTypes;
qRegisterMetaType<QRadioTuner::Band>();
qRegisterMetaType<QRadioTuner::Error>();
qRegisterMetaType<QRadioTuner::SearchMode>();
qRegisterMetaType<QRadioTuner::State>();
qRegisterMetaType<QRadioTuner::StereoMode>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterRadioTunerMetaTypes)
/*!
\class QRadioTuner

View File

@@ -43,20 +43,16 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterEncoderSettingsMetaTypes()
{
class QMediaEncoderSettingsPrivateRegisterMetaTypes
{
public:
QMediaEncoderSettingsPrivateRegisterMetaTypes()
{
qRegisterMetaType<QAudioEncoderSettings>();
qRegisterMetaType<QVideoEncoderSettings>();
qRegisterMetaType<QImageEncoderSettings>();
}
} _registerMetaTypes;
qRegisterMetaType<QAudioEncoderSettings>();
qRegisterMetaType<QVideoEncoderSettings>();
qRegisterMetaType<QImageEncoderSettings>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterEncoderSettingsMetaTypes)
class QAudioEncoderSettingsPrivate : public QSharedData
{
public:

View File

@@ -80,20 +80,16 @@ QT_BEGIN_NAMESPACE
\sa QAudioRecorder
*/
namespace
static void qRegisterMediaRecorderMetaTypes()
{
class MediaRecorderRegisterMetaTypes
{
public:
MediaRecorderRegisterMetaTypes()
{
qRegisterMetaType<QMediaRecorder::State>("QMediaRecorder::State");
qRegisterMetaType<QMediaRecorder::Status>("QMediaRecorder::Status");
qRegisterMetaType<QMediaRecorder::Error>("QMediaRecorder::Error");
}
} _registerRecorderMetaTypes;
qRegisterMetaType<QMediaRecorder::State>("QMediaRecorder::State");
qRegisterMetaType<QMediaRecorder::Status>("QMediaRecorder::Status");
qRegisterMetaType<QMediaRecorder::Error>("QMediaRecorder::Error");
}
Q_CONSTRUCTOR_FUNCTION(qRegisterMediaRecorderMetaTypes)
QMediaRecorderPrivate::QMediaRecorderPrivate():
mediaObject(0),
control(0),

View File

@@ -48,19 +48,15 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterAbstractVideoBufferMetaTypes()
{
class QAbstractVideoBufferPrivateRegisterMetaTypes
{
public:
QAbstractVideoBufferPrivateRegisterMetaTypes()
{
qRegisterMetaType<QAbstractVideoBuffer::HandleType>();
qRegisterMetaType<QAbstractVideoBuffer::MapMode>();
}
} _registerMetaTypes;
qRegisterMetaType<QAbstractVideoBuffer::HandleType>();
qRegisterMetaType<QAbstractVideoBuffer::MapMode>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterAbstractVideoBufferMetaTypes)
/*!
\class QAbstractVideoBuffer
\brief The QAbstractVideoBuffer class is an abstraction for video data.

View File

@@ -50,18 +50,13 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterAbstractVideoSurfaceMetaTypes()
{
class QAbstractVideoSurfacePrivateRegisterMetaTypes
{
public:
QAbstractVideoSurfacePrivateRegisterMetaTypes()
{
qRegisterMetaType<QAbstractVideoSurface::Error>();
}
} _registerMetaTypes;
qRegisterMetaType<QAbstractVideoSurface::Error>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterAbstractVideoSurfaceMetaTypes)
class QAbstractVideoSurfacePrivate {
public:

View File

@@ -55,20 +55,15 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterVideoFrameMetaTypes()
{
class QVideoFramePrivateRegisterMetaTypes
{
public:
QVideoFramePrivateRegisterMetaTypes()
{
qRegisterMetaType<QVideoFrame>();
qRegisterMetaType<QVideoFrame::FieldType>();
qRegisterMetaType<QVideoFrame::PixelFormat>();
}
} _registerMetaTypes;
qRegisterMetaType<QVideoFrame>();
qRegisterMetaType<QVideoFrame::FieldType>();
qRegisterMetaType<QVideoFrame::PixelFormat>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterVideoFrameMetaTypes)
class QVideoFramePrivate : public QSharedData
{

View File

@@ -49,20 +49,15 @@
QT_BEGIN_NAMESPACE
namespace
static void qRegisterVideoSurfaceFormatMetaTypes()
{
class QVideoSurfaceFormatPrivateRegisterMetaTypes
{
public:
QVideoSurfaceFormatPrivateRegisterMetaTypes()
{
qRegisterMetaType<QVideoSurfaceFormat>();
qRegisterMetaType<QVideoSurfaceFormat::Direction>();
qRegisterMetaType<QVideoSurfaceFormat::YCbCrColorSpace>();
}
} _registerMetaTypes;
qRegisterMetaType<QVideoSurfaceFormat>();
qRegisterMetaType<QVideoSurfaceFormat::Direction>();
qRegisterMetaType<QVideoSurfaceFormat::YCbCrColorSpace>();
}
Q_CONSTRUCTOR_FUNCTION(qRegisterVideoSurfaceFormatMetaTypes)
class QVideoSurfaceFormatPrivate : public QSharedData
{