KCmdLineOptions options;
options.add("mlt-path <path>", ki18n("Set the path for MLT environment"));
options.add("+[file]", ki18n("Document to open")); //new
+ options.add("i <clips>", ki18n("Comma separated list of clips to add")); //new
KCmdLineArgs::addCmdLineOptions(options); //new
KApplication app;
}
} else {
KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); //new
-
+ QString clipsToLoad = args->getOption("i");
QString mltPath = args->getOption("mlt-path");
KUrl url;
if (args->count()) {
url = args->url(0);
}
- window = new MainWindow(mltPath, url);
+ window = new MainWindow(mltPath, url, clipsToLoad);
window->show();
args->clear();
EffectsList MainWindow::customEffects;
EffectsList MainWindow::transitions;
-MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent) :
+MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & clipsToLoad, QWidget *parent) :
KXmlGuiWindow(parent),
m_activeDocument(NULL),
m_activeTimeline(NULL),
newFile(false);
}
+ if (!clipsToLoad.isEmpty() && m_activeDocument) {
+ QStringList list = clipsToLoad.split(',');
+ QList <QUrl> urls;
+ foreach(QString path, list) {
+ kDebug() << QDir::current().absoluteFilePath(path);
+ urls << QUrl::fromLocalFile(QDir::current().absoluteFilePath(path));
+ }
+ m_projectList->slotAddClip(urls);
+ }
+
#ifndef NO_JOGSHUTTLE
activateShuttleDevice();
#endif /* NO_JOGSHUTTLE */
/** @brief Initialises the main window.
* @param MltPath (optional) path to MLT environment
* @param Url (optional) file to open
+ * @param clipsToLoad (optional) a comma separated list of clips to import in project
*
* If Url is present, it will be opened, otherwhise, if openlastproject is
* set, latest project will be opened. If no file is open after trying this,
* a default new file will be created. */
explicit MainWindow(const QString &MltPath = QString(),
- const KUrl &Url = KUrl(), QWidget *parent = 0);
+ const KUrl &Url = KUrl(), const QString & clipsToLoad = QString(), QWidget *parent = 0);
virtual ~MainWindow();
/** @brief Locates the MLT environment.