+ScopeMenu::ScopeMenu(ScopeGUI *gui, int x, int y)
+ : BC_PopupMenu(x, y, xS(100), _("Scopes"))
+{
+ this->gui = gui;
+}
+
+void ScopeMenu::create_objects()
+{
+ add_item(hist_on =
+ new ScopeScopesOn(this, _("Histogram"), SCOPE_HISTOGRAM));
+ add_item(hist_rgb_on =
+ new ScopeScopesOn(this, _("Histogram RGB"), SCOPE_HISTOGRAM_RGB));
+ add_item(new BC_MenuItem("-"));
+ add_item(wave_on =
+ new ScopeScopesOn(this, _("Waveform"), SCOPE_WAVEFORM));
+ add_item(wave_rgb_on =
+ new ScopeScopesOn(this, _("Waveform RGB"), SCOPE_WAVEFORM_RGB));
+ add_item(wave_ply_on =
+ new ScopeScopesOn(this, _("Waveform ply"), SCOPE_WAVEFORM_PLY));
+ add_item(new BC_MenuItem("-"));
+ add_item(vect_on =
+ new ScopeScopesOn(this, _("Vectorscope"), SCOPE_VECTORSCOPE));
+}
+
+void ScopeMenu::update_toggles()
+{
+ hist_on->set_checked(gui->use_hist);
+ hist_rgb_on->set_checked(gui->use_hist_parade);
+ wave_on->set_checked(gui->use_wave);
+ wave_rgb_on->set_checked(gui->use_wave_parade>0);
+ wave_ply_on->set_checked(gui->use_wave_parade<0);
+ vect_on->set_checked(gui->use_vector);
+}
+
+
+ScopeGainReset::ScopeGainReset(ScopeGain *gain, int x, int y)
+ : BC_Button(x, y, gain->gui->theme->get_image_set("reset_button"))
+{
+ this->gain = gain;
+}
+
+int ScopeGainReset::calculate_w(BC_Theme *theme)
+{
+ VFrame *vfrm = *theme->get_image_set("reset_button");
+ return vfrm->get_w();
+}
+
+int ScopeGainReset::handle_event()
+{
+ gain->slider->update(5);
+ return gain->handle_event();
+}
+
+ScopeGainSlider::ScopeGainSlider(ScopeGain *gain, int x, int y, int w)
+ : BC_ISlider(x, y, 0, w, w, 1, 9, *gain->value)
+{
+ this->gain = gain;
+}
+
+int ScopeGainSlider::handle_event()
+{
+ return gain->handle_event();
+}
+
+ScopeGain::ScopeGain(ScopeGUI *gui, int x, int y, int w, int *value)
+{
+ this->gui = gui;
+ this->x = x;
+ this->y = y;
+ this->w = w;
+ this->value = value;
+
+ slider = 0;
+ reset = 0;
+}
+ScopeGain::~ScopeGain()
+{
+ delete reset;
+ delete slider;
+}
+
+int ScopeGain::calculate_h()
+{
+ return BC_ISlider::get_span(0);
+}
+
+void ScopeGain::create_objects()
+{
+ reset_w = ScopeGainReset::calculate_w(gui->theme);
+ gui->add_subwindow(slider = new ScopeGainSlider(this, x, y, w-reset_w-xS(5)));
+ gui->add_subwindow(reset = new ScopeGainReset(this, x+w-reset_w, y));
+}
+
+int ScopeGain::handle_event()
+{
+ *value = slider->get_value();
+ gui->update_scope();
+ gui->toggle_event();
+ return 1;
+}
+
+void ScopeGain::reposition_window(int x, int y)
+{
+ this->x = x; this->y = y;
+ slider->reposition_window(x, y);
+ reset->reposition_window(x+w-reset_w, y);
+}
+
+ScopeWaveSlider::ScopeWaveSlider(ScopeGUI *gui, int x, int y, int w)
+ : ScopeGain(gui, x, y, w, &gui->use_wave_gain)
+{
+}
+
+ScopeVectSlider::ScopeVectSlider(ScopeGUI *gui, int x, int y, int w)
+ : ScopeGain(gui, x, y, w, &gui->use_vect_gain)
+{
+}
+
+ScopeSmooth::ScopeSmooth(ScopeGUI *gui, int x, int y)
+ : BC_CheckBox(x, y, gui->use_smooth, _("Smooth"))
+{
+ this->gui = gui;
+}
+
+int ScopeSmooth::handle_event()
+{
+ gui->use_smooth = get_value();
+ gui->update_scope();
+ gui->toggle_event();
+ return 1;
+}
+