Skip to content

Commit

Permalink
Convert whitebalance filters to QML
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatherly committed May 28, 2014
1 parent e95e6b2 commit b1ae4d4
Show file tree
Hide file tree
Showing 16 changed files with 480 additions and 727 deletions.
14 changes: 2 additions & 12 deletions src/docks/filtersdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
#include <QDebug>
#include "mainwindow.h"
#include "settings.h"
#include "filters/whitebalancefilter.h"
#include "filters/webvfxfilter.h"
#include "qmltypes/qmlfilter.h"
#include "qmltypes/qmlmetadata.h"
#include "qmltypes/qmlprofile.h"
#include "qmltypes/qmlutilities.h"
#include "qmltypes/colorpickeritem.h"
#include "qmltypes/colorwheelitem.h"

static bool compareQAction(const QAction* a1, const QAction* a2)
Expand All @@ -50,10 +50,10 @@ static QActionList getFilters(FiltersDock* dock, Ui::FiltersDock* ui)
if (!Settings.playerGPU() && MLT.repository()->filters()->get_data("webvfx"))
actions.append(ui->actionOverlayHTML);
#endif
actions.append(ui->actionWhiteBalance);

// Find all of the plugin filters.
qmlRegisterType<QmlMetadata>("org.shotcut.qml", 1, 0, "Metadata");
qmlRegisterType<ColorPickerItem>("Shotcut.Controls", 1, 0, "ColorPickerItem");
qmlRegisterType<ColorWheelItem>("Shotcut.Controls", 1, 0, "ColorWheelItem");
QQmlEngine engine;
QDir dir = QmlUtilities::qmlDir();
Expand Down Expand Up @@ -235,8 +235,6 @@ void FiltersDock::on_listView_clicked(const QModelIndex &index)
QmlMetadata* meta = qmlMetadataForService(filter);
if (meta)
loadQuickPanel(meta, index.row());
else if (name == "frei0r.colgate" || name == "movit.white_balance")
loadWidgetsPanel(new WhiteBalanceFilter(*filter));
else if (name == "webvfx")
loadWidgetsPanel(new WebvfxFilter(*filter));
else
Expand All @@ -258,14 +256,6 @@ void FiltersDock::on_listView_doubleClicked(const QModelIndex &index)
m_model.setData(index, true, Qt::CheckStateRole);
}

void FiltersDock::on_actionWhiteBalance_triggered()
{
Mlt::Filter* filter = m_model.add(Settings.playerGPU()? "movit.white_balance": "frei0r.colgate");
loadWidgetsPanel(new WhiteBalanceFilter(*filter, true));
delete filter;
ui->listView->setCurrentIndex(m_model.index(m_model.rowCount() - 1));
}

void FiltersDock::onActionTriggered(QAction* action)
{
if (action->children().count()) {
Expand Down
2 changes: 0 additions & 2 deletions src/docks/filtersdock.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ private slots:
void on_actionMirror_triggered();

void on_listView_doubleClicked(const QModelIndex &index);

void on_actionWhiteBalance_triggered();

void onActionTriggered(QAction* action);

Expand Down
5 changes: 0 additions & 5 deletions src/docks/filtersdock.ui
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@
<string>Mirror</string>
</property>
</action>
<action name="actionWhiteBalance">
<property name="text">
<string>White Balance</string>
</property>
</action>
<action name="actionOverlayHTML">
<property name="text">
<string>Overlay HTML</string>
Expand Down
100 changes: 0 additions & 100 deletions src/filters/whitebalancefilter.cpp

This file was deleted.

55 changes: 0 additions & 55 deletions src/filters/whitebalancefilter.h

This file was deleted.

0 comments on commit b1ae4d4

Please sign in to comment.