svn path=/trunk/kdenlive/; revision=3793
+void ClipManager::clearUnusedProducers()
+{
+ for (int i = 0; i < m_clipList.count(); i++) {
+ if (m_clipList.at(i)->numReferences() == 0) m_clipList.at(i)->deleteProducers();
+ }
+}
+
void ClipManager::resetProducersList(QList <Mlt::Producer *> prods)
{
for (int i = 0; i < m_clipList.count(); i++) {
void ClipManager::resetProducersList(QList <Mlt::Producer *> prods)
{
for (int i = 0; i < m_clipList.count(); i++) {
kDebug() << "// // // REPLACE CLIP: " << id;
}
}
kDebug() << "// // // REPLACE CLIP: " << id;
}
}
}
void ClipManager::slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId)
}
void ClipManager::slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId)
void endAudioThumbsGeneration(const QString &requestedId);
void askForAudioThumb(const QString &id);
QString projectFolder() const;
void endAudioThumbsGeneration(const QString &requestedId);
void askForAudioThumb(const QString &id);
QString projectFolder() const;
+ void clearUnusedProducers();
void resetProducersList(QList <Mlt::Producer *> prods);
void addFolder(const QString&, const QString&);
void deleteFolder(const QString&);
void resetProducersList(QList <Mlt::Producer *> prods);
void addFolder(const QString&, const QString&);
void deleteFolder(const QString&);
signals:
void reloadClip(const QString &);
signals:
void reloadClip(const QString &);
KdenliveSettings::setCurrent_profile(profile);
KdenliveSettings::setProject_fps(m_activeDocument->fps());
setCaption(m_activeDocument->description(), m_activeDocument->isModified());
KdenliveSettings::setCurrent_profile(profile);
KdenliveSettings::setProject_fps(m_activeDocument->fps());
setCaption(m_activeDocument->description(), m_activeDocument->isModified());
+
+ m_activeDocument->clipManager()->clearUnusedProducers();
m_monitorManager->resetProfiles(m_activeDocument->timecode());
m_monitorManager->resetProfiles(m_activeDocument->timecode());
m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeTimeline->tracksNumber());
m_effectStack->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode());
if (m_renderWidget) m_renderWidget->setProfile(m_activeDocument->mltProfile());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeTimeline->tracksNumber());
m_effectStack->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode());
if (m_renderWidget) m_renderWidget->setProfile(m_activeDocument->mltProfile());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
- m_activeDocument->clipManager()->resetProducersList(m_projectMonitor->render->producersList());
+ //m_activeDocument->clipManager()->resetProducersList(m_projectMonitor->render->producersList());
if (dar != m_activeDocument->dar()) m_projectList->reloadClipThumbnails();
m_activeTimeline->updateProjectFps();
if (dar != m_activeDocument->dar()) m_projectList->reloadClipThumbnails();
m_activeTimeline->updateProjectFps();
// We need to desactivate & reactivate monitors to get a refresh
// We need to desactivate & reactivate monitors to get a refresh
- m_monitorManager->switchMonitors();
+ //m_monitorManager->switchMonitors();
{
if (m_blocked) return;
m_timecode = tc;
{
if (m_blocked) return;
m_timecode = tc;
- QTimer::singleShot(300, this, SLOT(slotResetProfiles()));
+ slotResetProfiles();
+ //QTimer::singleShot(300, this, SLOT(slotResetProfiles()));
}
void MonitorManager::slotResetProfiles()
}
void MonitorManager::slotResetProfiles()
m_doc = doc;
connect(m_doc->clipManager(), SIGNAL(reloadClip(const QString &)), this, SLOT(slotReloadClip(const QString &)));
m_doc = doc;
connect(m_doc->clipManager(), SIGNAL(reloadClip(const QString &)), this, SLOT(slotReloadClip(const QString &)));
+ connect(m_doc->clipManager(), SIGNAL(checkAllClips()), this, SLOT(updateAllClips()));
QMap <QString, QString> flist = doc->clipManager()->documentFolderList();
QMapIterator<QString, QString> f(flist);
QMap <QString, QString> flist = doc->clipManager()->documentFolderList();
QMapIterator<QString, QString> f(flist);
void ProjectList::slotRefreshClipThumbnail(ProjectItem *item, bool update)
{
if (item) {
void ProjectList::slotRefreshClipThumbnail(ProjectItem *item, bool update)
{
if (item) {
- int height = 50;
- int width = (int)(height * m_render->dar());
DocClipBase *clip = item->referencedClip();
if (!clip) {
slotProcessNextThumbnail();
return;
}
QPixmap pix;
DocClipBase *clip = item->referencedClip();
if (!clip) {
slotProcessNextThumbnail();
return;
}
QPixmap pix;
+ int height = 50;
+ int width = (int)(height * m_render->dar());
if (clip->clipType() == AUDIO) pix = KIcon("audio-x-generic").pixmap(QSize(width, height));
else if (clip->clipType() == TEXT || clip->clipType() == IMAGE) pix = KThumb::getFrame(item->referencedClip()->producer(), 0, width, height);
else pix = item->referencedClip()->thumbProducer()->extractImage(item->referencedClip()->getClipThumbFrame(), width, height);
if (clip->clipType() == AUDIO) pix = KIcon("audio-x-generic").pixmap(QSize(width, height));
else if (clip->clipType() == TEXT || clip->clipType() == IMAGE) pix = KThumb::getFrame(item->referencedClip()->producer(), 0, width, height);
else pix = item->referencedClip()->thumbProducer()->extractImage(item->referencedClip()->getClipThumbFrame(), width, height);
QDomElement producersList();
void setRenderer(Render *projectRender);
void slotUpdateClipProperties(const QString &id, QMap <QString, QString> properties);
QDomElement producersList();
void setRenderer(Render *projectRender);
void slotUpdateClipProperties(const QString &id, QMap <QString, QString> properties);
QByteArray headerInfo() const;
void setHeaderInfo(const QByteArray &state);
void setupMenu(QMenu *addMenu, QAction *defaultAction);
QByteArray headerInfo() const;
void setHeaderInfo(const QByteArray &state);
void setupMenu(QMenu *addMenu, QAction *defaultAction);
public slots:
void setDocument(KdenliveDoc *doc);
public slots:
void setDocument(KdenliveDoc *doc);
void slotReplyGetImage(const QString &clipId, const QPixmap &pix);
void slotReplyGetFileProperties(const QString &clipId, Mlt::Producer *producer, const QMap < QString, QString > &properties, const QMap < QString, QString > &metadata, bool replace);
void slotAddClip(DocClipBase *clip, bool getProperties);
void slotReplyGetImage(const QString &clipId, const QPixmap &pix);
void slotReplyGetFileProperties(const QString &clipId, Mlt::Producer *producer, const QMap < QString, QString > &properties, const QMap < QString, QString > &metadata, bool replace);
void slotAddClip(DocClipBase *clip, bool getProperties);
void Render::closeMlt()
{
//delete m_osdTimer;
void Render::closeMlt()
{
//delete m_osdTimer;
-
- Mlt::Service service(m_mltProducer->get_service());
- if (service.type() == tractor_type) {
- Mlt::Tractor tractor(service);
- int trackNb = tractor.count();
-
- while (trackNb > 1) {
- Mlt::Producer trackProducer(tractor.track(trackNb - 1));
- Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
- trackPlaylist.clear();
- trackNb--;
+ if (m_mltProducer) {
+ Mlt::Service service(m_mltProducer->get_service());
+ if (service.type() == tractor_type) {
+ Mlt::Tractor tractor(service);
+ int trackNb = tractor.count();
+
+ while (trackNb > 1) {
+ Mlt::Producer trackProducer(tractor.track(trackNb - 1));
+ Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
+ trackPlaylist.clear();
+ trackNb--;
+ }
- kDebug() << "// // // CLOSE RENDERER";
+ kDebug() << "// // // CLOSE RENDERER " << m_name;
delete m_mltConsumer;
delete m_mltProducer;
delete m_blackClip;
delete m_mltConsumer;
delete m_mltProducer;
delete m_blackClip;
int pos = 0;
if (m_mltProducer) {
pos = m_mltProducer->position();
int pos = 0;
if (m_mltProducer) {
pos = m_mltProducer->position();
+
+
+ Mlt::Service service(m_mltProducer->get_service());
+ if (service.type() == tractor_type) {
+ Mlt::Tractor tractor(service);
+ int trackNb = tractor.count();
+ while (trackNb > 1) {
+ Mlt::Producer trackProducer(tractor.track(trackNb - 1));
+ Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
+ trackPlaylist.clear();
+ trackNb--;
+ }
+ }
+
+
delete m_mltProducer;
}
m_mltProducer = NULL;
delete m_mltProducer;
}
m_mltProducer = NULL;
+ delete m_blackClip;
+ m_blackClip = NULL;
- //WARNING: Trying to delete the profile will crash when trying to display a clip afterwards...
- /*if (m_mltProfile) delete m_mltProfile;
- m_mltProfile = NULL;*/
+ if (m_mltProfile) delete m_mltProfile;
+ m_mltProfile = NULL;
m_mltProducer->set_speed(0);
//if (KdenliveSettings::osdtimecode() && m_osdInfo) m_mltProducer->detach(*m_osdInfo);
m_mltProducer->set_speed(0);
//if (KdenliveSettings::osdtimecode() && m_osdInfo) m_mltProducer->detach(*m_osdInfo);
+
+ Mlt::Service service(m_mltProducer->get_service());
+ if (service.type() == tractor_type) {
+ Mlt::Tractor tractor(service);
+ int trackNb = tractor.count();
+ while (trackNb > 1) {
+ Mlt::Producer trackProducer(tractor.track(trackNb - 1));
+ Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
+ trackPlaylist.clear();
+ trackNb--;
+ }
+ }
+
delete m_mltProducer;
m_mltProducer = NULL;
emit stopped();
delete m_mltProducer;
m_mltProducer = NULL;
emit stopped();
-void Render::clear()
-{
- kDebug() << " ********* RENDER CLEAR";
- if (m_mltConsumer) {
- //m_mltConsumer->set("refresh", 0);
- if (!m_mltConsumer->is_stopped()) m_mltConsumer->stop();
- }
-
- if (m_mltProducer) {
- //if (KdenliveSettings::osdtimecode() && m_osdInfo) m_mltProducer->detach(*m_osdInfo);
- m_mltProducer->set_speed(0.0);
- delete m_mltProducer;
- m_mltProducer = NULL;
- emit stopped();
- }
-}
-
void Render::stop()
{
if (m_mltProducer == NULL) return;
void Render::stop()
{
if (m_mltProducer == NULL) return;
int pos = 0;
if (m_mltProducer) {
pos = m_mltProducer->position();
int pos = 0;
if (m_mltProducer) {
pos = m_mltProducer->position();
setSceneList(scene, pos);
}
setSceneList(scene, pos);
}
void start();
/** Stop Consumer */
void stop();
void start();
/** Stop Consumer */
void stop();
int getLength();
/** If the file is readable by mlt, return true, otherwise false */
bool isValid(KUrl url);
int getLength();
/** If the file is readable by mlt, return true, otherwise false */
bool isValid(KUrl url);
{
QDomNodeList titles = doc.elementsByTagName("kdenlivetitle");
//TODO: Check if the opened title size is equal to project size, otherwise warn user and rescale
{
QDomNodeList titles = doc.elementsByTagName("kdenlivetitle");
//TODO: Check if the opened title size is equal to project size, otherwise warn user and rescale
+ if (doc.documentElement().hasAttribute("width") && doc.documentElement().hasAttribute("height")) {
+ int doc_width = doc.documentElement().attribute("width").toInt();
+ int doc_height = doc.documentElement().attribute("height").toInt();
+ if (doc_width != m_width || doc_height != m_height) {
+ KMessageBox::information(kapp->activeWindow(), i18n("This title clip was created with a different frame size. It will now be converted to the current project's size."), i18n("Resizing Title Clip"));
+ //TODO: convert using QTransform
+ }
+ }
//TODO: get default title duration instead of hardcoded one
if (doc.documentElement().hasAttribute("out"))
*out = doc.documentElement().attribute("out").toDouble();
//TODO: get default title duration instead of hardcoded one
if (doc.documentElement().hasAttribute("out"))
*out = doc.documentElement().attribute("out").toDouble();