target_link_libraries(kdenlive
${KDE4_KDEUI_LIBS}
- ${KDE4_KIO_LIBS}
+ ${KDE4_KIO_LIBS}
+ ${KDE4_KNEWSTUFF2_LIBS}
${LIBMLTPLUS_LIBRARY}
${LIBMLT_LIBRARY}
${NEPOMUK_LIBRARIES}
install (FILES kdenlivesettings.kcfg DESTINATION share/config.kcfg)
install (FILES kdenlive.desktop DESTINATION share/applications/kde)
install (FILES application-x-kdenlive.svgz video-mlt-playlist.svgz DESTINATION share/icons/oxygen/scalable/mimetypes)
+install( FILES kdenlive.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
kde4_install_icons( ${ICON_INSTALL_DIR} )
initEffects::~initEffects() {
}
+
+// static
+void initEffects::refreshLumas() {
+
+ // Check for Kdenlive installed luma files
+ QStringList imagenamelist;
+ QStringList imagefiles;
+ QStringList filters;
+ filters << "*.pgm" << "*.png";
+
+ QStringList customLumas = KGlobal::dirs()->findDirs("appdata", "lumas");
+ foreach(const QString &folder, customLumas) {
+ QStringList filesnames = QDir(folder).entryList(filters, QDir::Files);
+ foreach(const QString &fname, filesnames) {
+ imagenamelist.append(fname);
+ imagefiles.append(folder + '/' + fname);
+ }
+ }
+
+ // Check for MLT lumas
+ QString folder = mlt_environment("MLT_DATA");
+ folder.append("/lumas/").append(mlt_environment("MLT_NORMALISATION"));
+ QDir lumafolder(folder);
+ QStringList filesnames = lumafolder.entryList(filters, QDir::Files);
+ foreach(const QString &fname, filesnames) {
+ imagenamelist.append(fname);
+ imagefiles.append(folder + '/' + fname);
+ }
+ QDomElement lumaTransition = MainWindow::transitions.getEffectByTag("luma", QString());
+ QDomNodeList params = lumaTransition.elementsByTagName("parameter");
+ for (int i = 0; i < params.count(); i++) {
+ QDomElement e = params.item(i).toElement();
+ if (e.attribute("tag") == "resource") {
+ e.setAttribute("paramlistdisplay", imagenamelist.join(","));
+ e.setAttribute("paramlist", imagefiles.join(","));
+ break;
+ }
+ }
+
+
+}
+
//static
Mlt::Repository *initEffects::parseEffectFiles() {
QStringList::Iterator more;
transitions->append(ret.documentElement());
//kDebug() << "//// //// TRANSITON XML";
- //kDebug() << ret.toString();
+ kDebug() << ret.toString();
/*
<transition fill="1" in="11" a_track="1" out="73" mlt_service="luma" b_track="2" softness="0" resource="/home/marco/Projekte/kdenlive/install_cmake/share/apps/kdenlive/pgm/PAL/square2.pgm" />
~initEffects();
static Mlt::Repository *parseEffectFiles();
+ static void refreshLumas();
static QDomDocument createDescriptionFromMlt(Mlt::Repository* repository, const QString& type, const QString& name);
static void fillTransitionsList(Mlt::Repository *, EffectsList* transitions, QStringList names);
static QDomElement quickParameterFill(QDomDocument & doc, QString name, QString tag, QString type, QString def = QString(), QString min = QString(), QString max = QString(), QString list = QString(), QString listdisplaynames = QString(), QString factor = QString(), QString namedesc = QString(), QString format = QString());
--- /dev/null
+[KNewStuff2]
+ProvidersUrl=http://download.kde.org/khotnewstuff/kdenlive-providers.xml
+TargetDir=kdenlive/lumas
+Uncompress=archive
\ No newline at end of file
</Menu>
<Menu name="settings" >
<Action name="manage_profiles" />
+ <Action name="get_new_stuff" />
</Menu>
</MenuBar>
</gui>
\ No newline at end of file
#include <KFileItem>
#include <KNotification>
#include <KNotifyConfigWidget>
+#include <knewstuff2/engine.h>
+#include <knewstuff2/ui/knewstuffaction.h>
#include <mlt++/Mlt.h>
collection->addAction("manage_profiles", profilesAction);
connect(profilesAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProfiles()));
+ KAction* fileGHNS = KNS::standardAction(i18n("Download New Lumas..."), this, SLOT(slotGetNewStuff()), actionCollection(), "get_new_stuff");
+
KAction* projectAction = new KAction(KIcon("configure"), i18n("Project Settings"), this);
collection->addAction("project_settings", projectAction);
connect(projectAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProjectSettings()));
} else m_activeTimeline->projectView()->setOutPoint();
}
+void MainWindow::slotGetNewStuff() {
+ kDebug() << "// GET NEW STUFF";
+ //KNS::Entry::List download();
+ KNS::Entry::List entries = KNS::Engine::download();
+ int numberInstalled = 0;
+ // list of changed entries
+ kDebug() << "// PARSING KNS";
+ foreach(KNS::Entry* entry, entries) {
+ // care only about installed ones
+ if (entry->status() == KNS::Entry::Installed) {
+ foreach(const QString &file, entry->installedFiles()) {
+ kDebug() << "// CURRENTLY INSTALLED: " << file;
+ }
+ }
+ }
+ qDeleteAll(entries);
+ initEffects::refreshLumas();
+}
#include "mainwindow.moc"
void slotInsertTrack(int ix = 0);
void slotDeleteTrack(int ix = 0);
void slotChangeTrack(int ix = 0);
+ void slotGetNewStuff();
};