From 93e814553c2c2471afd78fd65490a883765f4ffd Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Wed, 22 Jun 2022 17:20:29 -0300 Subject: Add 'add segment' functionality --- main.qml | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) (limited to 'main.qml') diff --git a/main.qml b/main.qml index 693938e..d0dda5b 100644 --- a/main.qml +++ b/main.qml @@ -9,8 +9,6 @@ import BassPlayer 0.1 ApplicationWindow { visible: true - width: layout.implicitWidth - height: layout.implicitHeight title: "Bass Player!" @@ -37,7 +35,9 @@ ApplicationWindow { title: "Duration" } onClicked: { - song.song_selected('song') + console.log(song.current_song) + song.song_selected(row) + console.log(song.current_song) } } @@ -118,19 +118,23 @@ ApplicationWindow { timer.stop() } } + Button { + text: "Add segment" + onClicked: { + addSegmentDialog.open() + } + } } } SongController { id: song - title: titleField.text - duration: durationField.text } Audio { id: audioInterface - audioRole: MusicRole + //audioRole: MusicRole } Timer { @@ -141,4 +145,33 @@ ApplicationWindow { slider.value = audioInterface.position / audioInterface.duration } } + + Dialog { + id: addSegmentDialog + title: "Add a segment" + standardButtons: StandardButton.Save | StandardButton.Cancel + + onAccepted: { + song.add_segment( + textviewName.text, + textviewFrom.text, + textviewTo.text + ) + } + + ColumnLayout { + TextField { + id: textviewName + placeholderText: "Name" + } + TextField { + id: textviewFrom + placeholderText: "From" + } + TextField { + id: textviewTo + placeholderText: "To" + } + } + } } -- cgit v1.2.3-70-g09d2