Marble

MovieCapture.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
4//
5
6#ifndef MOVIECAPTURE_H
7#define MOVIECAPTURE_H
8
9#include <QList>
10#include <QObject>
11
12#include "marble_export.h"
13
14namespace Marble
15{
16
17class MarbleWidget;
18
19class MovieCapturePrivate;
20
21class MovieFormat
22{
23public:
24 MovieFormat() = default;
25 explicit MovieFormat(const QString &type, const QString &name, const QString &extension)
26 : m_type(type)
27 , m_name(name)
28 , m_extension(extension)
29 {
30 }
31
32 QString type() const
33 {
34 return m_type;
35 }
36 QString name() const
37 {
38 return m_name;
39 }
40 QString extension() const
41 {
42 return m_extension;
43 }
44
45private:
46 QString m_type;
47 QString m_name;
48 QString m_extension;
49};
50
51class MARBLE_EXPORT MovieCapture : public QObject
52{
53 Q_OBJECT
54public:
55 enum SnapshotMethod {
56 TimeDriven,
57 DataDriven
58 };
59 MovieCapture(MarbleWidget *widget, QObject *parent);
60 ~MovieCapture() override;
61
62 int fps() const;
63 QString destination() const;
64 QList<MovieFormat> availableFormats();
65 MovieCapture::SnapshotMethod snapshotMethod() const;
66 bool checkToolsAvailability();
67
68public Q_SLOTS:
69 void setFps(int fps);
70 void setFilename(const QString &path);
71 void setSnapshotMethod(MovieCapture::SnapshotMethod method);
72 void recordFrame();
73 bool startRecording();
74 void stopRecording();
75 void cancelRecording();
76
77private Q_SLOTS:
78 void processWrittenMovie(int exitCode);
79
80Q_SIGNALS:
81 void rateCalculated(double);
82 void errorOccured();
83
84protected:
85 MovieCapturePrivate *const d_ptr;
86
87private:
88 Q_DECLARE_PRIVATE(MovieCapture)
89 QList<MovieFormat> m_supportedFormats;
90};
91
92} // namespace Marble
93
94Q_DECLARE_TYPEINFO(Marble::MovieFormat, Q_MOVABLE_TYPE);
95
96#endif // MOVIECAPTURE_H
QString name(GameStandardAction id)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.