proxy/mixer fixes, add proxy beep, igor ru xlat
[goodguy/history.git] / cinelerra-5.1 / cinelerra / edlsession.C
index 5876b9198bc96b101da278af04e160d8c5b056f6..f2c3e6321fc1a6cbd7511ae8d9fe4a33dac8fd02 100644 (file)
@@ -71,8 +71,9 @@ EDLSession::EDLSession(EDL *edl)
        cwindow_scrollbars = 0;
        cwindow_xscroll = cwindow_yscroll = 0;
        cwindow_zoom = 1.0;
-       strcpy(default_atransition, "");
-       strcpy(default_vtransition, "");
+       cwindow_click2play = 0;
+       strcpy(default_atransition, INIT_ATRANSITION);
+       strcpy(default_vtransition, INIT_VTRANSITION);
        default_transition_length = 1.0;
        edit_handle_mode[0] = MOVE_ALL_EDITS;
        edit_handle_mode[1] = MOVE_ONE_EDIT;
@@ -100,6 +101,7 @@ EDLSession::EDLSession(EDL *edl)
        proxy_scale = 1;
        proxy_use_scaler = 0;
        proxy_auto_scale = 1;
+       proxy_beep = 0;
        decode_subtitles = 0;
        subtitle_number = 0;
        label_cells = 0;
@@ -116,15 +118,17 @@ EDLSession::EDLSession(EDL *edl)
        record_write_length = 131072;
        record_realtime_toc = 1;
 
-        safe_regions = 0;
+       safe_regions = 0;
        sample_rate = 48000;
-        scrub_speed = 2.;
-        show_assets = 1;
-        show_titles = 1;
+       scrub_speed = 2.;
+       show_assets = 1;
+       show_titles = 1;
+       si_useduration = 1;
+       si_duration = 3;
        test_playback_edits = 1;
        time_format = TIME_HMSF;
-        nudge_format = 1;
-        tool_window = 0;
+       nudge_format = 1;
+       tool_window = 0;
        for(int i = 0; i < MAXCHANNELS; i++) {
                vchannel_x[i] = 64*i;
                vchannel_y[i] = 0;
@@ -133,13 +137,14 @@ EDLSession::EDLSession(EDL *edl)
        aconfig_in = new AudioInConfig;
        vconfig_in = new VideoInConfig;
        recording_format = new Asset;
-        video_every_frame = 0;
-        video_asynchronous = 0;
+       video_every_frame = 0;
+//     video_asynchronous = 0;
        video_tracks = 1;
        video_write_length = 30;
-        view_follows_playback = 1;
-        vwindow_meter = 0;
-        vwindow_zoom = 1.;
+       view_follows_playback = 1;
+       vwindow_meter = 0;
+       vwindow_zoom = 1.;
+       vwindow_click2play = 0;
 
        playback_config = new PlaybackConfig;
 }
@@ -159,7 +164,7 @@ int EDLSession::need_rerender(EDLSession *ptr)
        return ((playback_preload != ptr->playback_preload) ||
                (interpolation_type != ptr->interpolation_type) ||
                (video_every_frame != ptr->video_every_frame) ||
-               (video_asynchronous != ptr->video_asynchronous) ||
+//             (video_asynchronous != ptr->video_asynchronous) ||
                (real_time_playback != ptr->real_time_playback) ||
                (playback_software_position != ptr->playback_software_position) ||
                (test_playback_edits != ptr->test_playback_edits) ||
@@ -167,7 +172,9 @@ 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) ||
+               (proxy_use_scaler != ptr->proxy_use_scaler));
 }
 
 void EDLSession::equivalent_output(EDLSession *session, double *result)
@@ -192,25 +199,16 @@ void EDLSession::equivalent_output(EDLSession *session, double *result)
                *result = brender_start;
 }
 
