Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Start reimplementing track compositing change action

parent 83614f1b
......@@ -4059,16 +4059,11 @@ void MainWindow::slotManageCache()
void MainWindow::slotUpdateCompositing(QAction *compose)
{
// TODO refac
/*
if (pCore->projectManager()->currentTimeline()) {
int mode = compose->data().toInt();
pCore->projectManager()->currentTimeline()->switchComposite(mode);
if (m_renderWidget) {
m_renderWidget->errorMessage(RenderWidget::CompositeError, mode == 1 ? i18n("Rendering using low quality track compositing") : QString());
}
int mode = compose->data().toInt();
getMainTimeline()->controller()->switchCompositing(mode);
if (m_renderWidget) {
m_renderWidget->errorMessage(RenderWidget::CompositeError, mode == 1 ? i18n("Rendering using low quality track compositing") : QString());
}
*/
}
void MainWindow::slotUpdateCompositeAction(int mode)
......
......@@ -98,7 +98,6 @@ Rectangle {
property real baseUnit: fontMetrics.font.pointSize
property int currentTrack: 0
property color selectedTrackColor: Qt.rgba(activePalette.highlight.r, activePalette.highlight.g, activePalette.highlight.b, 0.4)
property alias trackCount: tracksRepeater.count
property bool stopScrolling: false
property int duration: timeline.duration
property color shotcutBlue: Qt.rgba(23/255, 92/255, 118/255, 1.0)
......
......@@ -981,3 +981,29 @@ void TimelineController::changeItemSpeed(int clipId, int speed)
{
m_model->changeItemSpeed(clipId, speed);
}
void TimelineController::switchCompositing(int mode)
{
//m_model->m_tractor->lock();
qDebug()<<"//// SWITCH COMPO: "<<mode;
QScopedPointer<Mlt::Service> service(m_model->m_tractor->field());
Mlt::Field *field = m_model->m_tractor->field();
field->lock();
while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) {
Mlt::Transition t((mlt_transition)service->get_service());
QString serviceName = t.get("mlt_service");
if (t.get_int("internal_added") == 237 && serviceName != QLatin1String("mix")) {
if (mode <= 0) {
// No compositing wanted, remove
field->disconnect_service(t);
qDebug()<<"//// DELETING TRANSITION!!!";
}
}
}
service.reset(service->producer());
}
field->unlock();
delete field;
}
......@@ -279,6 +279,11 @@ public:
/* @brief Return document properties with added settings from timeline
*/
QMap<QString, QString> documentProperties();
/** @brief Change track compsiting mode */
void switchCompositing(int mode);
/** @brief Change a clip item's speed in timeline */
void changeItemSpeed(int clipId, int speed);
public slots:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment