From 0c3fe540e925829022d9d8aa567c2dc2bd3d33d5 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Wed, 21 Jun 2017 13:03:30 +0800 Subject: Complete rewrite of the MIDI mapper. Enforces single fluidsynth instance. Documentation update. Minor changes to make lite version work. --- qmidiplayer-lite/main.qml | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'qmidiplayer-lite/main.qml') 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;} + } } -- cgit v1.2.3