-
 int EDLSession::load_defaults(BC_Hash *defaults)
 {
        char string[BCTEXTLEN];
+       audio_channels = defaults->get("ACHANNELS", audio_channels);
+       audio_tracks = defaults->get("ATRACKS", audio_tracks);
 // Default channel positions
-       for(int i = 0; i < MAXCHANNELS; i++)
-       {
+       for( int i=0; i<MAXCHANNELS; ++i ) {
                sprintf(string, "ACHANNEL_ANGLE_%d", i);
-               int default_position = i * 30;
-
-               if(i == 0) default_position = 180;
-               else
-               if(i == 1) default_position = 0;
-               else
-               if(default_position == 90) default_position = 300;
-               else
-               if(default_position == 0) default_position = 330;
-
-               achannel_positions[i] = defaults->get(string, default_position);
+               achannel_positions[i] = defaults->get(string,
+                       default_audio_channel_position(i, audio_channels));
        }
        aconfig_in->load_defaults(defaults);
        assetlist_format = defaults->get("ASSETLIST_FORMAT", ASSETS_ICONS);
@@ -221,8 +219,6 @@ int EDLSession::load_defaults(BC_Hash *defaults)
                sprintf(string, "ASSET_COLUMN%d", i);
                asset_columns[i] = defaults->get(string, 100);
        }
-       audio_channels = defaults->get("ACHANNELS", audio_channels);
-       audio_tracks = defaults->get("ATRACKS", audio_tracks);
        auto_conf->load_defaults(defaults);
        autos_follow_edits = defaults->get("AUTOS_FOLLOW_EDITS", 1);
        brender_start = defaults->get("BRENDER_START", brender_start);
@@ -252,9 +248,10 @@ int EDLSession::load_defaults(BC_Hash *defaults)
        cwindow_xscroll = defaults->get("CWINDOW_XSCROLL", 0);
        cwindow_yscroll = defaults->get("CWINDOW_YSCROLL", 0);
        cwindow_zoom = defaults->get("CWINDOW_ZOOM", (float)1);
-       sprintf(default_atransition, _("Crossfade"));
+       cwindow_click2play = defaults->get("CWINDOW_CLICK2PLAY", 0);
+       sprintf(default_atransition, INIT_ATRANSITION);
        defaults->get("DEFAULT_ATRANSITION", default_atransition);
-       sprintf(default_vtransition, _("Dissolve"));
+       sprintf(default_vtransition, INIT_VTRANSITION);
        defaults->get("DEFAULT_VTRANSITION", default_vtransition);
        default_transition_length = defaults->get("DEFAULT_TRANSITION_LENGTH", (double)1);
        edit_handle_mode[0] = defaults->get("EDIT_HANDLE_MODE0", MOVE_ALL_EDITS);
@@ -328,12 +325,13 @@ int EDLSession::load_defaults(BC_Hash *defaults)
        }
        video_channels = defaults->get("VCHANNELS", video_channels);
        video_every_frame = defaults->get("VIDEO_EVERY_FRAME", 0);
-       video_asynchronous = defaults->get("VIDEO_ASYNCHRONOUS", 0);
+//     video_asynchronous = defaults->get("VIDEO_ASYNCHRONOUS", 0);
        video_tracks = defaults->get("VTRACKS", video_tracks);
        video_write_length = defaults->get("VIDEO_WRITE_LENGTH", 30);
        view_follows_playback = defaults->get("VIEW_FOLLOWS_PLAYBACK", 1);
        vwindow_meter = defaults->get("VWINDOW_METER", 0);
        vwindow_zoom = defaults->get("VWINDOW_ZOOM", (float)1);
+       vwindow_click2play = defaults->get("VWINDOW_CLICK2PLAY", 0);
 
        decode_subtitles = defaults->get("DECODE_SUBTITLES", decode_subtitles);
        subtitle_number = defaults->get("SUBTITLE_NUMBER", subtitle_number);
@@ -394,6 +392,7 @@ int EDLSession::save_defaults(BC_Hash *defaults)
        defaults->update("CWINDOW_XSCROLL", cwindow_xscroll);
        defaults->update("CWINDOW_YSCROLL", cwindow_yscroll);
        defaults->update("CWINDOW_ZOOM", cwindow_zoom);
