Commit 7bc5a8ed authored by Nicolas Carion's avatar Nicolas Carion

remove old unused functions

parent bee67ca4
......@@ -277,43 +277,6 @@ double Render::sar() const
return m_qmlView->profile()->sar();
}
#if 0
/** Create the producer from the MLT XML QDomDocument */
void Render::initSceneList()
{
//qCDebug(KDENLIVE_LOG) << "-------- INIT SCENE LIST ------_";
QDomDocument doc;
QDomElement mlt = doc.createElement("mlt");
doc.appendChild(mlt);
QDomElement prod = doc.createElement("producer");
prod.setAttribute("resource", "colour");
prod.setAttribute("colour", "red");
prod.setAttribute("id", "black");
prod.setAttribute("in", "0");
prod.setAttribute("out", "0");
QDomElement tractor = doc.createElement("tractor");
QDomElement multitrack = doc.createElement("multitrack");
QDomElement playlist1 = doc.createElement("playlist");
playlist1.appendChild(prod);
multitrack.appendChild(playlist1);
QDomElement playlist2 = doc.createElement("playlist");
multitrack.appendChild(playlist2);
QDomElement playlist3 = doc.createElement("playlist");
multitrack.appendChild(playlist3);
QDomElement playlist4 = doc.createElement("playlist");
multitrack.appendChild(playlist4);
QDomElement playlist5 = doc.createElement("playlist");
multitrack.appendChild(playlist5);
tractor.appendChild(multitrack);
mlt.appendChild(tractor);
// //qCDebug(KDENLIVE_LOG)<<doc.toString();
/*
QString tmp = QString("<mlt><producer resource=\"colour\" colour=\"red\" id=\"red\" /><tractor><multitrack><playlist></playlist><playlist></playlist><playlist /><playlist /><playlist></playlist></multitrack></tractor></mlt>");*/
setSceneList(doc, 0);
}
#endif
void Render::loadUrl(const QString &url)
{
......@@ -438,122 +401,6 @@ void Render::startConsumer()
m_isActive = true;
}
int Render::setSceneList(const QDomDocument &list, int position)
{
return setSceneList(list.toString(), position);
}
int Render::setSceneList(QString playlist, int position)
{
requestedSeekPosition = SEEK_INACTIVE;
m_refreshTimer.stop();
QMutexLocker locker(&m_mutex);
// if (m_winid == -1) return -1;
int error = 0;
qDebug() << "////// RENDER, SET SCENE LIST:\n" << playlist <<"\n..........:::.";
// Remove previous profile info
QDomDocument doc;
doc.setContent(playlist);
QDomElement profile = doc.documentElement().firstChildElement(QStringLiteral("profile"));
doc.documentElement().removeChild(profile);
playlist = doc.toString();
if (m_mltConsumer) {
if (!m_mltConsumer->is_stopped()) {
m_mltConsumer->stop();
}
} else {
qCWarning(KDENLIVE_LOG) << "/////// ERROR, TRYING TO USE nullptr MLT CONSUMER";
error = -1;
}
if (m_mltProducer) {
m_mltProducer->set_speed(0);
qDeleteAll(m_slowmotionProducers);
m_slowmotionProducers.clear();
delete m_mltProducer;
m_mltProducer = nullptr;
emit stopped();
}
m_binController->destroyBin();
blockSignals(true);
m_locale = QLocale();
m_locale.setNumberOptions(QLocale::OmitGroupSeparator);
m_mltProducer = new Mlt::Producer(*m_qmlView->profile(), "xml-string", playlist.toUtf8().constData());
// m_mltProducer = new Mlt::Producer(*m_qmlView->profile(), "xml-nogl-string", playlist.toUtf8().constData());
if ((m_mltProducer == nullptr) || !m_mltProducer->is_valid()) {
qCDebug(KDENLIVE_LOG) << " WARNING - - - - -INVALID PLAYLIST: " << playlist.toUtf8().constData();
m_mltProducer = m_blackClip->cut(0, 1);
error = -1;
}
m_mltProducer->set("eof", "pause");
checkMaxThreads();
m_mltProducer->optimise();
m_fps = m_mltProducer->get_fps();
if (position != 0) {
// Seek to correct place after opening project.
m_mltProducer->seek(position);
}
// init MLT's document root, useful to find full urls
// m_binController->setDocumentRoot(doc.documentElement().attribute(QStringLiteral("root")));
// Fill Bin's playlist
Mlt::Service service(m_mltProducer->parent().get_service());
if (service.type() != tractor_type) {
qCWarning(KDENLIVE_LOG) << "// TRACTOR PROBLEM";
}
blockSignals(false);
Mlt::Tractor tractor(service);
Mlt::Properties retainList((mlt_properties)tractor.get_data("xml_retain"));
if (retainList.is_valid() && (retainList.get_data(m_binController->binPlaylistId().toUtf8().constData()) != nullptr)) {
Mlt::Playlist local_playlist((mlt_playlist)retainList.get_data(m_binController->binPlaylistId().toUtf8().constData()));
if (local_playlist.is_valid() && local_playlist.type() == playlist_type) {
// Load bin clips
m_binController->initializeBin(local_playlist);
}
}
// No Playlist found, create new one
if (m_qmlView) {
m_binController->createIfNeeded(m_qmlView->profile());
QString retain = QStringLiteral("xml_retain %1").arg(m_binController->binPlaylistId());
tractor.set(retain.toUtf8().constData(), m_binController->service(), 0);
// if (!m_binController->hasClip("black")) m_binController->addClipToBin("black", *m_blackClip);
// m_qmlView->setProducer(m_mltProducer);
m_mltConsumer = m_qmlView->consumer();
}
// qCDebug(KDENLIVE_LOG) << "// NEW SCENE LIST DURATION SET TO: " << m_mltProducer->get_playtime();
// m_mltConsumer->connect(*m_mltProducer);
m_mltProducer->set_speed(0);
fillSlowMotionProducers();
emit durationChanged(m_mltProducer->get_playtime() - 1);
// Fill bin
const QStringList ids = m_binController->getClipIds();
for (const QString &id : ids) {
if (id == QLatin1String("black")) {
continue;
}
// pass basic info, the others (folder, etc) will be taken from the producer itself
requestClipInfo info;
info.imageHeight = 0;
info.clipId = id;
info.replaceProducer = true;
// emit gotFileProperties(info, m_binController->getController(id).get());
}
////qCDebug(KDENLIVE_LOG)<<"// SETSCN LST, POS: "<<position;
if (position != 0) {
emit rendererPosition(position);
}
return error;
}
void Render::checkMaxThreads()
{
// Make sure we don't use too much threads, MLT avformat does not cope with too much threads
......
......@@ -109,18 +109,6 @@ class Render : public AbstractRender
void seek(const GenTime &time);
void seekToFrameDiff(int diff);
/** @brief Sets the current MLT producer playlist.
* @param list The xml describing the playlist
* @param position (optional) time to seek to */
int setSceneList(const QDomDocument &list, int position = 0);
/** @brief Sets the current MLT producer playlist.
* @param list new playlist
* @param position (optional) time to seek to
* @return 0 when it has success, different from 0 otherwise
*
* Creates the producer from the text playlist. */
int setSceneList(QString playlist, int position = 0);
bool updateProducer(Mlt::Producer *producer);
bool setProducer(Mlt::Producer *producer, int position, bool isActive);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment