Mercurial > audlegacy
comparison src/audacious/visualization.c @ 4361:3cd896ac4d49
indentation to stop eyes from bleeding
| author | mf0102 <0102@gmx.at> |
|---|---|
| date | Tue, 18 Mar 2008 15:05:34 +0100 |
| parents | 6a87d1c1da32 |
| children | 47cc110bef0c |
comparison
equal
deleted
inserted
replaced
| 4360:313dd79a2d24 | 4361:3cd896ac4d49 |
|---|---|
| 72 return; | 72 return; |
| 73 | 73 |
| 74 for (node = vp_data.enabled_list; node; node = g_list_next(node)) { | 74 for (node = vp_data.enabled_list; node; node = g_list_next(node)) { |
| 75 vp = node->data; | 75 vp = node->data; |
| 76 if (vp->playback_start) | 76 if (vp->playback_start) |
| 77 { | 77 { |
| 78 plugin_set_current((Plugin *)vp); | 78 plugin_set_current((Plugin *)vp); |
| 79 vp->playback_start(); | 79 vp->playback_start(); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 vp_data.playback_started = TRUE; | 82 vp_data.playback_started = TRUE; |
| 83 } | 83 } |
| 84 | 84 |
| 85 void | 85 void |
| 92 return; | 92 return; |
| 93 | 93 |
| 94 for (node = vp_data.enabled_list; node; node = g_list_next(node)) { | 94 for (node = vp_data.enabled_list; node; node = g_list_next(node)) { |
| 95 vp = node->data; | 95 vp = node->data; |
| 96 if (vp->playback_stop) | 96 if (vp->playback_stop) |
| 97 { | 97 { |
| 98 plugin_set_current((Plugin *)vp); | 98 plugin_set_current((Plugin *)vp); |
| 99 vp->playback_stop(); | 99 vp->playback_stop(); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 vp_data.playback_started = FALSE; | 102 vp_data.playback_started = FALSE; |
| 103 } | 103 } |
| 104 | 104 |
| 105 void | 105 void |
| 113 vp = node->data; | 113 vp = node->data; |
| 114 | 114 |
| 115 if (enable && !vp->enabled) { | 115 if (enable && !vp->enabled) { |
| 116 vp_data.enabled_list = g_list_append(vp_data.enabled_list, vp); | 116 vp_data.enabled_list = g_list_append(vp_data.enabled_list, vp); |
| 117 if (vp->init) | 117 if (vp->init) |
| 118 { | 118 { |
| 119 plugin_set_current((Plugin *)vp); | 119 plugin_set_current((Plugin *)vp); |
| 120 vp->init(); | 120 vp->init(); |
| 121 } | 121 } |
| 122 if (playback_get_playing() && vp->playback_start) | 122 if (playback_get_playing() && vp->playback_start) |
| 123 { | 123 { |
| 124 plugin_set_current((Plugin *)vp); | 124 plugin_set_current((Plugin *)vp); |
| 125 vp->playback_start(); | 125 vp->playback_start(); |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 else if (!enable && vp->enabled) { | 128 else if (!enable && vp->enabled) { |
| 129 vp_data.enabled_list = g_list_remove(vp_data.enabled_list, vp); | 129 vp_data.enabled_list = g_list_remove(vp_data.enabled_list, vp); |
| 130 if (playback_get_playing() && vp->playback_stop) | 130 if (playback_get_playing() && vp->playback_stop) |
| 131 { | 131 { |
| 132 plugin_set_current((Plugin *)vp); | 132 plugin_set_current((Plugin *)vp); |
| 133 vp->playback_stop(); | 133 vp->playback_stop(); |
| 134 } | 134 } |
| 135 if (vp->cleanup) | 135 if (vp->cleanup) |
| 136 { | 136 { |
| 137 plugin_set_current((Plugin *)vp); | 137 plugin_set_current((Plugin *)vp); |
| 138 vp->cleanup(); | 138 vp->cleanup(); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| 142 vp->enabled = enable; | 142 vp->enabled = enable; |
| 143 } | 143 } |
| 144 | 144 |
| 178 if (!strcmp(plugins[i], base)) { | 178 if (!strcmp(plugins[i], base)) { |
| 179 vp = node->data; | 179 vp = node->data; |
| 180 vp_data.enabled_list = | 180 vp_data.enabled_list = |
| 181 g_list_append(vp_data.enabled_list, vp); | 181 g_list_append(vp_data.enabled_list, vp); |
| 182 if (vp->init) | 182 if (vp->init) |
| 183 { | 183 { |
| 184 plugin_set_current((Plugin *)vp); | 184 plugin_set_current((Plugin *)vp); |
| 185 vp->init(); | 185 vp->init(); |
| 186 } | 186 } |
| 187 if (playback_get_playing() && vp->playback_start) | 187 if (playback_get_playing() && vp->playback_start) |
| 188 { | 188 { |
| 189 plugin_set_current((Plugin *)vp); | 189 plugin_set_current((Plugin *)vp); |
| 190 vp->playback_start(); | 190 vp->playback_start(); |
| 191 } | 191 } |
| 192 vp->enabled = TRUE; | 192 vp->enabled = TRUE; |
| 193 } | 193 } |
| 194 g_free(base); | 194 g_free(base); |
| 195 } | 195 } |
| 196 } | 196 } |
| 299 if (vp->num_pcm_chs_wanted == 1) { | 299 if (vp->num_pcm_chs_wanted == 1) { |
| 300 if (!mono_pcm_calced) { | 300 if (!mono_pcm_calced) { |
| 301 calc_mono_pcm(mono_pcm, pcm_data, nch); | 301 calc_mono_pcm(mono_pcm, pcm_data, nch); |
| 302 mono_pcm_calced = TRUE; | 302 mono_pcm_calced = TRUE; |
| 303 } | 303 } |
| 304 plugin_set_current((Plugin *)vp); | 304 plugin_set_current((Plugin *)vp); |
| 305 vp->render_pcm(mono_pcm); | 305 vp->render_pcm(mono_pcm); |
| 306 } | 306 } |
| 307 else { | 307 else { |
| 308 if (!stereo_pcm_calced) { | 308 if (!stereo_pcm_calced) { |
| 309 calc_stereo_pcm(stereo_pcm, pcm_data, nch); | 309 calc_stereo_pcm(stereo_pcm, pcm_data, nch); |
| 310 stereo_pcm_calced = TRUE; | 310 stereo_pcm_calced = TRUE; |
| 311 } | 311 } |
| 312 plugin_set_current((Plugin *)vp); | 312 plugin_set_current((Plugin *)vp); |
| 313 vp->render_pcm(stereo_pcm); | 313 vp->render_pcm(stereo_pcm); |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 if (vp->num_freq_chs_wanted > 0 && vp->render_freq) { | 316 if (vp->num_freq_chs_wanted > 0 && vp->render_freq) { |
| 317 if (vp->num_freq_chs_wanted == 1) { | 317 if (vp->num_freq_chs_wanted == 1) { |
| 318 if (!mono_freq_calced) { | 318 if (!mono_freq_calced) { |
| 319 calc_mono_freq(mono_freq, pcm_data, nch); | 319 calc_mono_freq(mono_freq, pcm_data, nch); |
| 320 mono_freq_calced = TRUE; | 320 mono_freq_calced = TRUE; |
| 321 } | 321 } |
| 322 plugin_set_current((Plugin *)vp); | 322 plugin_set_current((Plugin *)vp); |
| 323 vp->render_freq(mono_freq); | 323 vp->render_freq(mono_freq); |
| 324 } | 324 } |
| 325 else { | 325 else { |
| 326 if (!stereo_freq_calced) { | 326 if (!stereo_freq_calced) { |
| 327 calc_stereo_freq(stereo_freq, pcm_data, nch); | 327 calc_stereo_freq(stereo_freq, pcm_data, nch); |
| 328 stereo_freq_calced = TRUE; | 328 stereo_freq_calced = TRUE; |
| 329 } | 329 } |
| 330 plugin_set_current((Plugin *)vp); | 330 plugin_set_current((Plugin *)vp); |
| 331 vp->render_freq(stereo_freq); | 331 vp->render_freq(stereo_freq); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 node = g_list_next(node); | 334 node = g_list_next(node); |
| 335 } | 335 } |
| 428 intern_vis_data[1] = 37; | 428 intern_vis_data[1] = 37; |
| 429 } | 429 } |
| 430 else | 430 else |
| 431 intern_vis_data[1] = intern_vis_data[0]; | 431 intern_vis_data[1] = intern_vis_data[0]; |
| 432 } | 432 } |
| 433 else{ /*Voiceprint*/ | 433 else { /*Voiceprint*/ |
| 434 if (!mono_freq_calced) | 434 if (!mono_freq_calced) |
| 435 calc_mono_freq(mono_freq, pcm_data, nch); | 435 calc_mono_freq(mono_freq, pcm_data, nch); |
| 436 memset(intern_vis_data, 0, 256); | 436 memset(intern_vis_data, 0, 256); |
| 437 /* For the values [0-16] we use the frequency that's 3/2 as much. | 437 |
| 438 If we assume the 512 values calculated by calc_mono_freq to cover 0-22kHz linearly | 438 /* For the values [0-16] we use the frequency that's 3/2 as much. |
| 439 we get a range of [0-16] * 3/2 * 22000/512 = [0-1,031] Hz. | 439 If we assume the 512 values calculated by calc_mono_freq to |
| 440 Most stuff above that is harmonics and we want to utilize the 16 samples we have | 440 cover 0-22kHz linearly we get a range of |
| 441 to the max[tm] | 441 [0-16] * 3/2 * 22000/512 = [0-1,031] Hz. |
| 442 */ | 442 Most stuff above that is harmonics and we want to utilize the |
| 443 for(i = 0; i < 50 ; i+=3){ | 443 16 samples we have to the max[tm] |
| 444 intern_vis_data[i/3] += (mono_freq[0][i/2] >> 5); | 444 */ |
| 445 | 445 for (i = 0; i < 50 ; i+=3){ |
| 446 /*Boost frequencies above 257Hz a little*/ | 446 intern_vis_data[i/3] += (mono_freq[0][i/2] >> 5); |
| 447 //if(i > 4 * 3) | 447 |
| 448 // intern_vis_data[i/3] += 8; | 448 /*Boost frequencies above 257Hz a little*/ |
| 449 } | 449 //if(i > 4 * 3) |
| 450 } | 450 // intern_vis_data[i/3] += 8; |
| 451 } | |
| 452 } | |
| 451 } | 453 } |
| 452 else { /* (cfg.vis_type == VIS_SCOPE) */ | 454 else { /* (cfg.vis_type == VIS_SCOPE) */ |
| 453 | 455 |
| 454 /* Oscilloscope */ | 456 /* Oscilloscope */ |
| 455 gint pos, step; | 457 gint pos, step; |
