X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Faudioscope%2Faudioscope.C;h=9a8da423ef64ba0b6fa151a359075fc9bbd6eba8;hp=83ecc734fab2af13dc149b8700ff90f2adf40a13;hb=HEAD;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/plugins/audioscope/audioscope.C b/cinelerra-5.1/plugins/audioscope/audioscope.C index 83ecc734..9a8da423 100644 --- a/cinelerra-5.1/plugins/audioscope/audioscope.C +++ b/cinelerra-5.1/plugins/audioscope/audioscope.C @@ -132,7 +132,7 @@ AudioScopeWindowSize::AudioScopeWindowSize(AudioScope *plugin, char *text) : BC_PopupMenu(x, y, - 80, + xS(110), text) { this->plugin = plugin; @@ -232,10 +232,7 @@ void AudioScopeCanvas::calculate_point() CLAMP(x, 0, get_w() - 1); CLAMP(y, 0, get_h() - 1); - ((AudioScopeWindow*)plugin->thread->window)->calculate_probe( - x, - y, - 1); + ((AudioScopeWindow*)plugin->thread->window)->calculate_probe(x, y, 1); //printf("AudioScopeCanvas::calculate_point %d %d\n", __LINE__, Freq::tofreq(freq_index)); } @@ -273,7 +270,7 @@ AudioScopeMode::AudioScopeMode(AudioScope *plugin, int y) : BC_PopupMenu(x, y, - 180, + xS(180), mode_to_text(plugin->config.mode)) { this->plugin = plugin; @@ -338,14 +335,11 @@ int AudioScopeMode::text_to_mode(const char *text) AudioScopeWindow::AudioScopeWindow(AudioScope *plugin) - : PluginClientWindow(plugin, - plugin->w, - plugin->h, - 320, - 320, - 1) + : PluginClientWindow(plugin, plugin->w, plugin->h, xS(320), yS(320), 1) { - this->plugin = plugin; + this->plugin = plugin; + probe_x = -1; + probe_y = -1; } AudioScopeWindow::~AudioScopeWindow() @@ -632,8 +626,8 @@ AudioScope::AudioScope(PluginServer *server) { reset(); timer = new Timer; - w = 640; - h = 480; + w = xS(640); + h = yS(480); } AudioScope::~AudioScope() @@ -889,20 +883,15 @@ void AudioScope::update_gui() //printf("AudioScope::update_gui %d %d\n", __LINE__, total_frames); - +// expire old history frames + int new_frames = frame_history.size() + total_frames; + int expired = new_frames - config.history_size; + if( expired > 0 ) + frame_history.remove_object_block(0, expired); // Shift frames into history for(int frame = 0; frame < total_frames; frame++) - { - if(frame_history.size() >= config.history_size) - frame_history.remove_object_number(0); - - frame_history.append(frame_buffer.get(0)); - frame_buffer.remove_number(0); - } - -// Reduce history size - while(frame_history.size() > config.history_size) - frame_history.remove_object_number(0); + frame_history.append(frame_buffer.get(frame)); + frame_buffer.remove_block(0, total_frames); // Point probe data at history current_frame = frame_history.get(frame_history.size() - 1);