summaryrefslogtreecommitdiffstats
path: root/DOCS
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-05 15:26:57 +0100
committerwm4 <wm4@nowhere>2015-01-05 15:26:57 +0100
commit6719662fedaea4d07d7b96000efd7bcced01ca3b (patch)
tree6d2117148f9ff6e37c23ab2a5c057ffb5e71d092 /DOCS
parentdf595b06e6079ab9078d38ef76f5d536616846ca (diff)
downloadmpv-6719662fedaea4d07d7b96000efd7bcced01ca3b.tar.bz2
mpv-6719662fedaea4d07d7b96000efd7bcced01ca3b.tar.xz
DOCS/client_api_examples: qml: add test for vo_cmdline
Diffstat (limited to 'DOCS')
-rw-r--r--DOCS/client_api_examples/qml/main.qml32
-rw-r--r--DOCS/client_api_examples/qml/mpvrenderer.cpp8
-rw-r--r--DOCS/client_api_examples/qml/mpvrenderer.h2
3 files changed, 29 insertions, 13 deletions
diff --git a/DOCS/client_api_examples/qml/main.qml b/DOCS/client_api_examples/qml/main.qml
index 4b31406554..4c07351d32 100644
--- a/DOCS/client_api_examples/qml/main.qml
+++ b/DOCS/client_api_examples/qml/main.qml
@@ -13,7 +13,7 @@ Item {
MouseArea {
anchors.fill: parent
- onClicked: renderer.loadfile("../../../test.mkv")
+ onClicked: renderer.command(["loadfile", "../../../test.mkv"])
}
}
@@ -24,17 +24,35 @@ Item {
color: "white"
border.color: "black"
opacity: 0.8
- anchors.fill: label
+ anchors.fill: box
}
- Text {
- id: label
+ Row {
+ id: box
anchors.bottom: renderer.bottom
anchors.left: renderer.left
anchors.right: renderer.right
anchors.margins: 100
- wrapMode: Text.WordWrap
- text: "QtQuick and mpv are both rendering stuff.\n
- Click to load ../../../test.mkv"
+
+ Text {
+ anchors.margins: 10
+ wrapMode: Text.WordWrap
+ text: "QtQuick and mpv are both rendering stuff.\n
+ Click to load ../../../test.mkv"
+ }
+
+ CheckBox {
+ id: checkbox
+ anchors.margins: 10
+ // Heavily filtered means good, right?
+ text: "Make video looks like on a Smart TV"
+ onClicked: {
+ if (checkbox.checked) {
+ renderer.command(["vo_cmdline", "lscale=sharpen3:lparam1=1.0"])
+ } else {
+ renderer.command(["vo_cmdline", ""])
+ }
+ }
+ }
}
}
diff --git a/DOCS/client_api_examples/qml/mpvrenderer.cpp b/DOCS/client_api_examples/qml/mpvrenderer.cpp
index 0f6b6ba9f9..07ee360eb3 100644
--- a/DOCS/client_api_examples/qml/mpvrenderer.cpp
+++ b/DOCS/client_api_examples/qml/mpvrenderer.cpp
@@ -98,12 +98,10 @@ void MpvObject::doUpdate()
update();
}
-void MpvObject::loadfile(const QString& filename)
+void MpvObject::command(const QVariant& params)
{
- QVariantList cmd;
- cmd.append("loadfile");
- cmd.append(filename);
- mpv::qt::command_variant(mpv, cmd);
+ //mpv_command_string(mpv, s.toUtf8().data());
+ mpv::qt::command_variant(mpv, params);
}
QQuickFramebufferObject::Renderer *MpvObject::createRenderer() const
diff --git a/DOCS/client_api_examples/qml/mpvrenderer.h b/DOCS/client_api_examples/qml/mpvrenderer.h
index 700505ad20..ec7e5c4279 100644
--- a/DOCS/client_api_examples/qml/mpvrenderer.h
+++ b/DOCS/client_api_examples/qml/mpvrenderer.h
@@ -23,7 +23,7 @@ public:
virtual ~MpvObject();
virtual Renderer *createRenderer() const;
public slots:
- void loadfile(const QString& filename);
+ void command(const QVariant& params);
signals:
void onUpdate();
private slots: