Changeset View
Changeset View
Standalone View
Standalone View
src/monitor/qmlmanager.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 53 | { | |||
---|---|---|---|---|---|
61 | m_sceneType = type; | 61 | m_sceneType = type; | ||
62 | QQuickItem *root; | 62 | QQuickItem *root; | ||
63 | switch (type) { | 63 | switch (type) { | ||
64 | case MonitorSceneGeometry: | 64 | case MonitorSceneGeometry: | ||
65 | m_view->setSource(QUrl(QStringLiteral("qrc:/qml/kdenlivemonitoreffectscene.qml"))); | 65 | m_view->setSource(QUrl(QStringLiteral("qrc:/qml/kdenlivemonitoreffectscene.qml"))); | ||
66 | root = m_view->rootObject(); | 66 | root = m_view->rootObject(); | ||
67 | QObject::connect(root, SIGNAL(effectChanged()), this, SLOT(effectRectChanged()), Qt::UniqueConnection); | 67 | QObject::connect(root, SIGNAL(effectChanged()), this, SLOT(effectRectChanged()), Qt::UniqueConnection); | ||
68 | QObject::connect(root, SIGNAL(centersChanged()), this, SLOT(effectPolygonChanged()), Qt::UniqueConnection); | 68 | QObject::connect(root, SIGNAL(centersChanged()), this, SLOT(effectPolygonChanged()), Qt::UniqueConnection); | ||
69 | QObject::connect(root, SIGNAL(opacityChanged(qreal)), this, SIGNAL(opacityChanged(qreal)), Qt::UniqueConnection); | ||||
70 | QObject::connect(root, SIGNAL(angleChanged()), this, SIGNAL(angleChanged()), Qt:UniqueConnection); | ||||
69 | root->setProperty("profile", QPoint(profile.width(), profile.height())); | 71 | root->setProperty("profile", QPoint(profile.width(), profile.height())); | ||
70 | root->setProperty("framesize", QRect(0, 0, profile.width(), profile.height())); | 72 | root->setProperty("framesize", QRect(0, 0, profile.width(), profile.height())); | ||
71 | root->setProperty("scalex", (double)displayRect.width() / profile.width() * zoom); | 73 | root->setProperty("scalex", (double)displayRect.width() / profile.width() * zoom); | ||
72 | root->setProperty("scaley", (double)displayRect.width() / profileStretch / profile.width() * zoom); | 74 | root->setProperty("scaley", (double)displayRect.width() / profileStretch / profile.width() * zoom); | ||
73 | root->setProperty("center", displayRect.center()); | 75 | root->setProperty("center", displayRect.center()); | ||
74 | break; | 76 | break; | ||
75 | case MonitorSceneCorners: | 77 | case MonitorSceneCorners: | ||
76 | m_view->setSource(QUrl(QStringLiteral("qrc:/qml/kdenlivemonitorcornerscene.qml"))); | 78 | m_view->setSource(QUrl(QStringLiteral("qrc:/qml/kdenlivemonitorcornerscene.qml"))); | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 140 | { | |||
146 | mix.reserve(points.count()); | 148 | mix.reserve(points.count()); | ||
147 | for (int i = 0; i < points.count(); i++) { | 149 | for (int i = 0; i < points.count(); i++) { | ||
148 | mix << controlPoints.at(2 * i); | 150 | mix << controlPoints.at(2 * i); | ||
149 | mix << points.at(i); | 151 | mix << points.at(i); | ||
150 | mix << controlPoints.at(2 * i + 1); | 152 | mix << controlPoints.at(2 * i + 1); | ||
151 | } | 153 | } | ||
152 | emit effectPointsChanged(mix); | 154 | emit effectPointsChanged(mix); | ||
153 | } | 155 | } | ||
156 | | ||||
157 | void QmlManager::effectOpacityChanged() | ||||
158 | { | ||||
159 | if (!m_view->rootObject()) { | ||||
160 | return; | ||||
161 | } | ||||
162 | const qreal opacityValue = m_view->rootObject()->property("opacity").toReal(); | ||||
163 | emit opacityChanged(opacityValue); | ||||
164 | } | ||||
165 | | ||||
166 | void QmlManager::effectRotationChanged() | ||||
167 | { | ||||
168 | if (!m_view->rootObject()) { | ||||
169 | return; | ||||
170 | } | ||||
171 | emit angleChanged(); | ||||
172 | } |