X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=videoplayer%2Fsrc%2Fmain.rs;h=2389e1f7f4d783ecd0cdcab0c655517b5294fa8b;hb=b452b665dbed05eff9b1560b220fadf1138d9f1d;hp=e3d2d002a1ddba0514859aada31504f043760825;hpb=e2ca0dbe4e8c92c3c95cda0cf1dc57da164b1c8a;p=nihav-player.git diff --git a/videoplayer/src/main.rs b/videoplayer/src/main.rs index e3d2d00..2389e1f 100644 --- a/videoplayer/src/main.rs +++ b/videoplayer/src/main.rs @@ -13,7 +13,7 @@ use std::sync::atomic::{AtomicU8, Ordering}; use sdl2::event::{Event, WindowEvent}; use sdl2::keyboard::{Keycode, Mod}; -use sdl2::mouse::MouseButton; +use sdl2::mouse::{MouseButton, MouseWheelDirection}; use sdl2::render::{Canvas, Texture, TextureCreator}; use sdl2::pixels::PixelFormatEnum; use sdl2::video::{Window, WindowContext}; @@ -480,6 +480,9 @@ impl Player { _ => {}, }; } + if let Event::MouseWheel {direction: MouseWheelDirection::Normal, x: 0, y, ..} = event { + self.seek(10, y > 0, dmx, disp_queue)?; + } if let Event::KeyDown {keycode: Some(keycode), keymod, ..} = event { match keycode { Keycode::Escape => { @@ -487,7 +490,7 @@ impl Player { println!(); return Ok(true); }, - Keycode::Q if matches!(keymod, Mod::RSHIFTMOD | Mod::LSHIFTMOD) => { + Keycode::Q if keymod.contains(Mod::RSHIFTMOD) || keymod.contains(Mod::LSHIFTMOD) => { self.end = true; println!(); return Ok(true); @@ -881,7 +884,7 @@ fn main() { "-ae" => { player.play_audio = true; }, "-vn" => { player.play_video = false; }, "-ve" => { player.play_video = true; }, - "-seek" => { + "-seek" | "-start" => { if let Some(arg) = aiter.next() { if let Ok(time) = arg.parse::() { seek_time = time;