Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / edlsession.C
index 673ec070f77bb563f8a89e0c8c6d6600d24a42f8..1a761fc0bfb7d2cd240577cd316ab3d9055b120e 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * CINELERRA
  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2003-2016 Cinelerra CV contributors
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -75,7 +76,6 @@ EDLSession::EDLSession(EDL *edl)
        cwindow_zoom = 1.0;
        cwindow_click2play = 0;
        cwindow_clear_color = BLACK;
-       cwindow_clear_alpha = 0;
        strcpy(default_atransition, INIT_ATRANSITION);
        strcpy(default_vtransition, INIT_VTRANSITION);
        default_transition_length = 1.0;
@@ -102,6 +102,7 @@ EDLSession::EDLSession(EDL *edl)
        playback_buffer = 4096;
        playback_cursor_visible = 0;
        playback_preload = 0;
+       proxy_state = PROXY_INACTIVE;
        proxy_scale = 1;
        proxy_disabled_scale = 1;
        proxy_use_scaler = 0;
@@ -129,7 +130,6 @@ EDLSession::EDLSession(EDL *edl)
        scrub_speed = 2.;
        show_assets = 1;
        show_titles = 1;
-       gang_tracks = GANG_NONE;
        si_useduration = 1;
        si_duration = 3;
        test_playback_edits = 1;
@@ -181,11 +181,11 @@ int EDLSession::need_rerender(EDLSession *ptr)
                (subtitle_number != ptr->subtitle_number) ||
                (interpolate_raw != ptr->interpolate_raw) ||
                (white_balance_raw != ptr->white_balance_raw) ||
+               (proxy_state != ptr->proxy_state) ||
                (proxy_disabled_scale != ptr->proxy_disabled_scale) ||
                (proxy_scale != ptr->proxy_scale) ||
                (proxy_use_scaler != ptr->proxy_use_scaler) ||
-               (cwindow_clear_color != ptr->cwindow_clear_color) ||
-               (cwindow_clear_alpha != ptr->cwindow_clear_alpha));
+               (cwindow_clear_color != ptr->cwindow_clear_color));
 }
 
 void EDLSession::equivalent_output(EDLSession *session, double *result)
@@ -199,6 +199,7 @@ void EDLSession::equivalent_output(EDLSession *session, double *result)
            session->white_balance_raw != white_balance_raw ||
            session->decode_subtitles != decode_subtitles ||
            session->subtitle_number != subtitle_number ||
+           session->proxy_state != proxy_state ||
            session->proxy_disabled_scale != proxy_disabled_scale ||
            session->proxy_scale != proxy_scale ||
            session->proxy_use_scaler != proxy_use_scaler )
@@ -262,7 +263,6 @@ int EDLSession::load_defaults(BC_Hash *defaults)
        cwindow_zoom = defaults->get("CWINDOW_ZOOM", (float)1);
        cwindow_click2play = defaults->get("CWINDOW_CLICK2PLAY", 0);
        cwindow_clear_color = defaults->get("CWINDOW_CLEAR_COLOR", BLACK);
-       cwindow_clear_alpha = defaults->get("CWINDOW_CLEAR_ALPHA", 0);
        sprintf(default_atransition, INIT_ATRANSITION);
        defaults->get("DEFAULT_ATRANSITION", default_atransition);
        sprintf(default_vtransition, INIT_VTRANSITION);
@@ -326,7 +326,6 @@ int EDLSession::load_defaults(BC_Hash *defaults)
 
        show_assets = defaults->get("SHOW_ASSETS", 1);
        show_titles = defaults->get("SHOW_TITLES", 1);
-       gang_tracks = defaults->get("GANG_TRACKS", GANG_NONE);
 //     test_playback_edits = defaults->get("TEST_PLAYBACK_EDITS", 1);
        time_format = defaults->get("TIME_FORMAT", TIME_HMSF);
        timecode_offset = defaults->get("TIMECODE_OFFSET", timecode_offset);
@@ -413,7 +412,6 @@ int EDLSession::save_defaults(BC_Hash *defaults)
        defaults->update("CWINDOW_ZOOM", cwindow_zoom);
        defaults->update("CWINDOW_CLICK2PLAY", cwindow_click2play);
        defaults->update("CWINDOW_CLEAR_COLOR", cwindow_clear_color);
-       defaults->update("CWINDOW_CLEAR_ALPHA", cwindow_clear_alpha);
        defaults->update("DEFAULT_ATRANSITION", default_atransition);
        defaults->update("DEFAULT_VTRANSITION", default_vtransition);
        defaults->update("DEFAULT_TRANSITION_LENGTH", default_transition_length);
@@ -466,7 +464,6 @@ int EDLSession::save_defaults(BC_Hash *defaults)
        defaults->update("SI_DURATION",si_duration);
        defaults->update("SHOW_ASSETS", show_assets);
        defaults->update("SHOW_TITLES", show_titles);
-       defaults->update("GANG_TRACKS", gang_tracks);
 //     defaults->update("TEST_PLAYBACK_EDITS", test_playback_edits);
        defaults->update("TIME_FORMAT", time_format);
        defaults->update("TIMECODE_OFFSET", timecode_offset);
@@ -577,6 +574,11 @@ int EDLSession::load_video_config(FileXML *file, int append_mode, uint32_t load_
        proxy_disabled_scale = file->tag.get_property("PROXY_DISABLED_SCALE", proxy_disabled_scale);
        proxy_use_scaler = file->tag.get_property("PROXY_USE_SCALER", proxy_use_scaler);
        proxy_auto_scale = file->tag.get_property("PROXY_AUTO_SCALE", proxy_auto_scale);
+       proxy_state = file->tag.get_property("PROXY_STATE", -1);
+       if( proxy_state < 0 )  // convert older edl
+               proxy_state = proxy_scale != 1 ? PROXY_ACTIVE :
+                       proxy_disabled_scale != 1 ? PROXY_DISABLED :
+                       PROXY_INACTIVE;
        return 0;
 }
 
