本文整理汇总了C++中mlt::GeometryItem::mix方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryItem::mix方法的具体用法?C++ GeometryItem::mix怎么用?C++ GeometryItem::mix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mlt::GeometryItem
的用法示例。
在下文中一共展示了GeometryItem::mix方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotPositionChanged
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: slotTransparencyChanged
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();
}
示例3: slotPositionChanged
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();
}
示例4: mousePressEvent
// virtual
void KeyframeHelper::mousePressEvent(QMouseEvent * event)
{
m_hoverKeyframe = -1;
if (event->button() != Qt::LeftButton) {
QWidget::mousePressEvent(event);
return;
}
int xPos = event->x() - margin;
int headOffset = m_lineHeight / 1.5;
if (m_geom != NULL && (event->y() <= headOffset)) {
// check if we want to move a keyframe
int mousePos = qMax((int)(xPos / m_scale), 0) + m_offset;
Mlt::GeometryItem item;
if (m_geom->next_key(&item, mousePos) == 0) {
if (qAbs((item.frame() - m_offset)* m_scale - xPos) < headOffset) {
m_movingItem.x(item.x());
m_movingItem.y(item.y());
m_movingItem.w(item.w());
m_movingItem.h(item.h());
m_movingItem.mix(item.mix());
m_movingItem.frame(item.frame());
while (!m_extraMovingItems.isEmpty()) {
Mlt::GeometryItem *gitem = m_extraMovingItems.takeFirst();
if (gitem) delete gitem;
}
for (int i = 0; i < m_extraGeometries.count(); ++i) {
if (m_extraGeometries.at(i)->next_key(item, mousePos) == 0) {
Mlt::GeometryItem *item2 = new Mlt::GeometryItem();
item2->x(item.x());
item2->frame(item.frame());
m_extraMovingItems.append(item2);
} else {
m_extraMovingItems.append(NULL);
}
}
m_dragStart = event->pos();
return;
}
}
}
int seekRequest = xPos / m_scale;
if (seekRequest != m_position) {
m_seekPosition = seekRequest;
emit requestSeek(m_seekPosition);
update();
}
}
示例5: slotAddFrame
void Geometryval::slotAddFrame()
{
int pos = m_ui.spinPos->value();
Mlt::GeometryItem item;
item.frame(pos);
item.x(m_paramRect->pos().x());
item.y(m_paramRect->pos().y());
item.w(m_paramRect->rect().width());
item.h(m_paramRect->rect().height());
item.mix(m_ui.spinTransp->value());
m_geom->insert(item);
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_helper->update();
emit parameterChanged();
}
示例6: slotAddFrame
void Geometryval::slotAddFrame(int pos)
{
int frame = m_timePos.getValue();
if (pos == -1) pos = frame;
Mlt::GeometryItem item;
item.frame(pos);
QRectF r = m_paramRect->rect().normalized();
QPointF rectpos = m_paramRect->pos();
item.x(rectpos.x() / m_dar);
item.y(rectpos.y());
item.w(r.width() / m_dar);
item.h(r.height());
item.mix(spinTransp->value());
m_geom->insert(item);
buttonAdd->setEnabled(false);
buttonDelete->setEnabled(true);
widget->setEnabled(true);
spinTransp->setEnabled(true);
frameOptions->setEnabled(true);
m_reset->setEnabled(true);
m_helper->update();
emit parameterChanged();
}