Compare commits

..

No commits in common. "devel" and "master" have entirely different histories.

3 changed files with 2 additions and 61 deletions

View File

@ -6,6 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
anyhow = "1.0.75"
gstreamer = "0.21.2"
gtk = { version = "0.7.3", package = "gtk4", features = ["v4_8"] } gtk = { version = "0.7.3", package = "gtk4", features = ["v4_8"] }

View File

@ -1,6 +1,5 @@
use gtk::{prelude::*,ListBox, glib, Application, ApplicationWindow, Button, Video, Box, LayoutManager, ffi::gtk_layout_manager_allocate}; use gtk::prelude::*;
use gtk::{glib, Application, ApplicationWindow};
mod video;
const APP_ID: &str = "de.cscherr.vshot"; const APP_ID: &str = "de.cscherr.vshot";
@ -16,53 +15,10 @@ fn main() -> glib::ExitCode {
} }
fn build_ui(app: &Application) { fn build_ui(app: &Application) {
let select_button = Button::builder()
.label("select video")
.margin_top(12)
.margin_bottom(12)
.margin_start(12)
.margin_end(12)
.build();
select_button.connect_clicked(|button| {
println!("TODO");
});
let save_image_button = Button::builder()
.label("save")
.margin_top(12)
.margin_bottom(12)
.margin_start(12)
.margin_end(12)
.build();
save_image_button.connect_clicked(|button| {
println!("TODO");
});
let video_play = Video::builder()
.build();
// Create a `ListBox` and add labels with integers from 0 to 100
let meta_box = Box::builder()
.build();
meta_box.append(&save_image_button);
meta_box.append(&select_button);
let video_box = Box::builder()
.height_request(550)
.width_request(750)
.orientation(gtk::Orientation::Vertical)
.build();
video_box.append(&video_play);
let list = ListBox::builder()
.build();
list.append(&video_box);
list.append(&meta_box);
// Create a window and set the title // Create a window and set the title
let window = ApplicationWindow::builder() let window = ApplicationWindow::builder()
.application(app) .application(app)
.title("vshot") .title("vshot")
.child(&list)
.default_height(600)
.default_width(800)
.build(); .build();
// Present window // Present window

View File

@ -1,13 +0,0 @@
use std::{
env,
sync::{Arc, Mutex},
};
use anyhow::Error;
use gstreamer::prelude::*;
fn try_play_video(uri: &str) -> Result<(), Error> {
print!("hello world!");
return Ok(())
}