@@ -641,7 +643,6 @@ int EDLSession::load_xml(FileXML *file,
                cwindow_zoom = file->tag.get_property("CWINDOW_ZOOM", cwindow_zoom);
                cwindow_click2play = file->tag.get_property("CWINDOW_CLICK2PLAY", cwindow_click2play);
                cwindow_clear_color = file->tag.get_property("CWINDOW_CLEAR_COLOR", cwindow_clear_color);
-               cwindow_clear_alpha = file->tag.get_property("CWINDOW_CLEAR_ALPHA", cwindow_clear_alpha);
                editing_mode = file->tag.get_property("EDITING_MODE", editing_mode);
                folderlist_format = file->tag.get_property("FOLDERLIST_FORMAT", folderlist_format);
                highlighted_track = file->tag.get_property("HIGHLIGHTED_TRACK", 0);
@@ -652,7 +653,6 @@ int EDLSession::load_xml(FileXML *file,
                safe_regions = file->tag.get_property("SAFE_REGIONS", safe_regions);
                show_assets = file->tag.get_property("SHOW_ASSETS", 1);
                show_titles = file->tag.get_property("SHOW_TITLES", 1);
-               gang_tracks = file->tag.get_property("GANG_TRACKS", GANG_NONE);
 //             test_playback_edits = file->tag.get_property("TEST_PLAYBACK_EDITS", test_playback_edits);
                time_format = file->tag.get_property("TIME_FORMAT", time_format);
                timecode_offset = file->tag.get_property("TIMECODE_OFFSET", timecode_offset);
@@ -712,7 +712,6 @@ int EDLSession::save_xml(FileXML *file)
        file->tag.set_property("CWINDOW_ZOOM", cwindow_zoom);
        file->tag.set_property("CWINDOW_CLICK2PLAY", cwindow_click2play);
        file->tag.set_property("CWINDOW_CLEAR_COLOR", cwindow_clear_color);
-       file->tag.set_property("CWINDOW_CLEAR_ALPHA", cwindow_clear_alpha);
        file->tag.set_property("EDITING_MODE", editing_mode);
        file->tag.set_property("FOLDERLIST_FORMAT", folderlist_format);
        file->tag.set_property("HIGHLIGHTED_TRACK", highlighted_track);
@@ -723,7 +722,6 @@ int EDLSession::save_xml(FileXML *file)
        file->tag.set_property("SAFE_REGIONS", safe_regions);
        file->tag.set_property("SHOW_ASSETS", show_assets);
        file->tag.set_property("SHOW_TITLES", show_titles);
-       file->tag.set_property("GANG_TRACKS", gang_tracks);
        file->tag.set_property("TEST_PLAYBACK_EDITS", test_playback_edits);
        file->tag.set_property("TIME_FORMAT", time_format);
        file->tag.set_property("TIMECODE_OFFSET", timecode_offset);
@@ -773,6 +771,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_STATE", proxy_state);
        file->tag.set_property("PROXY_SCALE", proxy_scale);
        file->tag.set_property("PROXY_DISABLED_SCALE", proxy_disabled_scale);
        file->tag.set_property("PROXY_USE_SCALER", proxy_use_scaler);
@@ -851,7 +850,6 @@ int EDLSession::copy(EDLSession *session)
        cwindow_zoom = session->cwindow_zoom;
        cwindow_click2play = session->cwindow_click2play;
        cwindow_clear_color = session->cwindow_clear_color;
-       cwindow_clear_alpha = session->cwindow_clear_alpha;
        strcpy(default_atransition, session->default_atransition);
        strcpy(default_vtransition, session->default_vtransition);
        default_transition_length = session->default_transition_length;
@@ -901,7 +899,6 @@ int EDLSession::copy(EDLSession *session)
        si_duration = session->si_duration;
        show_assets = session->show_assets;
        show_titles = session->show_titles;
-       gang_tracks = session->gang_tracks;
        test_playback_edits = session->test_playback_edits;
        time_format = session->time_format;
        timecode_offset = session->timecode_offset;
@@ -921,6 +918,7 @@ int EDLSession::copy(EDLSession *session)
        vwindow_meter = session->vwindow_meter;
        vwindow_zoom = session->vwindow_zoom;
        vwindow_click2play = session->vwindow_click2play;
+       proxy_state = session->proxy_state;
        proxy_scale = session->proxy_scale;
        proxy_disabled_scale = session->proxy_disabled_scale;
        proxy_use_scaler = session->proxy_use_scaler;
@@ -941,13 +939,12 @@ 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"
-               "    proxy scale=%d\n disabled_scale=%d, use_scaler=%d, auto_scale=%d\n"
-               "    proxy_beep=%f render_beep=%f\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,
-               proxy_scale, proxy_disabled_scale, proxy_use_scaler, proxy_auto_scale,
-               proxy_beep, render_beep);
+               "    decode subtitles=%d subtitle_number=%d label_cells=%d program_no=%d render_beep=%f\n"
+               "    proxy_* auto_scale=%d state=%d scale=%d disabled_scale=%d use_scaler=%d beep=%f\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, render_beep,
+               proxy_auto_scale, proxy_state, proxy_scale, proxy_disabled_scale,
+               proxy_use_scaler, proxy_beep);
 }