mixer
[goodguy/history.git] / cinelerra-5.1 / cinelerra / edl.C
index d6810aa763b05bd779b34a4a3c441c648aa381bf..a27e10cc5e37a287c5244ea22f222945a92ec035 100644 (file)
@@ -240,6 +240,7 @@ int EDL::load_xml(FileXML *file,
                        for(int i = 0; i < clips.size(); i++)
                                clips.get(i)->Garbage::remove_user();
                        clips.remove_all();
+                       mixers.remove_all_objects();
                }
 
                if(load_flags & LOAD_TIMEBAR)
@@ -299,6 +300,14 @@ int EDL::load_xml(FileXML *file,
                                        new_folder(folder);
                                }
                                else
+                               if(file->tag.title_is("MIXERS"))
+                               {
+                                       if((load_flags & LOAD_SESSION))
+                                               mixers.load(file);
+                                       else
+                                               result = file->skip_tag();
+                               }
+                               else
                                if(file->tag.title_is("ASSETS"))
                                {
                                        if(load_flags & LOAD_ASSETS)
@@ -413,6 +422,7 @@ int EDL::copy_all(EDL *edl)
        copy_session(edl);
        copy_assets(edl);
        copy_clips(edl);
+       copy_mixers(edl);
        tracks->copy_from(edl->tracks);
        labels->copy_from(edl->labels);
        return 0;
@@ -456,6 +466,12 @@ void EDL::copy_assets(EDL *edl)
        }
 }
 
+void EDL::copy_mixers(EDL *edl)
+{
+       if(this == edl) return;
+       mixers.copy_from(edl->mixers);
+}
+
 void EDL::copy_session(EDL *edl, int session_only)
 {
        if(this == edl) return;
@@ -629,6 +645,7 @@ int EDL::copy(double start,
                                        output_path,
                                        1,
                                        0);
+                       mixers.save(file);
                }
 
                file->append_newline();
@@ -808,12 +825,23 @@ void EDL::set_outpoint(double position)
        }
 }
 
+void EDL::deglitch(double position)
+{
+       if( !session->cursor_on_frames ) return;
+       Track *current_track = tracks->first; 
+       for( ; current_track; current_track=current_track->next ) {
+               if( !current_track->record ) continue;
+               if( current_track->data_type != TRACK_AUDIO ) continue;
+               ATrack *atrack = (ATrack*)current_track;
+               atrack->deglitch(position, 
+                       session->labels_follow_edits, 
+                       session->plugins_follow_edits, 
+                       session->autos_follow_edits);
+       }
+}
 
-int EDL::clear(double start,
-       double end,
-       int clear_labels,
-       int clear_plugins,
-       int edit_autos)
+int EDL::clear(double start, double end,
+       int clear_labels, int clear_plugins, int edit_autos)
 {
        if(start == end)
        {
@@ -1136,7 +1164,7 @@ void EDL::insert_asset(Asset *asset,
 
        if(new_nested_edl)
        {
-               length = new_nested_edl->tracks->total_playable_length();
+               length = new_nested_edl->tracks->total_length();
                layers = 1;
                channels = new_nested_edl->session->audio_channels;
        }
@@ -1468,7 +1496,7 @@ int EDL::get_sample_rate()
 
 int64_t EDL::get_audio_samples()
 {
-       return (int64_t)(tracks->total_playable_length() *
+       return (int64_t)(tracks->total_length() *
                session->sample_rate);
 }
 
@@ -1505,7 +1533,7 @@ int EDL::get_video_layers()
 
 int64_t EDL::get_video_frames()
 {
-       return (int64_t)(tracks->total_playable_length() *
+       return (int64_t)(tracks->total_length() *
                session->frame_rate);
 }