]> git.sesse.net Git - kdenlive/commitdiff
indent fixes and geometry param will be used in initeffects
authorMarco Gittler <marco@gitma.de>
Sun, 3 Aug 2008 10:21:58 +0000 (10:21 +0000)
committerMarco Gittler <marco@gitma.de>
Sun, 3 Aug 2008 10:21:58 +0000 (10:21 +0000)
svn path=/branches/KDE4/; revision=2356

src/customtrackview.cpp
src/initeffects.cpp
src/kdenlivedoc.cpp
src/kdenlivesettingsdialog.cpp
src/renderer.cpp
src/renderer.h
src/titlewidget.cpp
src/trackview.cpp

index aa087fad9f6d9de220de7dbe41b4ae282b5cb487..0f2fcdbfc0252b93d30f80ef3c47d9f3af39a5ae 100644 (file)
@@ -1149,15 +1149,14 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event) {
         // resize start
         if (m_dragItem->type() == AVWIDGET) {
             bool success = m_document->renderer()->mltResizeClipStart(m_tracksList.count() - m_dragItem->track(), m_dragItem->endPos(), m_dragItem->startPos(), m_dragItemInfo.startPos, m_dragItem->cropStart(), m_dragItem->cropStart() + m_dragItem->endPos() - m_dragItem->startPos());
-           if (success) {
-               updateClipFade((ClipItem *) m_dragItem);
-               ResizeClipCommand *command = new ResizeClipCommand(this, m_dragItemInfo, info, false);
-               m_commandStack->push(command);
-           }
-           else {
-               m_dragItem->resizeStart((int) m_dragItemInfo.startPos.frames(m_document->fps()), m_scale);
-               emit displayMessage(i18n("Error when resizing clip"), ErrorMessage);
-           }
+            if (success) {
+                updateClipFade((ClipItem *) m_dragItem);
+                ResizeClipCommand *command = new ResizeClipCommand(this, m_dragItemInfo, info, false);
+                m_commandStack->push(command);
+            } else {
+                m_dragItem->resizeStart((int) m_dragItemInfo.startPos.frames(m_document->fps()), m_scale);
+                emit displayMessage(i18n("Error when resizing clip"), ErrorMessage);
+            }
         } else if (m_dragItem->type() == TRANSITIONWIDGET) {
             MoveTransitionCommand *command = new MoveTransitionCommand(this, m_dragItemInfo, info, false);
             m_commandStack->push(command);
@@ -1299,8 +1298,8 @@ void CustomTrackView::changeClipSpeed() {
             ItemInfo info = item->info();
             int percent = QInputDialog::getInteger(this, i18n("Edit Clip Speed"), i18n("New speed (percents)"), 100, 1, 300);
             double speed = (double) percent / 100.0;
-           if (item->speed() != speed)
-               new ChangeSpeedCommand(this, info, item->speed(), speed, item->clipProducer(), true, changeSelected);
+            if (item->speed() != speed)
+                new ChangeSpeedCommand(this, info, item->speed(), speed, item->clipProducer(), true, changeSelected);
         }
     }
     m_commandStack->push(changeSelected);
@@ -1463,10 +1462,9 @@ void CustomTrackView::resizeClip(const ItemInfo start, const ItemInfo end) {
     if (resizeClipStart) {
         bool success = m_document->renderer()->mltResizeClipStart(m_tracksList.count() - item->track(), item->endPos(), end.startPos, item->startPos(), item->cropStart() + end.startPos - start.startPos, item->cropStart() + end.startPos - start.startPos + item->endPos() - end.startPos);
         if (success) {
-           item->resizeStart((int) end.startPos.frames(m_document->fps()), m_scale);
-           updateClipFade(item);
-       }
-       else emit displayMessage(i18n("Error when resizing clip"), ErrorMessage);
+            item->resizeStart((int) end.startPos.frames(m_document->fps()), m_scale);
+            updateClipFade(item);
+        } else emit displayMessage(i18n("Error when resizing clip"), ErrorMessage);
     } else {
         m_document->renderer()->mltResizeClipEnd(m_tracksList.count() - item->track(), item->startPos(), item->cropStart(), item->cropStart() + end.endPos - item->startPos());
         item->resizeEnd((int) end.endPos.frames(m_document->fps()), m_scale);
index 96c7e6478f354874a0a2eba4f3406d17f8fa6641..b8468045a34e4fba6c340116f2ced80a683a3a1b 100644 (file)
@@ -438,7 +438,7 @@ QDomDocument initEffects::createDescriptionFromMlt(Mlt::Repository* repository,
                 if (QString(paramdesc.get("type")) == "boolean")
                     params.setAttribute("type", "bool");
                 if (!QString(paramdesc.get("format")).isEmpty() && QString(paramdesc.get("type")) != "geometry") {
-                    params.setAttribute("type", "complex");
+                    params.setAttribute("type", "geometry");
                     params.setAttribute("format", paramdesc.get("format"));
                 }
                 if (!QString(paramdesc.get("format")).isEmpty() && QString(paramdesc.get("type")) == "geometry") {
index 6de60180dc49eaa38bc9a47d162c1e27d9b76d97..c18d88074615ae397a891d0fa46e571ce3acd9af 100644 (file)
@@ -64,7 +64,7 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, MltVideoPro
                     int pos = 0;
                     for (int i = 0; i < maxprod; i++) {
                         QDomNode m = prods.at(pos);
-                       QString prodId = m.toElement().attribute("id");
+                        QString prodId = m.toElement().attribute("id");
                         if (prodId == "black" || prodId.startsWith("slowmotion"))
                             pos++;
                         else westley.removeChild(m);
@@ -91,7 +91,7 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, MltVideoPro
                         parent->slotGotProgressInfo(QString(), (int) m_documentLoadingProgress);
                         qApp->processEvents();
                     }
-                   QString prodId = e.attribute("id");
+                    QString prodId = e.attribute("id");
                     if (!e.isNull() && prodId != "black" && prodId.toInt() > 0) {
                         addClip(e, e.attribute("id").toInt());
                     }
index f644642ae780fcec5d30a4c6c149a513efc03c47..c2b5736df5d7234096b6f21306e4c8129c316b83 100644 (file)
@@ -110,8 +110,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(
 
 KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
 
-void KdenliveSettingsDialog::initDevices()
-{
+void KdenliveSettingsDialog::initDevices() {
     // Fill audio drivers
     m_configSdl.kcfg_audio_driver->addItem(i18n("Automatic"), QString());
     m_configSdl.kcfg_audio_driver->addItem(i18n("OSS"), "dsp");
@@ -121,12 +120,12 @@ void KdenliveSettingsDialog::initDevices()
     m_configSdl.kcfg_audio_driver->addItem(i18n("ARTS daemon"), "artsc");
 
     /*if (!KdenliveSettings::audiodriver().isEmpty())
-       for (uint i = 1;i < m_configDisplay.kcfg_audio_driver->count(); i++) {
-           if (m_configDisplay.kcfg_audio_driver->itemData(i).toString() == KdenliveSettings::audiodriver())
-               m_configDisplay.kcfg_audio_driver->setCurrentIndex(i);
-       }*/
-       // Fill video drivers
+    for (uint i = 1;i < m_configDisplay.kcfg_audio_driver->count(); i++) {
+     if (m_configDisplay.kcfg_audio_driver->itemData(i).toString() == KdenliveSettings::audiodriver())
+    m_configDisplay.kcfg_audio_driver->setCurrentIndex(i);
+    }*/
+
+    // Fill video drivers
     m_configSdl.kcfg_video_driver->addItem(i18n("Automatic"), QString());
     m_configSdl.kcfg_video_driver->addItem(i18n("X11"), "x11");
     m_configSdl.kcfg_video_driver->addItem(i18n("XFREE86 DGA 2.0"), "dga");
@@ -137,46 +136,44 @@ void KdenliveSettingsDialog::initDevices()
     m_configSdl.kcfg_video_driver->addItem(i18n("General graphics interface"), "ggi");
     m_configSdl.kcfg_video_driver->addItem(i18n("Ascii art library"), "aalib");
 
-       // Fill the list of audio playback devices
+    // Fill the list of audio playback devices
     m_configSdl.kcfg_audio_device->addItem(i18n("Default"), QString());
     if (KStandardDirs::findExe("aplay") != QString::null) {
-       m_readProcess.setOutputChannelMode(KProcess::OnlyStdoutChannel);
-       m_readProcess.setProgram("aplay", QStringList() << "-l");
-       connect(&m_readProcess, SIGNAL(readyReadStandardOutput()) ,this, SLOT(slotReadAudioDevices()));
-       m_readProcess.execute(5000);
-    }
-    else {
-       // If aplay is not installed on the system, parse the /proc/asound/pcm file
-       QFile file("/proc/asound/pcm");
-       if ( file.open( QIODevice::ReadOnly ) ) {
-           QTextStream stream( &file );
-           QString line;
-           while ( !stream.atEnd() ) {
+        m_readProcess.setOutputChannelMode(KProcess::OnlyStdoutChannel);
+        m_readProcess.setProgram("aplay", QStringList() << "-l");
+        connect(&m_readProcess, SIGNAL(readyReadStandardOutput()) , this, SLOT(slotReadAudioDevices()));
+        m_readProcess.execute(5000);
+    } else {
+        // If aplay is not installed on the system, parse the /proc/asound/pcm file
+        QFile file("/proc/asound/pcm");
+        if (file.open(QIODevice::ReadOnly)) {
+            QTextStream stream(&file);
+            QString line;
+            while (!stream.atEnd()) {
                 line = stream.readLine();
-               if (line.contains("playback")) {
-               QString deviceId = line.section(":", 0, 0);
-               m_configSdl.kcfg_audio_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt()));
-               }
-           }
+                if (line.contains("playback")) {
+                    QString deviceId = line.section(":", 0, 0);
+                    m_configSdl.kcfg_audio_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt()));
+                }
+            }
             file.close();
-       }
+        }
     }
 }
 
 
-void KdenliveSettingsDialog::slotReadAudioDevices()
-{
+void KdenliveSettingsDialog::slotReadAudioDevices() {
     QString result = QString(m_readProcess.readAllStandardOutput());
-    kDebug()<<"// / / / / / READING APLAY: ";
-    kDebug()<< result;
+    kDebug() << "// / / / / / READING APLAY: ";
+    kDebug() << result;
     QStringList lines = result.split('\n');
-    foreach (QString data, lines) {
-       kDebug()<<"// READING LINE: "<<data;
-       if (data.simplified().startsWith("card")) {
-           QString card = data.section(":", 0, 0).section(" ", -1);
-           QString device = data.section(":", 1, 1).section(" ", -1);
-           m_configSdl.kcfg_audio_device->addItem(data.section(":", -1), "plughw:" + card + "," + device);
-       }
+    foreach(QString data, lines) {
+        kDebug() << "// READING LINE: " << data;
+        if (data.simplified().startsWith("card")) {
+            QString card = data.section(":", 0, 0).section(" ", -1);
+            QString device = data.section(":", 1, 1).section(" ", -1);
+            m_configSdl.kcfg_audio_device->addItem(data.section(":", -1), "plughw:" + card + "," + device);
+        }
     }
 }
 
@@ -293,20 +290,20 @@ void KdenliveSettingsDialog::updateSettings() {
     bool resetProfile = false;
     QString value = m_configSdl.kcfg_audio_device->itemData(m_configSdl.kcfg_audio_device->currentIndex()).toString();
     if (value != KdenliveSettings::audiodevicename()) {
-       KdenliveSettings::setAudiodevicename(value);
-       resetProfile = true;
+        KdenliveSettings::setAudiodevicename(value);
+        resetProfile = true;
     }
 
     value = m_configSdl.kcfg_audio_driver->itemData(m_configSdl.kcfg_audio_driver->currentIndex()).toString();
     if (value != KdenliveSettings::audiodrivername()) {
-       KdenliveSettings::setAudiodrivername(value);
-       resetProfile = true;
+        KdenliveSettings::setAudiodrivername(value);
+        resetProfile = true;
     }
 
     value = m_configSdl.kcfg_video_driver->itemData(m_configSdl.kcfg_video_driver->currentIndex()).toString();
     if (value != KdenliveSettings::videodrivername()) {
-       KdenliveSettings::setVideodrivername(value);
-       resetProfile = true;
+        KdenliveSettings::setVideodrivername(value);
+        resetProfile = true;
     }
 
     KConfigDialog::updateSettings();
index df027a687c984af2072ada8183cd721e25088ed8..44ff8d238cc3155b81dea734e3fa8aeecf0f77f1 100644 (file)
@@ -82,28 +82,28 @@ Render::Render(const QString & rendererName, int winid, int extid, QWidget *pare
         m_mltConsumer->set("terminate_on_pause", 1);
         m_mltConsumer->set("rescale", "nearest");
         m_mltConsumer->set("progressive", 1);
-       char *tmp;
-
-       QString audioDevice = KdenliveSettings::audiodevicename();
-       if (!audioDevice.isEmpty()) {
-           tmp = decodedString(audioDevice);
-           m_mltConsumer->set("audio_device", tmp);
-           delete[] tmp;
-       }
-
-       QString videoDriver = KdenliveSettings::videodrivername();
-       if (!videoDriver.isEmpty()) {
-           tmp = decodedString(videoDriver);
-           m_mltConsumer->set("video_driver", tmp);
-           delete[] tmp;
-       }
-
-       QString audioDriver = KdenliveSettings::audiodrivername();
-       if (!audioDriver.isEmpty()) {
-           tmp = decodedString(audioDriver);
-           m_mltConsumer->set("audio_driver", tmp);
-           delete[] tmp;
-       }
+        char *tmp;
+
+        QString audioDevice = KdenliveSettings::audiodevicename();
+        if (!audioDevice.isEmpty()) {
+            tmp = decodedString(audioDevice);
+            m_mltConsumer->set("audio_device", tmp);
+            delete[] tmp;
+        }
+
+        QString videoDriver = KdenliveSettings::videodrivername();
+        if (!videoDriver.isEmpty()) {
+            tmp = decodedString(videoDriver);
+            m_mltConsumer->set("video_driver", tmp);
+            delete[] tmp;
+        }
+
+        QString audioDriver = KdenliveSettings::audiodrivername();
+        if (!audioDriver.isEmpty()) {
+            tmp = decodedString(audioDriver);
+            m_mltConsumer->set("audio_driver", tmp);
+            delete[] tmp;
+        }
 
         m_mltConsumer->set("audio_buffer", 1024);
         m_mltConsumer->set("frequency", 48000);
@@ -180,25 +180,25 @@ int Render::resetProfile(QString profile) {
 
     QString audioDevice = KdenliveSettings::audiodevicename();
     if (!audioDevice.isEmpty()) {
-       tmp = decodedString(audioDevice);
-       m_mltConsumer->set("audio_device", tmp);
-       delete[] tmp;
+        tmp = decodedString(audioDevice);
+        m_mltConsumer->set("audio_device", tmp);
+        delete[] tmp;
     }
 
     QString videoDriver = KdenliveSettings::videodrivername();
     if (!videoDriver.isEmpty()) {
-       tmp = decodedString(videoDriver);
-       m_mltConsumer->set("video_driver", tmp);
-       delete[] tmp;
+        tmp = decodedString(videoDriver);
+        m_mltConsumer->set("video_driver", tmp);
+        delete[] tmp;
     }
 
     QString audioDriver = KdenliveSettings::audiodrivername();
     if (!audioDriver.isEmpty()) {
-       tmp = decodedString(audioDriver);
-       m_mltConsumer->set("audio_driver", tmp);
-       delete[] tmp;
+        tmp = decodedString(audioDriver);
+        m_mltConsumer->set("audio_driver", tmp);
+        delete[] tmp;
     }
-    
+
 
     m_mltConsumer->set("progressive", 1);
     m_mltConsumer->set("audio_buffer", 1024);
@@ -1320,7 +1320,7 @@ int Render::mltChangeClipSpeed(ItemInfo info, double speed, Mlt::Producer *prod)
     int newLength = 0;
     Mlt::Service service(m_mltProducer->parent().get_service());
     if (service.type() != tractor_type) kWarning() << "// TRACTOR PROBLEM";
-    kDebug()<<"Changing clip speed, set in and out: "<<info.cropStart.frames(m_fps)<<" to "<<(info.endPos - info.startPos).frames(m_fps) - 1;
+    kDebug() << "Changing clip speed, set in and out: " << info.cropStart.frames(m_fps) << " to " << (info.endPos - info.startPos).frames(m_fps) - 1;
     Mlt::Tractor tractor(service);
     Mlt::Producer trackProducer(tractor.track(info.track));
     Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
@@ -1333,18 +1333,18 @@ int Render::mltChangeClipSpeed(ItemInfo info, double speed, Mlt::Producer *prod)
         mlt_service_lock(service.get_service());
         QString url = clip.parent().get("resource");
         url.append("?" + QString::number(speed));
-       Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
-       if (!slowprod || slowprod->get_producer() == NULL) {
-           char *tmp = decodedString(url);
-           slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp);
-           delete[] tmp;
-           QString producerid = "slowmotion:" + id + ":" + QString::number(speed);
-           tmp = decodedString(producerid);
-           slowprod->set("id", tmp);
-           delete[] tmp;
-           m_slowmotionProducers.insert(url, slowprod);
-       }
-       Mlt::Producer *cut = slowprod->cut(info.cropStart.frames(m_fps), (info.endPos - info.startPos).frames(m_fps) - 1);
+        Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
+        if (!slowprod || slowprod->get_producer() == NULL) {
+            char *tmp = decodedString(url);
+            slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp);
+            delete[] tmp;
+            QString producerid = "slowmotion:" + id + ":" + QString::number(speed);
+            tmp = decodedString(producerid);
+            slowprod->set("id", tmp);
+            delete[] tmp;
+            m_slowmotionProducers.insert(url, slowprod);
+        }
+        Mlt::Producer *cut = slowprod->cut(info.cropStart.frames(m_fps), (info.endPos - info.startPos).frames(m_fps) - 1);
         newLength = cut->get_length();
         trackPlaylist.replace_with_blank(clipIndex);
         trackPlaylist.consolidate_blanks(0);
@@ -1363,18 +1363,18 @@ int Render::mltChangeClipSpeed(ItemInfo info, double speed, Mlt::Producer *prod)
         QString url = clip.parent().get("resource");
         url = url.section("?", 0, 0);
         url.append("?" + QString::number(speed));
-       Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
-       if (!slowprod || slowprod->get_producer() == NULL) {
-           char *tmp = decodedString(url);
-           slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp);
-           delete[] tmp;
-           QString producerid = "slowmotion:" + id.section(":", 1, 1) + ":" + QString::number(speed);
-           tmp = decodedString(producerid);
-           slowprod->set("id", tmp);
-           delete[] tmp;
-           m_slowmotionProducers.insert(url, slowprod);
-       }
-       Mlt::Producer *cut = slowprod->cut(info.cropStart.frames(m_fps), (info.endPos - info.startPos).frames(m_fps) - 1);
+        Mlt::Producer *slowprod = m_slowmotionProducers.value(url);
+        if (!slowprod || slowprod->get_producer() == NULL) {
+            char *tmp = decodedString(url);
+            slowprod = new Mlt::Producer(*m_mltProfile, "framebuffer", tmp);
+            delete[] tmp;
+            QString producerid = "slowmotion:" + id.section(":", 1, 1) + ":" + QString::number(speed);
+            tmp = decodedString(producerid);
+            slowprod->set("id", tmp);
+            delete[] tmp;
+            m_slowmotionProducers.insert(url, slowprod);
+        }
+        Mlt::Producer *cut = slowprod->cut(info.cropStart.frames(m_fps), (info.endPos - info.startPos).frames(m_fps) - 1);
         newLength = cut->get_length();
         trackPlaylist.replace_with_blank(clipIndex);
         trackPlaylist.consolidate_blanks(0);
@@ -1721,14 +1721,14 @@ bool Render::mltResizeClipStart(int track, GenTime pos, GenTime moveEnd, GenTime
     Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
     if (trackPlaylist.is_blank_at((int) pos.frames(m_fps) - 1)) {
         kDebug() << "////////  ERROR RSIZING BLANK CLIP!!!!!!!!!!!";
-       return false;
+        return false;
     }
     int clipIndex = trackPlaylist.get_clip_index_at((int) pos.frames(m_fps) - 1);
     int previousStart = trackPlaylist.clip_start(clipIndex);
     //kDebug() << " ** RESIZING CLIP START:" << clipIndex << " on track:" << track << ", mid pos: " << pos.frames(25) << ", moving: " << moveFrame << ", in: " << in.frames(25) << ", out: " << out.frames(25);
     Mlt::Producer *clip = trackPlaylist.get_clip(clipIndex);
     if (clip == NULL) {
-       return false;
+        return false;
     }
     m_isBlocked = true;
     trackPlaylist.resize_clip(clipIndex, (int) in.frames(m_fps), (int) out.frames(m_fps));
index 4f0d8427e52e3cb7cf694eb112a0b61bab09295f..b85f9065820b41d90e2351f819a3a4dc4daf73c0 100644 (file)
@@ -172,10 +172,10 @@ Q_OBJECT public:
     void mltResizeTransparency(int oldStart, int newStart, int newEnd, int track, int id);
 
     /** Change speed of a clip in playlist. To do this, we create a new "framebuffer" producer.
-       This new producer must have its "resource" param set to: video.mpg?0.6 where video.mpg is the path
-       to the clip and 0.6 is the speed in percents. The newly created producer will have it's
-       "id" parameter set to: "slowmotion:parentid:speed", where parentid is the id of the original clip
-       in the ClipManager list and speed is the current speed */
+    This new producer must have its "resource" param set to: video.mpg?0.6 where video.mpg is the path
+    to the clip and 0.6 is the speed in percents. The newly created producer will have it's
+    "id" parameter set to: "slowmotion:parentid:speed", where parentid is the id of the original clip
+    in the ClipManager list and speed is the current speed */
     int mltChangeClipSpeed(ItemInfo info, double speed, Mlt::Producer *prod);
 
 private:   // Private attributes & methods
index 293ad2ccda31d19d9539e1c10f486e2e0946887a..903dc8f0971259ed9883b0d3a09002e515b42619 100644 (file)
@@ -630,7 +630,7 @@ QPixmap TitleWidget::renderedPixmap() {
     QPixmap pix(m_frameWidth, m_frameHeight);
     pix.fill(Qt::transparent);
     QPainter painter(&pix);
-
+    //painter.setRenderHint( QPainter::Antialiasing );
     m_scene->clearSelection();
     QPen framepen = m_frameBorder->pen();
     m_frameBorder->setPen(Qt::NoPen);
index 3cdd33d416831af581af384431dae8090a77de84..13c383bde05ef7fe469aa72003bc6210e86bc853 100644 (file)
@@ -334,14 +334,14 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool videotrack) {
             // Found a clip
             int in = elem.attribute("in").toInt();
             QString idString = elem.attribute("producer");
-           int id = idString.toInt();
-           bool hasSpeedAttribute = false;
-           double speed;
-           if (idString.startsWith("slowmotion")) {
-               hasSpeedAttribute = true;
-               id = idString.section(":", 1, 1).toInt();
-               speed = idString.section(":", 2, 2).toDouble();
-           }
+            int id = idString.toInt();
+            bool hasSpeedAttribute = false;
+            double speed;
+            if (idString.startsWith("slowmotion")) {
+                hasSpeedAttribute = true;
+                id = idString.section(":", 1, 1).toInt();
+                speed = idString.section(":", 2, 2).toDouble();
+            }
             DocClipBase *clip = m_doc->clipManager()->getClipById(id);
             if (clip != NULL) {
                 int out = elem.attribute("out").toInt();
@@ -353,7 +353,7 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool videotrack) {
                 clipinfo.track = ix;
                 //kDebug() << "// INSERTING CLIP: " << in << "x" << out << ", track: " << ix << ", ID: " << id << ", SCALE: " << m_scale << ", FPS: " << m_doc->fps();
                 ClipItem *item = new ClipItem(clip, clipinfo, m_scale, m_doc->fps());
-               if (hasSpeedAttribute) item->setSpeed(speed);
+                if (hasSpeedAttribute) item->setSpeed(speed);
                 m_scene->addItem(item);
                 clip->addReference();
                 position += (out - in + 1);