version update
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / localsession.C
index 7e1f50eaeb030eede38dd7bff30822f6e2d6d66d..75001658c7f76d98bbf8097c3cb781ba43977bdc 100644 (file)
@@ -24,6 +24,7 @@
 #include "clip.h"
 #include "bchash.h"
 #include "edl.h"
+#include "edlsession.h"
 #include "filesystem.h"
 #include "filexml.h"
 #include "floatauto.h"
@@ -86,7 +87,7 @@ LocalSession::LocalSession(EDL *edl)
        automation_maxs[AUTOGROUPTYPE_AUDIO_FADE] = 6;
        automation_mins[AUTOGROUPTYPE_VIDEO_FADE] = 0;
        automation_maxs[AUTOGROUPTYPE_VIDEO_FADE] = 100;
-       automation_mins[AUTOGROUPTYPE_SPEED] = 0.005;
+       automation_mins[AUTOGROUPTYPE_SPEED] = SPEED_MIN;
        automation_maxs[AUTOGROUPTYPE_SPEED] = 5.000;
        automation_mins[AUTOGROUPTYPE_INT255] = 0;
        automation_maxs[AUTOGROUPTYPE_INT255] = 255;
@@ -296,7 +297,9 @@ void LocalSession::load_xml(FileXML *file, unsigned long load_flags)
                for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
                        if (!Automation::autogrouptypes_fixedrange[i]) {
                                automation_mins[i] = file->tag.get_property(xml_autogrouptypes_titlesmin[i],automation_mins[i]);
+                               AUTOMATIONCLAMPS(automation_mins[i], i);
                                automation_maxs[i] = file->tag.get_property(xml_autogrouptypes_titlesmax[i],automation_maxs[i]);
+                               AUTOMATIONCLAMPS(automation_maxs[i], i);
                        }
                }
                floatauto_type = file->tag.get_property("FLOATAUTO_TYPE", floatauto_type);
@@ -345,9 +348,9 @@ int LocalSession::load_defaults(BC_Hash *defaults)
 //     track_start = defaults->get("TRACK_START", 0);
 //     view_start = defaults->get("VIEW_START", 0);
        zoom_sample = defaults->get("ZOOM_SAMPLE", DEFAULT_ZOOM_TIME);
-       zoom_y = defaults->get("ZOOMY", 64);
+       zoom_y = defaults->get("ZOOMY", DEFAULT_ZOOM_TRACK);
        int64_t zoom_track = defaults->get("ZOOM_TRACK", 0);
-       if( zoom_track == 0 ) zoom_track = 64;
+       if( zoom_track == 0 ) zoom_track = DEFAULT_ZOOM_TRACK;
        zoom_atrack = defaults->get("ZOOM_ATRACK", zoom_track);
        zoom_vtrack = defaults->get("ZOOM_VTRACK", zoom_track);
        red = defaults->get("RED", 0.0);
@@ -361,7 +364,9 @@ int LocalSession::load_defaults(BC_Hash *defaults)
        for (int i = 0; i < AUTOGROUPTYPE_COUNT; i++) {
                if (!Automation::autogrouptypes_fixedrange[i]) {
                        automation_mins[i] = defaults->get(xml_autogrouptypes_titlesmin[i], automation_mins[i]);
+                       AUTOMATIONCLAMPS(automation_mins[i], i);
                        automation_maxs[i] = defaults->get(xml_autogrouptypes_titlesmax[i], automation_maxs[i]);
+                       AUTOMATIONCLAMPS(automation_maxs[i], i);
                }
        }
 
@@ -507,9 +512,12 @@ void LocalSession::reset_view_limits()
 {
        automation_mins[AUTOGROUPTYPE_ZOOM] = 0.005;
        automation_maxs[AUTOGROUPTYPE_ZOOM] = 5.000;
-       automation_mins[AUTOGROUPTYPE_X] = -100;
-       automation_maxs[AUTOGROUPTYPE_X] = 100;
-       automation_mins[AUTOGROUPTYPE_Y] = -100;
-       automation_maxs[AUTOGROUPTYPE_Y] = 100;
+       int out_w = edl->session->output_w;
+       automation_mins[AUTOGROUPTYPE_X] = -out_w;
+       automation_maxs[AUTOGROUPTYPE_X] = out_w;
+       int out_h = edl->session->output_h;
+       automation_mins[AUTOGROUPTYPE_Y] = -out_h;
+       automation_maxs[AUTOGROUPTYPE_Y] = out_h;
+
 }