#include "interlacemodes.h"
#include "labels.h"
#include "localsession.h"
+#include "maskautos.h"
#include "mutex.h"
#include "nestededls.h"
#include "panauto.h"
if((load_flags & LOAD_VCONFIG) &&
(load_flags & LOAD_SESSION))
session->load_video_config(file, 0, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("AUDIO"))
if((load_flags & LOAD_ACONFIG) &&
(load_flags & LOAD_SESSION))
session->load_audio_config(file, 0, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("FOLDER"))
{
if(load_flags & LOAD_ASSETS)
assets->load(file, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is(labels->xml_tag))
{
if(load_flags & LOAD_TIMEBAR)
labels->load(file, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("LOCALSESSION"))
if((load_flags & LOAD_SESSION) ||
(load_flags & LOAD_TIMEBAR))
local_session->load_xml(file, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("SESSION"))
if((load_flags & LOAD_SESSION) &&
!parent_edl)
session->load_xml(file, 0, load_flags);
+ else
+ result = file->skip_tag();
}
else
if(file->tag.title_is("TRACK"))
// Media
// Don't replicate all assets for every clip.
-// The assets for the clips are probably in the mane EDL.
- if(!is_clip)
- copy_assets(start,
- end,
- file,
- all,
- output_path);
-
+// The assets for the clips are probably in the main EDL.
+ if( !is_clip )
+ copy_assets(start, end, file, all, output_path);
// Clips
// Don't want this if using clipboard
if(all)
//printf("EDL::copy 2\n");
// terminate file
- if(is_clip)
+ if( is_clip )
file->tag.set_title("/CLIP_EDL");
- else
- if(is_vwindow)
+ else if( is_vwindow )
file->tag.set_title("/VWINDOW_EDL");
else
file->tag.set_title("/EDL");
return 0;
}
+void EDL::retrack()
+{
+ int min_w = session->output_w, min_h = session->output_h;
+ for( Track *track=tracks->first; track!=0; track=track->next ) {
+ if( track->data_type != TRACK_VIDEO ) continue;
+ int w = min_w, h = min_h;
+ for( Edit *current=track->edits->first; current!=0; current=NEXT ) {
+ Indexable* indexable = current->get_source();
+ if( !indexable ) continue;
+ int edit_w = indexable->get_w(), edit_h = indexable->get_h();
+ if( w < edit_w ) w = edit_w;
+ if( h < edit_h ) h = edit_h;
+ }
+ if( track->track_w == w && track->track_h == h ) continue;
+ ((MaskAutos*)track->automation->autos[AUTOMATION_MASK])->
+ translate_masks( (w - track->track_w) / 2, (h - track->track_h) / 2);
+ track->track_w = w; track->track_h = h;
+ }
+}
+
void EDL::rechannel()
{
for(Track *current = tracks->first; current; current = NEXT)
}
-void EDL::set_path(char *path)
+void EDL::set_path(const char *path)
{
strcpy(this->path, path);
}
// Get the total output size scaled to aspect ratio
void EDL::calculate_conformed_dimensions(int single_channel, float &w, float &h)
{
- w = session->output_w;
- h = session->output_h;
-
if((float)session->output_w / session->output_h > get_aspect_ratio())
- {
- h = (float)h *
- (session->output_w / get_aspect_ratio() / session->output_h);
- }
+ h = (w = session->output_w) / get_aspect_ratio();
else
- {
- w = (float)w *
- (h * get_aspect_ratio() / session->output_w);
- }
+ w = (h = session->output_h) * get_aspect_ratio();
}
float EDL::get_aspect_ratio()
// Convert position to frames if cursor alignment is enabled
double EDL::align_to_frame(double position, int round)
{
-//printf("EDL::align_to_frame 1 %f\n", position);
- if(session->cursor_on_frames)
- {
-// Seconds -> Frames
- double temp = (double)position * session->frame_rate;
-//printf("EDL::align_to_frame 2 %f\n", temp);
-
-// Assert some things
- if(session->sample_rate == 0)
- printf("EDL::align_to_frame: sample_rate == 0\n");
-
- if(session->frame_rate == 0)
- printf("EDL::align_to_frame: frame_rate == 0\n");
-
-// Round frames
-// Always round down negative numbers
-// but round up only if requested
- if(round)
- {
- temp = Units::round(temp);
- }
- else
- {
-// if(temp < 0)
-// {
-// temp -= 0.5;
-// }
-// else
- temp = Units::to_int64(temp);
- }
-//printf("EDL::align_to_frame 3 %f\n", temp);
-
-// Frames -> Seconds
- temp /= session->frame_rate;
-
-//printf("EDL::align_to_frame 5 %f\n", temp);
-
- return temp;
+ if( session->cursor_on_frames && session->frame_rate > 0 ) {
+ double frame_no = position * session->frame_rate;
+ int64_t frame_pos = frame_no + (round ? 0.5 : 1e-6);
+ double pos = frame_pos / session->frame_rate;
+ if( !EQUIV(pos, position) ) position = pos;
}
-//printf("EDL::align_to_frame 3 %d\n", position);
-
-
return position;
}
// Asset and output device must have same resulting de-interlacing method
if( ilaceautofixmethod2(session->interlace_mode,
asset->interlace_autofixoption, asset->interlace_mode,
- asset->interlace_fixmethod) != BC_ILACE_FIXMETHOD_NONE )
+ asset->interlace_fixmethod) != ILACE_FIXMETHOD_NONE )
return 1;
// If we get here the frame is going to be directly copied. Whether it is