svn path=/branches/KDE4/; revision=2198
-void ClipManager::setThumbsProgress(KUrl url, int progress) {
- m_doc->setThumbsProgress(url, progress);
+void ClipManager::setThumbsProgress(const QString &message, int progress) {
+ m_doc->setThumbsProgress(message, progress);
}
QList <DocClipBase*> ClipManager::documentClipList() {
}
QList <DocClipBase*> ClipManager::documentClipList() {
void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, bool loop, const QString group, const int groupId);
DocClipBase *getClipById(int clipId);
void slotDeleteClip(uint clipId);
void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, bool loop, const QString group, const int groupId);
DocClipBase *getClipById(int clipId);
void slotDeleteClip(uint clipId);
- void setThumbsProgress(KUrl url, int progress);
+ void setThumbsProgress(const QString &message, int progress);
void checkAudioThumbs();
QList <DocClipBase*> documentClipList();
int getFreeClipId();
void checkAudioThumbs();
QList <DocClipBase*> documentClipList();
int getFreeClipId();
}
MltVideoProfile prof = ProfilesDialog::getVideoProfile(profileName);
if (prof.width == 0) prof = ProfilesDialog::getVideoProfile("dv_pal");
}
MltVideoProfile prof = ProfilesDialog::getVideoProfile(profileName);
if (prof.width == 0) prof = ProfilesDialog::getVideoProfile("dv_pal");
- KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, prof, m_commandStack);
+ KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, prof, m_commandStack, this);
TrackView *trackView = new TrackView(doc, this);
m_timelineArea->addTab(trackView, KIcon("kdenlive"), i18n("Untitled") + " / " + prof.description);
TrackView *trackView = new TrackView(doc, this);
m_timelineArea->addTab(trackView, KIcon("kdenlive"), i18n("Untitled") + " / " + prof.description);
- if (m_timelineArea->count() == 1)
+ if (m_timelineArea->count() == 1) {
+ connectDocumentInfo(doc);
connectDocument(trackView, doc);
connectDocument(trackView, doc);
else m_timelineArea->setTabBarHidden(false);
}
void MainWindow::activateDocument() {
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
KdenliveDoc *currentDoc = currentTab->document();
else m_timelineArea->setTabBarHidden(false);
}
void MainWindow::activateDocument() {
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
KdenliveDoc *currentDoc = currentTab->document();
+ connectDocumentInfo(currentDoc);
connectDocument(currentTab, currentDoc);
}
connectDocument(currentTab, currentDoc);
}
}
void MainWindow::openFile() { //changed
}
void MainWindow::openFile() { //changed
- KUrl url = KFileDialog::getOpenUrl(KUrl(), "application/vnd.kde.kdenlive;*.kdenlive");
+ KUrl url = KFileDialog::getOpenUrl(KUrl(), "*.kdenlive|Kdenlive project files (*.kdenlive)\n*.westley|MLT project files (*.westley)");
if (url.isEmpty()) return;
m_fileOpenRecent->addUrl(url);
openFile(url);
if (url.isEmpty()) return;
m_fileOpenRecent->addUrl(url);
openFile(url);
//TODO: get video profile from url before opening it
MltVideoProfile prof = ProfilesDialog::getVideoProfile(KdenliveSettings::default_profile());
if (prof.width == 0) prof = ProfilesDialog::getVideoProfile("dv_pal");
//TODO: get video profile from url before opening it
MltVideoProfile prof = ProfilesDialog::getVideoProfile(KdenliveSettings::default_profile());
if (prof.width == 0) prof = ProfilesDialog::getVideoProfile("dv_pal");
- KdenliveDoc *doc = new KdenliveDoc(url, KUrl(), prof, m_commandStack);
+ KdenliveDoc *doc = new KdenliveDoc(url, KUrl(), prof, m_commandStack, this);
+ connectDocumentInfo(doc);
TrackView *trackView = new TrackView(doc, this);
m_timelineArea->setCurrentIndex(m_timelineArea->addTab(trackView, KIcon("kdenlive"), doc->description()));
m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), doc->url().path());
if (m_timelineArea->count() > 1) m_timelineArea->setTabBarHidden(false);
TrackView *trackView = new TrackView(doc, this);
m_timelineArea->setCurrentIndex(m_timelineArea->addTab(trackView, KIcon("kdenlive"), doc->description()));
m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), doc->url().path());
if (m_timelineArea->count() > 1) m_timelineArea->setTabBarHidden(false);
+ slotGotProgressInfo(QString(), -1);
//connectDocument(trackView, doc);
}
//connectDocument(trackView, doc);
}
+void MainWindow::connectDocumentInfo(KdenliveDoc *doc) {
+ if (m_activeDocument) {
+ if (m_activeDocument == doc) return;
+ disconnect(m_activeDocument, SIGNAL(progressInfo(const QString &, int)), this, SLOT(slotGotProgressInfo(const QString &, int)));
+ }
+ connect(doc, SIGNAL(progressInfo(const QString &, int)), this, SLOT(slotGotProgressInfo(const QString &, int)));
+}
+
void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //changed
//m_projectMonitor->stop();
kDebug() << "/////////////////// CONNECTING DOC TO PROJECT VIEW ////////////////";
void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //changed
//m_projectMonitor->stop();
kDebug() << "/////////////////// CONNECTING DOC TO PROJECT VIEW ////////////////";
disconnect(m_activeDocument, SIGNAL(updateClipDisplay(int)), m_projectList, SLOT(slotUpdateClip(int)));
disconnect(m_activeDocument, SIGNAL(refreshClipThumbnail(int)), m_projectList, SLOT(slotRefreshClipThumbnail(int)));
disconnect(m_activeDocument, SIGNAL(deletTimelineClip(int)), m_activeTimeline, SLOT(slotDeleteClip(int)));
disconnect(m_activeDocument, SIGNAL(updateClipDisplay(int)), m_projectList, SLOT(slotUpdateClip(int)));
disconnect(m_activeDocument, SIGNAL(refreshClipThumbnail(int)), m_projectList, SLOT(slotRefreshClipThumbnail(int)));
disconnect(m_activeDocument, SIGNAL(deletTimelineClip(int)), m_activeTimeline, SLOT(slotDeleteClip(int)));
- disconnect(m_activeDocument, SIGNAL(thumbsProgress(KUrl, int)), this, SLOT(slotGotProgressInfo(KUrl, int)));
disconnect(m_activeTimeline, SIGNAL(clipItemSelected(ClipItem*)), effectStack, SLOT(slotClipItemSelected(ClipItem*)));
disconnect(trackView, SIGNAL(clipItemSelected(ClipItem*)), this, SLOT(slotActivateEffectStackView()));
disconnect(m_activeTimeline, SIGNAL(transitionItemSelected(Transition*)), transitionConfig, SLOT(slotTransitionItemSelected(Transition*)));
disconnect(m_activeTimeline, SIGNAL(clipItemSelected(ClipItem*)), effectStack, SLOT(slotClipItemSelected(ClipItem*)));
disconnect(trackView, SIGNAL(clipItemSelected(ClipItem*)), this, SLOT(slotActivateEffectStackView()));
disconnect(m_activeTimeline, SIGNAL(transitionItemSelected(Transition*)), transitionConfig, SLOT(slotTransitionItemSelected(Transition*)));
connect(doc, SIGNAL(refreshClipThumbnail(int)), m_projectList, SLOT(slotRefreshClipThumbnail(int)));
connect(doc, SIGNAL(deletTimelineClip(int)), trackView, SLOT(slotDeleteClip(int)));
connect(doc, SIGNAL(refreshClipThumbnail(int)), m_projectList, SLOT(slotRefreshClipThumbnail(int)));
connect(doc, SIGNAL(deletTimelineClip(int)), trackView, SLOT(slotDeleteClip(int)));
- connect(doc, SIGNAL(thumbsProgress(KUrl, int)), this, SLOT(slotGotProgressInfo(KUrl, int)));
connect(doc, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
connect(doc, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
-void MainWindow::slotGotProgressInfo(KUrl url, int progress) {
+void MainWindow::slotGotProgressInfo(const QString &message, int progress) {
statusProgressBar->setValue(progress);
statusProgressBar->setValue(progress);
- if (progress > 0) {
- statusLabel->setText(tr("Creating Audio Thumbs"));
+ if (progress >= 0) {
+ if (!message.isEmpty()) statusLabel->setText(message);
statusProgressBar->setVisible(true);
} else {
statusProgressBar->setVisible(true);
} else {
- statusLabel->setText("");
+ statusLabel->setText(QString());
statusProgressBar->setVisible(false);
}
}
statusProgressBar->setVisible(false);
}
}
void saveOptions();
void activateShuttleDevice();
void slotShuttleAction(int code);
void saveOptions();
void activateShuttleDevice();
void slotShuttleAction(int code);
+ void connectDocumentInfo(KdenliveDoc *doc);
public slots:
void openFile(const KUrl &url);
public slots:
void openFile(const KUrl &url);
+ void slotGotProgressInfo(const QString &message, int progress);
private slots:
void newFile();
private slots:
void newFile();
void slotEditProfiles();
void slotEditProjectSettings();
void slotDisplayActionMessage(QAction *a);
void slotEditProfiles();
void slotEditProjectSettings();
void slotDisplayActionMessage(QAction *a);
- void slotGotProgressInfo(KUrl url, int progress);
void slotSwitchVideoThumbs();
void slotSwitchAudioThumbs();
void slotSwitchMarkersComments();
void slotSwitchVideoThumbs();
void slotSwitchAudioThumbs();
void slotSwitchMarkersComments();
QDomElement e;
QDomElement p;
bool videotrack;
QDomElement e;
QDomElement p;
bool videotrack;
- kDebug() << "//////////// TIMELINE FOUND: " << m_projectTracks << " tracks";
int pos = m_projectTracks - 1;
int pos = m_projectTracks - 1;
for (int i = 0; i < m_projectTracks; i++) {
e = tracks.item(i).toElement();
QString playlist_name = e.attribute("producer");
for (int i = 0; i < m_projectTracks; i++) {
e = tracks.item(i).toElement();
QString playlist_name = e.attribute("producer");
pos--;
kDebug() << " PRO DUR: " << trackduration << ", TRACK DUR: " << duration;
if (trackduration > duration) duration = trackduration;
pos--;
kDebug() << " PRO DUR: " << trackduration << ", TRACK DUR: " << duration;
if (trackduration > duration) duration = trackduration;
+ } else {
+ // background black track
+ int black_clips = e.childNodes().count();
+ for (int i = 0; i < black_clips; i++)
+ m_doc->loadingProgressed();
+ qApp->processEvents();
+ pos--;
+ }
// parse transitions
QDomNodeList transitions = doc.elementsByTagName("transition");
int projectTransitions = transitions.count();
// parse transitions
QDomNodeList transitions = doc.elementsByTagName("transition");
int projectTransitions = transitions.count();
if (elem.tagName() == "blank") {
position += elem.attribute("length").toInt();
} else if (elem.tagName() == "entry") {
if (elem.tagName() == "blank") {
position += elem.attribute("length").toInt();
} else if (elem.tagName() == "entry") {
+ m_doc->loadingProgressed();
+ qApp->processEvents();
// Found a clip
int in = elem.attribute("in").toInt();
int id = elem.attribute("producer").toInt();
// Found a clip
int in = elem.attribute("in").toInt();
int id = elem.attribute("producer").toInt();