widgets/configjogshuttle_ui.ui
widgets/trackheader_ui.ui
widgets/clipproperties_ui.ui
+ widgets/markerdialog_ui.ui
)
set(kdenlive_SRCS
clipproperties.cpp
movetransitioncommand.cpp
slideshowclip.cpp
+ markerdialog.cpp
)
kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc )
#include "kdenlivesettings.h"
#include "clipproperties.h"
#include "kthumb.h"
+#include "markerdialog.h"
#define VIDEOTAB 0
#define AUDIOTAB 1
m_view.clip_filesize->setText(KIO::convertSize(f.size()));
m_view.clip_duration->setText(tc.getTimecode(m_clip->duration(), m_fps));
- QList < CommentedTime > marks = m_clip->commentedSnapMarkers();
+ // markers
+ m_view.marker_new->setIcon(KIcon("document-new"));
+ m_view.marker_new->setToolTip(i18n("Add marker"));
+ m_view.marker_edit->setIcon(KIcon("document-properties"));
+ m_view.marker_edit->setToolTip(i18n("Edit marker"));
+ m_view.marker_delete->setIcon(KIcon("trash-empty"));
+ m_view.marker_delete->setToolTip(i18n("Delete marker"));
+
+ slotFillMarkersList();
+ connect(m_view.marker_new, SIGNAL(clicked()), this, SLOT(slotAddMarker()));
+ connect(m_view.marker_edit, SIGNAL(clicked()), this, SLOT(slotEditMarker()));
+ connect(m_view.marker_delete, SIGNAL(clicked()), this, SLOT(slotDeleteMarker()));
+ connect(m_view.markers_list, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotEditMarker()));
+
+ adjustSize();
+}
+void ClipProperties::slotFillMarkersList() {
+ m_view.markers_list->clear();
+ QList < CommentedTime > marks = m_clip->commentedSnapMarkers();
for (uint count = 0; count < marks.count(); ++count) {
- QString time = m_tc.getTimecode(marks[count].time(), m_tc.fps());
- QStringList itemtext;
- itemtext << time << marks[count].comment();
- (void) new QTreeWidgetItem(m_view.markers_list, itemtext);
+ QString time = m_tc.getTimecode(marks[count].time(), m_tc.fps());
+ QStringList itemtext;
+ itemtext << time << marks[count].comment();
+ (void) new QTreeWidgetItem(m_view.markers_list, itemtext);
}
-
+}
- adjustSize();
+void ClipProperties::slotAddMarker() {
+ CommentedTime marker(GenTime(), i18n("Marker"));
+ MarkerDialog d(m_clip, marker, m_tc, this);
+ if (d.exec() == QDialog::Accepted) {
+ int id = m_clip->getId();
+ emit addMarker(id, d.newMarker().time(), d.newMarker().comment());
+ }
+ QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
+}
+
+void ClipProperties::slotEditMarker() {
+ QList < CommentedTime > marks = m_clip->commentedSnapMarkers();
+ int pos = m_view.markers_list->currentIndex().row();
+ if (pos < 0 || pos > marks.count() - 1) return;
+ MarkerDialog d(m_clip, marks.at(pos), m_tc, this);
+ if (d.exec() == QDialog::Accepted) {
+ int id = m_clip->getId();
+ emit addMarker(id, d.newMarker().time(), d.newMarker().comment());
+ }
+ QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
+}
+
+void ClipProperties::slotDeleteMarker() {
+ QList < CommentedTime > marks = m_clip->commentedSnapMarkers();
+ int pos = m_view.markers_list->currentIndex().row();
+ if (pos < 0 || pos > marks.count() - 1) return;
+ int id = m_clip->getId();
+ emit addMarker(id, marks.at(pos).time(), QString());
+
+ QTimer::singleShot(500, this, SLOT(slotFillMarkersList()));
}
int ClipProperties::clipId() const {
#include <QDialog>
#include "definitions.h"
-#include "docclipbase.h"
#include "timecode.h"
+#include "docclipbase.h"
#include "ui_clipproperties_ui.h"
class ClipProperties : public QDialog {
private slots:
void parseFolder();
+ void slotAddMarker();
+ void slotEditMarker();
+ void slotDeleteMarker();
+ void slotFillMarkersList();
private:
Ui::ClipProperties_UI m_view;
/** used to count images in slideshow clip */
int m_count;
bool m_clipNeedsRefresh;
+
+signals:
+ void addMarker(int, GenTime, QString);
};
GenTime position = pos - item->startPos() + item->cropStart();
QString comment = QInputDialog::getText(this, i18n("Add Marker"), i18n("Enter text for marker on clip <b>%1</b>", clip->clipName()), QLineEdit::Normal, i18n("marker"));
if (comment.isEmpty()) return;
- AddMarkerCommand *command = new AddMarkerCommand(this, QString(), comment, id, position, true);
+ slotAddClipMarker(id, position, comment);
+}
+
+void CustomTrackView::slotAddClipMarker(int id, GenTime t, QString c) {
+ QString oldcomment = m_document->clipManager()->getClipById(id)->markerComment(t);
+ AddMarkerCommand *command = new AddMarkerCommand(this, oldcomment, c, id, t, true);
m_commandStack->push(command);
}
#include <KUndoStack>
#include "kdenlivedoc.h"
+#include "docclipbase.h"
class ClipItem;
class AbstractClipItem;
void slotSwitchTrackAudio(int ix);
void slotSwitchTrackVideo(int ix);
void slotUpdateClip(int clipId);
+ void slotAddClipMarker(int id, GenTime t, QString c);
protected:
virtual void drawBackground(QPainter * painter, const QRectF & rect);
m_activeDocument->editTextClip(clip->getProperty("xml"), clip->getId());
return;
}
+ TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
ClipProperties dia(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
+ connect(&dia, SIGNAL(addMarker(int, GenTime, QString)), currentTab->projectView(), SLOT(slotAddClipMarker(int, GenTime, QString)));
if (dia.exec() == QDialog::Accepted) {
m_projectList->slotUpdateClipProperties(dia.clipId(), dia.properties());
if (dia.needsTimelineRefresh()) {
// update clip occurences in timeline
- TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
+
currentTab->projectView()->slotUpdateClip(dia.clipId());
}
}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+
+#include <KDebug>
+
+#include "markerdialog.h"
+
+MarkerDialog::MarkerDialog(DocClipBase *clip, CommentedTime t, Timecode tc, QWidget * parent): QDialog(parent), m_tc(tc), m_clip(clip), m_marker(t) {
+ setFont(KGlobalSettings::toolBarFont());
+ m_fps = m_tc.fps();
+ m_view.setupUi(this);
+ m_view.marker_position->setText(tc.getTimecode(t.time(), tc.fps()));
+ m_view.marker_comment->setText(t.comment());
+ connect(m_view.position_up, SIGNAL(clicked()), this, SLOT(slotTimeUp()));
+ connect(m_view.position_down, SIGNAL(clicked()), this, SLOT(slotTimeDown()));
+ m_view.marker_comment->selectAll();
+ m_view.marker_comment->setFocus();
+ adjustSize();
+}
+
+
+void MarkerDialog::slotTimeUp() {
+ int duration = m_tc.getFrameCount(m_view.marker_position->text(), m_fps);
+ if (duration >= m_clip->duration().frames(m_fps)) return;
+ duration ++;
+ m_view.marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps), m_fps));
+}
+
+void MarkerDialog::slotTimeDown() {
+ int duration = m_tc.getFrameCount(m_view.marker_position->text(), m_fps);
+ if (duration <= 0) return;
+ duration --;
+ m_view.marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps), m_fps));
+}
+
+CommentedTime MarkerDialog::newMarker() {
+ return CommentedTime(GenTime(m_tc.getFrameCount(m_view.marker_position->text(), m_fps), m_fps), m_view.marker_comment->text());
+}
+
+#include "markerdialog.moc"
+
+
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+
+#ifndef MARKERDIALOG_H
+#define MARKERDIALOG_H
+
+#include <QDialog>
+
+#include "docclipbase.h"
+#include "timecode.h"
+#include "ui_markerdialog_ui.h"
+
+class MarkerDialog : public QDialog {
+ Q_OBJECT
+
+public:
+ MarkerDialog(DocClipBase *clip, CommentedTime t, Timecode tc, QWidget * parent = 0);
+ CommentedTime newMarker();
+private slots:
+ void slotTimeUp();
+ void slotTimeDown();
+
+private:
+ Ui::MarkerDialog_UI m_view;
+ DocClipBase *m_clip;
+ CommentedTime m_marker;
+ Timecode m_tc;
+ double m_fps;
+};
+
+
+#endif
+
delete m_toolbar;
}
-void ProjectList::slotEditClip()
-{
+void ProjectList::slotEditClip() {
ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
if (item && !item->isGroup()) emit clipSelected(item->toXml());
emit showClipProperties(item->referencedClip());
<x>0</x>
<y>0</y>
<width>284</width>
- <height>172</height>
+ <height>204</height>
</rect>
</property>
<attribute name="title" >
<x>0</x>
<y>0</y>
<width>284</width>
- <height>172</height>
+ <height>204</height>
</rect>
</property>
<attribute name="title" >
<x>0</x>
<y>0</y>
<width>284</width>
- <height>172</height>
+ <height>204</height>
</rect>
</property>
<attribute name="title" >
<x>0</x>
<y>0</y>
<width>284</width>
- <height>172</height>
+ <height>204</height>
</rect>
</property>
<attribute name="title" >
</layout>
</widget>
<widget class="QWidget" name="tab_3" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>284</width>
+ <height>204</height>
+ </rect>
+ </property>
<attribute name="title" >
<string>Markers</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_7" >
- <item row="0" column="0" >
+ <item row="0" column="0" colspan="4" >
<widget class="QTreeWidget" name="markers_list" >
<property name="alternatingRowColors" >
<bool>true</bool>
</column>
</widget>
</item>
+ <item row="1" column="0" >
+ <widget class="QToolButton" name="marker_new" >
+ <property name="text" >
+ <string>N</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QToolButton" name="marker_edit" >
+ <property name="text" >
+ <string>E</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QToolButton" name="marker_delete" >
+ <property name="text" >
+ <string>D</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3" >
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>177</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="tab_advanced" >
<x>0</x>
<y>0</y>
<width>284</width>
- <height>172</height>
+ <height>204</height>
</rect>
</property>
<attribute name="title" >
--- /dev/null
+<ui version="4.0" >
+ <class>MarkerDialog_UI</class>
+ <widget class="QDialog" name="MarkerDialog_UI" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>331</width>
+ <height>109</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Marker</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item rowspan="3" row="0" column="0" >
+ <widget class="QLabel" name="clip_thumb" >
+ <property name="frameShape" >
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="text" >
+ <string>Image preview</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="2" row="0" column="1" >
+ <widget class="QLabel" name="clip_filesize_2" >
+ <property name="text" >
+ <string>Position</string>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="2" row="0" column="2" colspan="2" >
+ <widget class="KRestrictedLine" name="marker_position" >
+ <property name="inputMask" >
+ <string>99:99:99:99; </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4" >
+ <widget class="KArrowButton" name="position_up" />
+ </item>
+ <item row="1" column="4" >
+ <widget class="KArrowButton" name="position_down" >
+ <property name="arrowType" stdset="0" >
+ <number>2</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="clip_filesize_3" >
+ <property name="text" >
+ <string>Comment</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" colspan="3" >
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>218</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="0" colspan="5" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" colspan="3" >
+ <widget class="KLineEdit" name="marker_comment" />
+ </item>
+ </layout>
+ <zorder>buttonBox</zorder>
+ <zorder>marker_position</zorder>
+ <zorder>dial</zorder>
+ <zorder>position_up</zorder>
+ <zorder>position_down</zorder>
+ <zorder>clip_filesize_3</zorder>
+ <zorder>verticalSpacer</zorder>
+ <zorder>clip_thumb</zorder>
+ <zorder>clip_filesize_2</zorder>
+ <zorder>marker_comment</zorder>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>KArrowButton</class>
+ <extends>QPushButton</extends>
+ <header>karrowbutton.h</header>
+ </customwidget>
+ <customwidget>
+ <class>KLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>klineedit.h</header>
+ </customwidget>
+ <customwidget>
+ <class>KRestrictedLine</class>
+ <extends>KLineEdit</extends>
+ <header>krestrictedline.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>MarkerDialog_UI</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>MarkerDialog_UI</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>