]> git.sesse.net Git - kdenlive/blobdiff - src/geometryval.cpp
Allow audio capture through alsa for screen grabs. Should fix issue:
[kdenlive] / src / geometryval.cpp
index 050d5cc119458f5a3742b9336a71522f7d855940..2c40d6e098e651b1b95b8a045ab0a495ecc215fa 100644 (file)
@@ -273,6 +273,15 @@ void Geometryval::slotPositionChanged(int pos, bool seek) {
 }
 
 void Geometryval::slotDeleteFrame() {
+    // check there is more than one keyframe
+    Mlt::GeometryItem item;
+    const int pos = ui.spinPos->value();
+    int error = m_geom->next_key(&item, pos + 1);
+    if (error) {
+        error = m_geom->prev_key(&item, pos - 1);
+        if (error || item.frame() == pos) return;
+    }
+
     m_geom->remove(ui.spinPos->value());
     ui.buttonAdd->setEnabled(true);
     ui.buttonDelete->setEnabled(false);
@@ -306,7 +315,11 @@ void Geometryval::slotNextFrame() {
     Mlt::GeometryItem item;
     int error = m_geom->next_key(&item, m_helper->value() + 1);
     kDebug() << "// SEEK TO NEXT KFR: " << error;
-    if (error) return;
+    if (error) {
+        // Go to end
+        ui.spinPos->setValue(ui.spinPos->maximum());
+        return;
+    }
     int pos = item.frame();
     ui.spinPos->setValue(pos);
 }
@@ -332,6 +345,14 @@ void Geometryval::setupParam(const QDomElement& par, int minFrame, int maxFrame)
     QString val = par.attribute("value");
     if (par.attribute("fixed") == "1") {
         m_fixedMode = true;
+        ui.buttonPrevious->setHidden(true);
+        ui.buttonNext->setHidden(true);
+        ui.buttonDelete->setHidden(true);
+        ui.buttonAdd->setHidden(true);
+        ui.spinTransp->setMaximum(500);
+        ui.label_pos->setHidden(true);
+        m_helper->setHidden(true);
+        ui.spinPos->setHidden(true);
     }
     char *tmp = (char *) qstrdup(val.toUtf8().data());
     if (m_geom) m_geom->parse(tmp, maxFrame - minFrame, m_profile.width, m_profile.height);
@@ -340,10 +361,7 @@ void Geometryval::setupParam(const QDomElement& par, int minFrame, int maxFrame)
 
     //kDebug() << " / / UPDATING TRANSITION VALUE: " << m_geom->serialise();
     //read param her and set rect
-    if (m_fixedMode) {
-        m_helper->setHidden(true);
-        ui.spinPos->setHidden(true);
-    } else {
+    if (!m_fixedMode) {
         m_helper->setKeyGeometry(m_geom, maxFrame - minFrame - 1);
         m_helper->update();
         /*QDomDocument doc;
@@ -370,8 +388,8 @@ void Geometryval::setupParam(const QDomElement& par, int minFrame, int maxFrame)
     slotPositionChanged(0, false);
     if (!m_fixedMode) {
         connect(ui.spinPos, SIGNAL(valueChanged(int)), this , SLOT(slotPositionChanged(int)));
-        connect(ui.spinTransp, SIGNAL(valueChanged(int)), this , SLOT(slotTransparencyChanged(int)));
     }
+    connect(ui.spinTransp, SIGNAL(valueChanged(int)), this , SLOT(slotTransparencyChanged(int)));
 }
 
 void Geometryval::updateTransitionPath() {