Changeset 522
- Timestamp:
- 11/12/07 18:44:49 (10 months ago)
- Files:
-
- sweep/trunk/plugins/fade/fade.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sweep/trunk/plugins/fade/fade.c
r124 r522 37 37 sw_audio_t * d; 38 38 gfloat factor = start; 39 sw_framecount_t op_total, run_total ;40 glong i ;39 sw_framecount_t op_total, run_total, frames_total; 40 glong i, j; 41 41 sw_framecount_t offset, remaining, n; 42 42 … … 47 47 48 48 op_total = sounddata_selection_nr_frames (sounddata) / 100; 49 frames_total = sounddata_selection_nr_frames (sounddata); 50 49 51 if (op_total == 0) op_total = 1; 50 52 run_total = 0; … … 105 107 n = MIN(remaining, 1024); 106 108 107 factor = start + (end - start) * 0.01 * 108 (gfloat)run_total / (gfloat)op_total; 109 110 for (i=0; i < n * f->channels; i++) { 111 d[i] = (sw_audio_t)((gfloat)d[i] * factor); 109 for (i = 0; i < n; i++) 110 { 111 factor = start + (end - start) * 112 (gfloat)run_total++ / (gfloat)frames_total; 113 114 for (j = 0; j < f->channels; j++) 115 { 116 d[i*f->channels+j] = (sw_audio_t)((gfloat)d[i*f->channels+j] * factor); 117 } 112 118 } 113 119 … … 115 121 offset += n; 116 122 117 run_total += n; 118 sample_set_progress_percent (sample, run_total * 100 / op_total); 123 sample_set_progress_percent (sample, run_total * frames_total); 119 124 } 120 125
