Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hecomi/qml-osc
QML custom element that can handle OSC.
https://github.com/hecomi/qml-osc
Last synced: 14 days ago
JSON representation
QML custom element that can handle OSC.
- Host: GitHub
- URL: https://github.com/hecomi/qml-osc
- Owner: hecomi
- License: mit
- Created: 2013-11-09T09:17:24.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-09T09:33:38.000Z (about 11 years ago)
- Last Synced: 2023-03-15T11:15:27.014Z (over 1 year ago)
- Language: C++
- Size: 191 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
qml-osc
==============Overview
--------
- QML custom element that can handle OSC message.Libraries
---------
- [oscpack](http://www.rossbencina.com/code/oscpack)License
-------
- MIT LicenseUsage
-----
1. Include ```osc.pri``` into your qt project.```
include(../osc/osc.pri)folder_01.source = qml/CustomElementsTest
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
...
```2. Register custom qml in your ```main.cpp```.
```cpp
#include
#include "qtquick2applicationviewer.h"#include // add
#include // addint main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);qmlRegisterType("OSC", 1, 0, "OSCReceiver"); // add
qmlRegisterType("OSC", 1, 0, "OSCSender"); // addQtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/CustomElementsTest/main.qml"));
viewer.showExpanded();return app.exec();
}
```3. Using custom QML named ```OSCReceiver``` and ```OSCSender``` in your qml files.
```javascript
import QtQuick 2.0
import OSC 1.0Rectangle {
width: 360
height: 360
Text {
id: message
anchors.centerIn: parent
}
OSCReceiver {
port: 3333
onMessage: {
message.text = address + ' : ' + msg;
}
}
OSCSender {
id: osc
ip: '127.0.0.1'
port: 3333
}
Timer {
property int cnt: 0
interval: 1000/60
running: true
repeat: true
onTriggered: {
osc.send('/Hoge/cnt', ++cnt);
}
}
}
```