+       defaults->update("CWINDOW_CLICK2PLAY", cwindow_click2play);
        defaults->update("DEFAULT_ATRANSITION", default_atransition);
        defaults->update("DEFAULT_VTRANSITION", default_vtransition);
        defaults->update("DEFAULT_TRANSITION_LENGTH", default_transition_length);
@@ -441,7 +440,7 @@ int EDLSession::save_defaults(BC_Hash *defaults)
        defaults->update("SAFE_REGIONS", safe_regions);
        defaults->update("SAMPLERATE", sample_rate);
        defaults->update("SCRUB_SPEED", scrub_speed);
-       defaults->update("SI_USEDURATION",si_useduration);
+       defaults->update("SI_USEDURATION",si_useduration);
        defaults->update("SI_DURATION",si_duration);
        defaults->update("SHOW_ASSETS", show_assets);
        defaults->update("SHOW_TITLES", show_titles);
@@ -458,12 +457,13 @@ int EDLSession::save_defaults(BC_Hash *defaults)
        }
        defaults->update("VCHANNELS", video_channels);
        defaults->update("VIDEO_EVERY_FRAME", video_every_frame);
-       defaults->update("VIDEO_ASYNCHRONOUS", video_asynchronous);
+//     defaults->update("VIDEO_ASYNCHRONOUS", video_asynchronous);
        defaults->update("VTRACKS", video_tracks);
        defaults->update("VIDEO_WRITE_LENGTH", video_write_length);
        defaults->update("VIEW_FOLLOWS_PLAYBACK", view_follows_playback);
        defaults->update("VWINDOW_METER", vwindow_meter);
        defaults->update("VWINDOW_ZOOM", vwindow_zoom);
+       defaults->update("VWINDOW_CLICK2PLAY", vwindow_click2play);
 
        defaults->update("DECODE_SUBTITLES", decode_subtitles);
        defaults->update("SUBTITLE_NUMBER", subtitle_number);
