tweaks to making songs work
This commit is contained in:
parent
8af7c9bb6d
commit
eb899a9965
3 changed files with 27 additions and 5 deletions
8
TODO.org
8
TODO.org
|
@ -3,7 +3,7 @@
|
||||||
:CATEGORY: dev
|
:CATEGORY: dev
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
* Tasks [66%] [34/51]
|
* Tasks [67%] [35/52]
|
||||||
|
|
||||||
** TODO Start planning out what a 1.0 release would look like and decide how to get there :roadmap:
|
** TODO Start planning out what a 1.0 release would look like and decide how to get there :roadmap:
|
||||||
A 1.0 release may be achievable soon as long as I can figure out what is good to have in and what isn't. Then figure out what outstanding bugs and odd workflows exist and fix them. Then figure out deploying the package to various distros, windows, and mac.
|
A 1.0 release may be achievable soon as long as I can figure out what is good to have in and what isn't. Then figure out what outstanding bugs and odd workflows exist and fix them. Then figure out deploying the package to various distros, windows, and mac.
|
||||||
|
@ -79,10 +79,14 @@ This still needs ported to Rust. It'll be the hardest of the library models sinc
|
||||||
Both PDFs and reveal.js presentations think every slide is the first one. I need a way of finding the individual components and then properly switching to the next one.
|
Both PDFs and reveal.js presentations think every slide is the first one. I need a way of finding the individual components and then properly switching to the next one.
|
||||||
|
|
||||||
Switching to the next slide in reveal.js may be tricky since I'll need to push into the WebEngineView the next reveal function and then get back how many more slides and fragments there are.
|
Switching to the next slide in reveal.js may be tricky since I'll need to push into the WebEngineView the next reveal function and then get back how many more slides and fragments there are.
|
||||||
** TODO get_lyric_list method
|
** DONE get_lyric_list method
|
||||||
[[file:~/dev/church-presenter/src/rust/song_model.rs::todo!();]]
|
[[file:~/dev/church-presenter/src/rust/song_model.rs::todo!();]]
|
||||||
This is the big one. Previous implementation in cpp is here:
|
This is the big one. Previous implementation in cpp is here:
|
||||||
[[file:src/cpp/songsqlmodel.cpp::QStringList SongSqlModel::getLyricList(const int &row)]]
|
[[file:src/cpp/songsqlmodel.cpp::QStringList SongSqlModel::getLyricList(const int &row)]]
|
||||||
|
** TODO find song on SongSelect
|
||||||
|
This function will need to include parsing through the HTML of the results page. Finding the first "song-result", then "song-result-title", and inside that tag is the name. In the URL is the CCLI number.
|
||||||
|
|
||||||
|
Lyrics will probably be better to grab from genius lyrics.
|
||||||
** TODO new_song method
|
** TODO new_song method
|
||||||
[[file:~/dev/church-presenter/src/rust/song_model.rs::todo!();]]
|
[[file:~/dev/church-presenter/src/rust/song_model.rs::todo!();]]
|
||||||
** TODO Create a setting for holding static slides and audios
|
** TODO Create a setting for holding static slides and audios
|
||||||
|
|
|
@ -411,7 +411,7 @@ Item {
|
||||||
|
|
||||||
function newSong(index) {
|
function newSong(index) {
|
||||||
clearSlides();
|
clearSlides();
|
||||||
song = songProxyModel.songModel.getSong(index);
|
song = songProxyModel.getSong(index);
|
||||||
console.log(song.lyrics);
|
console.log(song.lyrics);
|
||||||
songIndex = song.id;
|
songIndex = song.id;
|
||||||
|
|
||||||
|
@ -438,6 +438,7 @@ Item {
|
||||||
song = songProxyModel.getSong(index);
|
song = songProxyModel.getSong(index);
|
||||||
console.log(song.lyrics);
|
console.log(song.lyrics);
|
||||||
songIndex = song.id;
|
songIndex = song.id;
|
||||||
|
console.log(song.id);
|
||||||
|
|
||||||
if (song.backgroundType == "image") {
|
if (song.backgroundType == "image") {
|
||||||
slideEditor.videoBackground = "";
|
slideEditor.videoBackground = "";
|
||||||
|
|
|
@ -111,7 +111,7 @@ mod song_model {
|
||||||
self.as_mut().set_highest_id(song.id);
|
self.as_mut().set_highest_id(song.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
let img = Song {
|
let song = Song {
|
||||||
id: song.id,
|
id: song.id,
|
||||||
title: song.title,
|
title: song.title,
|
||||||
lyrics: song.lyrics.unwrap_or_default(),
|
lyrics: song.lyrics.unwrap_or_default(),
|
||||||
|
@ -127,7 +127,7 @@ mod song_model {
|
||||||
font_size: song.font_size.unwrap_or_default(),
|
font_size: song.font_size.unwrap_or_default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
self.as_mut().add_song(img);
|
self.as_mut().add_song(song);
|
||||||
}
|
}
|
||||||
println!("--------------------------------------");
|
println!("--------------------------------------");
|
||||||
println!("{:?}", self.as_mut().songs());
|
println!("{:?}", self.as_mut().songs());
|
||||||
|
@ -189,6 +189,20 @@ mod song_model {
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[qinvokable]
|
||||||
|
pub fn new_song(self: Pin<&mut Self>) {
|
||||||
|
let song_id = self.rust().highest_id + 1;
|
||||||
|
let song_title = String::from("title");
|
||||||
|
|
||||||
|
let song = Song {
|
||||||
|
id: song_id,
|
||||||
|
title: song_title,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
self.add_song(song);
|
||||||
|
}
|
||||||
|
|
||||||
// fn add_item(
|
// fn add_item(
|
||||||
// mut self: Pin<&mut Self>,
|
// mut self: Pin<&mut Self>,
|
||||||
// song_id: i32,
|
// song_id: i32,
|
||||||
|
@ -315,6 +329,9 @@ mod song_model {
|
||||||
return QStringList::default();
|
return QStringList::default();
|
||||||
}
|
}
|
||||||
if let Some(song) = self.rust().songs.get(index as usize) {
|
if let Some(song) = self.rust().songs.get(index as usize) {
|
||||||
|
if song.lyrics.is_empty() {
|
||||||
|
return QStringList::default();
|
||||||
|
}
|
||||||
let raw_lyrics = song.lyrics.clone();
|
let raw_lyrics = song.lyrics.clone();
|
||||||
println!("raw-lyrics: {:?}", raw_lyrics);
|
println!("raw-lyrics: {:?}", raw_lyrics);
|
||||||
let vorder: Vec<&str> = song.verse_order.split(' ').collect();
|
let vorder: Vec<&str> = song.verse_order.split(' ').collect();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue