add_subdirectory(icons)
add_subdirectory(data)
add_subdirectory(lumas)
+add_subdirectory(titles)
add_subdirectory(po)
add_subdirectory(man)
install (FILES kdenlivesettings.kcfg DESTINATION ${KCFG_INSTALL_DIR})
install (FILES kdenlive.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
kde4_install_icons(${ICON_INSTALL_DIR})
-install( FILES kdenlive_wipes.knsrc kdenlive_renderprofiles.knsrc kdenlive_projectprofiles.knsrc kdenlivetranscodingrc DESTINATION ${CONFIG_INSTALL_DIR} )
+install( FILES kdenlive_titles.knsrc kdenlive_wipes.knsrc kdenlive_renderprofiles.knsrc kdenlive_projectprofiles.knsrc kdenlivetranscodingrc DESTINATION ${CONFIG_INSTALL_DIR} )
kde4_install_icons( ${ICON_INSTALL_DIR} )
--- /dev/null
+[KNewStuff2]
+ProvidersUrl=http://kdenlive.org/data/titletemplates.xml
+TargetDir=kdenlive/titles
+Uncompress=archive
+
+[KNewStuff3]
+ProvidersUrl=http://kdenlive.org/data/titletemplates.xml
+TargetDir=kdenlive/titles
+Uncompress=archive
<Action name="get_new_lumas" />
<Action name="get_new_profiles" />
<Action name="get_new_mlt_profiles" />
+ <Action name="get_new_titles" />
<Action name="run_wizard" />
<Menu name="themes_menu" ><text>Themes</text>
</Menu>
KNS3::standardAction(i18n("Download New Project Profiles..."), this, SLOT(slotGetNewMltProfileStuff()), actionCollection(), "get_new_mlt_profiles");
+ KNS3::standardAction(i18n("Download New Title Templates..."), this, SLOT(slotGetNewTitleStuff()), actionCollection(), "get_new_titles");
+
KAction* wizAction = new KAction(KIcon("configure"), i18n("Run Config Wizard"), this);
collection->addAction("run_wizard", wizAction);
connect(wizAction, SIGNAL(triggered(bool)), this, SLOT(slotRunWizard()));
return entries.size();
}
+void MainWindow::slotGetNewTitleStuff()
+{
+ if (getNewStuff("kdenlive_titles.knsrc") > 0) {
+ TitleWidget::refreshTitleTemplates();
+ }
+}
+
void MainWindow::slotGetNewLumaStuff()
{
if (getNewStuff("kdenlive_wipes.knsrc") > 0) {
void slotDeleteTrack(int ix = 0);
void slotChangeTrack(int ix = 0);
void slotGetNewLumaStuff();
+ void slotGetNewTitleStuff();
void slotGetNewRenderStuff();
void slotGetNewMltProfileStuff();
void slotAutoTransition();
#include "titlewidget.h"
#include "kdenlivesettings.h"
#include "KoSliderCombo.h"
-
+#include "kthumb.h"
#include <cmath>
#include <KDebug>
#include <QSignalMapper>
#include <QTextBlockFormat>
#include <QTextCursor>
+#include <QComboBox>
+#include <QCryptographicHash>
#if QT_VERSION >= 0x040600
#include <QGraphicsEffect>
#include <QGraphicsDropShadowEffect>
#endif
+static QList<TitleTemplate> titletemplates;
+
int settingUp = false;
const int IMAGEITEM = 7;
initAnimation();
connect(anim_start, SIGNAL(toggled(bool)), this, SLOT(slotAnimStart(bool)));
connect(anim_end, SIGNAL(toggled(bool)), this, SLOT(slotAnimEnd(bool)));
+ connect(templateBox,SIGNAL(currentIndexChanged(int)),this,SLOT(templateIndexChanged(int)));
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(KdenliveSettings::hastitleproducer());
+ refreshTitleTemplates();
+ templateBox->setIconSize(QSize(60,60));
+ templateBox->clear();
+ templateBox->addItem("");
+ foreach (TitleTemplate t, titletemplates)
+ {
+ templateBox->addItem(t.icon,t.name,t.file);
+ }
+ lastDocumentHash=QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex();
}
TitleWidget::~TitleWidget()
}
return result;
}
-
-
+//static
+void TitleWidget::refreshTitleTemplates()
+{
+ QStringList titlenamelist = QStringList() << i18n("None");
+ QStringList titlefiles = QStringList() << QString();
+ QStringList filters;
+ filters << "*.kdenlivetitle" ;
+ titletemplates.clear();
+ QStringList titleTemplates = KGlobal::dirs()->findDirs("appdata", "titles");
+ foreach(const QString &folder, titleTemplates) {
+ QStringList filesnames = QDir(folder).entryList(filters, QDir::Files);
+ foreach(const QString &fname, filesnames) {
+ //titlenamelist.append(fname);
+ //titlefiles.append(KUrl(folder).path(KUrl::AddTrailingSlash) + fname);
+ TitleTemplate t;
+ t.name=fname;
+ t.file=KUrl(folder).path(KUrl::AddTrailingSlash) + fname;
+ t.icon=QIcon(KThumb::getImage(t.file,0,60,60));
+ titletemplates.append(t);
+ }
+ }
+ kDebug() << titlenamelist << titlefiles;
+}
+void TitleWidget::templateIndexChanged(int index )
+{
+ QString item=templateBox->itemData(index).toString();
+ if (item!="")
+ {
+ if (lastDocumentHash!=QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex())
+ {
+ if (KMessageBox::questionYesNo(this, i18n("Title was changed !\nDo you realy want to load a new Template?\nAll changes in this Document are lost !!")) == KMessageBox::No) return;
+ }
+ loadTitle(item);
+ lastDocumentHash=QCryptographicHash::hash(xml().toString().toAscii(), QCryptographicHash::Md5).toHex();
+ }
+}
//virtual
void TitleWidget::resizeEvent(QResizeEvent * /*event*/)
{
#include <QMap>
#include <QSignalMapper>
+class TitleTemplate
+{
+public:
+ QString file;
+ QString name;
+ QIcon icon;
+};
class Transform
{
double rotatex, rotatey, rotatez;
};
+
class TitleWidget : public QDialog , public Ui::TitleWidget_UI
{
Q_OBJECT
/** \brief Get clip duration. */
int duration() const;
+ /** load Title Templates*/
+ static void refreshTitleTemplates();
protected:
virtual void resizeEvent(QResizeEvent * event);
/** project path for storing title clips */
QString m_projectTitlePath;
Timecode m_tc;
+ QString lastDocumentHash;
/** See http://doc.trolltech.com/4.5/signalsandslots.html#advanced-signals-and-slots-usage */
QSignalMapper *m_signalMapper;
void slotZIndexDown();
void slotZIndexTop();
void slotZIndexBottom();
+ void templateIndexChanged(int);
};
<rect>
<x>0</x>
<y>0</y>
- <width>977</width>
- <height>633</height>
+ <width>1383</width>
+ <height>835</height>
</rect>
</property>
<property name="sizePolicy">
</property>
</widget>
</item>
- <item row="0" column="5" colspan="4">
+ <item row="0" column="5" colspan="6">
<widget class="QFrame" name="frame_properties">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
</layout>
</widget>
</item>
- <item row="2" column="0" colspan="8">
+ <item row="2" column="0" colspan="10">
<widget class="QSplitter" name="splitter">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
</item>
<item row="0" column="0">
<widget class="KColorButton" name="backgroundColor">
- <property name="color">
+ <property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
- <property name="defaultColor">
+ <property name="defaultColor" stdset="0">
<color>
<red>0</red>
<green>0</green>
</property>
</widget>
</item>
- <item row="1" column="0" colspan="9">
+ <item row="1" column="0" colspan="11">
<widget class="QStackedWidget" name="toolbar_stack">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
</item>
<item row="0" column="1">
<widget class="KColorButton" name="rectBColor">
- <property name="color">
+ <property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
- <property name="defaultColor">
+ <property name="defaultColor" stdset="0">
<color>
<red>0</red>
<green>0</green>
</item>
<item row="0" column="5">
<widget class="KColorButton" name="rectFColor">
- <property name="color">
+ <property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
- <property name="defaultColor">
+ <property name="defaultColor" stdset="0">
<color>
<red>0</red>
<green>0</green>
<property name="flat">
<bool>false</bool>
</property>
- <property name="color">
+ <property name="color" stdset="0">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
- <property name="defaultColor">
+ <property name="defaultColor" stdset="0">
<color>
<red>0</red>
<green>0</green>
</widget>
</widget>
</item>
- <item row="3" column="6">
+ <item row="3" column="8">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
+ <item row="3" column="7">
+ <widget class="QComboBox" name="templateBox"/>
+ </item>
+ <item row="3" column="6">
+ <widget class="QLabel" name="label_22">
+ <property name="text">
+ <string>Template:</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<customwidgets>
--- /dev/null
+FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.kdenlivetitle")
+INSTALL (FILES ${files} DESTINATION ${DATA_INSTALL_DIR}/kdenlive/titles)
--- /dev/null
+<kdenlivetitle width="1920" height="1080" out="125">
+ <item z-index="0" type="QGraphicsTextItem">
+ <position x="728" y="443">
+ <transform>1,0,0,0,1,0,0,0,1</transform>
+ </position>
+ <content font-color="254,255,240,255" font-outline-color="0,0,0,255" font-pixel-size="79" font-italic="0" font-underline="0" font-weight="50" font="Arial Black" font-outline="2.7">Text here</content>
+ </item>
+ <startviewport rect="0,-692.22,1920,1080"/>
+ <endviewport rect="-3.64326,613.89,1920,1080"/>
+ <background color="0,0,0,0"/>
+</kdenlivetitle>
--- /dev/null
+<kdenlivetitle width="1920" height="1080" out="125">
+ <item z-index="3" type="QGraphicsTextItem">
+ <position x="106" y="869">
+ <transform>1,0,0,0,1,0,0,0,1</transform>
+ </position>
+ <content font-color="255,255,255,255" font-outline-color="0,0,0,255" font-pixel-size="46" font-italic="0" font-underline="0" font-weight="50" font="Arial Black" font-outline="1.2">2010/01/01</content>
+ </item>
+ <item z-index="2" type="QGraphicsTextItem">
+ <position x="1148" y="907">
+ <transform>1,0,0,0,1,0,0,0,1</transform>
+ </position>
+ <content font-color="254,255,240,255" font-outline-color="0,0,0,255" font-pixel-size="79" font-italic="0" font-underline="0" font-weight="50" font="Arial Black" font-outline="2.7">Text here </content>
+ </item>
+ <item z-index="1" type="QGraphicsRectItem">
+ <position x="-6" y="850">
+ <transform zoom="100">1,0,0,0,1,0,0,0,1</transform>
+ </position>
+ <content pencolor="0,0,0,0" rect="0,0,1936,234" penwidth="0" brushcolor="175,175,175,136"/>
+ </item>
+ <startviewport rect="0,0,1920,1080"/>
+ <endviewport rect="0,0,1920,1080"/>
+ <background color="0,0,0,0"/>
+</kdenlivetitle>
--- /dev/null
+<kdenlivetitle width="1920" height="1080" out="125">
+ <item z-index="0" type="QGraphicsTextItem">
+ <position x="728" y="443">
+ <transform>1,0,0,0,1,0,0,0,1</transform>
+ </position>
+ <content font-color="254,255,240,255" font-outline-color="0,0,0,255" font-pixel-size="79" font-italic="0" font-underline="0" font-weight="50" font="Arial Black" font-outline="2.7">Text here</content>
+ </item>
+ <startviewport rect="0,0,1920,1080"/>
+ <endviewport rect="0,0,1920,1080"/>
+ <background color="0,0,0,0"/>
+</kdenlivetitle>