fix drag handle segv, new app icons
[goodguy/history.git] / cinelerra-5.1 / cinelerra / mainsession.C
index f7224b4c0cd84af9ca1174a908f4e79eb81203cf..4bfda7b05dcd5b17339ec7bc02c788126c62f5ac 100644 (file)
  *
  */
 
+#include "auto.h"
 #include "bcdisplayinfo.h"
 #include "clip.h"
 #include "bchash.h"
+#include "edit.h"
+#include "edits.h"
 #include "edl.h"
 #include "edlsession.h"
 #include "guicast.h"
@@ -30,7 +33,7 @@
 #include "meterpanel.h"
 #include "mwindow.h"
 #include "mwindowgui.h"
-#include "auto.h"
+#include "plugin.h"
 
 MainSession::MainSession(MWindow *mwindow)
 {
@@ -84,6 +87,7 @@ MainSession::MainSession(MWindow *mwindow)
        cwindow_x = cwindow_y = cwindow_w = cwindow_h = 0;
        ctool_x = ctool_y = 0;
        awindow_x = awindow_y = awindow_w = awindow_h = 0;
+       bwindow_w = bwindow_h = 0;
        rmonitor_x = rmonitor_y = rmonitor_w = rmonitor_h = 0;
        rwindow_x = rwindow_y = rwindow_w = rwindow_h = 0;
        gwindow_x = gwindow_y = 0;
@@ -252,6 +256,9 @@ void MainSession::default_window_positions(int window_config)
        awindow_w = root_x + root_w - awindow_x - border_left - border_right;
        awindow_h = mwindow_h;
 
+       bwindow_w = 600;
+       bwindow_h = 360;
+
        ewindow_w = 640;
        ewindow_h = 240;
 
@@ -388,6 +395,10 @@ int MainSession::load_defaults(BC_Hash *defaults)
 
 // Other windows
        afolders_w = defaults->get("ABINS_W", 200);
+
+       bwindow_w = defaults->get("BWINDOW_W", bwindow_w);
+       bwindow_h = defaults->get("BWINDOW_H", bwindow_h);
+
        rwindow_x = defaults->get("RWINDOW_X", rwindow_x);
        rwindow_y = defaults->get("RWINDOW_Y", rwindow_y);
        rwindow_w = defaults->get("RWINDOW_W", rwindow_w);
@@ -479,6 +490,9 @@ int MainSession::save_defaults(BC_Hash *defaults)
        defaults->update("AWINDOW_W", awindow_w);
        defaults->update("AWINDOW_H", awindow_h);
 
+       defaults->update("BWINDOW_W", bwindow_w);
+       defaults->update("BWINDOW_H", bwindow_h);
+
        defaults->update("EWINDOW_W", ewindow_w);
        defaults->update("EWINDOW_H", ewindow_h);
 
@@ -558,3 +572,20 @@ int MainSession::save_defaults(BC_Hash *defaults)
 
        return 0;
 }
+
+Track *MainSession::drag_handle_track()
+{
+       Track *track = 0;
+       switch( current_operation ) {
+       case DRAG_EDITHANDLE1:
+       case DRAG_EDITHANDLE2:
+               track = drag_edit->edits->track;
+               break;
+       case DRAG_PLUGINHANDLE1:
+       case DRAG_PLUGINHANDLE2:
+               track = drag_plugin->edits->track;
+               break;
+       }
+       return track;
+}
+