slotAudioThumbOver();
return;
}
+
kDebug() << "reading audio thumbs from file";
+
+ int h1 = arrayWidth * m_channels;
+ int h2 = (int) frame * h1;
+ int h3;
for (int z = (int) frame; z < (int)(frame + frameLength); z++) {
+ h2 += h1;
+ h3 = 0;
for (int c = 0; c < m_channels; c++) {
+ h3 += arrayWidth;
QByteArray m_array(arrayWidth, '\x00');
for (int i = 0; i < arrayWidth; i++)
- m_array[i] = channelarray[z*arrayWidth*m_channels + c*arrayWidth + i];
+ m_array[i] = channelarray[h2 + h3 + i];
storeIn[z][c] = m_array;
}
}
}
if (update)
emit projectModified();
- QTimer::singleShot(30, this, SLOT(slotProcessNextThumbnail()));
+
+ slotProcessNextThumbnail();
}
}
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsDropEnabled);
toReload = clipId;
}
- //Q_ASSERT_X(item->referencedClip(), "void ProjectList::slotReplyGetFileProperties", QString("Item with groupName %1 does not have a clip associated").arg(item->groupName()).toLatin1());
item->referencedClip()->setProducer(producer, replace);
item->referencedClip()->askForAudioThumbs();
if (!replace && item->data(0, Qt::DecorationRole).isNull())
if (!toReload.isEmpty())
item->slotSetToolTip();
- //emit receivedClipDuration(clipId);
if (m_listView->isEnabled() && replace) {
// update clip in clip monitor
emit clipSelected(NULL);
requestClipThumbnail(clipId);
}*/
} else kDebug() << "//////// COULD NOT FIND CLIP TO UPDATE PRPS...";
- int max = m_doc->clipManager()->clipsCount();
if (item && m_infoQueue.isEmpty() && m_thumbnailQueue.isEmpty()) {
m_listView->setCurrentItem(item);
bool updatedProfile = false;
}
if (updatedProfile == false) emit clipSelected(item->referencedClip());
} else {
+ int max = m_doc->clipManager()->clipsCount();
emit displayMessage(i18n("Loading clips"), (int)(100 *(max - m_infoQueue.count()) / max));
}
if (!toReload.isEmpty())
emit clipNeedsReload(toReload, true);
- // small delay so that the app can display the progress info
- QTimer::singleShot(30, this, SLOT(slotProcessNextClipInQueue()));
+
+ qApp->processEvents();
+ slotProcessNextClipInQueue();
}
bool ProjectList::adjustProjectProfileToItem(ProjectItem *item)
{
KUrl url = KUrl(xml.attribute("resource", QString()));
Mlt::Producer *producer = NULL;
+ CLIPTYPE type = (CLIPTYPE)xml.attribute("type").toInt();
+
//kDebug() << "PROFILE WIDT: "<< xml.attribute("mlt_service") << ": "<< m_mltProfile->width() << "\n...................\n\n";
/*if (xml.attribute("type").toInt() == TEXT && !QFile::exists(url.path())) {
emit replyGetFileProperties(clipId, producer, QMap < QString, QString >(), QMap < QString, QString >(), replaceProducer);
return;
}*/
- if (xml.attribute("type").toInt() == COLOR) {
+
+ if (type == COLOR) {
producer = new Mlt::Producer(*m_mltProfile, 0, ("colour:" + xml.attribute("colour")).toUtf8().constData());
- } else if (xml.attribute("type").toInt() == TEXT) {
+ } else if (type == TEXT) {
producer = new Mlt::Producer(*m_mltProfile, 0, ("kdenlivetitle:" + xml.attribute("resource")).toUtf8().constData());
if (producer && producer->is_valid() && xml.hasAttribute("xmldata"))
producer->set("xmldata", xml.attribute("xmldata").toUtf8().constData());
}
// setup length here as otherwise default length (currently 15000 frames in MLT) will be taken even if outpoint is larger
- if (xml.attribute("type").toInt() == COLOR || xml.attribute("type").toInt() == TEXT
- || xml.attribute("type").toInt() == IMAGE || xml.attribute("type").toInt() == SLIDESHOW)
+ if (type == COLOR || type == TEXT || type == IMAGE || type == SLIDESHOW)
producer->set("length", xml.attribute("out").toInt() - xml.attribute("in").toInt() + 1);
if (xml.hasAttribute("out"))
Mlt::Frame *frame = producer->get_frame();
- if (xml.attribute("type").toInt() == SLIDESHOW) {
+ if (type == SLIDESHOW) {
int ttl = xml.hasAttribute("ttl") ? xml.attribute("ttl").toInt() : 0;
if (ttl) producer->set("ttl", ttl);
if (!xml.attribute("animation").isEmpty()) {