rework proxy scaler, fix crop-gui coord, video_data tweak for proxy_format
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / mainsession.C
index ef81185acdc62f814d9929c37e6c6a4c6460c8a9..e40f343efbc16adc8a414a8c559a971442186c82 100644 (file)
@@ -56,16 +56,16 @@ MainSession::MainSession(MWindow *mwindow)
        drag_clips = new ArrayList<EDL*>;
        drag_edits = new ArrayList<Edit*>;
        drag_edit = 0;
+       drag_group = 0;
+       drag_group_edit = 0;
+       drag_group_position = 0;
+       drag_group_first_track = 0;
+       group_number = 1;
        clip_number = 1;
        brender_end = 0;
        cwindow_controls = 1;
        trim_edits = 0;
        current_tip = -1;
-       drag_handle = 0;
-       cwindow_fullscreen = 0;
-       rwindow_fullscreen = 0;
-       vwindow_fullscreen = 0;
-       zwindow_fullscreen = 0;
        selected_zwindow = -1;
        actual_frame_rate = 0;
        title_bar_alpha = 0;
@@ -125,6 +125,8 @@ MainSession::~MainSession()
        delete drag_auto_gang;
        delete drag_clips;
        delete drag_edits;
+       if( drag_group )
+               drag_group->remove_user();
 }
 
 void MainSession::boundaries()
@@ -199,9 +201,42 @@ void MainSession::default_window_positions(int window_config)
        int border_bottom = display_info.get_bottom_border();
 
        int dual_head = screens > 1 ? 1 : 0;
-       int right_w = root_w;
+       int left_w = 0, right_w = root_w;
+       int xin_screens = display_info.get_xinerama_screens();
+       if( xin_screens > 1 ) {
+               dual_head = 1;
+               int x, y, w, h;
+               for( int s=0; s<xin_screens; ++s ) {
+                       if( display_info.xinerama_geometry(s, x, y, w, h) )
+                               continue;
+                       if( !y && !x ) {
+                               left_w = w;
+                               break;
+                       }
+               }
+               if( left_w > 0 ) {
+                       for( int s=0; s<xin_screens; ++s ) {
+                               if( display_info.xinerama_geometry(s, x, y, w, h) )
+                                       continue;
+                               if( !y && x == left_w ) {
+                                       right_w = w;
+                                       screens = 2;
+                                       break;
+                               }
+                       }
+                       if( window_config == 1 ) {
+                               root_x = left_w;
+                               root_w = right_w;
+                       }
+                       else {
+                       // use same aspect ratio to compute left height
+                               root_w = left_w;
+                               root_h = (root_w*root_h) / right_w;
+                       }
+               }
+       }
 // Wider than 16:9, narrower than dual head
-       if( screens < 2 && (float)root_w / root_h > 1.8) {
+       if( screens < 2 && (float)root_w / root_h > 1.8 ) {
                dual_head = 1;
                switch( root_h ) {
                case 600:  right_w = 800;   break;
@@ -451,7 +486,7 @@ int MainSession::load_defaults(BC_Hash *defaults)
 
        current_tip = defaults->get("CURRENT_TIP", current_tip);
        actual_frame_rate = defaults->get("ACTUAL_FRAME_RATE", (float)-1);
-       title_bar_alpha = defaults->get("TITLE_BAR_ALPHA", (float)0);
+       title_bar_alpha = defaults->get("TITLE_BAR_ALPHA", (float)1);
 
        boundaries();
        return 0;