@@ -20,20 +20,13 @@ use super::plot::{Plot, PlotMarkerMoved};
2020
2121pub const CANVAS_HEIGHT : f32 = 80.0 ;
2222
23- #[ derive( Clone , Debug ) ]
24- pub enum Direction {
25- Up ,
26- Down ,
27- }
28-
2923#[ derive( Clone , Debug ) ]
3024pub enum SessionMessage {
3125 SetCutPosition ( SetCutPosition ) ,
3226 CutSongs ,
3327 FinishedCutting ( CutInfo ) ,
3428 PlaybackSong ,
3529 UpdateProgress ( Progress ) ,
36- Scroll ( Direction ) ,
3730}
3831
3932#[ derive( Clone , Debug ) ]
@@ -45,14 +38,12 @@ pub struct SetCutPosition {
4538pub struct SessionGui {
4639 plots : Vec < Plot > ,
4740 reader : Mutex < WavFileReader > ,
48- session : RecordingSession ,
4941 path : SessionPath ,
5042 cuts : Manual ,
5143 cutting_state : CuttingState ,
5244 playback_state : PlaybackState ,
5345 last_touched_song : usize ,
5446 playback_index : usize ,
55- scroll_pos : i32 ,
5647}
5748
5849enum CuttingState {
@@ -106,7 +97,6 @@ impl SessionGui {
10697 let cuts = Manual :: new ( & mut reader, & session. session , DbusLengthsStrategy ) ;
10798 let playback_state = PlaybackState :: Waiting ;
10899 Ok ( Self {
109- session : session. session ,
110100 reader : Mutex :: new ( reader) ,
111101 plots,
112102 cuts,
@@ -115,7 +105,6 @@ impl SessionGui {
115105 last_touched_song : 0 ,
116106 playback_state,
117107 playback_index : 0 ,
118- scroll_pos : 0 ,
119108 } )
120109 }
121110
@@ -135,7 +124,6 @@ impl SessionGui {
135124 }
136125 SessionMessage :: PlaybackSong => self . playback_song ( ) ,
137126 SessionMessage :: UpdateProgress ( _) => todo ! ( ) ,
138- SessionMessage :: Scroll ( dir) => self . scroll ( dir) ,
139127 }
140128 }
141129
@@ -157,9 +145,11 @@ impl SessionGui {
157145 text ( song. to_string_short ( ) . to_string ( ) ) . align_x ( Horizontal :: Left )
158146 } ;
159147 let titles = Row :: new ( )
148+ . push ( horizontal_space ( ) )
160149 . push_maybe ( plot. song_before ( ) . map ( make_title) )
161150 . push ( horizontal_space ( ) )
162- . push_maybe ( plot. song_after ( ) . map ( make_title) ) ;
151+ . push_maybe ( plot. song_after ( ) . map ( make_title) )
152+ . push ( horizontal_space ( ) ) ;
163153 column ! [ titles, canvas] . into ( )
164154 } )
165155 . collect ( ) ;
@@ -193,8 +183,6 @@ impl SessionGui {
193183
194184 match key {
195185 key:: Named :: Space => Some ( SessionMessage :: PlaybackSong ) ,
196- key:: Named :: ArrowDown => Some ( SessionMessage :: Scroll ( Direction :: Down ) ) ,
197- key:: Named :: ArrowUp => Some ( SessionMessage :: Scroll ( Direction :: Up ) ) ,
198186 _ => None ,
199187 }
200188 } )
@@ -232,12 +220,4 @@ impl SessionGui {
232220 fn get_wav_source ( & self , info : & PlaybackInfo ) -> WavSource {
233221 WavSource :: new ( & mut self . reader . lock ( ) . unwrap ( ) , info. start , info. end )
234222 }
235-
236- fn scroll ( & mut self , dir : Direction ) {
237- self . scroll_pos += match dir {
238- Direction :: Up => 1 ,
239- Direction :: Down => -1 ,
240- } ;
241- self . scroll_pos = self . scroll_pos . max ( 0 ) ;
242- }
243223}
0 commit comments