add proxy
[goodguy/history.git] / cinelerra-5.1 / cinelerra / edlsession.C
index 1a83545e063cccf443973b9c7f4583074cd922e4..c65e53f1ba977f0041cb1ed067e1e1f417862f76 100644 (file)
@@ -98,6 +98,7 @@ EDLSession::EDLSession(EDL *edl)
        playback_buffer = 4096;
        playback_cursor_visible = 0;
        playback_preload = 0;
+       proxy_scale = 1;
        decode_subtitles = 0;
        subtitle_number = 0;
        label_cells = 0;
@@ -165,21 +166,23 @@ int EDLSession::need_rerender(EDLSession *ptr)
                (decode_subtitles != ptr->decode_subtitles) ||
                (subtitle_number != ptr->subtitle_number) ||
                (interpolate_raw != ptr->interpolate_raw) ||
-               (white_balance_raw != ptr->white_balance_raw));
+               (white_balance_raw != ptr->white_balance_raw) ||
+               (proxy_scale != ptr->proxy_scale));
 }
 
 void EDLSession::equivalent_output(EDLSession *session, double *result)
 {
-       if(session->output_w != output_w ||
-               session->output_h != output_h ||
-               !EQUIV(session->frame_rate, frame_rate) ||
-               session->color_model != color_model ||
-               session->interpolation_type != interpolation_type ||
-               session->interpolate_raw != interpolate_raw ||
-               session->white_balance_raw != white_balance_raw ||
-               session->mpeg4_deblock != mpeg4_deblock ||
-               session->decode_subtitles != decode_subtitles ||
-               session->subtitle_number != subtitle_number)
+       if( session->output_w != output_w ||
+           session->output_h != output_h ||
+           !EQUIV(session->frame_rate, frame_rate) ||
+           session->color_model != color_model ||
+           session->interpolation_type != interpolation_type ||
+           session->interpolate_raw != interpolate_raw ||
+           session->white_balance_raw != white_balance_raw ||
+           session->mpeg4_deblock != mpeg4_deblock ||
+           session->decode_subtitles != decode_subtitles ||
+           session->subtitle_number != subtitle_number ||
+           session->proxy_scale != proxy_scale )
                *result = 0;
 
 // If it's before the current brender_start, render extra data.
@@ -281,6 +284,7 @@ int EDLSession::load_defaults(BC_Hash *defaults)
        delete playback_config;
        playback_config = new PlaybackConfig;
        playback_config->load_defaults(defaults);
+//     proxy_scale = defaults->get("PROXY_SCALE", 1);
        real_time_playback = defaults->get("PLAYBACK_REALTIME", 0);
        real_time_record = defaults->get("REALTIME_RECORD", 0);
        record_positioning = defaults->get("RECORD_POSITIONING", 1);
@@ -422,6 +426,7 @@ int EDLSession::save_defaults(BC_Hash *defaults)
        defaults->update("PLAYBACK_SOFTWARE_POSITION", playback_software_position);
        playback_config->save_defaults(defaults);
        defaults->update("PLAYBACK_REALTIME", real_time_playback);
+//     defaults->update("PROXY_SCALE", proxy_scale);
        defaults->update("REALTIME_RECORD", real_time_record);
        defaults->update("RECORD_POSITIONING", record_positioning);
        defaults->update("RECORD_RAW_STREAM", record_raw_stream);
@@ -489,6 +494,7 @@ void EDLSession::boundaries()
        Workarounds::clamp(min_meter_db, -80, -20);
        Workarounds::clamp(max_meter_db, 0, 10);
        Workarounds::clamp(frames_per_foot, 1, 32);
+       Workarounds::clamp(proxy_scale, 1, 32);
        Workarounds::clamp(output_w, 16, (int)BC_INFINITY);
        Workarounds::clamp(output_h, 16, (int)BC_INFINITY);
        Workarounds::clamp(video_write_length, 1, 1000);
@@ -546,6 +552,7 @@ int EDLSession::load_video_config(FileXML *file, int append_mode, uint32_t load_
        output_h = file->tag.get_property("OUTPUTH", output_h);
        aspect_w = file->tag.get_property("ASPECTW", aspect_w);
        aspect_h = file->tag.get_property("ASPECTH", aspect_h);
+       proxy_scale = file->tag.get_property("PROXY_SCALE", proxy_scale);
        return 0;
 }
 
@@ -735,6 +742,7 @@ int EDLSession::save_video_config(FileXML *file)
        file->tag.set_property("OUTPUTH", output_h);
        file->tag.set_property("ASPECTW", aspect_w);
        file->tag.set_property("ASPECTH", aspect_h);
+       file->tag.set_property("PROXY_SCALE", proxy_scale);
        file->append_tag();
        file->tag.set_title("/VIDEO");
        file->append_tag();
@@ -873,6 +881,7 @@ int EDLSession::copy(EDLSession *session)
        view_follows_playback = session->view_follows_playback;
        vwindow_meter = session->vwindow_meter;
        vwindow_zoom = session->vwindow_zoom;
+       proxy_scale = session->proxy_scale;
 
        subtitle_number = session->subtitle_number;
        decode_subtitles = session->decode_subtitles;
@@ -887,9 +896,11 @@ void EDLSession::dump()
        printf("EDLSession::dump\n");
        printf("    audio_tracks=%d audio_channels=%d sample_rate=%jd\n"
                "    video_tracks=%d frame_rate=%f output_w=%d output_h=%d aspect_w=%f aspect_h=%f\n"
-               "    decode subtitles=%d subtitle_number=%d label_cells=%d program_no=%d\n",
+               "    decode subtitles=%d subtitle_number=%d label_cells=%d program_no=%d\n"
+               "    proxy_scale=%d\n",
                audio_tracks, audio_channels, sample_rate, video_tracks,
                frame_rate, output_w, output_h, aspect_w, aspect_h,
-               decode_subtitles, subtitle_number, label_cells, program_no);
+               decode_subtitles, subtitle_number, label_cells, program_no,
+               proxy_scale);
 }