Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
ParameterRecord.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef PARAMETERRECORD_H
4#define PARAMETERRECORD_H
5
6#pragma once
7
8#if HAVE_QT6_MULTIMEDIA
9 #include <QMediaFormat>
10#endif
11#include <QMediaRecorder>
12
13#include "Parameter.h"
14
15class CLIENT_EXPORT CParameterRecord : public CParameter
16{
17 Q_OBJECT
18
19public:
20 explicit CParameterRecord(QObject *parent = nullptr,
21 const QString& szPrefix = QString());
22
23 const QString GetPath() const;
24 int SetPath(const QString& szPath);
25
31 const QString GetFile(bool bAuto = false);
32 int SetFile(const QString& szFile);
33
34 QString GetImageFile(bool bAuto = false);
35 void SetImageFile(const QString &newImageFile);
36
37 QString GetImagePath() const;
38 void SetImagePath(const QString &newImagePath);
39
40#if HAVE_QT6_MULTIMEDIA
41 const QMediaFormat::FileFormat GetFileFormat() const;
42 int SetFileFormat(const QMediaFormat::FileFormat &f);
43
44 const QMediaFormat::VideoCodec GetVideoCodec() const;
45 int SetVideoCodec(QMediaFormat::VideoCodec);
46
47 const QMediaFormat::AudioCodec GetAudioCodec() const;
48 int SetAudioCodec(QMediaFormat::AudioCodec);
49
50 QMediaRecorder::Quality GetQuality() const;
51 void SetQuality(const QMediaRecorder::Quality &newQuality);
52 QMediaRecorder::EncodingMode GetEncodingMode() const;
53 void SetEncodingMode(const QMediaRecorder::EncodingMode &newEncodingMode);
54#endif
55
56 qreal GetVideoFrameRate() const;
57 void SetVideoFrameRate(qreal newVideoFrameRate);
58 int GetAudioSampleRate() const;
59 void SetAudioSampleRate(int newAudioSampleRate);
60
61 virtual CParameterRecord& operator=(const CParameterRecord &in);
62
63 bool GetEnableVideo() const;
64 void SetEnableVideo(bool newEnableVideo);
65 bool GetEnableAudio() const;
66 void SetEnableAudio(bool newEnableAudio);
67
68 enum ENDACTION {
69 No,
70 OpenFile,
71 OpenFolder
72 };
73 Q_ENUM(ENDACTION)
74
75 CParameterRecord::ENDACTION GetEndAction() const;
76 void SetEndAction(ENDACTION newEndAction);
77
78Q_SIGNALS:
79 void sigQualityChanged();
80 void sigEncodingModeChanged();
81 void sigImageFileChanged();
82 void sigEnableVideoChanged();
83 void sigEnableAudioChanged();
84 void sigEndActionChanged();
85
86 void ImagePathChanged();
87
88private:
89 bool m_bEnableVideo;
90 bool m_bEnableAudio;
91 QString m_szFile;
92 QString m_szPath;
93 QString m_szImageFile;
94 QString m_szImagePath;
95
96#if HAVE_QT6_MULTIMEDIA
97 QMediaFormat::FileFormat m_FileFormat;
98 QMediaFormat::VideoCodec m_VideoCodec;
99 QMediaFormat::AudioCodec m_AudioCodec;
100
101 QMediaRecorder::Quality m_Quality;
102 QMediaRecorder::EncodingMode m_EncodingMode;
103#endif
104
105 qreal m_VideoFrameRate;
106 int m_AudioSampleRate;
107
108 ENDACTION m_EndAction;
109
110protected:
111 virtual int OnLoad(QSettings &set) override;
112 virtual int OnSave(QSettings &set) override;
113};
114
115CLIENT_EXPORT CParameterRecord& operator << (CParameterRecord& para, QMediaRecorder& recorder);
116CLIENT_EXPORT CParameterRecord& operator << (CParameterRecord& para, QMediaRecorder& recorder);
117CLIENT_EXPORT CParameterRecord& operator >> (CParameterRecord& para, QMediaRecorder& recorder);
118
119#endif // PARAMETERRECORD_H
Parameter interface.
Definition Parameter.h:169