Changeset View
Changeset View
Standalone View
Standalone View
src/qml/midiplayer/MidiPlayer.qml
Show All 16 Lines | |||||
17 | ** | 17 | ** | ||
18 | ** You should have received a copy of the GNU General Public License | 18 | ** You should have received a copy of the GNU General Public License | ||
19 | ** along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | ** along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
20 | ** | 20 | ** | ||
21 | ****************************************************************************/ | 21 | ****************************************************************************/ | ||
22 | 22 | | |||
23 | import QtQuick 2.4 | 23 | import QtQuick 2.4 | ||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.minuet 1.0 | ||||
25 | 26 | | |||
26 | Rectangle { | 27 | Rectangle { | ||
27 | function timeLabelChanged(timeLabel) { playbackTime.text = timeLabel } | 28 | function timeLabelChanged(timeLabel) { playbackTime.text = timeLabel } | ||
28 | function volumeChanged(value) { volumeLabel.text = i18n("Volume: %1\%").arg(value) } | 29 | function volumeChanged(value) { volumeLabel.text = i18n("Volume: %1\%").arg(value) } | ||
29 | function tempoChanged(value) { tempoLabel.text = i18n("Tempo: %1 bpm").arg(value) } | 30 | function tempoChanged(value) { tempoLabel.text = i18n("Tempo: %1 bpm").arg(value) } | ||
30 | function pitchChanged(value) { pitchLabel.text = i18n("Pitch: %1").arg(value) } | 31 | function pitchChanged(value) { pitchLabel.text = i18n("Pitch: %1").arg(value) } | ||
32 | function stateChanged(state) { | ||||
33 | if (state == MidiSequencer.PlayingState) | ||||
34 | item12.state = "Pause" | ||||
35 | else | ||||
36 | item12.state = "Play" | ||||
37 | } | ||||
31 | 38 | | |||
32 | height: childrenRect.height + 15 | 39 | height: childrenRect.height + 15 | ||
33 | anchors { left: parent.left; bottom: parent.bottom } | 40 | anchors { left: parent.left; bottom: parent.bottom } | ||
34 | color: "black" | 41 | color: "black" | ||
35 | 42 | | |||
36 | Rectangle { | 43 | Rectangle { | ||
37 | id: labels | 44 | id: labels | ||
38 | 45 | | |||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 84 | Text { | |||
80 | width: item1.width | 87 | width: item1.width | ||
81 | horizontalAlignment: Text.AlignHCenter | 88 | horizontalAlignment: Text.AlignHCenter | ||
82 | text: "00:00.00" | 89 | text: "00:00.00" | ||
83 | font.pointSize: 24 | 90 | font.pointSize: 24 | ||
84 | color: "#008000" | 91 | color: "#008000" | ||
85 | } | 92 | } | ||
86 | MultimediaButton { | 93 | MultimediaButton { | ||
87 | id: item12 | 94 | id: item12 | ||
88 | 95 | anchors.horizontalCenterOffset: -30 | |||
89 | anchors { top: playbackTime.bottom; horizontalCenter: playbackTime.horizontalCenter } | 96 | anchors { top: playbackTime.bottom; horizontalCenter: playbackTime.horizontalCenter;} | ||
90 | source: "../images/multimedia-pause.png" | 97 | state: "Play" | ||
98 | states: [ | ||||
99 | State { | ||||
100 | name: "Play" | ||||
101 | PropertyChanges { | ||||
102 | target: item12; | ||||
103 | text: i18n("Play") | ||||
104 | onActivated: sequencer.play(); | ||||
105 | source: "../images/multimedia-play.png" | ||||
106 | } | ||||
107 | }, | ||||
108 | State { | ||||
109 | name: "Pause" | ||||
110 | PropertyChanges { | ||||
111 | target: item12; | ||||
91 | text: i18n("Pause") | 112 | text: i18n("Pause") | ||
92 | onActivated: sequencer.pause() | 113 | onActivated: sequencer.pause(); | ||
114 | source: "../images/multimedia-pause.png" | ||||
93 | } | 115 | } | ||
94 | MultimediaButton { | 116 | } | ||
95 | anchors { top: playbackTime.bottom; right: item12.left; rightMargin: -2 } | 117 | ] | ||
96 | source: "../images/multimedia-play.png" | | |||
97 | text: i18n("Play") | | |||
98 | onActivated: sequencer.play() | | |||
99 | } | 118 | } | ||
100 | MultimediaButton { | 119 | MultimediaButton { | ||
101 | anchors { top: playbackTime.bottom; left: item12.right; leftMargin: -2 } | 120 | anchors.horizontalCenterOffset: +30 | ||
121 | anchors { top: playbackTime.bottom; horizontalCenter: playbackTime.horizontalCenter;} | ||||
102 | source: "../images/multimedia-stop.png" | 122 | source: "../images/multimedia-stop.png" | ||
103 | text: i18n("Stop") | 123 | text: i18n("Stop") | ||
104 | onActivated: sequencer.stop() | 124 | onActivated: sequencer.stop() | ||
105 | } | 125 | } | ||
106 | } | 126 | } | ||
107 | Item { | 127 | Item { | ||
108 | id: item2 | 128 | id: item2 | ||
109 | 129 | | |||
Show All 25 Lines |