CuteLogger
Fast and simple logging solution for Qt based applications
slideshowgeneratorwidget.h
1/*
2 * Copyright (c) 2020-2025 Meltytech, LLC
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef SLIDESHOWGENERATORWIDGET_H
19#define SLIDESHOWGENERATORWIDGET_H
20
21#include <MltProducer.h>
22#include <QFuture>
23#include <QMutex>
24#include <QWidget>
25
26class QComboBox;
27class QDoubleSpinBox;
28class QSlider;
29class QSpinBox;
30namespace Mlt {
31class Filter;
32class Playlist;
33class Transition;
34} // namespace Mlt
35class ProducerPreviewWidget;
36
37class SlideshowGeneratorWidget : public QWidget
38{
39 Q_OBJECT
40
41public:
42 SlideshowGeneratorWidget(Mlt::Playlist *clips, QWidget *parent = 0);
43 virtual ~SlideshowGeneratorWidget();
44
45 Mlt::Playlist *getSlideshow();
46
47private slots:
48 void on_parameterChanged();
49
50private:
51 struct SlideshowConfig
52 {
53 double imageDuration;
54 double audioVideoDuration;
55 int aspectConversion;
56 int zoomPercent;
57 double transitionDuration;
58 int transitionStyle;
59 int transitionSoftness;
60 };
61
62 void attachAffineFilter(SlideshowConfig &config, Mlt::Producer *producer, int endPosition);
63 void attachBlurFilter(SlideshowConfig &config, Mlt::Producer *producer);
64 void applyLumaTransitionProperties(Mlt::Transition *luma, SlideshowConfig &config);
65 void generatePreviewSlideshow();
66 Q_INVOKABLE void startPreview();
67
68 QDoubleSpinBox *m_imageDurationSpinner;
69 QDoubleSpinBox *m_audioVideoDurationSpinner;
70 QComboBox *m_aspectConversionCombo;
71 QSpinBox *m_zoomPercentSpinner;
72 QDoubleSpinBox *m_transitionDurationSpinner;
73 QComboBox *m_transitionStyleCombo;
74 QSpinBox *m_softnessSpinner;
75 ProducerPreviewWidget *m_preview;
76 Mlt::Playlist *m_clips;
77
78 // Mutext Protected Members
79 QFuture<void> m_future;
80 QMutex m_mutex;
81 bool m_refreshPreview;
82 SlideshowConfig m_config;
83 Mlt::Producer m_previewProducer;
84};
85
86#endif // SLIDESHOWGENERATORWIDGET_H