}
void initEffects::fillTransitionsList(Mlt::Repository * repository, EffectsList* transitions, QStringList names) {
+ // remove transitions that are not implemented
+ int pos = names.indexOf("mix");
+ if (pos != -1) names.takeAt(pos);
+ pos = names.indexOf("region");
+ if (pos != -1) names.takeAt(pos);
foreach(const QString &name, names) {
QDomDocument ret;
QDomElement ktrans = ret.createElement("ktransition");
#include "mainwindow.h"
-KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, MainWindow *parent): QObject(parent), m_render(NULL), m_url(url), m_projectFolder(projectFolder), m_commandStack(new QUndoStack(undoGroup)), m_modified(false), m_documentLoadingProgress(0), m_documentLoadingStep(0.0), m_startPos(0), m_zoom(7), m_autosave(NULL) {
+KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QPoint tracks, MainWindow *parent): QObject(parent), m_render(NULL), m_url(url), m_projectFolder(projectFolder), m_commandStack(new QUndoStack(undoGroup)), m_modified(false), m_documentLoadingProgress(0), m_documentLoadingStep(0.0), m_startPos(0), m_zoom(7), m_autosave(NULL) {
m_clipManager = new ClipManager(this);
if (!url.isEmpty()) {
QString tmpFile;
} else {
parent->slotGotProgressInfo(i18n("File %1 is not a Kdenlive project file."), 100);
kWarning() << " NO KDENLIVE INFO FOUND IN FILE: " << url.path();
- m_document = createEmptyDocument();
+ m_document = createEmptyDocument(tracks.x(), tracks.y());
setProfilePath(profileName);
}
KIO::NetAccess::removeTempFile(tmpFile);
} else {
KMessageBox::error(parent, KIO::NetAccess::lastErrorString());
parent->slotGotProgressInfo(i18n("File %1 is not a Kdenlive project file."), 100);
- m_document = createEmptyDocument();
+ m_document = createEmptyDocument(tracks.x(), tracks.y());
setProfilePath(profileName);
}
} else {
- m_document = createEmptyDocument();
+ m_document = createEmptyDocument(tracks.x(), tracks.y());
setProfilePath(profileName);
}
m_scenelist = m_document.toString();
m_autosave->remove();
}
-QDomDocument KdenliveDoc::createEmptyDocument() {
+QDomDocument KdenliveDoc::createEmptyDocument(const int videotracks, const int audiotracks) {
// Creating new document
QDomDocument doc;
QDomElement westley = doc.createElement("westley");
// create playlists
- const int audiotracks = 2;
- const int videotracks = 3;
int total = audiotracks + videotracks + 1;
for (int i = 1; i < total; i++) {
QString titleName = "title";
int counter = 0;
QString path = titlesFolder + titleName + QString::number(counter).rightJustified(3, '0', false);
- while (QFile::exists(path + ".kdenlivetitle")) {
+ while (QFile::exists(path + ".png")) {
counter++;
path = titlesFolder + titleName + QString::number(counter).rightJustified(3, '0', false);
}
class KdenliveDoc: public QObject {
Q_OBJECT public:
- KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, MainWindow *parent = 0);
+ KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QPoint tracks, MainWindow *parent = 0);
~KdenliveDoc();
QDomNodeList producersList();
double fps() const;
double m_documentLoadingStep;
double m_documentLoadingProgress;
void convertDocument(double version);
- QDomDocument createEmptyDocument();
+ QDomDocument createEmptyDocument(const int videotracks, const int audiotracks);
public slots:
void slotCreateTextClip(QString group, const QString &groupId);
void MainWindow::newFile() {
QString profileName;
KUrl projectFolder;
+ QPoint projectTracks(3, 2);
if (m_timelineArea->count() == 0) profileName = KdenliveSettings::default_profile();
else {
ProjectSettings *w = new ProjectSettings;
if (w->exec() != QDialog::Accepted) return;
profileName = w->selectedProfile();
projectFolder = w->selectedFolder();
+ projectTracks = w->tracks();
delete w;
}
- KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, this);
+ KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, projectTracks, this);
doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
TrackView *trackView = new TrackView(doc, this);
m_timelineArea->addTab(trackView, KIcon("kdenlive"), doc->description());
void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale) {
KdenliveDoc *doc;
- doc = new KdenliveDoc(url, KUrl(), m_commandStack, QString(), this);
+ doc = new KdenliveDoc(url, KUrl(), m_commandStack, QString(), QPoint(3, 2), this);
if (stale == NULL) {
stale = new KAutoSaveFile(url, doc);
doc->m_autosave = stale;
//buttonOk->setEnabled(false);
m_view.audio_thumbs->setChecked(KdenliveSettings::audiothumbnails());
m_view.video_thumbs->setChecked(KdenliveSettings::videothumbnails());
+ m_view.audio_tracks->setValue(2);
+ m_view.video_tracks->setValue(3);
slotUpdateDisplay();
connect(m_view.profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
connect(m_view.project_folder, SIGNAL(textChanged(const QString &)), this, SLOT(slotUpdateButton(const QString &)));
return m_view.project_folder->url();
}
+QPoint ProjectSettings::tracks() {
+ QPoint p;
+ p.setX(m_view.video_tracks->value());
+ p.setY(m_view.audio_tracks->value());
+ return p;
+}
+
#include "projectsettings.moc"
ProjectSettings(QWidget * parent = 0);
QString selectedProfile() const;
KUrl selectedFolder() const;
+ QPoint tracks();
private slots:
void slotUpdateDisplay();
<rect>
<x>0</x>
<y>0</y>
- <width>370</width>
- <height>257</height>
+ <width>315</width>
+ <height>273</height>
</rect>
</property>
<property name="windowTitle" >
<string>Project Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_3" >
- <item row="0" column="0" colspan="2" >
+ <item row="0" column="0" colspan="3" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Project folder</string>
</property>
</widget>
</item>
- <item row="0" column="2" colspan="3" >
+ <item row="0" column="3" colspan="5" >
<widget class="KUrlRequester" name="project_folder" />
</item>
- <item row="1" column="0" colspan="5" >
+ <item row="1" column="0" colspan="8" >
<widget class="QGroupBox" name="properties" >
<property name="title" >
<string>Video Profile</string>
</layout>
</widget>
</item>
- <item row="2" column="0" >
+ <item row="2" column="0" colspan="2" >
+ <widget class="QLabel" name="label_7" >
+ <property name="text" >
+ <string>Video tracks</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" colspan="2" >
+ <widget class="QSpinBox" name="video_tracks" />
+ </item>
+ <item row="2" column="4" colspan="2" >
+ <widget class="QLabel" name="label_8" >
+ <property name="text" >
+ <string>Audio tracks</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="6" >
+ <widget class="QSpinBox" name="audio_tracks" />
+ </item>
+ <item row="2" column="7" >
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>67</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Thumbnails:</string>
</property>
</widget>
</item>
- <item row="2" column="1" colspan="2" >
+ <item row="3" column="1" colspan="3" >
<widget class="QCheckBox" name="video_thumbs" >
<property name="text" >
<string>Video</string>
</property>
</widget>
</item>
- <item row="2" column="3" >
+ <item row="3" column="4" >
<widget class="QCheckBox" name="audio_thumbs" >
<property name="text" >
<string>Audio</string>
</property>
</widget>
</item>
- <item row="2" column="4" >
+ <item row="3" column="5" colspan="3" >
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
- <item row="3" column="0" colspan="5" >
+ <item row="4" column="3" colspan="3" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</spacer>
</item>
- <item row="4" column="1" colspan="4" >
+ <item row="5" column="1" colspan="7" >
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</widget>
</item>
</layout>
+ <zorder>label_4</zorder>
+ <zorder>project_folder</zorder>
+ <zorder>properties</zorder>
+ <zorder>label_2</zorder>
+ <zorder>video_thumbs</zorder>
+ <zorder>audio_thumbs</zorder>
+ <zorder>buttonBox</zorder>
+ <zorder>label_6</zorder>
+ <zorder>horizontalSpacer_2</zorder>
+ <zorder>label_8</zorder>
+ <zorder>label_7</zorder>
+ <zorder>video_tracks</zorder>
+ <zorder>audio_tracks</zorder>
</widget>
<customwidgets>
<customwidget>