videoscope tweaks, add scope overlay grid (andrea), hw probe fix for sw fallback
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / editpanel.C
index 74aa53c984b06f58b10d760faa4f69dd8a6e570c..03eb9e483e5b2d3f925037d7f1bf2b721da39f15 100644 (file)
@@ -48,6 +48,7 @@
 #include "timebar.h"
 #include "trackcanvas.h"
 #include "transportque.h"
+#include "vwindowgui.h"
 #include "zoombar.h"
 
 
@@ -170,19 +171,16 @@ void EditPanel::update()
 
 int EditPanel::calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons)
 {
-       int result = 0;
-       int button_w = mwindow->theme->get_image_set("ibeam")[0]->get_w();
-       if( use_keyframe ) {
+       int button_w = xS(24); // mwindow->theme->get_image_set("meters")[0]->get_w();
+       int result = button_w * total_buttons;
+       if( use_keyframe )
                result += 2*(button_w + mwindow->theme->toggle_margin);
-       }
-
-       result += button_w * total_buttons;
        return result;
 }
 
 int EditPanel::calculate_h(MWindow *mwindow)
 {
-       return mwindow->theme->get_image_set("ibeam")[0]->get_h();
+       return mwindow->theme->get_image_set("meters")[0]->get_h();
 }
 
 void EditPanel::create_buttons()
@@ -261,16 +259,6 @@ void EditPanel::create_buttons()
                x1 += paste->get_w();
        }
 
-       if( use_meters ) {
-               if( meter_panel ) {
-                       meters = new MeterShow(mwindow, meter_panel, x1, y1);
-                       subwindow->add_subwindow(meters);
-                       x1 += meters->get_w();
-               }
-               else
-                       printf("EditPanel::create_objects: meter_panel == 0\n");
-       }
-
        if( use_labels ) {
                labelbutton = new EditLabelbutton(mwindow, this, x1, y1);
                subwindow->add_subwindow(labelbutton);
@@ -330,6 +318,16 @@ void EditPanel::create_buttons()
                scope_dialog = new EditPanelScopeDialog(mwindow, this);
        }
 
+       if( use_meters ) {
+               if( meter_panel ) {
+                       meters = new MeterShow(mwindow, meter_panel, x1, y1);
+                       subwindow->add_subwindow(meters);
+                       x1 += meters->get_w();
+               }
+               else
+                       printf("EditPanel::create_objects: meter_panel == 0\n");
+       }
+
        if( use_commercial ) {
                commercial = new EditCommercial(mwindow, this, x1, y1);
                subwindow->add_subwindow(commercial);
@@ -395,11 +393,6 @@ void EditPanel::reposition_buttons(int x, int y)
                x1 += paste->get_w();
        }
 
-       if( use_meters ) {
-               meters->reposition_window(x1, y1);
-               x1 += meters->get_w();
-       }
-
        if( use_labels ) {
                labelbutton->reposition_window(x1, y1);
                x1 += labelbutton->get_w();
@@ -445,6 +438,11 @@ void EditPanel::reposition_buttons(int x, int y)
                scope->reposition_window(x1, y1-yS(1));
                x1 += scope->get_w();
        }
+
+       if( use_meters ) {
+               meters->reposition_window(x1, y1);
+               x1 += meters->get_w();
+       }
 }
 
 void EditPanel::create_objects()
@@ -1166,6 +1164,10 @@ EditPanelScopeDialog::~EditPanelScopeDialog()
        delete gui_lock;
 }
 
+void EditPanelScopeDialog::handle_close_event(int result)
+{
+       scope_gui = 0;
+}
 void EditPanelScopeDialog::handle_done_event(int result)
 {
        gui_lock->lock("EditPanelScopeDialog::handle_done_event");
@@ -1201,7 +1203,7 @@ EditPanelScopeGUI::EditPanelScopeGUI(MWindow *mwindow, EditPanelScopeDialog *dia
  : ScopeGUI(mwindow->theme,
        mwindow->session->scope_x, mwindow->session->scope_y,
        mwindow->session->scope_w, mwindow->session->scope_h,
-       mwindow->preferences->processors)
+       mwindow->get_cpus())
 {
        this->mwindow = mwindow;
        this->dialog = dialog;
@@ -1219,6 +1221,10 @@ void EditPanelScopeGUI::create_objects()
        use_vector = session->use_vector;
        use_hist_parade = session->use_hist_parade;
        use_wave_parade = session->use_wave_parade;
+       use_wave_gain = session->use_wave_gain;
+       use_vect_gain = session->use_vect_gain;
+       use_smooth = session->use_smooth;
+       use_graticule = session->use_graticule;
        ScopeGUI::create_objects();
 }
 
@@ -1230,6 +1236,10 @@ void EditPanelScopeGUI::toggle_event()
        session->use_vector = use_vector;
        session->use_hist_parade = use_hist_parade;
        session->use_wave_parade = use_wave_parade;
+       session->use_wave_gain = use_wave_gain;
+       session->use_vect_gain = use_vect_gain;
+       session->use_smooth = use_smooth;
+       session->use_graticule = use_graticule;
 }
 
 int EditPanelScopeGUI::translation_event()
@@ -1263,6 +1273,21 @@ EditPanelScope::~EditPanelScope()
 {
 }
 
+void EditPanelScopeGUI::update_scope()
+{
+       Canvas *canvas = 0;
+       if( dialog->panel->is_cwindow() ) {
+               CWindowGUI *cgui = (CWindowGUI *)dialog->panel->subwindow;
+               canvas = cgui->canvas;
+       }
+       else if( dialog->panel->is_vwindow() ) {
+               VWindowGUI *vgui = (VWindowGUI *)dialog->panel->subwindow;
+               canvas = vgui->canvas;
+       }
+       if( canvas && canvas->refresh_frame )
+               process(canvas->refresh_frame);
+}
+
 int EditPanelScope::handle_event()
 {
        unlock_window();