#include "kdenlive-config.h"
#include "cliptranscode.h"
#include "ui_templateclip_ui.h"
-#include "vectorscope.h"
-#include "waveform.h"
-#include "rgbparade.h"
-#include "histogram.h"
+#include "colorscopes/vectorscope.h"
+#include "colorscopes/waveform.h"
+#include "colorscopes/rgbparade.h"
+#include "colorscopes/histogram.h"
#include "audiospectrum.h"
+#include "spectrogram.h"
#include <KApplication>
#include <KAction>
m_findActivated(false),
m_stopmotion(NULL)
{
- qRegisterMetaType<QVector<int16_t> > ();
+ qRegisterMetaType<QVector<int16_t> > ();
// Create DBus interface
new MainWindowAdaptor(this);
QDBusConnection dbus = QDBusConnection::sessionBus();
connect(m_clipMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)));
}*/
- m_audioSpectrum = new AudioSpectrum(m_projectMonitor, m_clipMonitor);
+ m_audioSpectrum = new AudioSpectrum();
m_audioSpectrumDock = new QDockWidget(i18n("AudioSpectrum"), this);
m_audioSpectrumDock->setObjectName(m_audioSpectrum->widgetName());
m_audioSpectrumDock->setWidget(m_audioSpectrum);
addDockWidget(Qt::TopDockWidgetArea, m_audioSpectrumDock);
+
+ m_spectrogram = new Spectrogram();
+ m_spectrogramDock = new QDockWidget(i18n("Spectrogram"), this);
+ m_spectrogramDock->setObjectName(m_spectrogram->widgetName());
+ m_spectrogramDock->setWidget(m_spectrogram);
+ addDockWidget(Qt::TopDockWidgetArea, m_spectrogramDock);
+
+ // Connect the audio signal to the audio scope slots
bool b = true;
if (m_projectMonitor) {
qDebug() << "project monitor connected";
- b &= connect(m_projectMonitor->render, SIGNAL(audioSamplesSignal(const QVector<int16_t>&,const int&,const int&, const int&)),
- m_audioSpectrum, SLOT(slotReceiveAudio(const QVector<int16_t>&,const int&,const int&,const int&)));
- b &= connect(m_projectMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)),
- m_audioSpectrum, SLOT(slotReceiveAudioTemp(const QByteArray&)));
- connect(m_projectMonitor->render, SIGNAL(audioSamplesSignal(const QVector<int16_t>&,const int&,const int&, const int&)),
- m_audiosignal, SLOT(slotReceiveAudio(const QVector<int16_t>&,const int&,const int&,const int&)));
+ b &= connect(m_projectMonitor->render, SIGNAL(audioSamplesSignal(QVector<int16_t>, int, int, int)),
+ m_audioSpectrum, SLOT(slotReceiveAudio(QVector<int16_t>, int, int, int)));
+ b &= connect(m_projectMonitor->render, SIGNAL(audioSamplesSignal(const QVector<int16_t>&, const int&, const int&, const int&)),
+ m_audiosignal, SLOT(slotReceiveAudio(const QVector<int16_t>&, const int&, const int&, const int&)));
+ b &= connect(m_projectMonitor->render, SIGNAL(audioSamplesSignal(QVector<int16_t>,int,int,int)),
+ m_spectrogram, SLOT(slotReceiveAudio(QVector<int16_t>,int,int,int)));
}
if (m_clipMonitor) {
qDebug() << "clip monitor connected";
- b &= connect(m_clipMonitor->render, SIGNAL(audioSamplesSignal(const QVector<int16_t>&,int,int,int)),
- m_audioSpectrum, SLOT(slotReceiveAudio(const QVector<int16_t>&,int,int,int)));
- b &= connect(m_clipMonitor->render, SIGNAL(audioSamplesSignal(const QVector<int16_t>&,int,int,int)),
- m_audiosignal, SLOT(slotReceiveAudio(const QVector<int16_t>&,int,int,int)));
- }
+ b &= connect(m_clipMonitor->render, SIGNAL(audioSamplesSignal(QVector<int16_t>, int, int, int)),
+ m_audioSpectrum, SLOT(slotReceiveAudio(QVector<int16_t>, int, int, int)));
+ b &= connect(m_clipMonitor->render, SIGNAL(audioSamplesSignal(const QVector<int16_t>&, int, int, int)),
+ m_audiosignal, SLOT(slotReceiveAudio(const QVector<int16_t>&, int, int, int)));
+ b &= connect(m_clipMonitor->render, SIGNAL(audioSamplesSignal(QVector<int16_t>,int,int,int)),
+ m_spectrogram, SLOT(slotReceiveAudio(QVector<int16_t>,int,int,int)));
+ }
+ // Ensure connections were set up correctly
Q_ASSERT(b);
m_undoViewDock = new QDockWidget(i18n("Undo History"), this);
// duration changed, we need to update duration
newprops.insert("out", QString::number(dia_ui->outPoint()));
}
+ if (!path.isEmpty()) {
+ // we are editing an external file, asked if we want to detach from that file or save the result to that title file.
+ if (KMessageBox::questionYesNo(this, i18n("You are editing an external title clip (%1). Do you want to save your changes to the title file or save the changes for this project only?", path), i18n("Save Title"), KGuiItem(i18n("Save to title file")), KGuiItem(i18n("Save in project only"))) == KMessageBox::Yes) {
+ // save to external file
+ dia_ui->saveTitle(path);
+ } else newprops.insert("resource", QString());
+ }
EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newprops, true);
m_activeDocument->commandStack()->push(command);
//m_activeTimeline->projectView()->slotUpdateClip(clip->getId());
return;
} else {
for (int i = 0; i < m_scopesList.count(); i++) {
- if (m_scopesList.at(i)->isVisible() && tabifiedDockWidgets(m_scopesList.at(i)).isEmpty() && static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled()) {
+ if (m_scopesList.at(i)->isVisible() && tabifiedDockWidgets(m_scopesList.at(i)).isEmpty() && static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled()) {
request = true;
break;
}
// Check scopes
bool request = false;
for (int i = 0; i < m_scopesList.count(); i++) {
- if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled()) {
- kDebug() << "SCOPE VISIBLE: " << static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->widgetName();
+ if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled()) {
+ kDebug() << "SCOPE VISIBLE: " << static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->widgetName();
request = true;
break;
}
bool request = false;
for (int i = 0; i < m_scopesList.count(); i++) {
// Check if we need the renderer to send a new frame for update
- if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;
- static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->slotActiveMonitorChanged(m_clipMonitor->isActive());
+ if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;
+ static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget())->slotActiveMonitorChanged(m_clipMonitor->isActive());
}
if (request) {
if (m_clipMonitor->isActive()) m_clipMonitor->render->sendFrameUpdate();
if (m_stopmotion == NULL) {
m_stopmotion = new StopmotionWidget(m_activeDocument->projectFolder(), m_stopmotion_actions->actions(), this);
connect(m_stopmotion, SIGNAL(addOrUpdateSequence(const QString)), m_projectList, SLOT(slotAddOrUpdateSequence(const QString)));
- for (int i = 0; i < m_scopesList.count(); i++) {
- // Check if we need the renderer to send a new frame for update
- /*if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;*/
- connect(m_stopmotion, SIGNAL(gotFrame(QImage)), static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget()), SLOT(slotRenderZoneUpdated(QImage)));
- //static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->slotMonitorCapture();
- }
+ for (int i = 0; i < m_scopesList.count(); i++) {
+ // Check if we need the renderer to send a new frame for update
+ /*if (!m_scopesList.at(i)->widget()->visibleRegion().isEmpty() && !(static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->autoRefreshEnabled())) request = true;*/
+ connect(m_stopmotion, SIGNAL(gotFrame(QImage)), static_cast<AbstractGfxScopeWidget *>(m_scopesList.at(i)->widget()), SLOT(slotRenderZoneUpdated(QImage)));
+ //static_cast<AbstractScopeWidget *>(m_scopesList.at(i)->widget())->slotMonitorCapture();
+ }
}
m_stopmotion->show();
}