+
+EditPanelScopeDialog::EditPanelScopeDialog(MWindow *mwindow, EditPanel *panel)
+ : BC_DialogThread()
+{
+ this->mwindow = mwindow;
+ this->panel = panel;
+ scope_gui = 0;
+ gui_lock = new Mutex("EditPanelScopeDialog::gui_lock");
+}
+
+EditPanelScopeDialog::~EditPanelScopeDialog()
+{
+ close_window();
+ delete gui_lock;
+}
+
+void EditPanelScopeDialog::handle_done_event(int result)
+{
+ gui_lock->lock("EditPanelScopeDialog::handle_done_event");
+ scope_gui = 0;
+ gui_lock->unlock();
+
+ panel->subwindow->lock_window("EditPanelScopeDialog::handle_done_event");
+ panel->scope->update(0);
+ panel->subwindow->unlock_window();
+}
+
+BC_Window* EditPanelScopeDialog::new_gui()
+{
+ EditPanelScopeGUI *gui = new EditPanelScopeGUI(mwindow, this);
+ gui->create_objects();
+ scope_gui = gui;
+ return gui;
+}
+
+void EditPanelScopeDialog::process(VFrame *output_frame)
+{
+ if( panel->scope_dialog ) {
+ panel->scope_dialog->gui_lock->lock("EditPanelScopeDialog::process");
+ if( panel->scope_dialog->scope_gui ) {
+ EditPanelScopeGUI *gui = panel->scope_dialog->scope_gui;
+ gui->process(output_frame);
+ }
+ panel->scope_dialog->gui_lock->unlock();
+ }
+}
+
+EditPanelScopeGUI::EditPanelScopeGUI(MWindow *mwindow, EditPanelScopeDialog *dialog)
+ : ScopeGUI(mwindow->theme,
+ mwindow->session->scope_x, mwindow->session->scope_y,
+ mwindow->session->scope_w, mwindow->session->scope_h,
+ mwindow->preferences->processors)
+{
+ this->mwindow = mwindow;
+ this->dialog = dialog;
+}
+
+EditPanelScopeGUI::~EditPanelScopeGUI()
+{
+}
+
+void EditPanelScopeGUI::create_objects()
+{
+ MainSession *session = mwindow->session;
+ use_hist = session->use_hist;
+ use_wave = session->use_wave;
+ use_vector = session->use_vector;
+ use_hist_parade = session->use_hist_parade;
+ use_wave_parade = session->use_wave_parade;
+ ScopeGUI::create_objects();
+}
+
+void EditPanelScopeGUI::toggle_event()
+{
+ MainSession *session = mwindow->session;
+ session->use_hist = use_hist;
+ session->use_wave = use_wave;
+ session->use_vector = use_vector;
+ session->use_hist_parade = use_hist_parade;
+ session->use_wave_parade = use_wave_parade;
+}
+
+int EditPanelScopeGUI::translation_event()
+{
+ ScopeGUI::translation_event();
+ MainSession *session = mwindow->session;
+ session->scope_x = get_x();
+ session->scope_y = get_y();
+ return 0;
+}
+
+int EditPanelScopeGUI::resize_event(int w, int h)
+{
+ ScopeGUI::resize_event(w, h);
+ MainSession *session = mwindow->session;
+ session->scope_w = w;
+ session->scope_h = h;
+ return 0;
+}
+
+EditPanelScope::EditPanelScope(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme ?
+ mwindow->theme->get_image_set("scope_toggle") : 0, 0)
+{
+ this->mwindow = mwindow;
+ this->panel = panel;
+ set_tooltip(_("View scope"));
+}
+
+EditPanelScope::~EditPanelScope()
+{
+}
+
+int EditPanelScope::handle_event()
+{
+ unlock_window();
+ int v = get_value();
+ if( v )
+ panel->scope_dialog->start();
+ else
+ panel->scope_dialog->close_window();
+ lock_window("EditPanelScope::handle_event");
+ return 1;
+}
+