m_fps(fps),
m_count(0),
m_clipNeedsRefresh(false),
- m_clipNeedsReLoad(false)
+ m_clipNeedsReLoad(false),
+ m_propsDelegate(NULL)
{
+ setAttribute(Qt::WA_DeleteOnClose, true);
setFont(KGlobalSettings::toolBarFont());
m_view.setupUi(this);
KUrl url = m_clip->fileURL();
m_view.clip_path->setText(url.path());
m_view.clip_description->setText(m_clip->description());
- QMap <QString, QString> props = m_clip->properties();
+ connect(m_view.clip_description, SIGNAL(textChanged(QString)), this, SLOT(slotModified()));
+ QMap <QString, QString> props = m_clip->properties();
m_view.clip_force_out->setHidden(true);
m_view.clip_out->setHidden(true);
m_view.clip_force_ar->setChecked(true);
m_view.clip_ar->setEnabled(true);
m_view.clip_ar->setValue(props.value("force_aspect_ratio").toDouble());
- }
+ } else if (props.contains("aspect_ratio")) m_view.clip_ar->setValue(props.value("aspect_ratio").toDouble());
+ connect(m_view.clip_force_ar, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.clip_ar, SIGNAL(valueChanged(double)), this, SLOT(slotModified()));
if (props.contains("force_fps") && props.value("force_fps").toDouble() > 0) {
m_view.clip_force_framerate->setChecked(true);
m_view.clip_framerate->setEnabled(true);
m_view.clip_framerate->setValue(props.value("force_fps").toDouble());
}
+ connect(m_view.clip_force_framerate, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.clip_framerate, SIGNAL(valueChanged(double)), this, SLOT(slotModified()));
if (props.contains("force_progressive")) {
m_view.clip_force_progressive->setChecked(true);
m_view.clip_progressive->setEnabled(true);
m_view.clip_progressive->setValue(props.value("force_progressive").toInt());
}
+ connect(m_view.clip_force_progressive, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.clip_progressive, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
if (props.contains("threads") && props.value("threads").toInt() != 1) {
m_view.clip_force_threads->setChecked(true);
m_view.clip_threads->setEnabled(true);
m_view.clip_threads->setValue(props.value("threads").toInt());
}
+ connect(m_view.clip_force_threads, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.clip_threads, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
if (props.contains("video_index") && props.value("video_index").toInt() != 0) {
m_view.clip_force_vindex->setChecked(true);
m_view.clip_vindex->setEnabled(true);
m_view.clip_vindex->setValue(props.value("video_index").toInt());
}
+ connect(m_view.clip_force_vindex, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.clip_vindex, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
if (props.contains("audio_index") && props.value("audio_index").toInt() != 0) {
m_view.clip_force_aindex->setChecked(true);
m_view.clip_aindex->setEnabled(true);
m_view.clip_aindex->setValue(props.value("audio_index").toInt());
}
+ connect(m_view.clip_force_aindex, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.clip_aindex, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
if (props.contains("audio_max")) {
m_view.clip_aindex->setMaximum(props.value("audio_max").toInt());
m_view.image_size->setText(props.value("frame_size"));
if (props.contains("transparency"))
m_view.image_transparency->setChecked(props.value("transparency").toInt());
+ connect(m_view.image_transparency, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
int width = 180.0 * KdenliveSettings::project_display_ratio();
if (width % 2 == 1) width++;
m_view.clip_thumb->setPixmap(QPixmap(url.path()).scaled(QSize(width, 180), Qt::KeepAspectRatio));
m_view.tabWidget->removeTab(VIDEOTAB);
m_view.clip_thumb->setHidden(true);
m_view.clip_color->setColor(QColor('#' + props.value("colour").right(8).left(6)));
+ connect(m_view.clip_color, SIGNAL(changed(QColor)), this, SLOT(slotModified()));
} else if (t == SLIDESHOW) {
bool isMime = true;
if (url.fileName().startsWith(".all.")) {
} else m_view.luma_file->setEnabled(false);
slotEnableLuma(m_view.slide_fade->checkState());
slotEnableLumaFile(m_view.slide_luma->checkState());
+
+ connect(m_view.slide_fade, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.slide_luma, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.slide_loop, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.slide_crop, SIGNAL(toggled(bool)), this, SLOT(slotModified()));
+ connect(m_view.slide_duration, SIGNAL(textChanged(QString)), this, SLOT(slotModified()));
+ connect(m_view.slide_duration_frames, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
+ connect(m_view.luma_duration, SIGNAL(textChanged(QString)), this, SLOT(slotModified()));
+ connect(m_view.luma_softness, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
+ connect(m_view.luma_file, SIGNAL(currentIndexChanged(int)), this, SLOT(slotModified()));
+ connect(m_view.animation, SIGNAL(currentIndexChanged(int)), this, SLOT(slotModified()));
+
+
connect(m_view.slide_fade, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLuma(int)));
connect(m_view.slide_luma, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLumaFile(int)));
-
connect(m_view.image_type, SIGNAL(currentIndexChanged(int)), this, SLOT(parseFolder()));
+
} else if (t != AUDIO) {
m_view.tabWidget->removeTab(IMAGETAB);
m_view.tabWidget->removeTab(SLIDETAB);
connect(m_view.marker_delete, SIGNAL(clicked()), this, SLOT(slotDeleteMarker()));
connect(m_view.markers_list, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotEditMarker()));
+ connect(this, SIGNAL(accepted()), this, SLOT(slotApplyProperties()));
+ connect(m_view.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(slotApplyProperties()));
+ m_view.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
//adjustSize();
}
ClipProperties::~ClipProperties()
{
- delete m_propsDelegate;
+ if (m_propsDelegate) delete m_propsDelegate;
}
+void ClipProperties::slotApplyProperties()
+{
+ if (m_clip != NULL)
+ emit applyNewClipProperties(m_clip->getId(), m_clip->properties(), properties(), needsTimelineRefresh(), needsTimelineReload());
+ m_view.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
+}
+
+void ClipProperties::disableClipId(const QString &id)
+{
+ if (m_clip && m_view.buttonBox->button(QDialogButtonBox::Ok)->isEnabled()) {
+ if (m_clip->getId() == id) {
+ // clip was removed from project, close this properties dialog
+ close();
+ }
+ }
+}
+
+void ClipProperties::slotModified()
+{
+ m_view.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
+}
+
+
void ClipProperties::slotEnableLuma(int state)
{
bool enable = false;
}
m_count = result.count();
+ m_view.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(m_count > 0);
if (m_count == 0) {
// no images, do not accept that
m_view.slide_info->setText(i18n("No image found"));
const QString &clipId() const;
bool needsTimelineRefresh() const;
bool needsTimelineReload() const;
-
+ void disableClipId(const QString &id);
+
private slots:
void parseFolder();
void slotAddMarker();
void slotEnableLuma(int state);
void slotEnableLumaFile(int state);
void slotUpdateDurationFormat(int ix);
+ void slotApplyProperties();
+ void slotModified();
private:
Ui::ClipProperties_UI m_view;
signals:
void addMarker(const QString &, GenTime, QString);
+ void applyNewClipProperties(const QString, QMap <QString, QString> , QMap <QString, QString> , bool, bool);
};
m_audiosignalDock->setObjectName("audiosignal");
m_audiosignalDock->setWidget(m_audiosignal);
addDockWidget(Qt::TopDockWidgetArea, m_audiosignalDock);
- if (m_projectMonitor){
- connect(m_projectMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)) );
+ if (m_projectMonitor) {
+ connect(m_projectMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)));
}
- if (m_clipMonitor){
- connect(m_clipMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)) );
+ if (m_clipMonitor) {
+ connect(m_clipMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)));
}
//connect(m_histogramDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
//connect(m_histogram, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
disconnect(m_activeDocument, SIGNAL(guidesUpdated()), this, SLOT(slotGuidesUpdated()));
disconnect(m_activeDocument, SIGNAL(addProjectClip(DocClipBase *, bool)), m_projectList, SLOT(slotAddClip(DocClipBase *, bool)));
disconnect(m_activeDocument, SIGNAL(resetProjectList()), m_projectList, SLOT(slotResetProjectList()));
- disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(const QString &)), m_projectList, SLOT(slotDeleteClip(const QString &)));
+ disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(const QString &)), this, SLOT(slotDeleteClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(deleteTimelineClip(const QString &)), m_activeTimeline, SLOT(slotDeleteClip(const QString &)));
}
//m_activeDocument->setRenderer(NULL);
disconnect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
- disconnect(m_projectList, SIGNAL(refreshClip()), m_clipMonitor, SLOT(refreshMonitor()));
+ disconnect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
m_clipMonitor->stop();
}
KdenliveSettings::setCurrent_profile(doc->profilePath());
m_transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), doc->tracksList());
m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *, QPoint)));
- connect(m_projectList, SIGNAL(refreshClip()), m_clipMonitor, SLOT(refreshMonitor()));
+ connect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
connect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), trackView->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
connect(doc, SIGNAL(addProjectClip(DocClipBase *, bool)), m_projectList, SLOT(slotAddClip(DocClipBase *, bool)));
connect(doc, SIGNAL(resetProjectList()), m_projectList, SLOT(slotResetProjectList()));
- connect(doc, SIGNAL(signalDeleteProjectClip(const QString &)), m_projectList, SLOT(slotDeleteClip(const QString &)));
+ connect(doc, SIGNAL(signalDeleteProjectClip(const QString &)), this, SLOT(slotDeleteClip(const QString &)));
connect(doc, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &)));
connect(doc, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &)));
}
// any type of clip but a title
- ClipProperties dia(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
- connect(&dia, SIGNAL(addMarker(const QString &, GenTime, QString)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(const QString &, GenTime, QString)));
- if (dia.exec() == QDialog::Accepted) {
- QMap <QString, QString> newprops = dia.properties();
- if (newprops.isEmpty()) return;
- EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newprops, true);
- m_activeDocument->commandStack()->push(command);
- m_activeDocument->setModified();
+ ClipProperties *dia = new ClipProperties(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
+ connect(dia, SIGNAL(addMarker(const QString &, GenTime, QString)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(const QString &, GenTime, QString)));
+ connect(dia, SIGNAL(applyNewClipProperties(const QString, QMap <QString, QString> , QMap <QString, QString> , bool, bool)), this, SLOT(slotApplyNewClipProperties(const QString, QMap <QString, QString> , QMap <QString, QString> , bool, bool)));
+ dia->show();
+}
- if (dia.needsTimelineRefresh()) {
- // update clip occurences in timeline
- m_activeTimeline->projectView()->slotUpdateClip(clip->getId(), dia.needsTimelineReload());
- }
+
+void MainWindow::slotApplyNewClipProperties(const QString id, QMap <QString, QString> props, QMap <QString, QString> newprops, bool refresh, bool reload)
+{
+ if (newprops.isEmpty()) return;
+ EditClipCommand *command = new EditClipCommand(m_projectList, id, props, newprops, true);
+ m_activeDocument->commandStack()->push(command);
+ m_activeDocument->setModified();
+
+ if (refresh) {
+ // update clip occurences in timeline
+ m_activeTimeline->projectView()->slotUpdateClip(id, reload);
}
}
{
QList <QDockWidget *> docks = findChildren<QDockWidget *>();
for (int i = 0; i < docks.count(); i++) {
- QDockWidget* dock=docks.at(i);
- if (show){
- dock->setTitleBarWidget(0);
- }else{
- if (!dock->isFloating()){
+ QDockWidget* dock = docks.at(i);
+ if (show) {
+ dock->setTitleBarWidget(0);
+ } else {
+ if (!dock->isFloating()) {
dock->setTitleBarWidget(new QWidget);
}
}
void MainWindow::slotOpenStopmotion()
{
if (m_stopmotion == NULL) {
- m_stopmotion = new StopmotionWidget(m_activeDocument->projectFolder(), this);
- connect(m_stopmotion, SIGNAL(addOrUpdateSequence(const QString)), m_projectList, SLOT(slotAddOrUpdateSequence(const QString)));
+ m_stopmotion = new StopmotionWidget(m_activeDocument->projectFolder(), this);
+ connect(m_stopmotion, SIGNAL(addOrUpdateSequence(const QString)), m_projectList, SLOT(slotAddOrUpdateSequence(const QString)));
}
m_stopmotion->show();
}
+
+void MainWindow::slotDeleteClip(const QString &id)
+{
+ QList <ClipProperties *> list = findChildren<ClipProperties *>();
+ for (int i = 0; i < list.size(); ++i) {
+ list.at(i)->disableClipId(id);
+ }
+ m_projectList->slotDeleteClip(id);
+}
+
#include "mainwindow.moc"
/** @brief Update the capture folder if user asked a change. */
void slotUpdateCaptureFolder();
+ /** @brief Apply new properties to a clip */
+ void slotApplyNewClipProperties(const QString id, QMap <QString, QString> props, QMap <QString, QString> newprops, bool refresh, bool reload);
+
+ /** @brief Delete a clip from current project */
+ void slotDeleteClip(const QString &id);
+
/** @brief Saves the widgets layout */
void slotSaveLayout(QAction*);
void slotLoadLayout(QAction*);
activateMonitor(active);
}
+void MonitorManager::slotRefreshCurrentMonitor()
+{
+ if (m_clipMonitor->isActive()) m_clipMonitor->refreshMonitor();
+ else m_projectMonitor->refreshMonitor();
+}
#include "monitormanager.moc"
* @param activateClip whether to activate the clip monitor */
void slotSwitchMonitors(bool activateClip);
+private slots:
+ void slotRefreshCurrentMonitor();
+
private:
Monitor *m_clipMonitor;
Monitor *m_projectMonitor;
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ <set>QDialogButtonBox::Apply|QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>