Commit 42c7c030 authored by Vincent Pinon's avatar Vincent Pinon

cleanup some debug messages (reduce startup verbosity)

parent 1c134a91
......@@ -56,14 +56,11 @@ template <typename AssetType> void AbstractAssetsRepository<AssetType>::init()
// sox effects are not usage directly (parameters not available)
continue;
}
// qDebug() << "trying to parse " <<name <<" blacklist="<<m_blacklist.contains(name);
if (!m_blacklist.contains(name) && parseInfoFromMlt(name, info)) {
m_assets[name] = info;
} else {
if (m_blacklist.contains(name)) {
qDebug() << name << "is blacklisted";
} else {
qDebug() << "WARNING : Fails to parse " << name;
if (!m_blacklist.contains(name)) {
qWarning() << "Failed to parse" << name;
}
}
}
......@@ -95,14 +92,6 @@ template <typename AssetType> void AbstractAssetsRepository<AssetType>::init()
for (const auto &custom : customAssets) {
// Custom assets should override default ones
m_assets[custom.first] = custom.second;
/*if (m_assets.count(custom.second.mltId) > 0) {
m_assets.erase(custom.second.mltId);
}
if (m_assets.count(custom.first) == 0) {
m_assets[custom.first] = custom.second;
} else {
qDebug() << "Error: conflicting asset name " << custom.first;
}*/
}
}
......@@ -251,11 +240,10 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
res.xml = eff;
return true;
} else {
qDebug() << "Invalid title/identifier for " << assetId;
qDebug() << metadata->get("title") << "/" << metadata->get("identifier");
qWarning() << "Invalid title/identifier for" << assetId;
}
} else {
qDebug() << "Metadata for" << assetId << "is invalid.";
qWarning() << "Invalid metadata for" << assetId;
}
return false;
}
......@@ -315,7 +303,7 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
}
if (!exists(tag)) {
qDebug() << "++++++ Unknown asset : " << tag;
qDebug() << "Unknown asset" << tag;
return false;
}
......@@ -348,7 +336,7 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
template <typename AssetType> QDomElement AbstractAssetsRepository<AssetType>::getXml(const QString &assetId) const
{
if (m_assets.count(assetId) == 0) {
qDebug() << "Error : Requesting info on unknown transition " << assetId;
qWarning() << "Unknown transition" << assetId;
return QDomElement();
}
return m_assets.at(assetId).xml.cloneNode().toElement();
......
......@@ -132,7 +132,7 @@ QVariant ProjectItemModel::data(const QModelIndex &index, int role) const
if (thumb.canConvert<QIcon>()) {
icon = thumb.value<QIcon>();
} else {
qDebug() << "ERROR: invalid icon found";
qWarning() << "invalid icon";
}
return icon;
}
......@@ -538,24 +538,24 @@ void ProjectItemModel::loadSubClips(const QString &id, const QString &dataMap, F
QWriteLocker locker(&m_lock);
std::shared_ptr<ProjectClip> clip = getClipByBinID(id);
if (!clip) {
qDebug()<<" = = = = = CLIP NOT LOADED";
qWarning() << "Clip not loaded";
return;
}
auto json = QJsonDocument::fromJson(dataMap.toUtf8());
if (!json.isArray()) {
qDebug() << "Error loading zones : Json file should be an array";
qWarning() << "Error loading zones: no json array";
return;
}
int maxFrame = clip->duration().frames(pCore->getCurrentFps()) - 1;
auto list = json.array();
for (const auto &entry : qAsConst(list)) {
if (!entry.isObject()) {
qDebug() << "Warning : Skipping invalid marker data";
qWarning() << "Skipping invalid marker data";
continue;
}
auto entryObj = entry.toObject();
if (!entryObj.contains(QLatin1String("name"))) {
qDebug() << "Warning : Skipping invalid zone(does not contain name)";
qWarning() << "Skipping invalid zone (does not contain name)";
continue;
}
int in = entryObj[QLatin1String("in")].toInt();
......@@ -565,7 +565,7 @@ void ProjectItemModel::loadSubClips(const QString &id, const QString &dataMap, F
zoneProperties.insert(QStringLiteral("rating"), QString::number(entryObj[QLatin1String("rating")].toInt()));
zoneProperties.insert(QStringLiteral("tags"), entryObj[QLatin1String("tags")].toString(QString()));
if (in >= out) {
qDebug() << "Warning : Invalid zone: "<<zoneProperties.value("name")<<", "<<in<<"-"<<out;
qWarning() << "Invalid zone" << zoneProperties.value("name") << in << out;
continue;
}
if (maxFrame > 0) {
......@@ -700,7 +700,6 @@ bool ProjectItemModel::requestAddFolder(QString &id, const QString &name, const
bool ProjectItemModel::requestAddBinClip(QString &id, const QDomElement &description, const QString &parentId, Fun &undo, Fun &redo,
const std::function<void(const QString &)> &readyCallBack)
{
qDebug() << "/////////// requestAddBinClip" << parentId;
QWriteLocker locker(&m_lock);
if (id.isEmpty()) {
id =
......@@ -710,12 +709,9 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const QDomElement &descrip
}
}
Q_ASSERT(isIdFree(id));
qDebug() << "/////////// found id" << id;
std::shared_ptr<ProjectClip> new_clip =
ProjectClip::construct(id, description, m_blankThumb, std::static_pointer_cast<ProjectItemModel>(shared_from_this()));
qDebug() << "/////////// constructed ";
bool res = addItem(new_clip, parentId, undo, redo);
qDebug() << "/////////// added " << res;
if (res) {
int loadJob = emit pCore->jobManager()->startJob<LoadJob>({id}, -1, QString(), description, std::bind(readyCallBack, id));
emit pCore->jobManager()->startJob<ThumbJob>({id}, loadJob, QString(), 0, true);
......@@ -933,7 +929,6 @@ bool ProjectItemModel::loadFolders(Mlt::Properties &folders, std::unordered_map<
downLinks[parentId].push_back(folderId);
upLinks[folderId] = parentId;
folderNames[folderId] = folderName;
qDebug() << "Found folder " << folderId << "name = " << folderName << "parent=" << parentId;
}
// In case there are some non-existent parent, we fall back to root
......@@ -942,7 +937,7 @@ bool ProjectItemModel::loadFolders(Mlt::Properties &folders, std::unordered_map<
upLinks[f.first] = -1;
}
if (f.first != -1 && downLinks.count(upLinks[f.first]) == 0) {
qDebug() << "Warning: parent folder " << upLinks[f.first] << "for folder" << f.first << "is invalid. Folder will be placed in topmost directory.";
qWarning() << f.first << "has invalid parent folder" << upLinks[f.first] << "it will be placed in top directory";
upLinks[f.first] = -1;
}
}
......@@ -996,19 +991,15 @@ void ProjectItemModel::loadBinPlaylist(Mlt::Tractor *documentTractor, Mlt::Tract
QWriteLocker locker(&m_lock);
clean();
Mlt::Properties retainList((mlt_properties)documentTractor->get_data("xml_retain"));
qDebug() << "Loading bin playlist...";
if (retainList.is_valid()) {
qDebug() << "retain is valid";
Mlt::Playlist playlist((mlt_playlist)retainList.get_data(BinPlaylist::binPlaylistId.toUtf8().constData()));
if (playlist.is_valid() && playlist.type() == playlist_type) {
qDebug() << "playlist is valid";
if (progressDialog == nullptr && playlist.count() > 0) {
// Display message on splash screen
emit pCore->loadingMessageUpdated(i18n("Loading project clips..."));
}
// Load bin clips
auto currentLocale = strdup(setlocale(MLT_LC_CATEGORY, nullptr));
qDebug() << "Init bin; Current LC" << currentLocale;
// Load folders
Mlt::Properties folderProperties;
Mlt::Properties playlistProps(playlist.get_properties());
......@@ -1022,7 +1013,6 @@ void ProjectItemModel::loadBinPlaylist(Mlt::Tractor *documentTractor, Mlt::Tract
Fun undo = []() { return true; };
Fun redo = []() { return true; };
qDebug() << "Found " << playlist.count() << "clips";
int max = playlist.count();
if (progressDialog) {
progressDialog->setMaximum(progressDialog->maximum() + max);
......@@ -1036,7 +1026,6 @@ void ProjectItemModel::loadBinPlaylist(Mlt::Tractor *documentTractor, Mlt::Tract
}
QScopedPointer<Mlt::Producer> prod(playlist.get_clip(i));
if (prod->is_blank() || !prod->is_valid()) {
qDebug() << "producer is not valid or blank";
continue;
}
std::shared_ptr<Mlt::Producer> producer(new Mlt::Producer(prod->parent()));
......@@ -1056,7 +1045,6 @@ void ProjectItemModel::loadBinPlaylist(Mlt::Tractor *documentTractor, Mlt::Tract
i.value()->set("_kdenlive_processed", 1);
requestAddBinClip(newId, std::move(i.value()), parentId, undo, redo);
binIdCorresp[QString::number(i.key())] = newId;
qDebug() << "Loaded clip " << i.key() << "under id" << newId;
}
}
}
......
......@@ -60,7 +60,6 @@ void Core::prepareShutdown()
Core::~Core()
{
qDebug() << "deleting core";
if (m_monitorManager) {
delete m_monitorManager;
}
......@@ -243,7 +242,7 @@ void Core::buildLumaThumbs(const QStringList &values)
std::unique_ptr<Core> &Core::self()
{
if (!m_self) {
qDebug() << "Error : Core has not been created";
qWarning() << "Core has not been created";
}
return m_self;
}
......@@ -323,8 +322,7 @@ MixerManager *Core::mixer()
void Core::initLocale()
{
qDebug() << "Using modified system locale without group separator for numbers";
QLocale systemLocale = QLocale(); // For disabling group separator by default → OK
QLocale systemLocale = QLocale(); // For disabling group separator by default
systemLocale.setNumberOptions(QLocale::OmitGroupSeparator);
QLocale::setDefault(systemLocale);
}
......@@ -456,7 +454,7 @@ int Core::getItemPosition(const ObjectId &id)
if (m_mainWindow->getCurrentTimeline()->controller()->getModel()->isClip(id.second)) {
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getMixInOut(id.second).first;
} else {
qDebug()<<"// ERROR QUERYING NON CLIP PROPERTIES\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!";
qWarning() << "querying non clip properties";
}
break;
case ObjectType::BinClip:
......@@ -465,7 +463,7 @@ int Core::getItemPosition(const ObjectId &id)
return 0;
break;
default:
qDebug() << "ERROR: unhandled object type";
qWarning() << "unhandled object type";
}
return 0;
}
......@@ -473,7 +471,7 @@ int Core::getItemPosition(const ObjectId &id)
int Core::getItemIn(const ObjectId &id)
{
if (!m_guiConstructed || !m_mainWindow->getCurrentTimeline() || !m_mainWindow->getCurrentTimeline()->controller()->getModel()) {
qDebug() << "/ / // QUERYING ITEM IN BUT GUI NOT BUILD!!";
qWarning() << "GUI not build";
return 0;
}
switch (id.first) {
......@@ -481,7 +479,7 @@ int Core::getItemIn(const ObjectId &id)
if (m_mainWindow->getCurrentTimeline()->controller()->getModel()->isClip(id.second)) {
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getClipIn(id.second);
} else {
qDebug()<<"// ERROR QUERYING NON CLIP PROPERTIES\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!";
qWarning() << "querying non clip properties";
}
break;
case ObjectType::TimelineMix:
......@@ -492,7 +490,7 @@ int Core::getItemIn(const ObjectId &id)
return 0;
break;
default:
qDebug() << "ERROR: unhandled object type";
qWarning() << "unhandled object type";
}
return 0;
}
......@@ -518,7 +516,7 @@ PlaylistState::ClipState Core::getItemState(const ObjectId &id)
return PlaylistState::Disabled;
break;
default:
qDebug() << "ERROR: unhandled object type";
qWarning() << "unhandled object type";
break;
}
return PlaylistState::Disabled;
......@@ -549,11 +547,11 @@ int Core::getItemDuration(const ObjectId &id)
std::pair<int, int> mixInOut = m_mainWindow->getCurrentTimeline()->controller()->getModel()->getMixInOut(id.second);
return (mixInOut.second - mixInOut.first);
} else {
qDebug()<<"// ERROR QUERYING NON CLIP PROPERTIES\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!";
qWarning() << "querying non clip properties";
}
break;
default:
qDebug() << "ERROR: unhandled object type";
qWarning() << "unhandled object type";
}
return 0;
}
......@@ -568,7 +566,7 @@ int Core::getItemTrack(const ObjectId &id)
return m_mainWindow->getCurrentTimeline()->controller()->getModel()->getItemTrackId(id.second);
break;
default:
qDebug() << "ERROR: unhandled object type";
qWarning() << "unhandled object type";
}
return 0;
}
......@@ -604,7 +602,7 @@ void Core::refreshProjectItem(const ObjectId &id)
requestMonitorRefresh();
break;
default:
qDebug() << "ERROR: unhandled object type";
qWarning() << "unhandled object type";
}
}
......
......@@ -77,7 +77,6 @@ void EffectsRepository::parseCustomAssetFile(const QString &file_name, std::unor
QDomNodeList effects = base.elementsByTagName(QStringLiteral("effect"));
if (effects.count() > 1) {
// Effect group
//qDebug() << "Error: found unsupported effect group" << base.attribute(QStringLiteral("name"))<<" : "<<file_name;
Info result;
result.xml = base;
result.description = Xml::getSubTagContent(base, QStringLiteral("description"));
......@@ -92,7 +91,7 @@ void EffectsRepository::parseCustomAssetFile(const QString &file_name, std::unor
currentId = currentEffect.attribute(QStringLiteral("tag"), QString());
}
if (!exists(currentId) && customAssets.count(currentId) == 0) {
qDebug() << "Error: found unsupported effect in group" << currentId<<" : "<<file_name;
qWarning() << "unsupported effect in group" << currentId << ":" << file_name;
return;
}
}
......@@ -117,7 +116,7 @@ void EffectsRepository::parseCustomAssetFile(const QString &file_name, std::unor
int nbr_effect = effects.count();
if (nbr_effect == 0) {
qDebug() << "+++++++++++++\nEffect broken: " << file_name << "\n+++++++++++";
qWarning() << "broken effect:" << file_name;
return;
}
......@@ -133,8 +132,7 @@ void EffectsRepository::parseCustomAssetFile(const QString &file_name, std::unor
continue;
}
if (customAssets.count(result.id) > 0) {
qDebug() << "Warning: duplicate custom definition of effect" << result.id << "found. Only last one will be considered. Duplicate found in"
<< file_name;
//qDebug() << "duplicate effect" << result.id;
}
result.xml = currentEffect;
......@@ -237,7 +235,6 @@ QString EffectsRepository::getCustomPath(const QString &id)
QString customAssetDir = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("effects"), QStandardPaths::LocateDirectory);
QPair <QStringList, QStringList> results;
QDir current_dir(customAssetDir);
qDebug()<<"==== FETCHING CUSTOM PATH FOR ID: "<<id;
return current_dir.absoluteFilePath(QString("%1.xml").arg(id));
}
......@@ -306,7 +303,7 @@ QPair <QString, QString> EffectsRepository::fixCustomAssetFile(const QString &pa
int nbr_effect = effects.count();
if (nbr_effect == 0) {
qDebug() << "+++++++++++++\nEffect broken: " << path << "\n+++++++++++";
qWarning() << "broken effect:" << path;
results.second = path;
return results;
}
......@@ -328,7 +325,7 @@ QPair <QString, QString> EffectsRepository::fixCustomAssetFile(const QString &pa
QDir dir(QFileInfo(path).absoluteDir());
if (!dir.mkpath(QStringLiteral("legacy"))) {
// Cannot create the legacy folder, abort
qDebug()<<" = = = Could not create legacy folder in : "<<dir.absolutePath();
qWarning() << "Could not create old effects backup folder" << dir.absolutePath();
results.second = path;
return results;
}
......@@ -354,7 +351,6 @@ QPair <QString, QString> EffectsRepository::fixCustomAssetFile(const QString &pa
if (ok) {
double defaultVal = param.attribute(QLatin1String("default")).toDouble() / factor;
param.setAttribute(QLatin1String("default"), QString::number(defaultVal));
qDebug()<<" = = \nadjusting default to: "<<defaultVal;
if (currentValue.contains(QLatin1Char('='))) {
QStringList valueStr = currentValue.split(QLatin1Char(';'));
QStringList resultStr;
......@@ -370,7 +366,6 @@ QPair <QString, QString> EffectsRepository::fixCustomAssetFile(const QString &pa
}
}
param.setAttribute(QLatin1String("value"), resultStr.join(QLatin1Char(';')));
qDebug()<<"=== ADJUSTED VAL: "<<resultStr.join(QLatin1Char(';'));
}
}
}
......@@ -383,7 +378,7 @@ QPair <QString, QString> EffectsRepository::fixCustomAssetFile(const QString &pa
dir.cd(QStringLiteral("legacy"));
if (!file.copy(dir.absoluteFilePath(QFileInfo(file).fileName()))) {
// Cannot copy the backup file
qDebug()<<" = = = Could not copy file in : "<<dir.absoluteFilePath(QFileInfo(file).fileName());
qWarning() << "Could not copy old effect to" << dir.absoluteFilePath(QFileInfo(file).fileName());
results.second = path;
return results;
}
......
......@@ -45,7 +45,6 @@ void LocaleHandling::resetLocale()
std::setlocale(MLT_LC_CATEGORY, "C");
#endif
::qputenv(MLT_LC_NAME, "C");
qDebug() << "LC_NUMERIC reset to C";
}
QPair<QLocale, LocaleHandling::MatchType> LocaleHandling::getQLocaleForDecimalPoint(const QString &requestedLocale, const QString &decimalPoint)
......
......@@ -27,27 +27,6 @@ static void mlt_log_handler(void *service, int mlt_level, const char *format, va
{
if (mlt_level > mlt_log_get_level())
return;
/*enum Logger::LogLevel cuteLoggerLevel = Logger::Fatal;
switch (mlt_level) {
case MLT_LOG_DEBUG:
cuteLoggerLevel = Logger::Trace;
break;
case MLT_LOG_ERROR:
case MLT_LOG_FATAL:
case MLT_LOG_PANIC:
cuteLoggerLevel = Logger::Error;
break;
case MLT_LOG_INFO:
cuteLoggerLevel = Logger::Info;
break;
case MLT_LOG_VERBOSE:
cuteLoggerLevel = Logger::Debug;
break;
case MLT_LOG_WARNING:
cuteLoggerLevel = Logger::Warning;
break;
}*/
QString message;
mlt_properties properties = service? MLT_SERVICE_PROPERTIES((mlt_service) service) : NULL;
if (properties) {
......@@ -72,7 +51,7 @@ static void mlt_log_handler(void *service, int mlt_level, const char *format, va
message = QString::vasprintf(format, args);
message.replace('\n', "");
}
qDebug()<<"==========\n\nMLT ERROR:\n"<<message<<"\n";
qDebug() << "MLT:" << message;
}
......@@ -92,7 +71,6 @@ MltConnection::MltConnection(const QString &mltPath)
#else
auto locale = strdup(std::setlocale(MLT_LC_CATEGORY, nullptr));
#endif
qDebug() << "NEW LC_ALL" << locale;
locateMeltAndProfilesPath(mltPath);
......@@ -113,7 +91,7 @@ MltConnection::MltConnection(const QString &mltPath)
void MltConnection::construct(const QString &mltPath)
{
if (MltConnection::m_self) {
qDebug() << "DEBUG: Warning : trying to open a second mlt connection";
qWarning() << "Trying to open a 2nd mlt connection";
return;
}
MltConnection::m_self.reset(new MltConnection(mltPath));
......@@ -225,7 +203,6 @@ void MltConnection::locateMeltAndProfilesPath(const QString &mltPath)
}
}
}
qCDebug(KDENLIVE_LOG) << "MLT profiles path: " << KdenliveSettings::mltpath();
// Parse again MLT profiles to build a list of available video formats
if (profilesList.isEmpty()) {
locateMeltAndProfilesPath();
......
......@@ -183,12 +183,6 @@ void GLWidget::initializeGL()
openglContext()->makeCurrent(&m_offscreenSurface);
initializeOpenGLFunctions();
qCDebug(KDENLIVE_LOG) << "OpenGL vendor: " << QString::fromUtf8((const char *)glGetString(GL_VENDOR));
qCDebug(KDENLIVE_LOG) << "OpenGL renderer: " << QString::fromUtf8((const char *)glGetString(GL_RENDERER));
qCDebug(KDENLIVE_LOG) << "OpenGL Threaded: " << openglContext()->supportsThreadedOpenGL();
qCDebug(KDENLIVE_LOG) << "OpenGL ARG_SYNC: " << openglContext()->hasExtension("GL_ARB_sync");
qCDebug(KDENLIVE_LOG) << "OpenGL OpenGLES: " << openglContext()->isOpenGLES();
// C & D
if (onlyGLESGPUAccel()) {
disableGPUAccel();
......@@ -501,7 +495,7 @@ bool GLWidget::initGPUAccelSync()
if (m_ClientWaitSync) {
return true;
} else {
qCDebug(KDENLIVE_LOG) << " / / // NO GL SYNC, ERROR";
qWarning() << "no GL sync";
// fallback on A || B
// TODO: fallback on A || B || C?
disableGPUAccel();
......@@ -878,7 +872,6 @@ int GLWidget::setProducer(const QString &file)
if (m_producer) {
m_producer.reset();
}
qDebug()<<"==== OPENING PROIDUCER FILE: "<<file;
m_producer = std::make_shared<Mlt::Producer>(new Mlt::Producer(pCore->getCurrentProfile()->profile(), nullptr, file.toUtf8().constData()));
if (m_consumer) {
//m_consumer->stop();
......@@ -1090,7 +1083,6 @@ int GLWidget::reconfigure()
// switch sdl audio backend
KdenliveSettings::setSdlAudioBackend(bk);
}
qDebug() << "++++++++\nSwitching audio backend to: " << bk << "\n++++++++++";
KdenliveSettings::setAudiobackend(bk);
serviceName = bk;
break;
......@@ -1100,7 +1092,7 @@ int GLWidget::reconfigure()
}
}
if (!m_consumer || !m_consumer->is_valid()) {
qWarning() << "WARNING, NO AUDIO BACKEND FOUND";
qWarning() << "no audio backend found";
return -1;
}
setProperty("mlt_service", serviceName);
......@@ -1347,7 +1339,6 @@ const QString GLWidget::sceneList(const QString &root, const QString &fullPath,
{
LocaleHandling::resetLocale();
QString playlist;
qCDebug(KDENLIVE_LOG) << " * * *Setting document xml root: " << root;
Mlt::Consumer xmlConsumer(pCore->getCurrentProfile()->profile(), "xml", fullPath.isEmpty() ? "kdenlive_playlist" : fullPath.toUtf8().constData());
if (!root.isEmpty()) {
xmlConsumer.set("root", root.toUtf8().constData());
......
......@@ -72,7 +72,6 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
QSet<QString> reserved_names{QLatin1String("playlistmain"), QLatin1String("timeline_preview"), QLatin1String("timeline_overlay"), QLatin1String("black_track"), QLatin1String("overlay_track")};
bool ok = true;
qDebug() << "//////////////////////\nTrying to construct" << tractor.count() << "tracks.\n////////////////////////////////";
// Import master track effects
std::shared_ptr<Mlt::Service> serv = std::make_shared<Mlt::Service>(tractor.get_service());
......@@ -91,7 +90,6 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
switch (track->type()) {
case producer_type:
// TODO check that it is the black track, and otherwise log an error
qDebug() << "SUSPICIOUS: we weren't expecting a producer when parsing the timeline";
break;
case tractor_type: {
// that is a double track
......@@ -113,7 +111,6 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
}
case playlist_type: {
// that is a single track
qDebug() << "Adding track: " << track->get("id");
int tid;
Mlt::Playlist local_playlist(*track);
const QString trackName = local_playlist.get("kdenlive:track_name");
......@@ -137,7 +134,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
break;
}
default:
qDebug() << "ERROR: Unexpected item in the timeline";
qWarning() << "Unexpected track type" << track->type();
}
}
timeline->_resetView();
......@@ -159,7 +156,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
if (internal.isEmpty() && isMix.isEmpty()) {
compositions << new Mlt::Transition(t);
if (id.isEmpty()) {
qDebug() << "// Warning, this should not happen, transition without id: " << t.get("id") << " = " << t.get("mlt_service")<<", ON TRACK: "<<t.get_b_track();
qWarning() << "transition without id" << t.get("id") << t.get("mlt_service") << "on track" << t.get_b_track();
t.set("kdenlive_id", t.get("mlt_service"));
}
}
......@@ -190,13 +187,10 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
auto transProps = std::make_unique<Mlt::Properties>(t->get_properties());
compositionOk = timeline->requestCompositionInsertion(id, timeline->getTrackIndexFromPosition(t->get_b_track() - 1), t->get_a_track(), t->get_in(), t->get_length(), std::move(transProps), compoId, undo, redo, false, originalDecimalPoint);
if (!compositionOk) {
qDebug() << "ERROR : failed to insert composition in track " << t->get_b_track() << ", position" << t->get_in() << ", ID: " << id
<< ", MLT ID: " << t->get("id");
// timeline->requestItemDeletion(compoId, false);
m_errorMessage << i18n("Invalid composition %1 found on track %2 at %3.", t->get("id"), t->get_b_track(), t->get_in());
continue;
}
qDebug() << "Inserted composition in track " << t->get_b_track() << ", position" << t->get_in() << "/" << t->get_out();
}
// build internal track compositing
......@@ -224,7 +218,7 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
{
if (track.count() != 2) {
// we expect a tractor with two tracks (a "fake" track)
qDebug() << "ERROR : wrong number of subtracks";
qWarning() << "wrong number of subtracks";
return false;
}
// Check same track transitions
......@@ -236,7 +230,7 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
QString id(t.get("kdenlive_id"));
compositions << new Mlt::Transition(t);
if (id.isEmpty()) {
qDebug() << "// Warning, this should not happen, transition without id: " << t.get("id") << " = " << t.get("mlt_service");
qWarning() << "transition without id" << t.get("id") << t.get("mlt_service");
t.set("kdenlive_id", t.get("mlt_service"));
}
}
......@@ -245,7 +239,7 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
for (int i = 0; i < track.count(); i++) {
std::unique_ptr<Mlt::Producer> sub_track(track.track(i));
if (sub_track->type() != playlist_type) {
qDebug() << "ERROR : SubTracks must be MLT::Playlist";
qWarning() << "subtrack must be playlist";
return false;
}
Mlt::Playlist playlist(*sub_track);
......@@ -330,7 +324,6 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
switch (clip->type()) {
case unknown_type:
case producer_type: {
qDebug() << "Looking for clip with ID " << clip->parent().get("kdenlive:id") << " and name " << clip->parent().get("kdenlive:clipname");
QString binId;
if (clip->parent().get_int("_kdenlive_processed") == 1) {
// This is a bin clip, already processed no need to change id
......@@ -345,13 +338,12 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
}
if (binIdCorresp.count(clipId) == 0) {
// Project was somehow corrupted
qDebug()<<"=== WARNING, CANNOT FIND CLIP WITH ID: "<<clipId<<" IN BIN PLAYLIST";
qWarning() << "can't find clip with id: " << clipId << "in bin playlist";
QStringList fixedId = pCore->projectItemModel()->getClipByUrl(QFileInfo(clip->parent().get("resource")));
if (!fixedId.isEmpty()) {
binId = fixedId.first();
m_errorMessage << i18n("Invalid clip %1 (%2) not found in project bin, recovered.", clip->parent().get("id"), clipId);
} else {
qWarning()<<"Warning, clip in timeline has no parent in bin: "<<clip->parent().get("id");
m_errorMessage << i18n("Project corrupted. Clip %1 (%2) not found in project bin.", clip->parent().get("id"), clipId);
}
} else {
......@@ -365,28 +357,25 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
int cid = -1;
if (pCore->bin()->getBinClip(binId)) {
PlaylistState::ClipState st = inferState(clip, audioTrack);
qDebug()<<"==== INSERTING CLIP IN PLAYLIST: "<<playlist<<"\n8888888888888888888888";
cid = ClipModel::construct(timeline, binId, clip, st, tid, originalDecimalPoint, playlist);
ok = timeline->requestClipMove(cid, tid, position, true, true, false, true, undo, redo);
} else {
qDebug() << "// Cannot find bin clip: " << binId << " - " << clip->get("id");
qWarning() << "can't find bin clip" << binId << clip->get("id");
}
if (!ok && cid > -1) {
qDebug() << "ERROR : failed to insert clip in track" << tid << "position" << position;
timeline->requestItemDeletion(cid, false);
m_errorMessage << i18n("Invalid clip %1 found on track %2 at %3.", clip->parent().get("id"), track.get("id"), position);
break;
}
qDebug() << "Inserted clip in track" << tid << "at " << position;
break;
}
case tractor_type: {
// TODO This is a nested timeline