adding an audio picker for songs
This commit is contained in:
parent
7916427442
commit
a8943b86cf
1 changed files with 47 additions and 2 deletions
|
@ -163,7 +163,7 @@ Item {
|
|||
Controls.TextField {
|
||||
id: songVorderField
|
||||
|
||||
Layout.preferredWidth: 300
|
||||
/* Layout.preferredWidth: 300 */
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 20
|
||||
Layout.rightMargin: 20
|
||||
|
@ -177,7 +177,7 @@ Item {
|
|||
Controls.ScrollView {
|
||||
id: songLyricsField
|
||||
|
||||
Layout.preferredHeight: 3000
|
||||
Layout.preferredHeight: 2000
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.leftMargin: 20
|
||||
|
@ -213,7 +213,32 @@ Item {
|
|||
onEditingFinished: updateAuthor(text)
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 300
|
||||
Layout.leftMargin: 20
|
||||
Layout.rightMargin: 20
|
||||
|
||||
Controls.TextField {
|
||||
id: songAudioField
|
||||
Layout.fillWidth: true
|
||||
placeholderText: "Audio File..."
|
||||
text: song.audio
|
||||
padding: 10
|
||||
onEditingFinished: showPassiveNotification(text)
|
||||
|
||||
}
|
||||
|
||||
Controls.ToolButton {
|
||||
id: audioPickerButton
|
||||
Layout.fillHeight: true
|
||||
text: "Audio"
|
||||
icon.name: "folder-music-symbolic"
|
||||
onClicked: audioFileDialog.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Controls.SplitView.fillHeight: true
|
||||
Controls.SplitView.preferredWidth: 700
|
||||
|
@ -245,6 +270,22 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: audioFileDialog
|
||||
title: "Please choose an audio file"
|
||||
folder: shortcuts.home
|
||||
selectMultiple: false
|
||||
nameFilters: ["Audio files (*.mp3 *.flac *.wav *.opus *.MP3 *.FLAC *.WAV *.OPUS)"]
|
||||
onAccepted: {
|
||||
updateAudioFile(audioFileDialog.fileUrls[0]);
|
||||
print("audio = " + audioFileDialog.fileUrls[0]);
|
||||
}
|
||||
onRejected: {
|
||||
print("Canceled")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: videoFileDialog
|
||||
title: "Please choose a background"
|
||||
|
@ -328,6 +369,10 @@ Item {
|
|||
songsqlmodel.updateVerseOrder(songIndex, vorder)
|
||||
}
|
||||
|
||||
function updateAudioFile(file) {
|
||||
songsqlmodel.updateAudio(songIndex, file);
|
||||
}
|
||||
|
||||
function updateBackground(background, backgroundType) {
|
||||
song.backgroundType = backgroundType;
|
||||
song.background = background;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue