@@ -61,8 +61,6 @@ pub struct Plot {
6161 volume_data : Vec < Data > ,
6262 song_before : Option < Song > ,
6363 song_after : Option < Song > ,
64- start : AudioTime ,
65- end : AudioTime ,
6664 cut_time : AudioTime ,
6765 finished_cut_before : bool ,
6866 finished_cut_after : bool ,
@@ -103,15 +101,13 @@ impl Plot {
103101 volume_data,
104102 song_before,
105103 song_after,
106- start,
107- end,
108104 cut_time,
109105 finished_cut_before : false ,
110106 finished_cut_after : false ,
111107 }
112108 }
113109
114- pub fn get_plot_path ( & self , data : & [ Data ] , bounds : & Bounds ) -> Path {
110+ fn get_plot_path ( & self , data : & [ Data ] , bounds : & Bounds ) -> Path {
115111 let mut path = Builder :: new ( ) ;
116112
117113 if data. len ( ) > 0 {
@@ -125,7 +121,7 @@ impl Plot {
125121
126122 /// Return the path left of the marker and the path right
127123 /// of the marker, so they can be colored individually.
128- pub fn get_plot_paths ( & self , bounds : & Bounds ) -> ( Path , Path ) {
124+ fn get_plot_paths ( & self , bounds : & Bounds ) -> ( Path , Path ) {
129125 let cutoff = self
130126 . volume_data
131127 . iter ( )
@@ -139,7 +135,7 @@ impl Plot {
139135 )
140136 }
141137
142- pub fn get_marker_path ( & self , bounds : & Bounds ) -> Path {
138+ fn get_marker_path ( & self , bounds : & Bounds ) -> Path {
143139 let mut path = Builder :: new ( ) ;
144140 path. move_to ( bounds. data_to_point ( & Data {
145141 time : self . cut_time ,
@@ -179,10 +175,22 @@ impl Plot {
179175 Bounds {
180176 width : bounds. width ,
181177 height : bounds. height ,
182- min_time : self . volume_data . first ( ) . unwrap ( ) . time ,
183- max_time : self . volume_data . last ( ) . unwrap ( ) . time ,
178+ min_time : self . min_time ( ) ,
179+ max_time : self . max_time ( ) ,
184180 }
185181 }
182+
183+ pub fn max_time ( & self ) -> AudioTime {
184+ self . volume_data . last ( ) . unwrap ( ) . time
185+ }
186+
187+ fn min_time ( & self ) -> AudioTime {
188+ self . volume_data . first ( ) . unwrap ( ) . time
189+ }
190+
191+ pub fn cut_time ( & self ) -> AudioTime {
192+ self . cut_time
193+ }
186194}
187195
188196pub struct PlotMarkerMoved {
0 commit comments