mirror of
				https://github.com/johrpan/musicus.git
				synced 2025-10-26 11:47:25 +01:00 
			
		
		
		
	Update most dependencies
This commit is contained in:
		
							parent
							
								
									51030545db
								
							
						
					
					
						commit
						d6b79fae59
					
				
					 15 changed files with 687 additions and 532 deletions
				
			
		
							
								
								
									
										1051
									
								
								Cargo.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										1051
									
								
								Cargo.lock
									
										
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							|  | @ -4,16 +4,16 @@ version = "0.1.0" | ||||||
| edition = "2021" | edition = "2021" | ||||||
| 
 | 
 | ||||||
| [dependencies] | [dependencies] | ||||||
| fragile = "1.2.0" | fragile = "2" | ||||||
| gio = "0.15.11" | gio = "0.16" | ||||||
| glib = "0.15.11" | glib = "0.16" | ||||||
| gstreamer = "0.18.8" | gstreamer = "0.19" | ||||||
| gstreamer-player = "0.18.0" | gstreamer-player = "0.19" | ||||||
| log = { version = "0.4.16", features = ["std"] } | log = { version = "0.4", features = ["std"] } | ||||||
| musicus_database = { version = "0.1.0", path = "../database" } | musicus_database = { version = "0.1.0", path = "../database" } | ||||||
| musicus_import = { version = "0.1.0", path = "../import" } | musicus_import = { version = "0.1.0", path = "../import" } | ||||||
| thiserror = "1.0.31" | thiserror = "1" | ||||||
| tokio = { version = "1.18.0", features = ["sync"] } | tokio = { version = "1", features = ["sync"] } | ||||||
| 
 | 
 | ||||||
