builds correctly now
This commit is contained in:
parent
bf9f65fade
commit
0ebdaf2921
2 changed files with 48 additions and 48 deletions
|
@ -332,7 +332,7 @@ impl slide_model::SlideModel {
|
||||||
let path =
|
let path =
|
||||||
PathBuf::from(slide.video_background.to_string());
|
PathBuf::from(slide.video_background.to_string());
|
||||||
let screenshot = ffmpeg::bg_path_from_video(&path);
|
let screenshot = ffmpeg::bg_path_from_video(&path);
|
||||||
let mut screenshot_string = screenshot.into_os_string().into_string().unwrap_or_default();
|
let mut screenshot_string = screenshot.clone().into_os_string().into_string().unwrap_or_default();
|
||||||
screenshot_string.insert_str(0, "file://");
|
screenshot_string.insert_str(0, "file://");
|
||||||
slide.video_thumbnail = screenshot_string;
|
slide.video_thumbnail = screenshot_string;
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
|
@ -575,9 +575,9 @@ impl slide_model::SlideModel {
|
||||||
|
|
||||||
match ty {
|
match ty {
|
||||||
Some(ty) if ty == QString::from("image") => {
|
Some(ty) if ty == QString::from("image") => {
|
||||||
slide.ty = ty;
|
slide.ty = ty.to_string();
|
||||||
slide.image_background = background;
|
slide.image_background = background.to_string();
|
||||||
slide.video_background = QString::from("");
|
slide.video_background = String::from("");
|
||||||
slide.slide_index = 0;
|
slide.slide_index = 0;
|
||||||
self.as_mut().insert_slide(&slide, slide_index);
|
self.as_mut().insert_slide(&slide, slide_index);
|
||||||
debug!("Image added to slide model!");
|
debug!("Image added to slide model!");
|
||||||
|
@ -589,26 +589,26 @@ impl slide_model::SlideModel {
|
||||||
"rust: add song of {:?} length at index {:?}",
|
"rust: add song of {:?} length at index {:?}",
|
||||||
&count, &slide_index
|
&count, &slide_index
|
||||||
);
|
);
|
||||||
slide.ty = ty.clone();
|
slide.ty = ty.clone().to_string();
|
||||||
// debug!("{:?}", text_vec[i].clone());
|
// debug!("{:?}", text_vec[i].clone());
|
||||||
slide.text = text.clone();
|
slide.text = text.clone().to_string();
|
||||||
slide.slide_count = count as i32;
|
slide.slide_count = count as i32;
|
||||||
slide.slide_index = i as i32;
|
slide.slide_index = i as i32;
|
||||||
if background_type == QString::from("image") {
|
if background_type == QString::from("image") {
|
||||||
slide.image_background = background.clone();
|
slide.image_background = background.clone().to_string();
|
||||||
slide.video_background = QString::from("");
|
slide.video_background = String::from("");
|
||||||
} else {
|
} else {
|
||||||
slide.video_background = background.clone();
|
slide.video_background = background.clone().to_string();
|
||||||
slide.image_background = QString::from("");
|
slide.image_background = String::from("");
|
||||||
}
|
}
|
||||||
self.as_mut()
|
self.as_mut()
|
||||||
.insert_slide(&slide, slide_index + i as i32);
|
.insert_slide(&slide, slide_index + i as i32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(ty) if ty == QString::from("video") => {
|
Some(ty) if ty == QString::from("video") => {
|
||||||
slide.ty = ty;
|
slide.ty = ty.to_string();
|
||||||
slide.image_background = QString::from("");
|
slide.image_background = String::from("");
|
||||||
slide.video_background = background;
|
slide.video_background = background.to_string();
|
||||||
slide.slide_index = 0;
|
slide.slide_index = 0;
|
||||||
self.as_mut().insert_slide(&slide, slide_index);
|
self.as_mut().insert_slide(&slide, slide_index);
|
||||||
}
|
}
|
||||||
|
@ -618,17 +618,17 @@ impl slide_model::SlideModel {
|
||||||
&QString::from(".html"),
|
&QString::from(".html"),
|
||||||
CaseSensitivity::CaseInsensitive,
|
CaseSensitivity::CaseInsensitive,
|
||||||
) {
|
) {
|
||||||
slide.ty = ty.clone();
|
slide.ty = ty.clone().to_string();
|
||||||
slide.html = true;
|
slide.html = true;
|
||||||
slide.image_background = background.clone();
|
slide.image_background = background.clone().to_string();
|
||||||
slide.video_background = QString::from("");
|
slide.video_background = String::from("");
|
||||||
slide.slide_index = 0;
|
slide.slide_index = 0;
|
||||||
self.as_mut().insert_slide(&slide, slide_index);
|
self.as_mut().insert_slide(&slide, slide_index);
|
||||||
} else {
|
} else {
|
||||||
for i in 0..slide.slide_count {
|
for i in 0..slide.slide_count {
|
||||||
slide.ty = ty.clone();
|
slide.ty = ty.clone().to_string();
|
||||||
slide.image_background = background.clone();
|
slide.image_background = background.clone().to_string();
|
||||||
slide.video_background = QString::from("");
|
slide.video_background = String::from("");
|
||||||
slide.slide_index = i;
|
slide.slide_index = i;
|
||||||
self.as_mut()
|
self.as_mut()
|
||||||
.insert_slide(&slide, slide_index + i);
|
.insert_slide(&slide, slide_index + i);
|
||||||
|
@ -705,32 +705,32 @@ impl slide_model::SlideModel {
|
||||||
.get(&QString::from("type"))
|
.get(&QString::from("type"))
|
||||||
.unwrap_or(QVariant::from(&QString::from("")))
|
.unwrap_or(QVariant::from(&QString::from("")))
|
||||||
.value()
|
.value()
|
||||||
.unwrap_or(QString::from(""));
|
.unwrap_or(QString::from("")).to_string();
|
||||||
slide.text = service_item
|
slide.text = service_item
|
||||||
.get(&QString::from("text"))
|
.get(&QString::from("text"))
|
||||||
.unwrap_or(QVariant::from(&QString::from("")))
|
.unwrap_or(QVariant::from(&QString::from("")))
|
||||||
.value()
|
.value()
|
||||||
.unwrap_or(QString::from(""));
|
.unwrap_or(QString::from("")).to_string();
|
||||||
slide.image_background = service_item
|
slide.image_background = service_item
|
||||||
.get(&QString::from("imageBackground"))
|
.get(&QString::from("imageBackground"))
|
||||||
.unwrap_or(QVariant::from(&QString::from("")))
|
.unwrap_or(QVariant::from(&QString::from("")))
|
||||||
.value()
|
.value()
|
||||||
.unwrap_or(QString::from(""));
|
.unwrap_or(QString::from("")).to_string();
|
||||||
slide.video_background = service_item
|
slide.video_background = service_item
|
||||||
.get(&QString::from("videoBackground"))
|
.get(&QString::from("videoBackground"))
|
||||||
.unwrap_or(QVariant::from(&QString::from("")))
|
.unwrap_or(QVariant::from(&QString::from("")))
|
||||||
.value()
|
.value()
|
||||||
.unwrap_or(QString::from(""));
|
.unwrap_or(QString::from("")).to_string();
|
||||||
slide.audio = service_item
|
slide.audio = service_item
|
||||||
.get(&QString::from("audio"))
|
.get(&QString::from("audio"))
|
||||||
.unwrap_or(QVariant::from(&QString::from("")))
|
.unwrap_or(QVariant::from(&QString::from("")))
|
||||||
.value()
|
.value()
|
||||||
.unwrap_or(QString::from(""));
|
.unwrap_or(QString::from("")).to_string();
|
||||||
slide.font = service_item
|
slide.font = service_item
|
||||||
.get(&QString::from("font"))
|
.get(&QString::from("font"))
|
||||||
.unwrap_or(QVariant::from(&QString::from("")))
|
.unwrap_or(QVariant::from(&QString::from("")))
|
||||||
.value()
|
.value()
|
||||||
.unwrap_or(QString::from(""));
|
.unwrap_or(QString::from("")).to_string();
|
||||||
slide.font_size = service_item
|
slide.font_size = service_item
|
||||||
.get(&QString::from("fontSize"))
|
.get(&QString::from("fontSize"))
|
||||||
.unwrap_or(QVariant::from(&50))
|
.unwrap_or(QVariant::from(&50))
|
||||||
|
@ -740,12 +740,12 @@ impl slide_model::SlideModel {
|
||||||
.get(&QString::from("vtextAlignment"))
|
.get(&QString::from("vtextAlignment"))
|
||||||
.unwrap_or(QVariant::from(&QString::from("center")))
|
.unwrap_or(QVariant::from(&QString::from("center")))
|
||||||
.value()
|
.value()
|
||||||
.unwrap_or(QString::from("center"));
|
.unwrap_or(QString::from("center")).to_string();
|
||||||
slide.vtext_alignment = service_item
|
slide.vtext_alignment = service_item
|
||||||
.get(&QString::from("vtextAlignment"))
|
.get(&QString::from("vtextAlignment"))
|
||||||
.unwrap_or(QVariant::from(&QString::from("center")))
|
.unwrap_or(QVariant::from(&QString::from("center")))
|
||||||
.value()
|
.value()
|
||||||
.unwrap_or(QString::from("center"));
|
.unwrap_or(QString::from("center")).to_string();
|
||||||
slide.service_item_id = index;
|
slide.service_item_id = index;
|
||||||
slide.slide_index = service_item
|
slide.slide_index = service_item
|
||||||
.get(&QString::from("slideNumber"))
|
.get(&QString::from("slideNumber"))
|
||||||
|
@ -772,37 +772,37 @@ impl slide_model::SlideModel {
|
||||||
.unwrap_or(QVariant::from(&false))
|
.unwrap_or(QVariant::from(&false))
|
||||||
.value()
|
.value()
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
slide.video_thumbnail = QString::from("");
|
slide.video_thumbnail = String::from("");
|
||||||
|
|
||||||
match ty {
|
match ty {
|
||||||
Some(ty) if ty == QString::from("image") => {
|
Some(ty) if ty == QString::from("image") => {
|
||||||
slide.ty = ty;
|
slide.ty = ty.to_string();
|
||||||
slide.image_background = background;
|
slide.image_background = background.to_string();
|
||||||
slide.video_background = QString::from("");
|
slide.video_background = String::from("");
|
||||||
slide.slide_index = 0;
|
slide.slide_index = 0;
|
||||||
self.as_mut().add_slide(&slide);
|
self.as_mut().add_slide(&slide);
|
||||||
}
|
}
|
||||||
Some(ty) if ty == QString::from("song") => {
|
Some(ty) if ty == QString::from("song") => {
|
||||||
for (i, text) in text_vec.iter().enumerate() {
|
for (i, text) in text_vec.iter().enumerate() {
|
||||||
slide.ty = ty.clone();
|
slide.ty = ty.clone().to_string();
|
||||||
// debug!("{:?}", text_vec[i].clone());
|
// debug!("{:?}", text_vec[i].clone());
|
||||||
slide.text = text.clone();
|
slide.text = text.clone().to_string();
|
||||||
slide.slide_count = text_vec.len() as i32;
|
slide.slide_count = text_vec.len() as i32;
|
||||||
slide.slide_index = i as i32;
|
slide.slide_index = i as i32;
|
||||||
if background_type == QString::from("image") {
|
if background_type == QString::from("image") {
|
||||||
slide.image_background = background.clone();
|
slide.image_background = background.clone().to_string();
|
||||||
slide.video_background = QString::from("");
|
slide.video_background = String::from("");
|
||||||
} else {
|
} else {
|
||||||
slide.video_background = background.clone();
|
slide.video_background = background.clone().to_string();
|
||||||
slide.image_background = QString::from("");
|
slide.image_background = String::from("");
|
||||||
}
|
}
|
||||||
self.as_mut().add_slide(&slide);
|
self.as_mut().add_slide(&slide);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(ty) if ty == QString::from("video") => {
|
Some(ty) if ty == QString::from("video") => {
|
||||||
slide.ty = ty;
|
slide.ty = ty.to_string();
|
||||||
slide.image_background = QString::from("");
|
slide.image_background = String::from("");
|
||||||
slide.video_background = background;
|
slide.video_background = background.to_string();
|
||||||
slide.slide_index = 0;
|
slide.slide_index = 0;
|
||||||
self.as_mut().add_slide(&slide);
|
self.as_mut().add_slide(&slide);
|
||||||
}
|
}
|
||||||
|
@ -812,17 +812,17 @@ impl slide_model::SlideModel {
|
||||||
&QString::from(".html"),
|
&QString::from(".html"),
|
||||||
CaseSensitivity::CaseInsensitive,
|
CaseSensitivity::CaseInsensitive,
|
||||||
) {
|
) {
|
||||||
slide.ty = ty.clone();
|
slide.ty = ty.clone().to_string();
|
||||||
slide.html = true;
|
slide.html = true;
|
||||||
slide.image_background = background.clone();
|
slide.image_background = background.clone().to_string();
|
||||||
slide.video_background = QString::from("");
|
slide.video_background = String::from("");
|
||||||
slide.slide_index = 0;
|
slide.slide_index = 0;
|
||||||
self.as_mut().add_slide(&slide);
|
self.as_mut().add_slide(&slide);
|
||||||
} else {
|
} else {
|
||||||
for i in 0..slide.slide_count {
|
for i in 0..slide.slide_count {
|
||||||
slide.ty = ty.clone();
|
slide.ty = ty.clone().to_string();
|
||||||
slide.image_background = background.clone();
|
slide.image_background = background.clone().to_string();
|
||||||
slide.video_background = QString::from("");
|
slide.video_background = String::from("");
|
||||||
slide.slide_index = i;
|
slide.slide_index = i;
|
||||||
self.as_mut().add_slide(&slide);
|
self.as_mut().add_slide(&slide);
|
||||||
}
|
}
|
||||||
|
@ -1213,7 +1213,7 @@ impl slide_model::SlideModel {
|
||||||
if let Some(slide) =
|
if let Some(slide) =
|
||||||
self.as_mut().rust_mut().slides.get_mut(index as usize)
|
self.as_mut().rust_mut().slides.get_mut(index as usize)
|
||||||
{
|
{
|
||||||
slide.obs_scene = obs_scene;
|
slide.obs_scene = obs_scene.to_string();
|
||||||
self.as_mut().data_changed(tl, br, &vector_roles);
|
self.as_mut().data_changed(tl, br, &vector_roles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue