]> git.sesse.net Git - kdenlive/commitdiff
- Fix split audio with locked audio tracks
authorTill Theato <root@ttill.de>
Thu, 3 Jun 2010 16:44:00 +0000 (16:44 +0000)
committerTill Theato <root@ttill.de>
Thu, 3 Jun 2010 16:44:00 +0000 (16:44 +0000)
- cleanup

svn path=/trunk/kdenlive/; revision=4496

src/abstractgroupitem.cpp
src/abstractgroupitem.h
src/customtrackview.cpp
src/kdenliveui.rc
src/monitor.h
src/projectlist.h
src/renderer.cpp

index cf5717a85d520a531a3404a4908e6f34a83b3595..7d2cc39a1b829bc20f65ad90e05ffd20f6d8b6bf 100644 (file)
@@ -79,40 +79,27 @@ CustomTrackScene* AbstractGroupItem::projectScene()
 
 QPainterPath AbstractGroupItem::clipGroupShape(QPointF offset) const
 {
-    QPainterPath path;
-    QList<QGraphicsItem *> children = childItems();
-    for (int i = 0; i < children.count(); i++) {
-        if (children.at(i)->type() == AVWIDGET) {
-            QRectF r(children.at(i)->sceneBoundingRect());
-            r.translate(offset);
-            path.addRect(r);
-        } else if (children.at(i)->type() == GROUPWIDGET) {
-            QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
-            for (int j = 0; j < subchildren.count(); j++) {
-                if (subchildren.at(j)->type() == AVWIDGET) {
-                    QRectF r(subchildren.at(j)->sceneBoundingRect());
-                    r.translate(offset);
-                    path.addRect(r);
-                }
-            }
-        }
-    }
-    return path;
+    return groupShape(AVWIDGET, offset);
 }
 
 QPainterPath AbstractGroupItem::transitionGroupShape(QPointF offset) const
+{
+    return groupShape(TRANSITIONWIDGET, offset);
+}
+
+QPainterPath AbstractGroupItem::groupShape(GRAPHICSRECTITEM type, QPointF offset) const
 {
     QPainterPath path;
     QList<QGraphicsItem *> children = childItems();
     for (int i = 0; i < children.count(); i++) {
-        if (children.at(i)->type() == TRANSITIONWIDGET) {
+        if (children.at(i)->type() == (int)type) {
             QRectF r(children.at(i)->sceneBoundingRect());
             r.translate(offset);
             path.addRect(r);
         } else if (children.at(i)->type() == GROUPWIDGET) {
             QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
             for (int j = 0; j < subchildren.count(); j++) {
-                if (subchildren.at(j)->type() == TRANSITIONWIDGET) {
+                if (subchildren.at(j)->type() == (int)type) {
                     QRectF r(subchildren.at(j)->sceneBoundingRect());
                     r.translate(offset);
                     path.addRect(r);
index c6c5952167d6eace483128a5e7d62409af360866..45ed065667b3ebdc597519c9423ac9cba8aa9f25 100644 (file)
@@ -39,8 +39,8 @@ public:
     CustomTrackScene* projectScene();
     void addItem(QGraphicsItem * item);
     int track() const;
-    QPainterPath clipGroupShape(QPointF) const;
-    QPainterPath transitionGroupShape(QPointF) const;
+    QPainterPath clipGroupShape(QPointF offset) const;
+    QPainterPath transitionGroupShape(QPointF offset) const;
     void setItemLocked(bool locked);
     bool isItemLocked() const;
     //    ItemInfo info() const;
@@ -55,6 +55,7 @@ protected:
 
 private:
     void fixItemRect();
+    QPainterPath groupShape(GRAPHICSRECTITEM type, QPointF offset) const;
 };
 
 #endif
index d3c3b8b8c72b9fdff17d6b9d587085a7bf4be5c6..d151995e48d1b16f31ef583a091ea4eca2039d6b 100644 (file)
@@ -5526,7 +5526,7 @@ void CustomTrackView::doSplitAudio(const GenTime &pos, int track, bool split)
         int freetrack = m_document->tracksCount() - track - 1;
         for (; freetrack > 0; freetrack--) {
             kDebug() << "// CHK DOC TRK:" << freetrack << ", DUR:" << m_document->renderer()->mltTrackDuration(freetrack);
-            if (m_document->trackInfoAt(freetrack - 1).type == AUDIOTRACK) {
+            if (m_document->trackInfoAt(freetrack - 1).type == AUDIOTRACK && !m_document->trackInfoAt(freetrack - 1).isLocked) {
                 kDebug() << "// CHK DOC TRK:" << freetrack << ", DUR:" << m_document->renderer()->mltTrackDuration(freetrack);
                 if (m_document->renderer()->mltTrackDuration(freetrack) < start || m_document->renderer()->mltGetSpaceLength(pos, freetrack, false) >= clip->cropDuration().frames(m_document->fps())) {
                     kDebug() << "FOUND SPACE ON TRK: " << freetrack;
index 1d4e7510ebebec4dc7e5eb48348acff67baff7f2..1a8122bd68475098aa26c772f7fe773d6a328a9c 100644 (file)
@@ -70,7 +70,7 @@
          <Action name="clip_audio_only" />
          <Action name="clip_video_only" />
          <Action name="clip_audio_and_video" />
-</Menu>
+    </Menu>
 
     <Menu name="timeline" ><text>Timeline</text>
       <Menu name="keyboard_selection" ><text>Selection</text>
       <Action name="get_new_titles" />
       <Action name="run_wizard" />
       <Menu name="themes_menu" ><text>Themes</text>
-      </Menu>
+    </Menu>
 </Menu>
   </MenuBar>
 </gui>
index 2d1130811c3162b8fbf7d160fdbc67eb67652f3a..6b0be9d30e4357a5db8e06d0cad7923e12e9af27 100644 (file)
@@ -92,9 +92,7 @@ protected:
      *
      * Moves towards the end of the clip/timeline on mouse wheel down/back, the
      * opposite on mouse wheel up/forward.
-     * Ctrl + wheel moves by a single frame, without Ctrl it moves by a second.
-     *
-     * See also http://www.kdenlive.org/mantis/view.php?id=265. */
+     * Ctrl + wheel moves by a second, without Ctrl it moves by a single frame. */
     virtual void wheelEvent(QWheelEvent * event);
     virtual void mouseMoveEvent(QMouseEvent *event);
     virtual QStringList mimeTypes() const;
index 02753668dac41c3f57d96497364704accfd454f1..376c9c60c5183108e756ae749dc8cfb29a117543 100644 (file)
@@ -174,6 +174,7 @@ public slots:
     /** @brief Prepares removing the selected items. */
     void slotRemoveClip();
     void slotAddClip(const QList <QUrl> givenList = QList <QUrl> (), const QString &groupName = QString(), const QString &groupId = QString());
+
     /** @brief Adds, edits or deletes a folder item.
     *
     * This is triggered by AddFolderCommand and EditFolderCommand. */
@@ -228,6 +229,7 @@ private slots:
     void slotAddSlideshowClip();
     void slotAddTitleClip();
     void slotAddTitleTemplateClip();
+
     /** @brief Shows the context menu after enabling and disabling actions based on the item's type.
     * @param pos The position where the menu should pop up
     * @param item The item for which the checks should be done */
index 2a2f45dfb8c15e72f637d577293ee4f879754727..2a78c8e6cc88bb8f18ebbb696c42125da2d68503 100644 (file)
@@ -538,8 +538,7 @@ void Render::slotSplitView(bool doit)
     if (service.type() != tractor_type || tractor.count() < 2) return;
     Mlt::Field *field = tractor.field();
     if (doit) {
-        int screen = 0;
-        for (int i = 1; i < tractor.count() && screen < 4; i++) {
+        for (int i = 1, screen = 0; i < tractor.count() && screen < 4; i++) {
             Mlt::Producer trackProducer(tractor.track(i));
             kDebug() << "// TRACK: " << i << ", HIDE: " << trackProducer.get("hide");
             if (QString(trackProducer.get("hide")).toInt() != 1) {