| [target.'cfg(target_os = "linux")'.dependencies] | [target.'cfg(target_os = "linux")'.dependencies] | ||||||
| mpris-player = "0.6.1" | mpris-player = "0.6" | ||||||
|  |  | ||||||
|  | @ -1,6 +1,5 @@ | ||||||
| use crate::{Backend, Error, Result}; | use crate::{Backend, Error, Result}; | ||||||
| use glib::clone; | use glib::clone; | ||||||
| use gstreamer_player::prelude::*; |  | ||||||
| use musicus_database::Track; | use musicus_database::Track; | ||||||
| use std::cell::{Cell, RefCell}; | use std::cell::{Cell, RefCell}; | ||||||
| use std::path::PathBuf; | use std::path::PathBuf; | ||||||
|  | @ -32,7 +31,10 @@ pub struct Player { | ||||||
| impl Player { | impl Player { | ||||||
|     pub fn new(music_library_path: PathBuf) -> Rc<Self> { |     pub fn new(music_library_path: PathBuf) -> Rc<Self> { | ||||||
|         let dispatcher = gstreamer_player::PlayerGMainContextSignalDispatcher::new(None); |         let dispatcher = gstreamer_player::PlayerGMainContextSignalDispatcher::new(None); | ||||||
|         let player = gstreamer_player::Player::new(None, Some(&dispatcher.upcast())); |         let player = gstreamer_player::Player::new( | ||||||
|  |             gstreamer_player::PlayerVideoRenderer::NONE, | ||||||
|  |             Some(&dispatcher), | ||||||
|  |         ); | ||||||
|         let mut config = player.config(); |         let mut config = player.config(); | ||||||
|         config.set_position_update_interval(250); |         config.set_position_update_interval(250); | ||||||
|         player.set_config(config).unwrap(); |         player.set_config(config).unwrap(); | ||||||
|  | @ -196,7 +198,7 @@ impl Player { | ||||||
|     /// Add some items to the playlist.
 |     /// Add some items to the playlist.
 | ||||||
|     pub fn add_items(&self, mut items: Vec<Track>) -> Result<()> { |     pub fn add_items(&self, mut items: Vec<Track>) -> Result<()> { | ||||||
|         if items.is_empty() { |         if items.is_empty() { | ||||||
|             return Ok(()) |             return Ok(()); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         let was_empty = { |         let was_empty = { | ||||||
|  |  | ||||||
|  | @ -4,10 +4,10 @@ version = "0.1.0" | ||||||
| edition = "2021" | edition = "2021" | ||||||
| 
 | 
 | ||||||
| [dependencies] | [dependencies] | ||||||
| diesel = { version = "1.4.8", features = ["sqlite"] } | diesel = { version = "1", features = ["sqlite"] } | ||||||
| diesel_migrations = "1.4.0" | diesel_migrations = "1" | ||||||
| chrono = "0.4.19" | chrono = "0.4" | ||||||
| log = "0.4.16" | log = "0.4" | ||||||
| rand = "0.8.5" | rand = "0.8" | ||||||
| thiserror = "1.0.31" | thiserror = "1" | ||||||
| uuid = { version = "1.0.0", features = ["v4"] } | uuid = { version = "1", features = ["v4"] } | ||||||
|  |  | ||||||
|  | @ -60,7 +60,12 @@ pub struct Track { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl Track { | impl Track { | ||||||
|     pub fn new(recording: Recording, work_parts: Vec<usize>, source_index: usize, path: String) -> Self { |     pub fn new( | ||||||
|  |         recording: Recording, | ||||||
|  |         work_parts: Vec<usize>, | ||||||
|  |         source_index: usize, | ||||||
|  |         path: String, | ||||||
|  |     ) -> Self { | ||||||
|         Self { |         Self { | ||||||
|             recording, |             recording, | ||||||
|             work_parts, |             work_parts, | ||||||
|  | @ -295,8 +300,8 @@ impl Database { | ||||||
|             name: row.name, |             name: row.name, | ||||||
|             discid: row.discid, |             discid: row.discid, | ||||||
|             tracks, |             tracks, | ||||||
|             last_used: row.last_used.map(|t| Utc.timestamp(t, 0)), |             last_used: row.last_used.map(|t| Utc.timestamp_opt(t, 0).unwrap()), | ||||||
|             last_played: row.last_played.map(|t| Utc.timestamp(t, 0)), |             last_played: row.last_played.map(|t| Utc.timestamp_opt(t, 0).unwrap()), | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         Ok(medium) |         Ok(medium) | ||||||
|  | @ -328,8 +333,8 @@ impl Database { | ||||||
|             work_parts: part_indices, |             work_parts: part_indices, | ||||||
|             source_index: row.source_index as usize, |             source_index: row.source_index as usize, | ||||||
|             path: row.path, |             path: row.path, | ||||||
|             last_used: row.last_used.map(|t| Utc.timestamp(t, 0)), |             last_used: row.last_used.map(|t| Utc.timestamp_opt(t, 0).unwrap()), | ||||||
|             last_played: row.last_played.map(|t| Utc.timestamp(t, 0)), |             last_played: row.last_played.map(|t| Utc.timestamp_opt(t, 0).unwrap()), | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         Ok(track) |         Ok(track) | ||||||
|  |  | ||||||
|  | @ -275,8 +275,8 @@ impl Database { | ||||||
|             work, |             work, | ||||||
|             comment: row.comment, |             comment: row.comment, | ||||||
|             performances: performance_descriptions, |             performances: performance_descriptions, | ||||||
|             last_used: row.last_used.map(|t| Utc.timestamp(t, 0)), |             last_used: row.last_used.map(|t| Utc.timestamp_opt(t, 0).unwrap()), | ||||||
|             last_played: row.last_played.map(|t| Utc.timestamp(t, 0)), |             last_played: row.last_played.map(|t| Utc.timestamp_opt(t, 0).unwrap()), | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         Ok(recording_description) |         Ok(recording_description) | ||||||
|  |  | ||||||
|  | @ -67,7 +67,13 @@ pub struct Work { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl Work { | impl Work { | ||||||
|     pub fn new(id: String, title: String, composer: Person, instruments: Vec<Instrument>, parts: Vec<WorkPart>) -> Self { |     pub fn new( | ||||||
|  |         id: String, | ||||||
|  |         title: String, | ||||||
|  |         composer: Person, | ||||||
|  |         instruments: Vec<Instrument>, | ||||||
|  |         parts: Vec<WorkPart>, | ||||||
|  |     ) -> Self { | ||||||
|         Self { |         Self { | ||||||
|             id, |             id, | ||||||
|             title, |             title, | ||||||
|  | @ -219,8 +225,8 @@ impl Database { | ||||||
|             title: row.title, |             title: row.title, | ||||||
|             instruments, |             instruments, | ||||||
|             parts, |             parts, | ||||||
|             last_used: row.last_used.map(|t| Utc.timestamp(t, 0)), |             last_used: row.last_used.map(|t| Utc.timestamp_opt(t, 0).unwrap()), | ||||||
|             last_played: row.last_played.map(|t| Utc.timestamp(t, 0)), |             last_played: row.last_played.map(|t| Utc.timestamp_opt(t, 0).unwrap()), | ||||||
|         }) |         }) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,13 +4,13 @@ version = "0.1.0" | ||||||
| edition = "2021" | edition = "2021" | ||||||
| 
 | 
 | ||||||
| [dependencies] | [dependencies] | ||||||
| base64 = "0.13.0" | base64 = "0.13" | ||||||
| glib = "0.15.11" | glib = "0.16" | ||||||
| gstreamer = "0.18.8" | gstreamer = "0.19" | ||||||
| gstreamer-pbutils = "0.18.7" | gstreamer-pbutils = "0.19" | ||||||
| log = "0.4.16" | log = "0.4" | ||||||
| once_cell = "1.10.0" | once_cell = "1" | ||||||
| rand = "0.8.5" | rand = "0.8" | ||||||
| thiserror = "1.0.31" | thiserror = "1" | ||||||
| sha2 = "0.10.2" | sha2 = "0.10" | ||||||
| tokio = { version = "1.18.0", features = ["sync"] } | tokio = { version = "1", features = ["sync"] } | ||||||
|  |  | ||||||
|  | @ -18,11 +18,11 @@ pub(super) fn new() -> Result<ImportSession> { | ||||||
|     // Build the GStreamer pipeline. It will contain a fakesink initially to be able to run it
 |     // Build the GStreamer pipeline. It will contain a fakesink initially to be able to run it
 | ||||||
|     // forward to the paused state without specifying a file name before knowing the tracks.
 |     // forward to the paused state without specifying a file name before knowing the tracks.
 | ||||||
| 
 | 
 | ||||||
|     let cdparanoiasrc = ElementFactory::make("cdparanoiasrc", None)?; |     let cdparanoiasrc = ElementFactory::make("cdparanoiasrc").build()?; | ||||||
|     let queue = ElementFactory::make("queue", None)?; |     let queue = ElementFactory::make("queue").build()?; | ||||||
|     let audioconvert = ElementFactory::make("audioconvert", None)?; |     let audioconvert = ElementFactory::make("audioconvert").build()?; | ||||||
|     let flacenc = ElementFactory::make("flacenc", None)?; |     let flacenc = ElementFactory::make("flacenc").build()?; | ||||||
|     let fakesink = gstreamer::ElementFactory::make("fakesink", None)?; |     let fakesink = gstreamer::ElementFactory::make("fakesink").build()?; | ||||||
| 
 | 
 | ||||||
|     let pipeline = gstreamer::Pipeline::new(None); |     let pipeline = gstreamer::Pipeline::new(None); | ||||||
|     pipeline.add_many(&[&cdparanoiasrc, &queue, &audioconvert, &flacenc, &fakesink])?; |     pipeline.add_many(&[&cdparanoiasrc, &queue, &audioconvert, &flacenc, &fakesink])?; | ||||||
|  | @ -64,7 +64,7 @@ pub(super) fn new() -> Result<ImportSession> { | ||||||
|     fakesink.set_state(gstreamer::State::Null)?; |     fakesink.set_state(gstreamer::State::Null)?; | ||||||
|     pipeline.remove(&fakesink)?; |     pipeline.remove(&fakesink)?; | ||||||
| 
 | 
 | ||||||
|     let filesink = gstreamer::ElementFactory::make("filesink", None)?; |     let filesink = gstreamer::ElementFactory::make("filesink").build()?; | ||||||
|     pipeline.add(&filesink)?; |     pipeline.add(&filesink)?; | ||||||
|     gstreamer::Element::link(&flacenc, &filesink)?; |     gstreamer::Element::link(&flacenc, &filesink)?; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,17 +4,17 @@ version = "0.1.0" | ||||||
| edition = "2021" | edition = "2021" | ||||||
| 
 | 
 | ||||||
| [dependencies] | [dependencies] | ||||||
| anyhow = "1.0.57" | anyhow = "1" | ||||||
| adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs.git", package = "libadwaita", features = ["v1_2"] } | adw = { package = "libadwaita", version = "0.2", features = ["v1_2"] } | ||||||
| futures-channel = "0.3.21" | futures-channel = "0.3" | ||||||
| gettext-rs = { version = "0.7.0", features = ["gettext-system"] } | gettext-rs = { version = "0.7", features = ["gettext-system"] } | ||||||
| gio = {git = "https://github.com/gtk-rs/gtk-rs-core"} | gio = "0.16" | ||||||
| glib = {git = "https://github.com/gtk-rs/gtk-rs-core"} | glib = "0.16" | ||||||
| gstreamer = "0.18.8" | gstreamer = "0.19" | ||||||
| gtk = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gtk4" } | gtk = { package = "gtk4", version = "0.5" } | ||||||
| gtk-macros = "0.3.0" | gtk-macros = "0.3" | ||||||
| log = "0.4.16" | log = "0.4" | ||||||
| musicus_backend = { version = "0.1.0", path = "../backend" } | musicus_backend = { version = "0.1.0", path = "../backend" } | ||||||
| once_cell = "1.10.0" | once_cell = "1" | ||||||
| rand = "0.8.5" | rand = "0.8" | ||||||
| sanitize-filename = "0.3.0" | sanitize-filename = "0.4" | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ use adw::builders::ActionRowBuilder; | ||||||
| use anyhow::{anyhow, Result}; | use anyhow::{anyhow, Result}; | ||||||
| use gettextrs::gettext; | use gettextrs::gettext; | ||||||
| use glib::clone; | use glib::clone; | ||||||
| use gtk::builders::{ListBoxBuilder, FrameBuilder}; | use gtk::builders::{FrameBuilder, ListBoxBuilder}; | ||||||
| use gtk::prelude::*; | use gtk::prelude::*; | ||||||
| use gtk_macros::get_widget; | use gtk_macros::get_widget; | ||||||
| use musicus_backend::db::Medium; | use musicus_backend::db::Medium; | ||||||
|  |  | ||||||
|  | @ -26,8 +26,7 @@ fn main() { | ||||||
|     gettextrs::textdomain("musicus").unwrap(); |     gettextrs::textdomain("musicus").unwrap(); | ||||||
| 
 | 
 | ||||||
|     gstreamer::init().expect("Failed to initialize GStreamer!"); |     gstreamer::init().expect("Failed to initialize GStreamer!"); | ||||||
|     gtk::init().expect("Failed to initialize GTK!"); |     adw::init().expect("Failed to initialize libadwaita!"); | ||||||
|     adw::init(); |  | ||||||
|     resources::init().expect("Failed to initialize resources!"); |     resources::init().expect("Failed to initialize resources!"); | ||||||
| 
 | 
 | ||||||
|     let app = gtk::Application::new(Some("de.johrpan.musicus"), gio::ApplicationFlags::empty()); |     let app = gtk::Application::new(Some("de.johrpan.musicus"), gio::ApplicationFlags::empty()); | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| use super::Widget; | use super::Widget; | ||||||
| use adw::{prelude::*, builders::ActionRowBuilder}; | use adw::{builders::ActionRowBuilder, prelude::*}; | ||||||
| use gtk::builders::ButtonBuilder; | use gtk::builders::ButtonBuilder; | ||||||
| 
 | 
 | ||||||
| /// A list box row with a single button.
 | /// A list box row with a single button.
 | ||||||
|  |  | ||||||
|  | @ -20,7 +20,7 @@ impl IndexedListModel { | ||||||
| 
 | 
 | ||||||
| impl Default for IndexedListModel { | impl Default for IndexedListModel { | ||||||
|     fn default() -> Self { |     fn default() -> Self { | ||||||
|         glib::Object::new(&[]).unwrap() |         glib::Object::new(&[]) | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -57,13 +57,7 @@ mod indexed_list_model_imp { | ||||||
|             PROPERTIES.as_ref() |             PROPERTIES.as_ref() | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         fn set_property( |         fn set_property(&self, _: usize, value: &glib::Value, pspec: &glib::ParamSpec) { | ||||||
|             &self, |  | ||||||
|             _: &Self::Type, |  | ||||||
|             _: usize, |  | ||||||
|             value: &glib::Value, |  | ||||||
|             pspec: &glib::ParamSpec, |  | ||||||
|         ) { |  | ||||||
|             match pspec.name() { |             match pspec.name() { | ||||||
|                 "length" => { |                 "length" => { | ||||||
|                     let length = value.get::<u32>().unwrap(); |                     let length = value.get::<u32>().unwrap(); | ||||||
|  | @ -73,7 +67,7 @@ mod indexed_list_model_imp { | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { |         fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { | ||||||
|             match pspec.name() { |             match pspec.name() { | ||||||
|                 "length" => self.length.get().to_value(), |                 "length" => self.length.get().to_value(), | ||||||
|                 _ => unimplemented!(), |                 _ => unimplemented!(), | ||||||
|  | @ -82,15 +76,15 @@ mod indexed_list_model_imp { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     impl ListModelImpl for IndexedListModel { |     impl ListModelImpl for IndexedListModel { | ||||||
|         fn item_type(&self, _: &Self::Type) -> glib::Type { |         fn item_type(&self) -> glib::Type { | ||||||
|             ItemIndex::static_type() |             ItemIndex::static_type() | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         fn n_items(&self, _: &Self::Type) -> u32 { |         fn n_items(&self) -> u32 { | ||||||
|             self.length.get() |             self.length.get() | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         fn item(&self, _: &Self::Type, position: u32) -> Option<glib::Object> { |         fn item(&self, position: u32) -> Option<glib::Object> { | ||||||
|             Some(ItemIndex::new(position).upcast()) |             Some(ItemIndex::new(position).upcast()) | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | @ -104,7 +98,7 @@ glib::wrapper! { | ||||||
| impl ItemIndex { | impl ItemIndex { | ||||||
|     /// Create a new item index.
 |     /// Create a new item index.
 | ||||||
|     pub fn new(value: u32) -> Self { |     pub fn new(value: u32) -> Self { | ||||||
|         glib::Object::new(&[("value", &value)]).unwrap() |         glib::Object::new(&[("value", &value)]) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /// Get the value of the item index..
 |     /// Get the value of the item index..
 | ||||||
|  | @ -146,13 +140,7 @@ mod item_index_imp { | ||||||
|             PROPERTIES.as_ref() |             PROPERTIES.as_ref() | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         fn set_property( |         fn set_property(&self, _: usize, value: &glib::Value, pspec: &glib::ParamSpec) { | ||||||
|             &self, |  | ||||||
|             _: &Self::Type, |  | ||||||
|             _: usize, |  | ||||||
|             value: &glib::Value, |  | ||||||
|             pspec: &glib::ParamSpec, |  | ||||||
|         ) { |  | ||||||
|             match pspec.name() { |             match pspec.name() { | ||||||
|                 "value" => { |                 "value" => { | ||||||
|                     let value = value.get::<u32>().unwrap(); |                     let value = value.get::<u32>().unwrap(); | ||||||
|  | @ -162,7 +150,7 @@ mod item_index_imp { | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         fn property(&self, _obj: &Self::Type, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { |         fn property(&self, _id: usize, pspec: &glib::ParamSpec) -> glib::Value { | ||||||
|             match pspec.name() { |             match pspec.name() { | ||||||
|                 "value" => self.value.get().to_value(), |                 "value" => self.value.get().to_value(), | ||||||
|                 _ => unimplemented!(), |                 _ => unimplemented!(), | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| use super::Widget; | use super::Widget; | ||||||
| use gtk::{prelude::*, builders::ButtonBuilder}; | use gtk::{builders::ButtonBuilder, prelude::*}; | ||||||
| use gtk_macros::get_widget; | use gtk_macros::get_widget; | ||||||
| 
 | 
 | ||||||
| /// A widget displaying a title, a framed child widget and, if needed, some
 | /// A widget displaying a title, a framed child widget and, if needed, some
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue