aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-lite/main.qml
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-06-21 13:03:30 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-06-21 13:03:30 +0800
commit0c3fe540e925829022d9d8aa567c2dc2bd3d33d5 (patch)
treeab9ecae4def5a329b5e796839ece97f4b9c0297f /qmidiplayer-lite/main.qml
parent64c91c7da66ba71e2bb32077680f234aba4ac65d (diff)
downloadQMidiPlayer-0c3fe540e925829022d9d8aa567c2dc2bd3d33d5.tar.xz
Complete rewrite of the MIDI mapper.
Enforces single fluidsynth instance. Documentation update. Minor changes to make lite version work.
Diffstat (limited to 'qmidiplayer-lite/main.qml')
-rw-r--r--qmidiplayer-lite/main.qml36
1 files changed, 27 insertions, 9 deletions
diff --git a/qmidiplayer-lite/main.qml b/qmidiplayer-lite/main.qml
index 0ec0975..ace1427 100644
--- a/qmidiplayer-lite/main.qml
+++ b/qmidiplayer-lite/main.qml
@@ -8,10 +8,12 @@ Window {
id: window1
width: 420
height: 240
- title: "QMidiPlayer Lite"
+ title: "QMidiPlayer Lite TP"
visible: true
property bool playing
playing: false
+ property string soundfont
+ soundfont: ""
MouseArea {
id: mouseArea1
@@ -20,9 +22,6 @@ Window {
anchors.leftMargin: 0
anchors.topMargin: 0
anchors.fill: parent
- onClicked: {
- //Qt.quit();
- }
Button {
id: button2
@@ -35,7 +34,7 @@ Window {
if(!playing)
{
qmpcore.loadFile(fileName.text);
- qmpcore.initFluidSynth();
+ qmpcore.initFluidSynth(soundfont);
qmpcore.playFile();
playing=true;
uiTimer.start();
@@ -92,6 +91,18 @@ Window {
}
}
}
+
+ Button {
+ id: button
+ anchors.top: parent.top
+ anchors.topMargin: 67
+ anchors.horizontalCenter: parent.horizontalCenter
+ x: 139
+ text: qsTr("Load SoundFont")
+ onClicked: {
+ sfFileDialog.open()
+ }
+ }
}
CQMPCoreWrapper {
@@ -115,17 +126,18 @@ Window {
Text {
id: fileName
text: qsTr("...")
- anchors.centerIn: parent
+ anchors.top: parent.top
+ anchors.topMargin: 100
+ anchors.horizontalCenter: parent.horizontalCenter
+ x: 139
}
Button {
id: button1
x: 170
- width: 80
- height: 27
text: qsTr("Open")
anchors.top: parent.top
- anchors.topMargin: 142
+ anchors.topMargin: 130
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
fileDialog.open();
@@ -140,5 +152,11 @@ Window {
fileName.text=fileUrl;
}
}
+ FileDialog {
+ id: sfFileDialog
+ title: qsTr("Select SoundFont")
+ nameFilters: ["SoundFont (*.sf2)"]
+ onAccepted: {soundfont=fileUrl;}
+ }
}