@@ -551,6 +551,7 @@ int EDLSession::load_video_config(FileXML *file, int append_mode, uint32_t load_
        proxy_scale = file->tag.get_property("PROXY_SCALE", proxy_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_beep = file->tag.get_property("PROXY_BEEP", proxy_beep);
        return 0;
 }
 
@@ -560,8 +561,6 @@ int EDLSession::load_audio_config(FileXML *file, int append_mode, uint32_t load_
 // load channels setting
        if(append_mode) return 0;
        audio_channels = file->tag.get_property("CHANNELS", (int64_t)audio_channels);
-
-
        for(int i = 0; i < audio_channels; i++)
        {
                sprintf(string, "ACHANNEL_ANGLE_%d", i);
@@ -620,6 +619,7 @@ int EDLSession::load_xml(FileXML *file,
                cwindow_xscroll = file->tag.get_property("CWINDOW_XSCROLL", cwindow_xscroll);
                cwindow_yscroll = file->tag.get_property("CWINDOW_YSCROLL", cwindow_yscroll);
                cwindow_zoom = file->tag.get_property("CWINDOW_ZOOM", cwindow_zoom);
+               cwindow_click2play = file->tag.get_property("CWINDOW_CLICK2PLAY", cwindow_click2play);
                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);
@@ -636,6 +636,7 @@ int EDLSession::load_xml(FileXML *file,
                tool_window = file->tag.get_property("TOOL_WINDOW", tool_window);
                vwindow_meter = file->tag.get_property("VWINDOW_METER", vwindow_meter);
                vwindow_zoom = file->tag.get_property("VWINDOW_ZOOM", vwindow_zoom);
+               vwindow_click2play = file->tag.get_property("VWINDOW_CLICK2PLAY", vwindow_click2play);
 
                decode_subtitles = file->tag.get_property("DECODE_SUBTITLES", decode_subtitles);
                subtitle_number = file->tag.get_property("SUBTITLE_NUMBER", subtitle_number);
@@ -683,6 +684,7 @@ int EDLSession::save_xml(FileXML *file)
        file->tag.set_property("CWINDOW_XSCROLL", cwindow_xscroll);
        file->tag.set_property("CWINDOW_YSCROLL", cwindow_yscroll);
        file->tag.set_property("CWINDOW_ZOOM", cwindow_zoom);
+       file->tag.set_property("CWINDOW_CLICK2PLAY", cwindow_click2play);
        file->tag.set_property("EDITING_MODE", editing_mode);
        file->tag.set_property("FOLDERLIST_FORMAT", folderlist_format);
        file->tag.set_property("HIGHLIGHTED_TRACK", highlighted_track);
@@ -699,6 +701,7 @@ int EDLSession::save_xml(FileXML *file)
        file->tag.set_property("TOOL_WINDOW", tool_window);
        file->tag.set_property("VWINDOW_METER", vwindow_meter);
        file->tag.set_property("VWINDOW_ZOOM", vwindow_zoom);
+       file->tag.set_property("VWINDOW_CLICK2PLAY", vwindow_click2play);
 
        file->tag.set_property("DECODE_SUBTITLES", decode_subtitles);
        file->tag.set_property("SUBTITLE_NUMBER", subtitle_number);
@@ -723,7 +726,7 @@ int EDLSession::save_video_config(FileXML *file)
        file->tag.set_property("COLORMODEL", string);
        ilacemode_to_xmltext(string, interlace_mode);
        file->tag.set_property("INTERLACE_MODE",string);
-    file->tag.set_property("CHANNELS", video_channels);
+       file->tag.set_property("CHANNELS", video_channels);
        for(int i = 0; i < video_channels; i++)
        {
                sprintf(string, "VCHANNEL_X_%d", i);
@@ -741,6 +744,7 @@ int EDLSession::save_video_config(FileXML *file)
        file->tag.set_property("PROXY_SCALE", proxy_scale);
        file->tag.set_property("PROXY_USE_SCALER", proxy_use_scaler);
        file->tag.set_property("PROXY_AUTO_SCALE", proxy_auto_scale);
+       file->tag.set_property("PROXY_BEEP", proxy_beep);
        file->append_tag();
        file->tag.set_title("/VIDEO");
        file->append_tag();
@@ -813,6 +817,7 @@ int EDLSession::copy(EDLSession *session)
        cwindow_xscroll = session->cwindow_xscroll;
        cwindow_yscroll = session->cwindow_yscroll;
        cwindow_zoom = session->cwindow_zoom;
+       cwindow_click2play = session->cwindow_click2play;
        strcpy(default_atransition, session->default_atransition);
        strcpy(default_vtransition, session->default_vtransition);
        default_transition_length = session->default_transition_length;
@@ -872,15 +877,17 @@ int EDLSession::copy(EDLSession *session)
        video_channels = session->video_channels;
        *vconfig_in = *session->vconfig_in;
        video_every_frame = session->video_every_frame;
-       video_asynchronous = session->video_asynchronous;
+//     video_asynchronous = session->video_asynchronous;
        video_tracks = session->video_tracks;
        video_write_length = session->video_write_length;
        view_follows_playback = session->view_follows_playback;
        vwindow_meter = session->vwindow_meter;
        vwindow_zoom = session->vwindow_zoom;
+       vwindow_click2play = session->vwindow_click2play;
        proxy_scale = session->proxy_scale;
        proxy_use_scaler = session->proxy_use_scaler;
        proxy_auto_scale = session->proxy_auto_scale;
+       proxy_beep = session->proxy_beep;
 
        subtitle_number = session->subtitle_number;
        decode_subtitles = session->decode_subtitles;
@@ -896,10 +903,10 @@ void EDLSession::dump()
        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 proxy_use_scaler=%d, proxy_auto_scale=%d\n",
+               "    proxy_scale=%d\n proxy_use_scaler=%d, proxy_auto_scale=%d proxy_beep=%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,
-               proxy_scale, proxy_use_scaler, proxy_auto_scale);
+               proxy_scale, proxy_use_scaler, proxy_auto_scale, proxy_beep);
 }