| 1 | /* Copyright 2013 Kjetil S. Matheussen |
| 2 | |
| 3 | This program is free software; you can redistribute it and/or |
| 4 | modify it under the terms of the GNU General Public License |
| 5 | as published by the Free Software Foundation; either version 2 |
| 6 | of the License, or (at your option) any later version. |
| 7 | |
| 8 | This program is distributed in the hope that it will be useful, |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | GNU General Public License for more details. |
| 12 | |
| 13 | You should have received a copy of the GNU General Public License |
| 14 | along with this program; if not, write to the Free Software |
| 15 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
| 16 | |
| 17 | #ifdef INCLUDE_MYLINE_AND_MYRECT |
| 18 | |
| 19 | namespace cvs{ |
| 20 | |
| 21 | struct MyLine{ |
| 22 | int x1,y1,x2,y2; |
| 23 | MyLine(int x1,int y1, int x2, int y2) |
| 24 | : x1(x1),y1(y1),x2(x2),y2(y2) |
| 25 | {} |
| 26 | }; |
| 27 | |
| 28 | struct MyRect{ |
| 29 | int x1,y1,x2,y2; |
| 30 | MyRect(int x1,int y1, int x2, int y2) |
| 31 | : x1(x1),y1(y1),x2(x2),y2(y2) |
| 32 | {} |
| 33 | int width() const {return x2-x1;} |
| 34 | int height() const {return y2-y1;} |
| 35 | }; |
| 36 | } |
| 37 | |
| 38 | |
| 39 | |
| 40 | #else // INCLUDE_MYLINE_AND_MYRECT |
| 41 | |
| 42 | |
| 43 | |
| 44 | #include <string> |
| 45 | |
| 46 | #define GLIDING_PEAK_AREAcxx . . $ `Qt/compressor_vertical_sliders.cpp:46:9`! 0 // Set to 1 to get gliding peaks area, which most meters use. Looks good, but I think it is slightly more confusing than the array used now. |
| 47 | |
| 48 | const int min_dbcxx . . $ min_db. = -40; |
| 49 | const int max_dbcxx . . $ max_db. = 40; |
| 50 | |
| 51 | const int k_timer_intervalcxx . . $ k_timer_interval. = 25; |
| 52 | |
| 53 | const int max_attack_releasecxx . . $ max_attack_release. = 500; |
| 54 | |
| 55 | const float def_thresholdcxx . . $ def_threshold. = 0.7f; |
| 56 | const float def_ratiocxx . . $ def_ratio. = 0.3; |
| 57 | const float def_makeupgaincxx . . $ def_makeupgain. = 0.3f; |
| 58 | |
| 59 | namespace cvscxx . . $ cvs/{ |
| 60 | |
| 61 | struct Compcxx . . $ cvs/Comp# : public MyWidgetcxx . . $ cvs/MyWidget#, public MyTimercxx . . $ cvs/MyTimer#{ |
| 62 | struct Patchcxx . . $ Patch# *_patchcxx . . $ cvs/Comp#_patch.; |
| 63 | |
| 64 | // All values have the value 0 at top, and 1 at bottom, and: |
| 65 | // 0 <= val1 <= val2 <= 1 |
| 66 | // (sometimes < instead of <=) |
| 67 | |
| 68 | // slider 1 |
| 69 | double in_val1cxx . . $ cvs/Comp#in_val1.; // 0 |
| 70 | double in_val2cxx . . $ cvs/Comp#in_val2.; // threshold |
| 71 | |
| 72 | // slider 2 |
| 73 | double out_val1cxx . . $ cvs/Comp#out_val1.; // used to calculate ratio ( ratio = in_val2/(out_val1-in_val2) ) |
| 74 | double out_val2cxx . . $ cvs/Comp#out_val2.; // threshold |
| 75 | |
| 76 | // slider 3 |
| 77 | double vol_val1cxx . . $ cvs/Comp#vol_val1.; // used to calculate volume ( volume = out_val1/vol_val1 ) |
| 78 | double vol_val2cxx . . $ cvs/Comp#vol_val2.; // threshold * volume |
| 79 | |
| 80 | // attack/release sliders |
| 81 | double attack_valcxx . . $ cvs/Comp#attack_val.; |
| 82 | double release_valcxx . . $ cvs/Comp#release_val.; |
| 83 | |
| 84 | int curr_slidercxx . . $ cvs/Comp#curr_slider.; |
| 85 | |
| 86 | struct Boxcxx . . $ cvs/Comp#Box#{ |
| 87 | int x1cxx . . $ cvs/Comp#Box#x1.,y1cxx . . $ cvs/Comp#Box#y1.,x2cxx . . $ cvs/Comp#Box#x2.,y2cxx . . $ cvs/Comp#Box#y2.; |
| 88 | int p1cxx . . $ cvs/Comp#Box#p1.,p2cxx . . $ cvs/Comp#Box#p2.; |
| 89 | |
| 90 | Boxcxx . . $ cvs/Comp#Box#Box(6d4df84d66905e21).(int _x1, int _y1, int _x2, int _y2, float val1,float val2) |
| 91 | : x1cxx . . $ cvs/Comp#Box#x1.(_x1) |
| 92 | , y1cxx . . $ cvs/Comp#Box#y1.(_y1) |
| 93 | , x2cxx . . $ cvs/Comp#Box#x2.(_x2) |
| 94 | , y2cxx . . $ cvs/Comp#Box#y2.(_y2) |
| 95 | { |
| 96 | p1cxx . . $ cvs/Comp#Box#p1. = scalecxx . . $ scale(a4708ef16e45b76e).(val1,0,1,y1cxx . . $ cvs/Comp#Box#y1.,y2cxx . . $ cvs/Comp#Box#y2.); |
| 97 | p2cxx . . $ cvs/Comp#Box#p2. = scalecxx . . $ scale(a4708ef16e45b76e).(val2,0,1,y1cxx . . $ cvs/Comp#Box#y1.,y2cxx . . $ cvs/Comp#Box#y2.); |
| 98 | } |
| 99 | |
| 100 | bool insidecxx . . $ cvs/Comp#Box#inside(cf9ef193275fa6d8).(int x,int y){ |
| 101 | return x>=x1cxx . . $ cvs/Comp#Box#x1. && x<x2cxx . . $ cvs/Comp#Box#x2. && y>y1cxx . . $ cvs/Comp#Box#y1. && y<y2cxx . . $ cvs/Comp#Box#y2.; |
| 102 | } |
| 103 | bool in_val1cxx . . $ cvs/Comp#Box#in_val1(83c267b20bac841a).(int y){ |
| 104 | int p=(p1cxx . . $ cvs/Comp#Box#p1.+p2cxx . . $ cvs/Comp#Box#p2.)/2; |
| 105 | return y<p; |
| 106 | } |
| 107 | bool in_val2cxx . . $ cvs/Comp#Box#in_val2(83c267b20bac841a).(int y){ |
| 108 | int p=(p1cxx . . $ cvs/Comp#Box#p1.+p2cxx . . $ cvs/Comp#Box#p2.)/2; |
| 109 | return y>=p; |
| 110 | } |
| 111 | }; |
| 112 | |
| 113 | struct Slidercxx . . $ cvs/Comp#Slider# : public Boxcxx . . $ cvs/Comp#Box#{ |
| 114 | Slidercxx . . $ cvs/Comp#Slider#Slider(6d4df84d66905e21).(int _x1, int _y1, int _x2, int _y2, float val1,float val2) |
| 115 | : Boxcxx . . $ cvs/Comp#Box#(_x1,_y1,_x2,_y2,val1,val2) |
| 116 | { |
| 117 | p1cxx . . $ cvs/Comp#Box#p1. = scalecxx . . $ scale(a4708ef16e45b76e).(val1,0,1,x1cxx . . $ cvs/Comp#Box#x1.,x2cxx . . $ cvs/Comp#Box#x2.); |
| 118 | } |
| 119 | }; |
| 120 | |
| 121 | struct Peakscxx . . $ cvs/Comp#Peaks#{ |
| 122 | const static int num_peakscxx . . $ cvs/Comp#Peaks#num_peaks. = 30;//24; |
| 123 | |
| 124 | float peakscxx . . $ cvs/Comp#Peaks#peaks.[num_peakscxx . . $ cvs/Comp#Peaks#num_peaks.]; // in dB |
| 125 | int peak_poscxx . . $ cvs/Comp#Peaks#peak_pos.; |
| 126 | float last_peakcxx . . $ cvs/Comp#Peaks#last_peak.; |
| 127 | |
| 128 | #if GLIDING_PEAK_AREAcxx . . $ `Qt/compressor_vertical_sliders.cpp:46:9`! |
| 129 | float min_peak_db, max_peak_db; // in dB |
| 130 | #endif |
| 131 | int min_peakcxx . . $ cvs/Comp#Peaks#min_peak., max_peakcxx . . $ cvs/Comp#Peaks#max_peak.; // in pixels |
| 132 | |
| 133 | Peakscxx . . $ cvs/Comp#Peaks#Peaks(49f6e7a06ebc5aa8).() |
| 134 | : peak_poscxx . . $ cvs/Comp#Peaks#peak_pos.(0) |
| 135 | , last_peakcxx . . $ cvs/Comp#Peaks#last_peak.(0) |
| 136 | #if GLIDING_PEAK_AREAcxx . . $ `Qt/compressor_vertical_sliders.cpp:46:9`! |
| 137 | , min_peak_db(0), max_peak_db(0) |
| 138 | #endif |
| 139 | , min_peakcxx . . $ cvs/Comp#Peaks#min_peak.(0) |
| 140 | , max_peakcxx . . $ cvs/Comp#Peaks#max_peak.(0) |
| 141 | { |
| 142 | for(int i=0;i<num_peakscxx . . $ cvs/Comp#Peaks#num_peaks.;i++) |
| 143 | peakscxx . . $ cvs/Comp#Peaks#peaks.[i]=0.0f; |
| 144 | } |
| 145 | |
| 146 | float get_min_peakcxx . . $ cvs/Comp#Peaks#get_min_peak(9b8c9e39889c762c).(){ |
| 147 | float ret=max_dbcxx . . $ max_db.; |
| 148 | for(int i=0;i<num_peakscxx . . $ cvs/Comp#Peaks#num_peaks.;i++) |
| 149 | if(peakscxx . . $ cvs/Comp#Peaks#peaks.[i]<ret) |
| 150 | ret=peakscxx . . $ cvs/Comp#Peaks#peaks.[i]; |
| 151 | return ret; |
| 152 | } |
| 153 | |
| 154 | float get_max_peakcxx . . $ cvs/Comp#Peaks#get_max_peak(9b8c9e39889c762c).(){ |
| 155 | float ret=min_dbcxx . . $ min_db.; |
| 156 | for(int i=0;i<num_peakscxx . . $ cvs/Comp#Peaks#num_peaks.;i++) |
| 157 | if(peakscxx . . $ cvs/Comp#Peaks#peaks.[i]>ret) |
| 158 | ret=peakscxx . . $ cvs/Comp#Peaks#peaks.[i]; |
| 159 | return ret; |
| 160 | } |
| 161 | |
| 162 | |
| 163 | #if GLIDING_PEAK_AREAcxx . . $ `Qt/compressor_vertical_sliders.cpp:46:9`! |
| 164 | // Trying gliding area instead of array. IMO it is less clear, and it also uses more CPU because of more gfx updates. |
| 165 | void update_peaks(const Box &box, float peak){ |
| 166 | const float inc = 0.1; |
| 167 | |
| 168 | if(peak>max_peak_db) |
| 169 | max_peak_db = peak; |
| 170 | else |
| 171 | max_peak_db = max_peak_db - inc; |
| 172 | |
| 173 | if(peak<min_peak_db) |
| 174 | min_peak_db = peak; |
| 175 | else |
| 176 | min_peak_db = min_peak_db + inc; |
| 177 | |
| 178 | if(min_peak_db < min_db) |
| 179 | min_peak_db = min_db; |
| 180 | |
| 181 | if(max_peak_db > max_db) |
| 182 | max_peak_db = max_db; |
| 183 | |
| 184 | if(min_peak_db>max_peak_db) |
| 185 | min_peak_db=max_peak_db; |
| 186 | |
| 187 | //if(box.x1<50) |
| 188 | // printf("min_peak_db: %f\n",min_peak_db); |
| 189 | |
| 190 | min_peak = scale(min_peak_db,min_db,max_db, box.y2, box.y1); |
| 191 | max_peak = scale(max_peak_db,min_db,max_db, box.y2, box.y1); |
| 192 | } |
| 193 | |
| 194 | #else |
| 195 | |
| 196 | void set_min_maxcxx . . $ cvs/Comp#Peaks#set_min_max(1bb742eadfaddceb).(const Boxcxx . . $ cvs/Comp#Box# &box){ |
| 197 | min_peakcxx . . $ cvs/Comp#Peaks#min_peak. = scalecxx . . $ scale(a4708ef16e45b76e).(get_min_peakcxx . . $ cvs/Comp#Peaks#get_min_peak(9b8c9e39889c762c).(),min_dbcxx . . $ min_db.,max_dbcxx . . $ max_db., box.y2cxx . . $ cvs/Comp#Box#y2., box.y1cxx . . $ cvs/Comp#Box#y1.); |
| 198 | max_peakcxx . . $ cvs/Comp#Peaks#max_peak. = scalecxx . . $ scale(a4708ef16e45b76e).(get_max_peakcxx . . $ cvs/Comp#Peaks#get_max_peak(9b8c9e39889c762c).(),min_dbcxx . . $ min_db.,max_dbcxx . . $ max_db., box.y2cxx . . $ cvs/Comp#Box#y2., box.y1cxx . . $ cvs/Comp#Box#y1.); |
| 199 | } |
| 200 | |
| 201 | #endif |
| 202 | |
| 203 | const int get_y_pixelcxx . . $ cvs/Comp#Peaks#get_y_pixel(e5cf0cf9769654ad).(const Boxcxx . . $ cvs/Comp#Box# &box){ |
| 204 | return scalecxx . . $ scale(a4708ef16e45b76e).(last_peakcxx . . $ cvs/Comp#Peaks#last_peak.,min_dbcxx . . $ min_db.,max_dbcxx . . $ max_db., box.y2cxx . . $ cvs/Comp#Box#y2., box.y1cxx . . $ cvs/Comp#Box#y1.); |
| 205 | } |
| 206 | |
| 207 | const MyLine get_line_linecxx . . $ cvs/Comp#Peaks#get_line_line(7a342cddc503d31d).(const Boxcxx . . $ cvs/Comp#Box# &box){ |
| 208 | const int peak = get_y_pixelcxx . . $ cvs/Comp#Peaks#get_y_pixel(e5cf0cf9769654ad).(box); |
| 209 | return MyLine(box.x1cxx . . $ cvs/Comp#Box#x1.,peak,box.x2cxx . . $ cvs/Comp#Box#x2.,peak); |
| 210 | } |
| 211 | |
| 212 | const MyLine get_line_to_next_boxcxx . . $ cvs/Comp#Peaks#get_line_to_next_box(1820c24ece116467).(const Boxcxx . . $ cvs/Comp#Box# &box1, Peakscxx . . $ cvs/Comp#Peaks# *peaks2, const Boxcxx . . $ cvs/Comp#Box# &box2){ |
| 213 | Peakscxx . . $ cvs/Comp#Peaks# *peaks1 = this; |
| 214 | int x1=box1.x2cxx . . $ cvs/Comp#Box#x2.; |
| 215 | int y1=peaks1->get_y_pixelcxx . . $ cvs/Comp#Peaks#get_y_pixel(e5cf0cf9769654ad).(box1); |
| 216 | int x2=box2.x1cxx . . $ cvs/Comp#Box#x1.; |
| 217 | int y2=peaks2->get_y_pixelcxx . . $ cvs/Comp#Peaks#get_y_pixel(e5cf0cf9769654ad).(box2); |
| 218 | |
| 219 | if(y1 < box1.y1cxx . . $ cvs/Comp#Box#y1.){ |
| 220 | x1=scalecxx . . $ scale(a4708ef16e45b76e).(box1.y1cxx . . $ cvs/Comp#Box#y1., y1,y2, x1,x2); |
| 221 | y1=box1.y1cxx . . $ cvs/Comp#Box#y1. - 10; // FIX. why is - 10 needed? |
| 222 | } |
| 223 | |
| 224 | if(y2 < box2.y1cxx . . $ cvs/Comp#Box#y1.){ |
| 225 | x2=scalecxx . . $ scale(a4708ef16e45b76e).(box2.y1cxx . . $ cvs/Comp#Box#y1., y1,y2, x1,x2); |
| 226 | y2=box2.y1cxx . . $ cvs/Comp#Box#y1. - 10; |
| 227 | } |
| 228 | |
| 229 | if(y1 > box1.y2cxx . . $ cvs/Comp#Box#y2.){ |
| 230 | x1=scalecxx . . $ scale(a4708ef16e45b76e).(box1.y2cxx . . $ cvs/Comp#Box#y2., y1,y2, x1,x2); |
| 231 | y1=box1.y2cxx . . $ cvs/Comp#Box#y2. + 10; |
| 232 | } |
| 233 | |
| 234 | if(y2 > box2.y2cxx . . $ cvs/Comp#Box#y2.){ |
| 235 | x2=scalecxx . . $ scale(a4708ef16e45b76e).(box2.y2cxx . . $ cvs/Comp#Box#y2., y1,y2, x1,x2); |
| 236 | y2=box2.y2cxx . . $ cvs/Comp#Box#y2. + 10; |
| 237 | } |
| 238 | |
| 239 | if(x1<box1.x2cxx . . $ cvs/Comp#Box#x2.) |
| 240 | x1=10000; |
| 241 | if(x1>box2.x1cxx . . $ cvs/Comp#Box#x1.) |
| 242 | x1=10000; |
| 243 | if(x2<box1.x2cxx . . $ cvs/Comp#Box#x2.) |
| 244 | x1=10000; |
| 245 | if(x2>box2.x1cxx . . $ cvs/Comp#Box#x1.) |
| 246 | x1=10000; |
| 247 | |
| 248 | |
| 249 | return MyLine(x1,y1,x2,y2); |
| 250 | } |
| 251 | |
| 252 | // For lines in boxes (those lines are always horizontal) |
| 253 | const MyRect get_line_rectcxx . . $ cvs/Comp#Peaks#get_line_rect(629bef92dae1868b).(const Boxcxx . . $ cvs/Comp#Box# &box){ |
| 254 | const int peak = get_y_pixelcxx . . $ cvs/Comp#Peaks#get_y_pixel(e5cf0cf9769654ad).(box); |
| 255 | return MyRect(box.x1cxx . . $ cvs/Comp#Box#x1.,peak-2,box.x2cxx . . $ cvs/Comp#Box#x2.,peak+3); |
| 256 | } |
| 257 | |
| 258 | void update_line_rectcxx . . $ cvs/Comp#Peaks#update_line_rect(24bd9f68b6058885).(MyWidgetcxx . . $ cvs/MyWidget# *widget, const Boxcxx . . $ cvs/Comp#Box# &box){ |
| 259 | widget->updatecxx . . $ cvs/MyWidget#update(73afc3747a524c7b).(get_line_rectcxx . . $ cvs/Comp#Peaks#get_line_rect(629bef92dae1868b).(box)); |
| 260 | } |
| 261 | |
| 262 | // For the lines between boxes. |
| 263 | void update_line_regioncxx . . $ cvs/Comp#Peaks#update_line_region(e10f29e97b22a345).(MyWidgetcxx . . $ cvs/MyWidget# *widget, const Boxcxx . . $ cvs/Comp#Box# &box1, Peakscxx . . $ cvs/Comp#Peaks# *peaks2, const Boxcxx . . $ cvs/Comp#Box# &box2){ |
| 264 | const MyLine line = get_line_to_next_boxcxx . . $ cvs/Comp#Peaks#get_line_to_next_box(1820c24ece116467).(box1,peaks2,box2); |
| 265 | |
| 266 | int x1=line.x1; |
| 267 | int y1=line.y1; |
| 268 | int x2=line.x2; |
| 269 | int y2=line.y2; |
| 270 | |
| 271 | if(x1==10000) |
| 272 | return; // Line is not painted. |
| 273 | |
| 274 | |
| 275 | int h_square = y2 - y1; |
| 276 | h_square *= h_square; |
| 277 | |
| 278 | int w_square = x2 - x1; |
| 279 | w_square *= w_square; |
| 280 | |
| 281 | int h = ceilcxx . . $ ceil(fee4f1d22bc8e617).(4.0/2.0 * sqrtcxx . . $ sqrt(fee4f1d22bc8e617).((double)h_square/(double)w_square + 1.0)); // "4.0" is the pen width. |
| 282 | |
| 283 | int y1_1 = y1-h; |
| 284 | int y1_2 = y1+h; |
| 285 | int y2_1 = y2-h; |
| 286 | int y2_2 = y2+h; |
| 287 | |
| 288 | const int dx = 8; |
| 289 | |
| 290 | if(y1_1 < y2_1) |
| 291 | for(int x=x1;x<x2;x+=dx){ |
| 292 | int y1=scalecxx . . $ scale(a4708ef16e45b76e).(x,x1,x2,y1_1,y2_1); |
| 293 | int y2=scalecxx . . $ scale(a4708ef16e45b76e).(x+dx,x1,x2,y1_2,y2_2)+1; |
| 294 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x,y1,x+dx,y2); |
| 295 | } |
| 296 | else |
| 297 | for(int x=x1;x<x2;x+=dx){ |
| 298 | int y1=scalecxx . . $ scale(a4708ef16e45b76e).(x+dx,x1,x2,y1_1,y2_1); |
| 299 | int y2=scalecxx . . $ scale(a4708ef16e45b76e).(x,x1,x2,y1_2,y2_2)+1; |
| 300 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x,y1,x+dx,y2); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | const MyRect get_area_rectcxx . . $ cvs/Comp#Peaks#get_area_rect(629bef92dae1868b).(const Boxcxx . . $ cvs/Comp#Box# &box){ |
| 305 | return MyRect(box.x1cxx . . $ cvs/Comp#Box#x1.,max_peakcxx . . $ cvs/Comp#Peaks#max_peak., |
| 306 | box.x2cxx . . $ cvs/Comp#Box#x2., min_peakcxx . . $ cvs/Comp#Peaks#min_peak.); |
| 307 | } |
| 308 | |
| 309 | void paint_peak_areacxx . . $ cvs/Comp#Peaks#paint_peak_area(10f03e368187e287).(MyPaintercxx . . $ cvs/MyPainter# *p, const Boxcxx . . $ cvs/Comp#Box# &box){ |
| 310 | MyColorcxx . . $ cvs/MyColor# colcxx . . $ cvs/MyColor#MyColor(b1146eedae1e1d0b).(40,90,140); |
| 311 | col =cxx . . $ cvs/MyColor#`operator=`(13a50e9053038475). col.lightercxx . . $ cvs/MyColor#lighter(372ef7c421a52c36).(80); |
| 312 | col.setAlphacxx . . $ cvs/MyColor#setAlpha(d4f767463ce0a6b3).(120); |
| 313 | |
| 314 | p->fillRectcxx . . $ cvs/MyPainter#fillRect(20f4596baf7dbac).(get_area_rectcxx . . $ cvs/Comp#Peaks#get_area_rect(629bef92dae1868b).(box), col); |
| 315 | } |
| 316 | |
| 317 | void paint_peak_linecxx . . $ cvs/Comp#Peaks#paint_peak_line(794e6a4ef9e74bce).(MyPaintercxx . . $ cvs/MyPainter# *p, const Boxcxx . . $ cvs/Comp#Box# &box, const MyColorcxx . . $ cvs/MyColor# &col){ |
| 318 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(51253c7414724c0b).(get_line_linecxx . . $ cvs/Comp#Peaks#get_line_line(7a342cddc503d31d).(box),col); |
| 319 | } |
| 320 | |
| 321 | void paint_peak_line_between_boxescxx . . $ cvs/Comp#Peaks#paint_peak_line_between_boxes(c845baf7be70d3a4).(MyPaintercxx . . $ cvs/MyPainter# *p, const Boxcxx . . $ cvs/Comp#Box# &box1, Peakscxx . . $ cvs/Comp#Peaks# *peaks2, const Boxcxx . . $ cvs/Comp#Box# &box2, const MyColorcxx . . $ cvs/MyColor# &col){ |
| 322 | const MyLine line = get_line_to_next_boxcxx . . $ cvs/Comp#Peaks#get_line_to_next_box(1820c24ece116467).(box1, peaks2, box2); |
| 323 | if(line.x1==10000) |
| 324 | return; |
| 325 | |
| 326 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(51253c7414724c0b).(line,col); |
| 327 | } |
| 328 | |
| 329 | // Only works if rect1.x1==rect2.x1 && rect2.x2==rect2.x2 |
| 330 | void update_xored_rectscxx . . $ cvs/Comp#Peaks#update_xored_rects(ca6e1b09263a705).(MyWidgetcxx . . $ cvs/MyWidget# *widget, const MyRect &rect1, const MyRect &rect2){ |
| 331 | if(rect1.y1==rect2.y1 && rect1.y2==rect2.y2) |
| 332 | return; |
| 333 | |
| 334 | MyRect r1=rect1; |
| 335 | MyRect r2=rect2; |
| 336 | int x1=rect1.x1; |
| 337 | int x2=rect1.x2; |
| 338 | |
| 339 | if(r1.y1 > r2.y1){ |
| 340 | MyRect temp=r1; |
| 341 | r1=r2; |
| 342 | r2=temp; |
| 343 | } |
| 344 | |
| 345 | #if 0 // for testing |
| 346 | widget->update(x1,r1.y1,x2,r1.y2); |
| 347 | widget->update(x1,r2.y1,x2,r2.y2); |
| 348 | return; |
| 349 | #endif |
| 350 | |
| 351 | if(r1.y1==r2.y1 && r2.y2<r1.y2){ |
| 352 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x1, r2.y2, x2, r1.y2); |
| 353 | return; |
| 354 | } |
| 355 | |
| 356 | if(r1.y1==r2.y1){ |
| 357 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x1, r1.y2, x2, r2.y2); |
| 358 | return; |
| 359 | } |
| 360 | |
| 361 | if(r1.y2==r2.y2){ |
| 362 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x1, r1.y1, x2, r2.y1); |
| 363 | return; |
| 364 | } |
| 365 | |
| 366 | if(r2.y2 < r1.y2){ |
| 367 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x1, r1.y1, x2, r2.y1); |
| 368 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x1, r2.y2, x2, r1.y2); |
| 369 | return; |
| 370 | } |
| 371 | |
| 372 | if(r2.y1 < r1.y2){ |
| 373 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x1, r1.y1, x2, r2.y1); |
| 374 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x1, r1.y2, x2, r2.y2); |
| 375 | } |
| 376 | |
| 377 | // i.e. they are non-overlapping |
| 378 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x1, r1.y1, x2, r1.y2); |
| 379 | widget->updatecxx . . $ cvs/MyWidget#update(748afa4755bc9595).(x1, r2.y1, x2, r2.y2); |
| 380 | } |
| 381 | |
| 382 | void add_peaks_and_update_areacxx . . $ cvs/Comp#Peaks#add_peaks_and_update_area(c093588ac79ae149).(MyWidgetcxx . . $ cvs/MyWidget# *widget, const Boxcxx . . $ cvs/Comp#Box# &box, float peak){ |
| 383 | |
| 384 | MyRect rect_before = get_area_rectcxx . . $ cvs/Comp#Peaks#get_area_rect(629bef92dae1868b).(box); |
| 385 | |
| 386 | if(peak<-1000) |
| 387 | peak=-1000; |
| 388 | if(peak>1000) |
| 389 | peak=1000; |
| 390 | |
| 391 | last_peakcxx . . $ cvs/Comp#Peaks#last_peak. = peak; |
| 392 | //printf("adding peak %.2f. ",peak); |
| 393 | peakscxx . . $ cvs/Comp#Peaks#peaks.[peak_poscxx . . $ cvs/Comp#Peaks#peak_pos.] = peak; |
| 394 | peak_poscxx . . $ cvs/Comp#Peaks#peak_pos.++; |
| 395 | if(peak_poscxx . . $ cvs/Comp#Peaks#peak_pos.==num_peakscxx . . $ cvs/Comp#Peaks#num_peaks.) |
| 396 | peak_poscxx . . $ cvs/Comp#Peaks#peak_pos.=0; |
| 397 | |
| 398 | #if GLIDING_PEAK_AREAcxx . . $ `Qt/compressor_vertical_sliders.cpp:46:9`! |
| 399 | update_peaks(box,peak); |
| 400 | #else |
| 401 | set_min_maxcxx . . $ cvs/Comp#Peaks#set_min_max(1bb742eadfaddceb).(box); |
| 402 | #endif |
| 403 | |
| 404 | MyRect rect_after = get_area_rectcxx . . $ cvs/Comp#Peaks#get_area_rect(629bef92dae1868b).(box); |
| 405 | |
| 406 | update_xored_rectscxx . . $ cvs/Comp#Peaks#update_xored_rects(ca6e1b09263a705).(widget, rect_before, rect_after); |
| 407 | } |
| 408 | }; |
| 409 | |
| 410 | Peakscxx . . $ cvs/Comp#Peaks# peaks_incxx . . $ cvs/Comp#peaks_in.; |
| 411 | Peakscxx . . $ cvs/Comp#Peaks# peaks_outcxx . . $ cvs/Comp#peaks_out.; |
| 412 | Peakscxx . . $ cvs/Comp#Peaks# peaks_volcxx . . $ cvs/Comp#peaks_vol.; |
| 413 | |
| 414 | float in_peak_valuecxx . . $ cvs/Comp#in_peak_value.; |
| 415 | float out_peak_valuecxx . . $ cvs/Comp#out_peak_value.; |
| 416 | float vol_peak_valuecxx . . $ cvs/Comp#vol_peak_value.; |
| 417 | |
| 418 | bool background_image_must_be_updatedcxx . . $ cvs/Comp#background_image_must_be_updated.; |
| 419 | |
| 420 | MyImagecxx . . $ cvs/MyImage# *background_imagecxx . . $ cvs/Comp#background_image.; |
| 421 | |
| 422 | void timercxx . . $ cvs/Comp#timer(49f6e7a06ebc5aa8).(){ // virtual method from MyTimer |
| 423 | if(isVisiblecxx . . $ cvs/MyWidget#isVisible(c9857a73d68e59ba).()) |
| 424 | update_peakscxx . . $ cvs/Comp#update_peaks(49f6e7a06ebc5aa8).(); |
| 425 | } |
| 426 | |
| 427 | ~cxx . . $ cvs/Comp#`~Comp`(ced63f7c635d850d).Compcxx . . $ cvs/Comp#(){ |
| 428 | delete background_imagecxx . . $ cvs/Comp#background_image.; |
| 429 | } |
| 430 | |
| 431 | Compcxx . . $ cvs/Comp#Comp(6b68fa269140e5a3).(struct Patchcxx . . $ Patch# *patch, void *parent) |
| 432 | : MyWidgetcxx . . $ cvs/MyWidget#(parent) |
| 433 | , _patchcxx . . $ cvs/Comp#_patch.(patch) |
| 434 | , in_val1cxx . . $ cvs/Comp#in_val1.(0.0) |
| 435 | , in_val2cxx . . $ cvs/Comp#in_val2.(def_thresholdcxx . . $ def_threshold.) |
| 436 | , out_val1cxx . . $ cvs/Comp#out_val1.(def_ratiocxx . . $ def_ratio.) |
| 437 | , out_val2cxx . . $ cvs/Comp#out_val2.(def_thresholdcxx . . $ def_threshold.) |
| 438 | , vol_val1cxx . . $ cvs/Comp#vol_val1.(def_makeupgaincxx . . $ def_makeupgain.) |
| 439 | , vol_val2cxx . . $ cvs/Comp#vol_val2.(def_thresholdcxx . . $ def_threshold.) |
| 440 | , curr_slidercxx . . $ cvs/Comp#curr_slider.(0) |
| 441 | , background_image_must_be_updatedcxx . . $ cvs/Comp#background_image_must_be_updated.(true) |
| 442 | , background_imagecxx . . $ cvs/Comp#background_image.(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 443 | { |
| 444 | createBackgroundImagecxx . . $ cvs/Comp#createBackgroundImage(49f6e7a06ebc5aa8).(); |
| 445 | |
| 446 | startTimercxx . . $ cvs/MyTimer#startTimer(d4f767463ce0a6b3).(k_timer_intervalcxx . . $ k_timer_interval.); // MyTimer |
| 447 | |
| 448 | set_thresholdcxx . . $ cvs/Comp#set_threshold(9364e6e7bff7660).(def_thresholdcxx . . $ def_threshold.); |
| 449 | set_compressor_parameterscxx . . $ cvs/Comp#set_compressor_parameters(49f6e7a06ebc5aa8).(); |
| 450 | |
| 451 | update_peakscxx . . $ cvs/Comp#update_peaks(49f6e7a06ebc5aa8).(); |
| 452 | } |
| 453 | |
| 454 | void createBackgroundImagecxx . . $ cvs/Comp#createBackgroundImage(49f6e7a06ebc5aa8).(){ |
| 455 | delete background_imagecxx . . $ cvs/Comp#background_image.; |
| 456 | background_imagecxx . . $ cvs/Comp#background_image. = new MyImagecxx . . $ cvs/MyImage#(widthcxx . . $ cvs/MyWidget#width(b126dc7c1de90089).(),heightcxx . . $ cvs/MyWidget#height(b126dc7c1de90089).()); |
| 457 | updateBackgroundImagecxx . . $ cvs/Comp#updateBackgroundImage(49f6e7a06ebc5aa8).(); |
| 458 | } |
| 459 | |
| 460 | void resizedcxx . . $ cvs/Comp#resized(49f6e7a06ebc5aa8).(){ |
| 461 | createBackgroundImagecxx . . $ cvs/Comp#createBackgroundImage(49f6e7a06ebc5aa8).(); |
| 462 | } |
| 463 | |
| 464 | int get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).(){ |
| 465 | return (widthcxx . . $ cvs/MyWidget#width(b126dc7c1de90089).()-1) / 4; |
| 466 | } |
| 467 | |
| 468 | int get_slider_heightcxx . . $ cvs/Comp#get_slider_height(b126dc7c1de90089).(){ |
| 469 | return 20; |
| 470 | } |
| 471 | |
| 472 | int get_box_heightcxx . . $ cvs/Comp#get_box_height(b126dc7c1de90089).(){ |
| 473 | //return height()-((get_slider_height()+1)*2); |
| 474 | return heightcxx . . $ cvs/MyWidget#height(b126dc7c1de90089).()-1; |
| 475 | } |
| 476 | |
| 477 | int get_width_between_boxescxx . . $ cvs/Comp#get_width_between_boxes(b126dc7c1de90089).(){ |
| 478 | return get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).() / 2; |
| 479 | } |
| 480 | |
| 481 | Boxcxx . . $ cvs/Comp#Box# get_slider1_parmscxx . . $ cvs/Comp#get_slider1_parms(6efcad09bf3cfa57).(){ |
| 482 | return Boxcxx . . $ cvs/Comp#Box#Box(6d4df84d66905e21).( |
| 483 | 0,0, |
| 484 | get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).(), |
| 485 | get_box_heightcxx . . $ cvs/Comp#get_box_height(b126dc7c1de90089).(), |
| 486 | in_val1cxx . . $ cvs/Comp#in_val1.,in_val2cxx . . $ cvs/Comp#in_val2.); |
| 487 | } |
| 488 | |
| 489 | Boxcxx . . $ cvs/Comp#Box# get_slider2_parmscxx . . $ cvs/Comp#get_slider2_parms(6efcad09bf3cfa57).(){ |
| 490 | return Boxcxx . . $ cvs/Comp#Box#Box(6d4df84d66905e21).( |
| 491 | get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).() + get_width_between_boxescxx . . $ cvs/Comp#get_width_between_boxes(b126dc7c1de90089).(), 0, |
| 492 | get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).() + get_width_between_boxescxx . . $ cvs/Comp#get_width_between_boxes(b126dc7c1de90089).() + get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).(), |
| 493 | get_box_heightcxx . . $ cvs/Comp#get_box_height(b126dc7c1de90089).(), |
| 494 | out_val1cxx . . $ cvs/Comp#out_val1.,out_val2cxx . . $ cvs/Comp#out_val2.); |
| 495 | } |
| 496 | |
| 497 | Boxcxx . . $ cvs/Comp#Box# get_slider3_parmscxx . . $ cvs/Comp#get_slider3_parms(6efcad09bf3cfa57).(){ |
| 498 | return Boxcxx . . $ cvs/Comp#Box#Box(6d4df84d66905e21).( |
| 499 | get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).() + get_width_between_boxescxx . . $ cvs/Comp#get_width_between_boxes(b126dc7c1de90089).() + get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).() + get_width_between_boxescxx . . $ cvs/Comp#get_width_between_boxes(b126dc7c1de90089).(), 0, |
| 500 | get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).() + get_width_between_boxescxx . . $ cvs/Comp#get_width_between_boxes(b126dc7c1de90089).() + get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).() + get_width_between_boxescxx . . $ cvs/Comp#get_width_between_boxes(b126dc7c1de90089).() + get_box_widthcxx . . $ cvs/Comp#get_box_width(b126dc7c1de90089).(), |
| 501 | get_box_heightcxx . . $ cvs/Comp#get_box_height(b126dc7c1de90089).(), |
| 502 | vol_val1cxx . . $ cvs/Comp#vol_val1., vol_val2cxx . . $ cvs/Comp#vol_val2.); |
| 503 | } |
| 504 | |
| 505 | #if 0 |
| 506 | Slider get_attack_slider_parms(){ |
| 507 | return Box( |
| 508 | 0,get_box_height() + 1, |
| 509 | width(), get_box_height() + get_slider_height() |
| 510 | attack_val,0.0f); |
| 511 | } |
| 512 | |
| 513 | Slider get_release_slider_parms(){ |
| 514 | return Box( |
| 515 | 0,get_box_height() + 1, |
| 516 | width(), get_box_height() + get_slider_height() |
| 517 | release_val,0.0f); |
| 518 | } |
| 519 | #endif |
| 520 | |
| 521 | double get_thresholdcxx . . $ cvs/Comp#get_threshold(31fa7155c10fdd13).(){ |
| 522 | return scalecxx . . $ scale(a4708ef16e45b76e).(in_val2cxx . . $ cvs/Comp#in_val2., |
| 523 | in_val1cxx . . $ cvs/Comp#in_val1.,1, |
| 524 | max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.); |
| 525 | } |
| 526 | |
| 527 | void set_threshold_guicxx . . $ cvs/Comp#set_threshold_gui(49f6e7a06ebc5aa8).(){ |
| 528 | set_thresholdcxx . . $ cvs/Comp#set_threshold(9364e6e7bff7660).(scalecxx . . $ scale(a4708ef16e45b76e).(get_compressor_parametercxx . . $ get_compressor_parameter(93d36f247079c9cd).(_patchcxx . . $ cvs/Comp#_patch., COMP_EFF_THRESHOLDcxx . . $ COMP_EFF_THRESHOLD.),max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.,in_val1cxx . . $ cvs/Comp#in_val1.,1)); |
| 529 | } |
| 530 | |
| 531 | double get_ratiocxx . . $ cvs/Comp#get_ratio(31fa7155c10fdd13).(){ |
| 532 | double len_in = in_val2cxx . . $ cvs/Comp#in_val2.-in_val1cxx . . $ cvs/Comp#in_val1.; |
| 533 | double len_out = out_val2cxx . . $ cvs/Comp#out_val2.-out_val1cxx . . $ cvs/Comp#out_val1.; |
| 534 | |
| 535 | if(len_in==0.0 && len_out==0.0) |
| 536 | return 1.0; |
| 537 | |
| 538 | if(len_out==0.0) |
| 539 | return 60; |
| 540 | |
| 541 | double ratio = fabscxx . . $ fabs(fee4f1d22bc8e617).(len_in-len_out)<0.00001 |
| 542 | ? 1.0 |
| 543 | : len_in / len_out; |
| 544 | |
| 545 | if(ratio>60) |
| 546 | ratio=60; |
| 547 | return ratio; |
| 548 | } |
| 549 | |
| 550 | void set_ratio_guicxx . . $ cvs/Comp#set_ratio_gui(49f6e7a06ebc5aa8).(){ |
| 551 | double ratio = get_compressor_parametercxx . . $ get_compressor_parameter(93d36f247079c9cd).(_patchcxx . . $ cvs/Comp#_patch., COMP_EFF_RATIOcxx . . $ COMP_EFF_RATIO.); |
| 552 | if(ratio<1.0){ |
| 553 | set_ratiocxx . . $ cvs/Comp#set_ratio(9364e6e7bff7660).(scalecxx . . $ scale(a4708ef16e45b76e).(ratio,1,0,0,-1)); |
| 554 | }else |
| 555 | set_ratiocxx . . $ cvs/Comp#set_ratio(9364e6e7bff7660).(out_val2cxx . . $ cvs/Comp#out_val2. - out_val2cxx . . $ cvs/Comp#out_val2./ratio); |
| 556 | } |
| 557 | |
| 558 | double get_makeup_gaincxx . . $ cvs/Comp#get_makeup_gain(31fa7155c10fdd13).(){ |
| 559 | return scalecxx . . $ scale(a4708ef16e45b76e).(vol_val1cxx . . $ cvs/Comp#vol_val1.,0,1,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.) - scalecxx . . $ scale(a4708ef16e45b76e).(out_val1cxx . . $ cvs/Comp#out_val1.,0,1,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.); |
| 560 | } |
| 561 | |
| 562 | // set_ratio must be called first. |
| 563 | void set_makeup_gain_guicxx . . $ cvs/Comp#set_makeup_gain_gui(49f6e7a06ebc5aa8).(){ |
| 564 | float vol = get_compressor_parametercxx . . $ get_compressor_parameter(93d36f247079c9cd).(_patchcxx . . $ cvs/Comp#_patch., COMP_EFF_OUTPUT_VOLUMEcxx . . $ COMP_EFF_OUTPUT_VOLUME.); |
| 565 | float addvol = scalecxx . . $ scale(a4708ef16e45b76e).(out_val1cxx . . $ cvs/Comp#out_val1.,0,1,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.) + vol; |
| 566 | set_makeupgaincxx . . $ cvs/Comp#set_makeupgain(9364e6e7bff7660).(scalecxx . . $ scale(a4708ef16e45b76e).(addvol,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.,0,1)); |
| 567 | } |
| 568 | |
| 569 | // After loading. |
| 570 | void set_gui_parameterscxx . . $ cvs/Comp#set_gui_parameters(49f6e7a06ebc5aa8).(){ |
| 571 | set_threshold_guicxx . . $ cvs/Comp#set_threshold_gui(49f6e7a06ebc5aa8).(); |
| 572 | set_ratio_guicxx . . $ cvs/Comp#set_ratio_gui(49f6e7a06ebc5aa8).(); |
| 573 | set_makeup_gain_guicxx . . $ cvs/Comp#set_makeup_gain_gui(49f6e7a06ebc5aa8).(); |
| 574 | } |
| 575 | |
| 576 | void set_compressor_parameterscxx . . $ cvs/Comp#set_compressor_parameters(49f6e7a06ebc5aa8).(){ |
| 577 | //double input_volume = 1.0; |
| 578 | double threshold = get_thresholdcxx . . $ cvs/Comp#get_threshold(31fa7155c10fdd13).(); |
| 579 | double ratio = get_ratiocxx . . $ cvs/Comp#get_ratio(31fa7155c10fdd13).(); |
| 580 | double output_volume = get_makeup_gaincxx . . $ cvs/Comp#get_makeup_gain(31fa7155c10fdd13).(); |
| 581 | |
| 582 | set_compressor_parametercxx . . $ set_compressor_parameter(11a1b181ddb9d33c).(_patchcxx . . $ cvs/Comp#_patch., COMP_EFF_RATIOcxx . . $ COMP_EFF_RATIO.,ratio); |
| 583 | set_compressor_parametercxx . . $ set_compressor_parameter(11a1b181ddb9d33c).(_patchcxx . . $ cvs/Comp#_patch., COMP_EFF_THRESHOLDcxx . . $ COMP_EFF_THRESHOLD., threshold); |
| 584 | //set_compressor_parameter(2,attack); |
| 585 | //set_compressor_parameter(3,release); |
| 586 | //set_compressor_parameter(4,input_volume); |
| 587 | set_compressor_parametercxx . . $ set_compressor_parameter(11a1b181ddb9d33c).(_patchcxx . . $ cvs/Comp#_patch., COMP_EFF_OUTPUT_VOLUMEcxx . . $ COMP_EFF_OUTPUT_VOLUME.,output_volume); |
| 588 | |
| 589 | #if 0 |
| 590 | printf("%f / %f\n%f / %f\n%f / %f\ninput_volume:\t\t %.2f\n" |
| 591 | "threshold:\t\t %f.2f\n" |
| 592 | "ratio:\t\t\t %f.2f\n" |
| 593 | "output_volume:\t\t %.2f\n\n",in_val2,out_val2,scale(vol_val1,0,1,max_db,min_db),scale(out_val1,0,1,max_db,min_db),vol_val1,out_val1, |
| 594 | input_volume, |
| 595 | threshold, |
| 596 | ratio, |
| 597 | output_volume); |
| 598 | #endif |
| 599 | } |
| 600 | |
| 601 | enumcxx . . $ cvs/Comp#$anonymous_type_0#{ |
| 602 | THRESHOLD_SLIDERcxx . . $ cvs/Comp#THRESHOLD_SLIDER. = 1, |
| 603 | RATIO_SLIDERcxx . . $ cvs/Comp#RATIO_SLIDER., |
| 604 | MAKEUPGAIN_SLIDERcxx . . $ cvs/Comp#MAKEUPGAIN_SLIDER. |
| 605 | }; |
| 606 | |
| 607 | double p_startposcxx . . $ cvs/Comp#p_startpos.; |
| 608 | int y_startposcxx . . $ cvs/Comp#y_startpos.; |
| 609 | |
| 610 | void set_makeupgaincxx . . $ cvs/Comp#set_makeupgain(9364e6e7bff7660).(float val){ |
| 611 | //double old = vol_val2; |
| 612 | vol_val1cxx . . $ cvs/Comp#vol_val1.=val; |
| 613 | #if 0 // allow this. |
| 614 | if(vol_val1<0.0) |
| 615 | vol_val1=0.0; |
| 616 | #endif |
| 617 | if(vol_val1cxx . . $ cvs/Comp#vol_val1.>0.9999) |
| 618 | vol_val1cxx . . $ cvs/Comp#vol_val1.=0.9999; |
| 619 | vol_val2cxx . . $ cvs/Comp#vol_val2. = vol_val1cxx . . $ cvs/Comp#vol_val1. + (out_val2cxx . . $ cvs/Comp#out_val2.-out_val1cxx . . $ cvs/Comp#out_val1.);// scale(out_val2, out_val1, 1.0, vol_val1, 1.0); |
| 620 | //printf("setting makeupgain to %f. old/new vol_val2: %f / %f\n",val,vol_val2,old); |
| 621 | } |
| 622 | |
| 623 | void set_ratiocxx . . $ cvs/Comp#set_ratio(9364e6e7bff7660).(float val){ |
| 624 | double vol_diff = vol_val1cxx . . $ cvs/Comp#vol_val1. - out_val1cxx . . $ cvs/Comp#out_val1.; |
| 625 | out_val1cxx . . $ cvs/Comp#out_val1.=val; |
| 626 | // if(out_val1<0.0) |
| 627 | // out_val1=0.0; |
| 628 | |
| 629 | if(out_val1cxx . . $ cvs/Comp#out_val1.<0){ |
| 630 | double threshold=get_compressor_parametercxx . . $ get_compressor_parameter(93d36f247079c9cd).(_patchcxx . . $ cvs/Comp#_patch., COMP_EFF_THRESHOLDcxx . . $ COMP_EFF_THRESHOLD.); //get_threshold(); |
| 631 | double threshold_scaled=scalecxx . . $ scale(a4708ef16e45b76e).(threshold,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.,0,1); |
| 632 | double ratio = scalecxx . . $ scale(a4708ef16e45b76e).(val,0,-1,1,0); //1.0 + val; // val is the out slider value, which goes from 0 to -1 when we are in expanding mode. |
| 633 | if(ratio<0.001) |
| 634 | ratio=0.001; |
| 635 | in_val1cxx . . $ cvs/Comp#in_val1. = ((ratio-1)*threshold_scaled) / (ratio*threshold_scaled - ratio - threshold_scaled); // From: i1 = i2*(1-ratio), i2=scale(threshold_scaled,0,1,i1,1), i1=in_va1, i2=in_val2 |
| 636 | out_val1cxx . . $ cvs/Comp#out_val1.=0.0; |
| 637 | if(in_val1cxx . . $ cvs/Comp#in_val1.>0.999) |
| 638 | in_val1cxx . . $ cvs/Comp#in_val1.=0.999; |
| 639 | in_val2cxx . . $ cvs/Comp#in_val2.=scalecxx . . $ scale(a4708ef16e45b76e).(threshold,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.,in_val1cxx . . $ cvs/Comp#in_val1.,1); |
| 640 | out_val2cxx . . $ cvs/Comp#out_val2.=in_val2cxx . . $ cvs/Comp#in_val2.; |
| 641 | }else{ |
| 642 | in_val1cxx . . $ cvs/Comp#in_val1.=0.0; |
| 643 | } |
| 644 | if(out_val1cxx . . $ cvs/Comp#out_val1.>in_val2cxx . . $ cvs/Comp#in_val2.-0.0001) |
| 645 | out_val1cxx . . $ cvs/Comp#out_val1.=in_val2cxx . . $ cvs/Comp#in_val2.-0.0001; |
| 646 | |
| 647 | set_makeupgaincxx . . $ cvs/Comp#set_makeupgain(9364e6e7bff7660).(vol_diff + out_val1cxx . . $ cvs/Comp#out_val1.); |
| 648 | } |
| 649 | |
| 650 | void set_thresholdcxx . . $ cvs/Comp#set_threshold(9364e6e7bff7660).(float val){ |
| 651 | //double bef=in_val2; |
| 652 | double old_inval1_scaled = scalecxx . . $ scale(a4708ef16e45b76e).(in_val1cxx . . $ cvs/Comp#in_val1.,0,in_val2cxx . . $ cvs/Comp#in_val2.,0,1); |
| 653 | double old_ratio_factor = out_val1cxx . . $ cvs/Comp#out_val1. / (in_val2cxx . . $ cvs/Comp#in_val2.-in_val1cxx . . $ cvs/Comp#in_val1.); |
| 654 | |
| 655 | in_val2cxx . . $ cvs/Comp#in_val2. = val; |
| 656 | if(in_val2cxx . . $ cvs/Comp#in_val2.<=0.0) |
| 657 | in_val2cxx . . $ cvs/Comp#in_val2.=0.00001; |
| 658 | if(in_val2cxx . . $ cvs/Comp#in_val2.>0.9999) |
| 659 | in_val2cxx . . $ cvs/Comp#in_val2.=0.9999; |
| 660 | |
| 661 | out_val2cxx . . $ cvs/Comp#out_val2. = in_val2cxx . . $ cvs/Comp#in_val2.; |
| 662 | |
| 663 | if(in_val1cxx . . $ cvs/Comp#in_val1.<=0.0){ |
| 664 | set_ratiocxx . . $ cvs/Comp#set_ratio(9364e6e7bff7660).(old_ratio_factor*in_val2cxx . . $ cvs/Comp#in_val2.); |
| 665 | }else{ |
| 666 | in_val1cxx . . $ cvs/Comp#in_val1. = scalecxx . . $ scale(a4708ef16e45b76e).(old_inval1_scaled,0,1,0,in_val2cxx . . $ cvs/Comp#in_val2.); |
| 667 | set_makeupgaincxx . . $ cvs/Comp#set_makeupgain(9364e6e7bff7660).(vol_val1cxx . . $ cvs/Comp#vol_val1.); |
| 668 | //printf("b %.2f - %.2f. Bef: %.2f, now: %.2f\n",in_val1,old_inval1_scaled,bef,in_val2); |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | void handle_mouse_eventcxx . . $ cvs/Comp#handle_mouse_event(3e454b8ccf442868). (int x, int y){ |
| 673 | //printf("Got mouse press event %d / %d\n",(int)event->x(),(int)event->y()); |
| 674 | |
| 675 | double new_val = p_startposcxx . . $ cvs/Comp#p_startpos. + scalecxx . . $ scale(a4708ef16e45b76e).(y-y_startposcxx . . $ cvs/Comp#y_startpos.,0,heightcxx . . $ cvs/MyWidget#height(b126dc7c1de90089).(),0,1); |
| 676 | //printf("p_startpos: %f\n",p_startpos); |
| 677 | |
| 678 | switch(curr_slidercxx . . $ cvs/Comp#curr_slider.){ |
| 679 | case THRESHOLD_SLIDERcxx . . $ cvs/Comp#THRESHOLD_SLIDER.: |
| 680 | set_thresholdcxx . . $ cvs/Comp#set_threshold(9364e6e7bff7660).(new_val); |
| 681 | break; |
| 682 | case RATIO_SLIDERcxx . . $ cvs/Comp#RATIO_SLIDER.: |
| 683 | set_ratiocxx . . $ cvs/Comp#set_ratio(9364e6e7bff7660).(new_val); |
| 684 | break; |
| 685 | case MAKEUPGAIN_SLIDERcxx . . $ cvs/Comp#MAKEUPGAIN_SLIDER.: |
| 686 | set_makeupgaincxx . . $ cvs/Comp#set_makeupgain(9364e6e7bff7660).(new_val); |
| 687 | break; |
| 688 | } |
| 689 | |
| 690 | set_compressor_parameterscxx . . $ cvs/Comp#set_compressor_parameters(49f6e7a06ebc5aa8).(); |
| 691 | |
| 692 | background_image_must_be_updatedcxx . . $ cvs/Comp#background_image_must_be_updated.=true; |
| 693 | updatecxx . . $ cvs/MyWidget#update(49f6e7a06ebc5aa8).(); |
| 694 | } |
| 695 | |
| 696 | bool mousePresscxx . . $ cvs/Comp#mousePress(cf9ef193275fa6d8).(int x, int y){ |
| 697 | Boxcxx . . $ cvs/Comp#Box# in_box = get_slider1_parmscxx . . $ cvs/Comp#get_slider1_parms(6efcad09bf3cfa57).(); |
| 698 | Boxcxx . . $ cvs/Comp#Box# out_box = get_slider2_parmscxx . . $ cvs/Comp#get_slider2_parms(6efcad09bf3cfa57).(); |
| 699 | Boxcxx . . $ cvs/Comp#Box# vol_box = get_slider3_parmscxx . . $ cvs/Comp#get_slider3_parms(6efcad09bf3cfa57).(); |
| 700 | |
| 701 | if(in_box.insidecxx . . $ cvs/Comp#Box#inside(cf9ef193275fa6d8).(x,y)){ |
| 702 | #ifdef COMPILING_RADIUM |
| 703 | SoundPlugin *plugin = (SoundPlugin*)_patch->patchdata; |
| 704 | Undo_AudioEffect_CurrPos(_patch, plugin->type->num_effects+EFFNUM_COMP_THRESHOLD); |
| 705 | #endif |
| 706 | |
| 707 | curr_slidercxx . . $ cvs/Comp#curr_slider. = THRESHOLD_SLIDERcxx . . $ cvs/Comp#THRESHOLD_SLIDER.; |
| 708 | p_startposcxx . . $ cvs/Comp#p_startpos. = in_box.p2cxx . . $ cvs/Comp#Box#p2.; |
| 709 | |
| 710 | }else if(out_box.insidecxx . . $ cvs/Comp#Box#inside(cf9ef193275fa6d8).(x,y)){ |
| 711 | #ifdef COMPILING_RADIUM |
| 712 | SoundPlugin *plugin = (SoundPlugin*)_patch->patchdata; |
| 713 | Undo_AudioEffect_CurrPos(_patch, plugin->type->num_effects+EFFNUM_COMP_RATIO); |
| 714 | #endif |
| 715 | |
| 716 | curr_slidercxx . . $ cvs/Comp#curr_slider. = RATIO_SLIDERcxx . . $ cvs/Comp#RATIO_SLIDER.; |
| 717 | if(in_box.p1cxx . . $ cvs/Comp#Box#p1.>0){ |
| 718 | p_startposcxx . . $ cvs/Comp#p_startpos. = scalecxx . . $ scale(a4708ef16e45b76e).(in_box.p1cxx . . $ cvs/Comp#Box#p1.,0,in_box.p2cxx . . $ cvs/Comp#Box#p2.,0,-heightcxx . . $ cvs/MyWidget#height(b126dc7c1de90089).()); |
| 719 | }else{ |
| 720 | p_startposcxx . . $ cvs/Comp#p_startpos. = out_box.p1cxx . . $ cvs/Comp#Box#p1.; |
| 721 | } |
| 722 | |
| 723 | }else if(vol_box.insidecxx . . $ cvs/Comp#Box#inside(cf9ef193275fa6d8).(x,y)){ |
| 724 | #ifdef COMPILING_RADIUM |
| 725 | SoundPlugin *plugin = (SoundPlugin*)_patch->patchdata; |
| 726 | Undo_AudioEffect_CurrPos(_patch, plugin->type->num_effects+EFFNUM_COMP_OUTPUT_VOLUME); |
| 727 | #endif |
| 728 | |
| 729 | curr_slidercxx . . $ cvs/Comp#curr_slider. = MAKEUPGAIN_SLIDERcxx . . $ cvs/Comp#MAKEUPGAIN_SLIDER.; |
| 730 | p_startposcxx . . $ cvs/Comp#p_startpos. = vol_box.p1cxx . . $ cvs/Comp#Box#p1.; |
| 731 | |
| 732 | } else { |
| 733 | return false; |
| 734 | } |
| 735 | |
| 736 | p_startposcxx . . $ cvs/Comp#p_startpos. = scalecxx . . $ scale(a4708ef16e45b76e).(p_startposcxx . . $ cvs/Comp#p_startpos.,0,heightcxx . . $ cvs/MyWidget#height(b126dc7c1de90089).(),0,1); |
| 737 | y_startposcxx . . $ cvs/Comp#y_startpos. = y; |
| 738 | |
| 739 | return true; |
| 740 | } |
| 741 | |
| 742 | bool mouseMovecxx . . $ cvs/Comp#mouseMove(cf9ef193275fa6d8). (int x, int y) |
| 743 | { |
| 744 | handle_mouse_eventcxx . . $ cvs/Comp#handle_mouse_event(3e454b8ccf442868).(x,y); |
| 745 | return true; |
| 746 | } |
| 747 | |
| 748 | bool mouseReleasecxx . . $ cvs/Comp#mouseRelease(cf9ef193275fa6d8). (int x, int y) |
| 749 | { |
| 750 | handle_mouse_eventcxx . . $ cvs/Comp#handle_mouse_event(3e454b8ccf442868).(x,y); |
| 751 | curr_slidercxx . . $ cvs/Comp#curr_slider. = 0; |
| 752 | return true; |
| 753 | } |
| 754 | |
| 755 | void paint_boxcxx . . $ cvs/Comp#paint_box(794e6a4ef9e74bce).(MyPaintercxx . . $ cvs/MyPainter# *p, const Boxcxx . . $ cvs/Comp#Box# &b, const MyColorcxx . . $ cvs/MyColor# &col){ |
| 756 | p->drawRectcxx . . $ cvs/MyPainter#drawRect(8d721085ee12c0d8).(b.x1cxx . . $ cvs/Comp#Box#x1., b.y1cxx . . $ cvs/Comp#Box#y1., |
| 757 | b.x2cxx . . $ cvs/Comp#Box#x2., b.y2cxx . . $ cvs/Comp#Box#y2., |
| 758 | col); |
| 759 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(8d721085ee12c0d8).(b.x1cxx . . $ cvs/Comp#Box#x1.,b.p1cxx . . $ cvs/Comp#Box#p1., |
| 760 | b.x2cxx . . $ cvs/Comp#Box#x2.,b.p1cxx . . $ cvs/Comp#Box#p1., |
| 761 | col); |
| 762 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(8d721085ee12c0d8).(b.x1cxx . . $ cvs/Comp#Box#x1.,b.p2cxx . . $ cvs/Comp#Box#p2., |
| 763 | b.x2cxx . . $ cvs/Comp#Box#x2.,b.p2cxx . . $ cvs/Comp#Box#p2., |
| 764 | col); |
| 765 | } |
| 766 | |
| 767 | #if 0 |
| 768 | void paint_slider(MyPainter *p, const Slider &s, const MyColor &col){ |
| 769 | p->drawRect(s.x1, s.y1, |
| 770 | s.x2, s.y2); |
| 771 | p->drawLine(s.x1,s.p1, |
| 772 | s.x2,s.p1); |
| 773 | } |
| 774 | #endif |
| 775 | |
| 776 | void paint_gradient_rectanglecxx . . $ cvs/Comp#paint_gradient_rectangle(3cb28bebe20c6bcc).(MyPaintercxx . . $ cvs/MyPainter# *p, const int x1, const int y1, const int x2, const int y2, const MyColorcxx . . $ cvs/MyColor# &c1, const MyColorcxx . . $ cvs/MyColor# &c2){ |
| 777 | #if 0 |
| 778 | for(int y=y1;y<y2;y++){ |
| 779 | p->setPen(mix_colors(c1,c2,scale(y, y1, y2, 1.0f,0.0f))); |
| 780 | p->drawLine(x1,y,x2,y); |
| 781 | } |
| 782 | #else |
| 783 | p->setGradientcxx . . $ cvs/MyPainter#setGradient(41cb549beba415bb).(0,y1,0,y2,c1,c2); |
| 784 | p->fillRectcxx . . $ cvs/MyPainter#fillRect(8d721085ee12c0d8).(x1, y1, x2 ,y2, c1); |
| 785 | p->unsetGradientcxx . . $ cvs/MyPainter#unsetGradient(49f6e7a06ebc5aa8).(); |
| 786 | #endif |
| 787 | } |
| 788 | |
| 789 | void paint_gradient_trapezoidcxx . . $ cvs/Comp#paint_gradient_trapezoid(61a3232f9f805cea).(MyPaintercxx . . $ cvs/MyPainter# *p, const int x1, const int y1_1, const int y1_2, const int x2, const int y2_1, const int y2_2, const int min_y, const int max_y, const MyColorcxx . . $ cvs/MyColor# &c1, const MyColorcxx . . $ cvs/MyColor# &c2){ |
| 790 | #if 0 |
| 791 | if(y1_2-y1_1 >= y2_2-y2_1) |
| 792 | for(int y1=y1_1;y1<y1_2;y1++){ |
| 793 | int y2=scale(y1,y1_1,y1_2,y2_1,y2_2); |
| 794 | p->setPen(mix_colors(c1,c2,scale(y1, y1_1,y1_2, 1.0f,0.0f))); |
| 795 | p->drawLine(x1,y1,x2,y2); |
| 796 | } |
| 797 | else |
| 798 | for(int y2=y2_1;y2<y2_2;y2++){ |
| 799 | int y1=scale(y2,y2_1,y2_2,y1_1,y1_2); |
| 800 | p->setPen(mix_colors(c1,c2,scale(y2, y2_1,y2_2, 1.0f,0.0f))); |
| 801 | p->drawLine(x1,y1,x2,y2); |
| 802 | } |
| 803 | #else |
| 804 | for(int x=x1;x<x2;x++){ |
| 805 | int y1=scalecxx . . $ scale(a4708ef16e45b76e).(x,x1,x2,y1_1,y2_1); |
| 806 | int y2=scalecxx . . $ scale(a4708ef16e45b76e).(x,x1,x2,y1_2,y2_2); |
| 807 | |
| 808 | p->setGradientcxx . . $ cvs/MyPainter#setGradient(41cb549beba415bb).(x,y1,x,y2,c1,c2); |
| 809 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(8d721085ee12c0d8).(x,R_BOUNDARIEScxx . . $ `common/nsmtracker.h:104:9`!(min_y,y1,max_y),x,R_BOUNDARIEScxx . . $ `common/nsmtracker.h:104:9`!(min_y,y2,max_y),c1); |
| 810 | } |
| 811 | p->unsetGradientcxx . . $ cvs/MyPainter#unsetGradient(49f6e7a06ebc5aa8).(); |
| 812 | #endif |
| 813 | } |
| 814 | |
| 815 | void paint_gradientcxx . . $ cvs/Comp#paint_gradient(1255730781554802).(MyPaintercxx . . $ cvs/MyPainter# *p, const Boxcxx . . $ cvs/Comp#Box# &in, const Boxcxx . . $ cvs/Comp#Box# &out, const Boxcxx . . $ cvs/Comp#Box# &vol){ |
| 816 | #if 0 // for testing if clipping is accurate |
| 817 | QColor col1(qrand()%255,qrand()%255,qrand()%255); |
| 818 | QColor col2(qrand()%255,qrand()%255,qrand()%255); |
| 819 | #else |
| 820 | MyColorcxx . . $ cvs/MyColor# col1cxx . . $ cvs/MyColor#MyColor(b1146eedae1e1d0b).(30,170,33); |
| 821 | MyColorcxx . . $ cvs/MyColor# col2cxx . . $ cvs/MyColor#MyColor(b1146eedae1e1d0b).(159,58,33); |
| 822 | #endif |
| 823 | col2=cxx . . $ cvs/MyColor#`operator=`(13a50e9053038475).col2.lightercxx . . $ cvs/MyColor#lighter(372ef7c421a52c36).(80); |
| 824 | |
| 825 | col1 =cxx . . $ cvs/MyColor#`operator=`(13a50e9053038475). col1.lightercxx . . $ cvs/MyColor#lighter(372ef7c421a52c36).(80); |
| 826 | col2 =cxx . . $ cvs/MyColor#`operator=`(13a50e9053038475). col2.lightercxx . . $ cvs/MyColor#lighter(372ef7c421a52c36).(60); |
| 827 | |
| 828 | //col1.setAlpha(120); |
| 829 | //col2.setAlpha(180); |
| 830 | |
| 831 | if(!isEnabledcxx . . $ cvs/MyWidget#isEnabled(c9857a73d68e59ba).()){ |
| 832 | //col1.setAlpha(40); |
| 833 | //col2.setAlpha(40); |
| 834 | col1 =cxx . . $ cvs/MyColor#`operator=`(13a50e9053038475). mix_colorscxx . . $ cvs/mix_colors(5beb090e9530825b).(col1, MyColorcxx . . $ cvs/MyColor#MyColor(49f6e7a06ebc5aa8).(), 0.4); |
| 835 | col2 =cxx . . $ cvs/MyColor#`operator=`(13a50e9053038475). mix_colorscxx . . $ cvs/mix_colors(5beb090e9530825b).(col2, MyColorcxx . . $ cvs/MyColor#MyColor(49f6e7a06ebc5aa8).(), 0.4); |
| 836 | }else{ |
| 837 | col1 =cxx . . $ cvs/MyColor#`operator=`(13a50e9053038475). mix_colorscxx . . $ cvs/mix_colors(5beb090e9530825b).(col1, MyColorcxx . . $ cvs/MyColor#MyColor(49f6e7a06ebc5aa8).(), 0.8); |
| 838 | col2 =cxx . . $ cvs/MyColor#`operator=`(13a50e9053038475). mix_colorscxx . . $ cvs/mix_colors(5beb090e9530825b).(col2, MyColorcxx . . $ cvs/MyColor#MyColor(49f6e7a06ebc5aa8).(), 0.8); |
| 839 | } |
| 840 | |
| 841 | // in slider |
| 842 | paint_gradient_rectanglecxx . . $ cvs/Comp#paint_gradient_rectangle(3cb28bebe20c6bcc).(p, in.x1cxx . . $ cvs/Comp#Box#x1.,in.p1cxx . . $ cvs/Comp#Box#p1., in.x2cxx . . $ cvs/Comp#Box#x2.,in.y2cxx . . $ cvs/Comp#Box#y2., col1, col2); |
| 843 | |
| 844 | float in_val = scalecxx . . $ scale(a4708ef16e45b76e).(in_val2cxx . . $ cvs/Comp#in_val2.,in_val1cxx . . $ cvs/Comp#in_val1.,1.0f,0.0f,1.0f); |
| 845 | MyColorcxx . . $ cvs/MyColor# col = mix_colorscxx . . $ cvs/mix_colors(5beb090e9530825b).(col1,col2,1.0f-in_val); |
| 846 | |
| 847 | // out slider top |
| 848 | paint_gradient_rectanglecxx . . $ cvs/Comp#paint_gradient_rectangle(3cb28bebe20c6bcc).(p, out.x1cxx . . $ cvs/Comp#Box#x1.,out.p1cxx . . $ cvs/Comp#Box#p1., out.x2cxx . . $ cvs/Comp#Box#x2.,out.p2cxx . . $ cvs/Comp#Box#p2., col1,col); |
| 849 | |
| 850 | // out slider bot. |
| 851 | paint_gradient_rectanglecxx . . $ cvs/Comp#paint_gradient_rectangle(3cb28bebe20c6bcc).(p, out.x1cxx . . $ cvs/Comp#Box#x1.,out.p2cxx . . $ cvs/Comp#Box#p2., out.x2cxx . . $ cvs/Comp#Box#x2.,out.y2cxx . . $ cvs/Comp#Box#y2., col, col2); |
| 852 | |
| 853 | // area between in slider and out slider, below threshold |
| 854 | paint_gradient_rectanglecxx . . $ cvs/Comp#paint_gradient_rectangle(3cb28bebe20c6bcc).(p, in.x2cxx . . $ cvs/Comp#Box#x2.,in.p2cxx . . $ cvs/Comp#Box#p2., out.x1cxx . . $ cvs/Comp#Box#x1.,out.y2cxx . . $ cvs/Comp#Box#y2., col, col2); |
| 855 | |
| 856 | // area between in slider and out slider, above threshold |
| 857 | paint_gradient_trapezoidcxx . . $ cvs/Comp#paint_gradient_trapezoid(61a3232f9f805cea).(p, in.x2cxx . . $ cvs/Comp#Box#x2.,in.p1cxx . . $ cvs/Comp#Box#p1.,in.p2cxx . . $ cvs/Comp#Box#p2., out.x1cxx . . $ cvs/Comp#Box#x1.,out.p1cxx . . $ cvs/Comp#Box#p1.,out.p2cxx . . $ cvs/Comp#Box#p2., out.y1cxx . . $ cvs/Comp#Box#y1., out.y2cxx . . $ cvs/Comp#Box#y2., col1, col); |
| 858 | |
| 859 | // volume slider |
| 860 | { |
| 861 | int p1 = vol.p1cxx . . $ cvs/Comp#Box#p1.; |
| 862 | int p2 = vol.p2cxx . . $ cvs/Comp#Box#p2.;//scale(out.p2, out.p1, out.y2, vol.p1, vol.y2); |
| 863 | int p3 = p2 + (out.y2cxx . . $ cvs/Comp#Box#y2.-out.p2cxx . . $ cvs/Comp#Box#p2.); |
| 864 | |
| 865 | // top |
| 866 | paint_gradient_rectanglecxx . . $ cvs/Comp#paint_gradient_rectangle(3cb28bebe20c6bcc).(p, vol.x1cxx . . $ cvs/Comp#Box#x1.,p1, vol.x2cxx . . $ cvs/Comp#Box#x2.,p2, col1, col); |
| 867 | |
| 868 | // middle. |
| 869 | paint_gradient_rectanglecxx . . $ cvs/Comp#paint_gradient_rectangle(3cb28bebe20c6bcc).(p, vol.x1cxx . . $ cvs/Comp#Box#x1.,p2, vol.x2cxx . . $ cvs/Comp#Box#x2.,p3, col, col2); |
| 870 | |
| 871 | //QColor col3=col2.light(scale(p3,vol.y2,vol.y1,100,40)); |
| 872 | MyColorcxx . . $ cvs/MyColor# col3=mix_colorscxx . . $ cvs/mix_colors(5beb090e9530825b).(col2,MyColorcxx . . $ cvs/MyColor#MyColor(b1146eedae1e1d0b).(1,1,1),R_BOUNDARIEScxx . . $ `common/nsmtracker.h:104:9`!(0.0f, scale(p3,vol.y2,vol.y1,1.0f,0.0f), 1.0f)); |
| 873 | |
| 874 | // bot. |
| 875 | paint_gradient_rectanglecxx . . $ cvs/Comp#paint_gradient_rectangle(3cb28bebe20c6bcc).(p, vol.x1cxx . . $ cvs/Comp#Box#x1.,p3, vol.x2cxx . . $ cvs/Comp#Box#x2.,vol.y2cxx . . $ cvs/Comp#Box#y2., col2, col3); |
| 876 | |
| 877 | // area between out slider and vol slider, above threshold |
| 878 | paint_gradient_trapezoidcxx . . $ cvs/Comp#paint_gradient_trapezoid(61a3232f9f805cea).(p, |
| 879 | out.x2cxx . . $ cvs/Comp#Box#x2., out.p1cxx . . $ cvs/Comp#Box#p1., out.p2cxx . . $ cvs/Comp#Box#p2., |
| 880 | vol.x1cxx . . $ cvs/Comp#Box#x1., vol.p1cxx . . $ cvs/Comp#Box#p1., vol.p2cxx . . $ cvs/Comp#Box#p2., |
| 881 | vol.y1cxx . . $ cvs/Comp#Box#y1., vol.y2cxx . . $ cvs/Comp#Box#y2., |
| 882 | col1,col); |
| 883 | |
| 884 | // area between out slider and vol slider, below threshold, colors in the col-col2 range. |
| 885 | paint_gradient_trapezoidcxx . . $ cvs/Comp#paint_gradient_trapezoid(61a3232f9f805cea).(p, |
| 886 | out.x2cxx . . $ cvs/Comp#Box#x2., out.p2cxx . . $ cvs/Comp#Box#p2.,out.y2cxx . . $ cvs/Comp#Box#y2., |
| 887 | vol.x1cxx . . $ cvs/Comp#Box#x1., p2,p3, |
| 888 | vol.y1cxx . . $ cvs/Comp#Box#y1., vol.y2cxx . . $ cvs/Comp#Box#y2., |
| 889 | col,col2); |
| 890 | |
| 891 | // area between out slider and vol slider, further below threshold, colors in the col2-col3 range. |
| 892 | if(p3 < vol.y2cxx . . $ cvs/Comp#Box#y2.) |
| 893 | paint_gradient_trapezoidcxx . . $ cvs/Comp#paint_gradient_trapezoid(61a3232f9f805cea).(p, |
| 894 | out.x2cxx . . $ cvs/Comp#Box#x2., out.y2cxx . . $ cvs/Comp#Box#y2., out.y2cxx . . $ cvs/Comp#Box#y2. + (vol.y2cxx . . $ cvs/Comp#Box#y2.-p2), |
| 895 | vol.x1cxx . . $ cvs/Comp#Box#x1., p3, vol.y2cxx . . $ cvs/Comp#Box#y2., |
| 896 | vol.y1cxx . . $ cvs/Comp#Box#y1., vol.y2cxx . . $ cvs/Comp#Box#y2., |
| 897 | col2,col3); |
| 898 | } |
| 899 | } |
| 900 | |
| 901 | |
| 902 | // Called regularly |
| 903 | void update_peakscxx . . $ cvs/Comp#update_peaks(49f6e7a06ebc5aa8).(){ |
| 904 | Boxcxx . . $ cvs/Comp#Box# in_box = get_slider1_parmscxx . . $ cvs/Comp#get_slider1_parms(6efcad09bf3cfa57).(); |
| 905 | Boxcxx . . $ cvs/Comp#Box# out_box = get_slider2_parmscxx . . $ cvs/Comp#get_slider2_parms(6efcad09bf3cfa57).(); |
| 906 | Boxcxx . . $ cvs/Comp#Box# vol_box = get_slider3_parmscxx . . $ cvs/Comp#get_slider3_parms(6efcad09bf3cfa57).(); |
| 907 | |
| 908 | in_peak_valuecxx . . $ cvs/Comp#in_peak_value. = get_graph_valuecxx . . $ get_graph_value(93d36f247079c9cd).(_patchcxx . . $ cvs/Comp#_patch., 0); |
| 909 | out_peak_valuecxx . . $ cvs/Comp#out_peak_value. = in_peak_valuecxx . . $ cvs/Comp#in_peak_value. + get_graph_valuecxx . . $ get_graph_value(93d36f247079c9cd).(_patchcxx . . $ cvs/Comp#_patch., 1); |
| 910 | vol_peak_valuecxx . . $ cvs/Comp#vol_peak_value. = out_peak_valuecxx . . $ cvs/Comp#out_peak_value. + get_makeup_gaincxx . . $ cvs/Comp#get_makeup_gain(31fa7155c10fdd13).(); |
| 911 | |
| 912 | //printf("in_peak_value: %f. out: %f, vol: %f\n",in_peak_value,out_peak_value,vol_peak_value); |
| 913 | |
| 914 | // update old line boxes |
| 915 | peaks_incxx . . $ cvs/Comp#peaks_in..update_line_rectcxx . . $ cvs/Comp#Peaks#update_line_rect(24bd9f68b6058885).(this,in_box); |
| 916 | peaks_outcxx . . $ cvs/Comp#peaks_out..update_line_rectcxx . . $ cvs/Comp#Peaks#update_line_rect(24bd9f68b6058885).(this,out_box); |
| 917 | peaks_volcxx . . $ cvs/Comp#peaks_vol..update_line_rectcxx . . $ cvs/Comp#Peaks#update_line_rect(24bd9f68b6058885).(this,vol_box); |
| 918 | |
| 919 | // update old lines between boxes |
| 920 | peaks_incxx . . $ cvs/Comp#peaks_in..update_line_regioncxx . . $ cvs/Comp#Peaks#update_line_region(e10f29e97b22a345).(this,in_box,&peaks_outcxx . . $ cvs/Comp#peaks_out.,out_box); |
| 921 | peaks_outcxx . . $ cvs/Comp#peaks_out..update_line_regioncxx . . $ cvs/Comp#Peaks#update_line_region(e10f29e97b22a345).(this,out_box,&peaks_volcxx . . $ cvs/Comp#peaks_vol.,vol_box); |
| 922 | |
| 923 | // Add new peaks, and update areas in boxes (both old and new) |
| 924 | peaks_incxx . . $ cvs/Comp#peaks_in..add_peaks_and_update_areacxx . . $ cvs/Comp#Peaks#add_peaks_and_update_area(c093588ac79ae149).(this,in_box, scalecxx . . $ scale(a4708ef16e45b76e).(scalecxx . . $ scale(a4708ef16e45b76e).(in_peak_valuecxx . . $ cvs/Comp#in_peak_value.,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.,in_val1cxx . . $ cvs/Comp#in_val1.,1),0,1,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.)); |
| 925 | peaks_outcxx . . $ cvs/Comp#peaks_out..add_peaks_and_update_areacxx . . $ cvs/Comp#Peaks#add_peaks_and_update_area(c093588ac79ae149).(this,out_box,scalecxx . . $ scale(a4708ef16e45b76e).(scalecxx . . $ scale(a4708ef16e45b76e).(out_peak_valuecxx . . $ cvs/Comp#out_peak_value.,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.,in_val1cxx . . $ cvs/Comp#in_val1.,1),0,1,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.)); |
| 926 | peaks_volcxx . . $ cvs/Comp#peaks_vol..add_peaks_and_update_areacxx . . $ cvs/Comp#Peaks#add_peaks_and_update_area(c093588ac79ae149).(this,vol_box,scalecxx . . $ scale(a4708ef16e45b76e).(scalecxx . . $ scale(a4708ef16e45b76e).(vol_peak_valuecxx . . $ cvs/Comp#vol_peak_value.,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.,in_val1cxx . . $ cvs/Comp#in_val1.,1),0,1,max_dbcxx . . $ max_db.,min_dbcxx . . $ min_db.)); |
| 927 | |
| 928 | // update new lines between boxes |
| 929 | peaks_incxx . . $ cvs/Comp#peaks_in..update_line_regioncxx . . $ cvs/Comp#Peaks#update_line_region(e10f29e97b22a345).(this,in_box,&peaks_outcxx . . $ cvs/Comp#peaks_out.,out_box); |
| 930 | peaks_outcxx . . $ cvs/Comp#peaks_out..update_line_regioncxx . . $ cvs/Comp#Peaks#update_line_region(e10f29e97b22a345).(this,out_box,&peaks_volcxx . . $ cvs/Comp#peaks_vol.,vol_box); |
| 931 | |
| 932 | // update new line boxes |
| 933 | peaks_incxx . . $ cvs/Comp#peaks_in..update_line_rectcxx . . $ cvs/Comp#Peaks#update_line_rect(24bd9f68b6058885).(this,in_box); |
| 934 | peaks_outcxx . . $ cvs/Comp#peaks_out..update_line_rectcxx . . $ cvs/Comp#Peaks#update_line_rect(24bd9f68b6058885).(this,out_box); |
| 935 | peaks_volcxx . . $ cvs/Comp#peaks_vol..update_line_rectcxx . . $ cvs/Comp#Peaks#update_line_rect(24bd9f68b6058885).(this,vol_box); |
| 936 | } |
| 937 | |
| 938 | void paintPeakscxx . . $ cvs/Comp#paintPeaks(1255730781554802).(MyPaintercxx . . $ cvs/MyPainter# *p, const Boxcxx . . $ cvs/Comp#Box# &in_box, const Boxcxx . . $ cvs/Comp#Box# &out_box, const Boxcxx . . $ cvs/Comp#Box# &vol_box){ |
| 939 | |
| 940 | // peak lines |
| 941 | { |
| 942 | MyColorcxx . . $ cvs/MyColor# colcxx . . $ cvs/MyColor#MyColor(b1146eedae1e1d0b).(0,90,180); |
| 943 | col =cxx . . $ cvs/MyColor#`operator=`(13a50e9053038475). col.lightercxx . . $ cvs/MyColor#lighter(372ef7c421a52c36).(60); |
| 944 | col.setAlphacxx . . $ cvs/MyColor#setAlpha(d4f767463ce0a6b3).(130); |
| 945 | |
| 946 | p->setThicknesscxx . . $ cvs/MyPainter#setThickness(d4f767463ce0a6b3).(4); |
| 947 | |
| 948 | // paint lines |
| 949 | { |
| 950 | // in |
| 951 | peaks_incxx . . $ cvs/Comp#peaks_in..paint_peak_linecxx . . $ cvs/Comp#Peaks#paint_peak_line(794e6a4ef9e74bce).(p, in_box, col); |
| 952 | |
| 953 | // between in and out |
| 954 | peaks_incxx . . $ cvs/Comp#peaks_in..paint_peak_line_between_boxescxx . . $ cvs/Comp#Peaks#paint_peak_line_between_boxes(c845baf7be70d3a4).(p, in_box, &peaks_outcxx . . $ cvs/Comp#peaks_out., out_box, col); |
| 955 | |
| 956 | // out |
| 957 | peaks_outcxx . . $ cvs/Comp#peaks_out..paint_peak_linecxx . . $ cvs/Comp#Peaks#paint_peak_line(794e6a4ef9e74bce).(p, out_box, col); |
| 958 | |
| 959 | // between out and vol |
| 960 | peaks_outcxx . . $ cvs/Comp#peaks_out..paint_peak_line_between_boxescxx . . $ cvs/Comp#Peaks#paint_peak_line_between_boxes(c845baf7be70d3a4).(p, out_box, &peaks_volcxx . . $ cvs/Comp#peaks_vol., vol_box, col); |
| 961 | |
| 962 | // vol |
| 963 | peaks_volcxx . . $ cvs/Comp#peaks_vol..paint_peak_linecxx . . $ cvs/Comp#Peaks#paint_peak_line(794e6a4ef9e74bce).(p, vol_box, col); |
| 964 | } |
| 965 | |
| 966 | p->setThicknesscxx . . $ cvs/MyPainter#setThickness(d4f767463ce0a6b3).(1); |
| 967 | } |
| 968 | |
| 969 | // peak areas |
| 970 | { |
| 971 | peaks_incxx . . $ cvs/Comp#peaks_in..paint_peak_areacxx . . $ cvs/Comp#Peaks#paint_peak_area(10f03e368187e287).(p,in_box); |
| 972 | peaks_outcxx . . $ cvs/Comp#peaks_out..paint_peak_areacxx . . $ cvs/Comp#Peaks#paint_peak_area(10f03e368187e287).(p,out_box); |
| 973 | peaks_volcxx . . $ cvs/Comp#peaks_vol..paint_peak_areacxx . . $ cvs/Comp#Peaks#paint_peak_area(10f03e368187e287).(p,vol_box); |
| 974 | } |
| 975 | |
| 976 | #if 0 // for checking that get_line_region returns correct value. |
| 977 | p->setPen(QPen()); |
| 978 | p->drawPolygon(peaks_in.get_line_region(in_box,&peaks_out,out_box)); |
| 979 | p->drawPolygon(peaks_out.get_line_region(out_box,&peaks_vol,vol_box)); |
| 980 | #endif |
| 981 | } |
| 982 | |
| 983 | void paintSliderTextcxx . . $ cvs/Comp#paintSliderText(b9b3a0b05c113359).(MyPaintercxx . . $ cvs/MyPainter# *p, const Boxcxx . . $ cvs/Comp#Box# &box, stdcxx . . $ std/::stringcxx . . $ std/string# text, double value, stdcxx . . $ std/::stringcxx . . $ std/string# unit){ |
| 984 | MyColorcxx . . $ cvs/MyColor# ccxx . . $ cvs/MyColor#MyColor(d4f767463ce0a6b3).(1); |
| 985 | c.setAlphacxx . . $ cvs/MyColor#setAlpha(d4f767463ce0a6b3).(160); |
| 986 | if(!isEnabledcxx . . $ cvs/MyWidget#isEnabled(c9857a73d68e59ba).()) |
| 987 | c.setAlphacxx . . $ cvs/MyColor#setAlpha(d4f767463ce0a6b3).(80); |
| 988 | |
| 989 | char temp[32]; |
| 990 | sprintf(temp,"%.1f",value); |
| 991 | stdcxx . . $ std/::stringcxx . . $ std/string# value_text = temp +cxx . . $ std/operator+(42c652dfebe55ad7). unit; |
| 992 | stdcxx . . $ std/::stringcxx . . $ std/string# one_line = text +cxx . . $ std/operator+(40fc1db9226233c6). " " +cxx . . $ std/operator+(db5dc2ea912c6495). value_text; |
| 993 | |
| 994 | MyRect rect(box.x1cxx . . $ cvs/Comp#Box#x1.+2,box.y1cxx . . $ cvs/Comp#Box#y1.+2,box.x2cxx . . $ cvs/Comp#Box#x2.-4,box.y2cxx . . $ cvs/Comp#Box#y2.-4); |
| 995 | |
| 996 | if(p->getTextWidthcxx . . $ cvs/MyPainter#getTextWidth(89800cbf2a9b278f).(textcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).) < rect.width() && p->getTextWidthcxx . . $ cvs/MyPainter#getTextWidth(89800cbf2a9b278f).(value_textcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).) < rect.width()){ |
| 997 | // horizontal |
| 998 | |
| 999 | p->drawTextcxx . . $ cvs/MyPainter#drawText(6615cf30cb3ea5f3).(rect, p->getTextWidthcxx . . $ cvs/MyPainter#getTextWidth(89800cbf2a9b278f).(one_linecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).)<rect.width() |
| 1000 | ? one_linecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5). |
| 1001 | : text+cxx . . $ std/operator+(40fc1db9226233c6)."\n"+cxx . . $ std/operator+(db5dc2ea912c6495).value_text, |
| 1002 | c); |
| 1003 | |
| 1004 | }else{ |
| 1005 | |
| 1006 | p->drawVerticalTextcxx . . $ cvs/MyPainter#drawVerticalText(6a04f36f6088565a).(box.x1cxx . . $ cvs/Comp#Box#x1.,box.y1cxx . . $ cvs/Comp#Box#y1.,one_linecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).,c); |
| 1007 | |
| 1008 | } |
| 1009 | //p->drawText(box.x1,box.y2-20,QString::number(value)); |
| 1010 | } |
| 1011 | |
| 1012 | void paint_box_fillcxx . . $ cvs/Comp#paint_box_fill(10f03e368187e287).(MyPaintercxx . . $ cvs/MyPainter# *p, const Boxcxx . . $ cvs/Comp#Box# &box){ |
| 1013 | MyColorcxx . . $ cvs/MyColor# colcxx . . $ cvs/MyColor#MyColor(b1146eedae1e1d0b).(150,190,10); |
| 1014 | col.setAlphacxx . . $ cvs/MyColor#setAlpha(d4f767463ce0a6b3).(10); |
| 1015 | |
| 1016 | if(box.p1cxx . . $ cvs/Comp#Box#p1.>box.y1cxx . . $ cvs/Comp#Box#y1.) |
| 1017 | p->fillRectcxx . . $ cvs/MyPainter#fillRect(8d721085ee12c0d8).(box.x1cxx . . $ cvs/Comp#Box#x1., box.y1cxx . . $ cvs/Comp#Box#y1., |
| 1018 | box.x2cxx . . $ cvs/Comp#Box#x2., box.p1cxx . . $ cvs/Comp#Box#p1., |
| 1019 | col); |
| 1020 | if(box.p2cxx . . $ cvs/Comp#Box#p2.<box.y2cxx . . $ cvs/Comp#Box#y2.) |
| 1021 | p->fillRectcxx . . $ cvs/MyPainter#fillRect(8d721085ee12c0d8).(box.x1cxx . . $ cvs/Comp#Box#x1., box.y2cxx . . $ cvs/Comp#Box#y2., |
| 1022 | box.x2cxx . . $ cvs/Comp#Box#x2., box.p2cxx . . $ cvs/Comp#Box#p2., |
| 1023 | col); |
| 1024 | } |
| 1025 | |
| 1026 | void paintBackgroundImagecxx . . $ cvs/Comp#paintBackgroundImage(4c1e117cfdeab271).(MyPaintercxx . . $ cvs/MyPainter# *p){ |
| 1027 | |
| 1028 | p->fillRectcxx . . $ cvs/MyPainter#fillRect(8d721085ee12c0d8).(0,0,widthcxx . . $ cvs/MyWidget#width(b126dc7c1de90089).(),heightcxx . . $ cvs/MyWidget#height(b126dc7c1de90089).(),MyColorcxx . . $ cvs/MyColor#MyColor(49f6e7a06ebc5aa8).()); |
| 1029 | |
| 1030 | //printf("Paint\n"); |
| 1031 | |
| 1032 | Boxcxx . . $ cvs/Comp#Box# in_box = get_slider1_parmscxx . . $ cvs/Comp#get_slider1_parms(6efcad09bf3cfa57).(); |
| 1033 | Boxcxx . . $ cvs/Comp#Box# out_box = get_slider2_parmscxx . . $ cvs/Comp#get_slider2_parms(6efcad09bf3cfa57).(); |
| 1034 | Boxcxx . . $ cvs/Comp#Box# vol_box = get_slider3_parmscxx . . $ cvs/Comp#get_slider3_parms(6efcad09bf3cfa57).(); |
| 1035 | |
| 1036 | paint_gradientcxx . . $ cvs/Comp#paint_gradient(1255730781554802).(p,in_box,out_box,vol_box); |
| 1037 | |
| 1038 | MyColorcxx . . $ cvs/MyColor# blackcxx . . $ cvs/MyColor#MyColor(b1146eedae1e1d0b).(1,1,1); |
| 1039 | black.setAlphacxx . . $ cvs/MyColor#setAlpha(d4f767463ce0a6b3).(80); |
| 1040 | |
| 1041 | paint_boxcxx . . $ cvs/Comp#paint_box(794e6a4ef9e74bce).(p, in_box, black); |
| 1042 | paint_boxcxx . . $ cvs/Comp#paint_box(794e6a4ef9e74bce).(p, out_box, black); |
| 1043 | paint_boxcxx . . $ cvs/Comp#paint_box(794e6a4ef9e74bce).(p, vol_box, black); |
| 1044 | |
| 1045 | // bottom line between sliders |
| 1046 | if(1){ |
| 1047 | MyColorcxx . . $ cvs/MyColor# c = mix_colorscxx . . $ cvs/mix_colors(5beb090e9530825b).(MyColorcxx . . $ cvs/MyColor#MyColor(b1146eedae1e1d0b).(1,1,1), MyColorcxx . . $ cvs/MyColor#MyColor(49f6e7a06ebc5aa8).(), 0.4); // Alpha color will not look correct here since the color it's drawn over differs. |
| 1048 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(8d721085ee12c0d8).(in_box.x2cxx . . $ cvs/Comp#Box#x2.,in_box.y2cxx . . $ cvs/Comp#Box#y2.,vol_box.x1cxx . . $ cvs/Comp#Box#x1.,out_box.y2cxx . . $ cvs/Comp#Box#y2.,c); |
| 1049 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(8d721085ee12c0d8).(out_box.x2cxx . . $ cvs/Comp#Box#x2.,out_box.y2cxx . . $ cvs/Comp#Box#y2.,vol_box.x1cxx . . $ cvs/Comp#Box#x1.,vol_box.y2cxx . . $ cvs/Comp#Box#y2.,c); |
| 1050 | } |
| 1051 | |
| 1052 | // threshold line between sliders |
| 1053 | if(1){ |
| 1054 | // between in and out |
| 1055 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(8d721085ee12c0d8).(in_box.x2cxx . . $ cvs/Comp#Box#x2.,in_box.p2cxx . . $ cvs/Comp#Box#p2., |
| 1056 | out_box.x1cxx . . $ cvs/Comp#Box#x1.,out_box.p2cxx . . $ cvs/Comp#Box#p2., |
| 1057 | black |
| 1058 | ); |
| 1059 | |
| 1060 | // between out and vol |
| 1061 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(8d721085ee12c0d8).(out_box.x2cxx . . $ cvs/Comp#Box#x2.,out_box.p2cxx . . $ cvs/Comp#Box#p2., |
| 1062 | vol_box.x1cxx . . $ cvs/Comp#Box#x1.,vol_box.p2cxx . . $ cvs/Comp#Box#p2., |
| 1063 | black); |
| 1064 | } |
| 1065 | |
| 1066 | paint_box_fillcxx . . $ cvs/Comp#paint_box_fill(10f03e368187e287).(p,in_box); |
| 1067 | paint_box_fillcxx . . $ cvs/Comp#paint_box_fill(10f03e368187e287).(p,out_box); |
| 1068 | paint_box_fillcxx . . $ cvs/Comp#paint_box_fill(10f03e368187e287).(p,vol_box); |
| 1069 | |
| 1070 | // // |
| 1071 | |
| 1072 | // border line between sliders |
| 1073 | if(1){ |
| 1074 | black.setAlphacxx . . $ cvs/MyColor#setAlpha(d4f767463ce0a6b3).(80); |
| 1075 | |
| 1076 | if(in_box.p1cxx . . $ cvs/Comp#Box#p1.!=out_box.p1cxx . . $ cvs/Comp#Box#p1.) |
| 1077 | p->setThicknesscxx . . $ cvs/MyPainter#setThickness(d4f767463ce0a6b3).(1); |
| 1078 | |
| 1079 | // between in and out |
| 1080 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(8d721085ee12c0d8).(in_box.x2cxx . . $ cvs/Comp#Box#x2.,in_box.p1cxx . . $ cvs/Comp#Box#p1., |
| 1081 | out_box.x1cxx . . $ cvs/Comp#Box#x1.,out_box.p1cxx . . $ cvs/Comp#Box#p1., |
| 1082 | black); |
| 1083 | |
| 1084 | if(out_box.p1cxx . . $ cvs/Comp#Box#p1.!=vol_box.p1cxx . . $ cvs/Comp#Box#p1.) |
| 1085 | p->setThicknesscxx . . $ cvs/MyPainter#setThickness(d4f767463ce0a6b3).(1); |
| 1086 | else |
| 1087 | p->setThicknesscxx . . $ cvs/MyPainter#setThickness(d4f767463ce0a6b3).(1); |
| 1088 | |
| 1089 | // between out and vol |
| 1090 | p->drawLinecxx . . $ cvs/MyPainter#drawLine(8d721085ee12c0d8).(out_box.x2cxx . . $ cvs/Comp#Box#x2.,out_box.p1cxx . . $ cvs/Comp#Box#p1., |
| 1091 | vol_box.x1cxx . . $ cvs/Comp#Box#x1.,vol_box.p1cxx . . $ cvs/Comp#Box#p1., |
| 1092 | black); |
| 1093 | |
| 1094 | p->setThicknesscxx . . $ cvs/MyPainter#setThickness(d4f767463ce0a6b3).(1); |
| 1095 | } |
| 1096 | |
| 1097 | paintSliderTextcxx . . $ cvs/Comp#paintSliderText(b9b3a0b05c113359).(p,in_box,"Threshold: "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,get_thresholdcxx . . $ cvs/Comp#get_threshold(31fa7155c10fdd13).(), "dB"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 1098 | paintSliderTextcxx . . $ cvs/Comp#paintSliderText(b9b3a0b05c113359).(p,out_box,"Ratio: "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,get_ratiocxx . . $ cvs/Comp#get_ratio(31fa7155c10fdd13).(),":1"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 1099 | paintSliderTextcxx . . $ cvs/Comp#paintSliderText(b9b3a0b05c113359).(p,vol_box,"Makeup Gain: "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,get_makeup_gaincxx . . $ cvs/Comp#get_makeup_gain(31fa7155c10fdd13).(),"dB"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 1100 | |
| 1101 | background_image_must_be_updatedcxx . . $ cvs/Comp#background_image_must_be_updated. = false; |
| 1102 | } |
| 1103 | |
| 1104 | void updateBackgroundImagecxx . . $ cvs/Comp#updateBackgroundImage(49f6e7a06ebc5aa8).(){ |
| 1105 | MyPaintercxx . . $ cvs/MyPainter# pcxx . . $ cvs/MyPainter#MyPainter(8a04056369b6c38d).(background_imagecxx . . $ cvs/Comp#background_image.); |
| 1106 | //background_image->fill(colors[11]); |
| 1107 | paintBackgroundImagecxx . . $ cvs/Comp#paintBackgroundImage(4c1e117cfdeab271).(&p); |
| 1108 | } |
| 1109 | |
| 1110 | void repaintcxx . . $ cvs/Comp#repaint(4c1e117cfdeab271).(MyPaintercxx . . $ cvs/MyPainter# *p){ |
| 1111 | //printf("Comp::repaint(). Ratio: %f\n", get_compressor_parameter(_patch, COMP_EFF_RATIO)); |
| 1112 | if(background_image_must_be_updatedcxx . . $ cvs/Comp#background_image_must_be_updated.==true) |
| 1113 | updateBackgroundImagecxx . . $ cvs/Comp#updateBackgroundImage(49f6e7a06ebc5aa8).(); |
| 1114 | |
| 1115 | Boxcxx . . $ cvs/Comp#Box# in_box = get_slider1_parmscxx . . $ cvs/Comp#get_slider1_parms(6efcad09bf3cfa57).(); |
| 1116 | Boxcxx . . $ cvs/Comp#Box# out_box = get_slider2_parmscxx . . $ cvs/Comp#get_slider2_parms(6efcad09bf3cfa57).(); |
| 1117 | Boxcxx . . $ cvs/Comp#Box# vol_box = get_slider3_parmscxx . . $ cvs/Comp#get_slider3_parms(6efcad09bf3cfa57).(); |
| 1118 | |
| 1119 | //paintBackgroundImage(&p); |
| 1120 | p->drawImagecxx . . $ cvs/MyPainter#drawImage(a5a6dd23101862a1).(0,0,background_imagecxx . . $ cvs/Comp#background_image.); |
| 1121 | |
| 1122 | paintPeakscxx . . $ cvs/Comp#paintPeaks(1255730781554802).(p, in_box, out_box, vol_box); |
| 1123 | } |
| 1124 | |
| 1125 | }; |
| 1126 | } |
| 1127 | |
| 1128 | #endif // INCLUDE_MYLINE_AND_MYRECT |