Пример #1
0
void Geometryval::slotPositionChanged(int pos, bool seek)
{
    if (seek && KdenliveSettings::transitionfollowcursor()) emit seekToPos(pos);
    m_ui.spinPos->setValue(pos);
    m_helper->setValue(pos);
    Mlt::GeometryItem item;
    int error = m_geom->fetch(&item, pos);
    if (error || item.key() == false) {
        // no keyframe under cursor, adjust buttons
        m_ui.buttonAdd->setEnabled(true);
        m_ui.buttonDelete->setEnabled(false);
        m_ui.widget->setEnabled(false);
        m_ui.spinTransp->setEnabled(false);
        m_scaleMenu->setEnabled(false);
        m_alignMenu->setEnabled(false);
    } else {
        m_ui.buttonAdd->setEnabled(false);
        m_ui.buttonDelete->setEnabled(true);
        m_ui.widget->setEnabled(true);
        m_ui.spinTransp->setEnabled(true);
        m_scaleMenu->setEnabled(true);
        m_alignMenu->setEnabled(true);
    }
    m_paramRect->setPos(item.x(), item.y());
    m_paramRect->setRect(0, 0, item.w(), item.h());
    m_ui.spinTransp->setValue(item.mix());
    m_paramRect->setBrush(QColor(255, 0, 0, item.mix()));
}
Пример #2
0
bool Geometryval::keyframeSelected()
{
    Mlt::GeometryItem item;
    int pos = m_timePos.getValue();
    if (m_geom->fetch(&item, pos) || item.key() == false) return false;
    return true;
}
Пример #3
0
void Geometryval::slotResize200()
{
    int pos = m_ui.spinPos->value();
    Mlt::GeometryItem item;
    int error = m_geom->fetch(&item, pos);
    if (error || item.key() == false) {
        // no keyframe under cursor
        return;
    }
    m_paramRect->setRect(0, 0, m_profile.width * 2, m_profile.height * 2);
    slotUpdateTransitionProperties();
}
Пример #4
0
void Geometryval::slotAlignRight()
{
    int pos = m_ui.spinPos->value();
    Mlt::GeometryItem item;
    int error = m_geom->fetch(&item, pos);
    if (error || item.key() == false) {
        // no keyframe under cursor
        return;
    }
    m_paramRect->setPos(m_profile.width - m_paramRect->rect().width(), m_paramRect->pos().y());
    slotUpdateTransitionProperties();
}
Пример #5
0
void Geometryval::slotResizeOriginal()
{
    if (m_frameSize.isNull()) slotResize100();
    int pos = m_ui.spinPos->value();
    Mlt::GeometryItem item;
    int error = m_geom->fetch(&item, pos);
    if (error || item.key() == false) {
        // no keyframe under cursor
        return;
    }
    m_paramRect->setRect(0, 0, m_frameSize.x(), m_frameSize.y());
    slotUpdateTransitionProperties();
}
Пример #6
0
void Geometryval::slotTransparencyChanged(int transp)
{
    int pos = m_ui.spinPos->value();
    Mlt::GeometryItem item;
    int error = m_geom->fetch(&item, pos);
    if (error || item.key() == false) {
        // no keyframe under cursor
        return;
    }
    item.mix(transp);
    m_paramRect->setBrush(QColor(255, 0, 0, transp));
    m_geom->insert(item);
    emit parameterChanged();
}
Пример #7
0
void Geometryval::slotResizeCustom()
{
    int pos = m_ui.spinPos->value();
    Mlt::GeometryItem item;
    int error = m_geom->fetch(&item, pos);
    if (error || item.key() == false) {
        // no keyframe under cursor
        return;
    }
    int scale = m_paramRect->rect().width() * 100 / m_profile.width;
    bool ok;
    scale =  QInputDialog::getInteger(this, i18n("Resize..."), i18n("Scale"), scale, 1, 2147483647, 10, &ok);
    if (!ok) return;
    m_paramRect->setRect(0, 0, m_profile.width * scale / 100, m_profile.height * scale / 100);
    slotUpdateTransitionProperties();
}
Пример #8
0
void Geometryval::slotPositionChanged(int pos, bool seek)
{
    if (pos == -1) {
        pos = m_timePos.getValue();
    }
    if (seek && KdenliveSettings::transitionfollowcursor()) emit seekToPos(pos + m_startPoint);
    m_timePos.setValue(pos);
    //spinPos->setValue(pos);
    m_helper->blockSignals(true);
    m_helper->setValue(pos);
    m_helper->blockSignals(false);
    Mlt::GeometryItem item;
    int error = m_geom->fetch(&item, pos);
    if (error || item.key() == false) {
        // no keyframe under cursor, adjust buttons
        buttonAdd->setEnabled(true);
        buttonDelete->setEnabled(false);
        widget->setEnabled(false);
        spinTransp->setEnabled(false);
        frameOptions->setEnabled(false);
        m_reset->setEnabled(false);
    } else {
        buttonAdd->setEnabled(false);
        buttonDelete->setEnabled(true);
        widget->setEnabled(true);
        spinTransp->setEnabled(true);
        frameOptions->setEnabled(true);
        m_reset->setEnabled(true);
    }

    m_paramRect->setPos(item.x() * m_dar, item.y());
    m_paramRect->setRect(0, 0, item.w() * m_dar, item.h());
    spinTransp->setValue(item.mix());
    m_paramRect->setBrush(QColor(255, 0, 0, item.mix()));
    slotUpdateGeometry();
}