Changeset View
Changeset View
Standalone View
Standalone View
src/core.cpp
Show All 13 Lines | |||||
14 | #include "project/projectmanager.h" | 14 | #include "project/projectmanager.h" | ||
15 | #include "monitor/monitormanager.h" | 15 | #include "monitor/monitormanager.h" | ||
16 | #include "mltconnection.h" | 16 | #include "mltconnection.h" | ||
17 | #include "profiles/profilerepository.hpp" | 17 | #include "profiles/profilerepository.hpp" | ||
18 | #include "mltcontroller/bincontroller.h" | 18 | #include "mltcontroller/bincontroller.h" | ||
19 | #include "mltcontroller/producerqueue.h" | 19 | #include "mltcontroller/producerqueue.h" | ||
20 | #include "bin/bin.h" | 20 | #include "bin/bin.h" | ||
21 | #include "library/librarywidget.h" | 21 | #include "library/librarywidget.h" | ||
22 | #include "mixer/audiomixer.h" | ||||
22 | #include "kdenlive_debug.h" | 23 | #include "kdenlive_debug.h" | ||
23 | 24 | | |||
24 | #include <QCoreApplication> | 25 | #include <QCoreApplication> | ||
25 | #include <KMessageBox> | 26 | #include <KMessageBox> | ||
26 | #include <QInputDialog> | 27 | #include <QInputDialog> | ||
27 | 28 | | |||
28 | #include <mlt++/MltRepository.h> | 29 | #include <mlt++/MltRepository.h> | ||
29 | 30 | | |||
30 | #include <locale> | 31 | #include <locale> | ||
31 | #ifdef Q_OS_MAC | 32 | #ifdef Q_OS_MAC | ||
32 | #include <xlocale.h> | 33 | #include <xlocale.h> | ||
33 | #endif | 34 | #endif | ||
34 | 35 | | |||
35 | Core *Core::m_self = nullptr; | 36 | Core *Core::m_self = nullptr; | ||
36 | 37 | | |||
37 | Core::Core() : | 38 | Core::Core() : | ||
38 | m_mainWindow(nullptr) | 39 | m_mainWindow(nullptr) | ||
39 | , m_projectManager(nullptr) | 40 | , m_projectManager(nullptr) | ||
40 | , m_monitorManager(nullptr) | 41 | , m_monitorManager(nullptr) | ||
41 | , m_binController(nullptr) | 42 | , m_binController(nullptr) | ||
42 | , m_producerQueue(nullptr) | 43 | , m_producerQueue(nullptr) | ||
43 | , m_binWidget(nullptr) | 44 | , m_binWidget(nullptr) | ||
45 | | ||||
44 | , m_library(nullptr) | 46 | , m_library(nullptr) | ||
47 | | ||||
45 | { | 48 | { | ||
46 | connect(qApp, &QCoreApplication::aboutToQuit, this, &QObject::deleteLater); | 49 | connect(qApp, &QCoreApplication::aboutToQuit, this, &QObject::deleteLater); | ||
47 | } | 50 | } | ||
48 | 51 | | |||
49 | Core::~Core() | 52 | Core::~Core() | ||
50 | { | 53 | { | ||
51 | m_monitorManager->stopActiveMonitor(); | 54 | m_monitorManager->stopActiveMonitor(); | ||
52 | delete m_producerQueue; | 55 | delete m_producerQueue; | ||
53 | delete m_binWidget; | 56 | delete m_binWidget; | ||
57 | | ||||
54 | delete m_projectManager; | 58 | delete m_projectManager; | ||
55 | delete m_binController; | 59 | delete m_binController; | ||
60 | delete m_mainWindow; | ||||
56 | delete m_monitorManager; | 61 | delete m_monitorManager; | ||
57 | m_self = nullptr; | 62 | m_self = nullptr; | ||
58 | } | 63 | } | ||
59 | 64 | | |||
60 | void Core::build(const QString &MltPath, const QUrl &Url, const QString &clipsToLoad) | 65 | void Core::build(const QString &MltPath, const QUrl &Url, const QString &clipsToLoad) | ||
61 | { | 66 | { | ||
62 | m_self = new Core(); | 67 | m_self = new Core(); | ||
63 | m_self->initLocale(); | 68 | m_self->initLocale(); | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 128 | if (!ok) { | |||
124 | KMessageBox::error(m_mainWindow, i18n("The given profile is invalid. We default to the profile \"dv_pal\", but you can change this from Kdenlive's settings panel")); | 129 | KMessageBox::error(m_mainWindow, i18n("The given profile is invalid. We default to the profile \"dv_pal\", but you can change this from Kdenlive's settings panel")); | ||
125 | m_profile = "dv_pal"; | 130 | m_profile = "dv_pal"; | ||
126 | } | 131 | } | ||
127 | KdenliveSettings::setDefault_profile(m_profile); | 132 | KdenliveSettings::setDefault_profile(m_profile); | ||
128 | } | 133 | } | ||
129 | 134 | | |||
130 | m_projectManager = new ProjectManager(this); | 135 | m_projectManager = new ProjectManager(this); | ||
131 | m_binWidget = new Bin(); | 136 | m_binWidget = new Bin(); | ||
137 | m_mixerWidget = new Audiomixer(); | ||||
132 | m_binController = new BinController(); | 138 | m_binController = new BinController(); | ||
133 | m_library = new LibraryWidget(m_projectManager); | 139 | m_library = new LibraryWidget(m_projectManager); | ||
134 | connect(m_library, SIGNAL(addProjectClips(QList<QUrl>)), m_binWidget, SLOT(droppedUrls(QList<QUrl>))); | 140 | connect(m_library, SIGNAL(addProjectClips(QList<QUrl>)), m_binWidget, SLOT(droppedUrls(QList<QUrl>))); | ||
135 | connect(this, &Core::updateLibraryPath, m_library, &LibraryWidget::slotUpdateLibraryPath); | 141 | connect(this, &Core::updateLibraryPath, m_library, &LibraryWidget::slotUpdateLibraryPath); | ||
136 | connect(m_binWidget, SIGNAL(storeFolder(QString, QString, QString, QString)), m_binController, SLOT(slotStoreFolder(QString, QString, QString, QString))); | 142 | connect(m_binWidget, SIGNAL(storeFolder(QString, QString, QString, QString)), m_binController, SLOT(slotStoreFolder(QString, QString, QString, QString))); | ||
137 | connect(m_binController, SIGNAL(loadFolders(QMap<QString, QString>)), m_binWidget, SLOT(slotLoadFolders(QMap<QString, QString>))); | 143 | connect(m_binController, SIGNAL(loadFolders(QMap<QString, QString>)), m_binWidget, SLOT(slotLoadFolders(QMap<QString, QString>))); | ||
138 | connect(m_binController, &BinController::requestAudioThumb, m_binWidget, &Bin::slotCreateAudioThumb); | 144 | connect(m_binController, &BinController::requestAudioThumb, m_binWidget, &Bin::slotCreateAudioThumb); | ||
139 | connect(m_binController, &BinController::abortAudioThumbs, m_binWidget, &Bin::abortAudioThumbs); | 145 | connect(m_binController, &BinController::abortAudioThumbs, m_binWidget, &Bin::abortAudioThumbs); | ||
140 | connect(m_binController, SIGNAL(loadThumb(QString, QImage, bool)), m_binWidget, SLOT(slotThumbnailReady(QString, QImage, bool))); | 146 | connect(m_binController, SIGNAL(loadThumb(QString, QImage, bool)), m_binWidget, SLOT(slotThumbnailReady(QString, QImage, bool))); | ||
141 | m_monitorManager = new MonitorManager(this); | 147 | m_monitorManager = new MonitorManager(this); | ||
148 | | ||||
149 | | ||||
150 | | ||||
151 | | ||||
152 | | ||||
153 | | ||||
154 | | ||||
155 | | ||||
156 | | ||||
157 | | ||||
158 | | ||||
142 | // Producer queue, creating MLT::Producers on request | 159 | // Producer queue, creating MLT::Producers on request | ||
143 | m_producerQueue = new ProducerQueue(m_binController); | 160 | m_producerQueue = new ProducerQueue(m_binController); | ||
144 | connect(m_producerQueue, SIGNAL(gotFileProperties(requestClipInfo, ClipController *)), m_binWidget, SLOT(slotProducerReady(requestClipInfo, ClipController *)), Qt::DirectConnection); | 161 | connect(m_producerQueue, SIGNAL(gotFileProperties(requestClipInfo, ClipController *)), m_binWidget, SLOT(slotProducerReady(requestClipInfo, ClipController *)), Qt::DirectConnection); | ||
145 | connect(m_producerQueue, &ProducerQueue::replyGetImage, m_binWidget, &Bin::slotThumbnailReady); | 162 | connect(m_producerQueue, &ProducerQueue::replyGetImage, m_binWidget, &Bin::slotThumbnailReady); | ||
146 | connect(m_producerQueue, &ProducerQueue::removeInvalidClip, m_binWidget, &Bin::slotRemoveInvalidClip, Qt::DirectConnection); | 163 | connect(m_producerQueue, &ProducerQueue::removeInvalidClip, m_binWidget, &Bin::slotRemoveInvalidClip, Qt::DirectConnection); | ||
147 | connect(m_producerQueue, SIGNAL(addClip(QString, QMap<QString, QString>)), m_binWidget, SLOT(slotAddUrl(QString, QMap<QString, QString>))); | 164 | connect(m_producerQueue, SIGNAL(addClip(QString, QMap<QString, QString>)), m_binWidget, SLOT(slotAddUrl(QString, QMap<QString, QString>))); | ||
148 | connect(m_binController, SIGNAL(createThumb(QDomElement, QString, int)), m_producerQueue, SLOT(getFileProperties(QDomElement, QString, int))); | 165 | connect(m_binController, SIGNAL(createThumb(QDomElement, QString, int)), m_producerQueue, SLOT(getFileProperties(QDomElement, QString, int))); | ||
149 | connect(m_binWidget, &Bin::producerReady, m_producerQueue, &ProducerQueue::slotProcessingDone, Qt::DirectConnection); | 166 | connect(m_binWidget, &Bin::producerReady, m_producerQueue, &ProducerQueue::slotProcessingDone, Qt::DirectConnection); | ||
Show All 23 Lines | 189 | { | |||
173 | return m_monitorManager; | 190 | return m_monitorManager; | ||
174 | } | 191 | } | ||
175 | 192 | | |||
176 | BinController *Core::binController() | 193 | BinController *Core::binController() | ||
177 | { | 194 | { | ||
178 | return m_binController; | 195 | return m_binController; | ||
179 | } | 196 | } | ||
180 | 197 | | |||
198 | Audiomixer *Core::audiomixer() | ||||
199 | { | ||||
200 | return m_mixerWidget; | ||||
201 | } | ||||
202 | | ||||
181 | Bin *Core::bin() | 203 | Bin *Core::bin() | ||
182 | { | 204 | { | ||
183 | return m_binWidget; | 205 | return m_binWidget; | ||
184 | } | 206 | } | ||
185 | 207 | | |||
186 | ProducerQueue *Core::producerQueue() | 208 | ProducerQueue *Core::producerQueue() | ||
187 | { | 209 | { | ||
188 | return m_producerQueue; | 210 | return m_producerQueue; | ||
Show All 34 Lines | 242 | #endif | |||
223 | QLocale::setDefault(systemLocale); | 245 | QLocale::setDefault(systemLocale); | ||
224 | } | 246 | } | ||
225 | 247 | | |||
226 | 248 | | |||
227 | std::unique_ptr<Mlt::Repository>& Core::getMltRepository() | 249 | std::unique_ptr<Mlt::Repository>& Core::getMltRepository() | ||
228 | { | 250 | { | ||
229 | return m_mltConnection->getMltRepository(); | 251 | return m_mltConnection->getMltRepository(); | ||
230 | } | 252 | } | ||
253 | |