#include "asset.h"
#include "assets.h"
+#include "awindowgui.h"
#include "bchash.h"
#include "bcsignals.h"
#include "clip.h"
+#include "cstrdup.h"
#include "edl.h"
#include "file.h"
#include "filesystem.h"
jpeg_quality = 80;
aspect_ratio = -1;
- interlace_autofixoption = BC_ILACE_AUTOFIXOPTION_AUTO;
- interlace_mode = BC_ILACE_MODE_UNDETECTED;
- interlace_fixmethod = BC_ILACE_FIXMETHOD_NONE;
+ interlace_autofixoption = ILACE_AUTOFIXOPTION_AUTO;
+ interlace_mode = ILACE_MODE_UNDETECTED;
+ interlace_fixmethod = ILACE_FIXMETHOD_NONE;
ampeg_bitrate = 256;
ampeg_derivative = 3;
actual_width = width = 0;
actual_height = height = 0;
video_length = 0;
+ single_frame = 0;
vmpeg_cmodel = BC_YUV420P;
frame_rate = 0;
program = -1;
void Asset::copy_location(Asset *asset)
{
- strcpy(this->path, asset->path);
- strcpy(this->folder, asset->folder);
+ strcpy(path, asset->path);
+ awindow_folder = asset->awindow_folder;
}
void Asset::copy_format(Asset *asset, int do_index)
this->audio_length = asset->audio_length;
this->video_length = asset->video_length;
-
+ this->single_frame = asset->single_frame;
ampeg_bitrate = asset->ampeg_bitrate;
ampeg_derivative = asset->ampeg_derivative;
return 0;
}
-Asset& Asset::operator=(Asset &asset)
-{
-printf("Asset::operator=\n");
- copy_location(&asset);
- copy_format(&asset, 1);
- return *this;
-}
-
-
-int Asset::equivalent(Asset &asset,
- int test_audio,
- int test_video)
+int Asset::equivalent(Asset &asset, int test_audio, int test_video, EDL *edl)
{
- int result = (!strcmp(asset.path, path) &&
- format == asset.format);
+ int result = format == asset.format ? 1 : 0;
+ if( result && strcmp(asset.path, path) ) {
+ char *out_path = edl ? FileSystem::basepath(edl->path) : 0;
+ char *sp = out_path ? strrchr(out_path,'/') : 0;
+ if( sp ) *++sp = 0;
+ char *apath = FileSystem::basepath(asset.path);
+ char *tpath = FileSystem::basepath(this->path);
+ if( out_path ) {
+ if( *apath != '/' ) {
+ char *cp = cstrcat(2, out_path, apath);
+ delete [] apath; apath = cp;
+ }
+ if( *tpath != '/' ) {
+ char *cp = cstrcat(2, out_path, tpath);
+ delete [] tpath; tpath = cp;
+ }
+ }
+ if( strcmp(apath, tpath) ) result = 1;
+ delete [] apath;
+ delete [] tpath;
+ delete [] out_path;
+ }
if(result && format == FILE_FFMPEG)
result = !strcmp(fformat, asset.fformat);
return result;
}
-int Asset::operator==(Asset &asset)
-{
-
- return equivalent(asset,
- 1,
- 1);
-}
-
-int Asset::operator!=(Asset &asset)
-{
- return !(*this == asset);
-}
-
int Asset::test_path(const char *path)
{
if(!strcasecmp(this->path, path))
else
if(file->tag.title_is("FOLDER"))
{
- strcpy(folder, file->read_text());
+ const char *string = file->tag.get_property("NUMBER");
+ awindow_folder = string ? atoi(string) :
+ AWindowGUI::folder_number(file->read_text());
}
else
if(file->tag.title_is("VIDEO"))
file->tag.get_property("VCODEC", vcodec);
video_length = file->tag.get_property("VIDEO_LENGTH", (int64_t)0);
+ single_frame = file->tag.get_property("SINGLE_FRAME", (int64_t)0);
interlace_autofixoption = file->tag.get_property("INTERLACE_AUTOFIX",0);
- ilacemode_to_xmltext(string, BC_ILACE_MODE_NOTINTERLACED);
- interlace_mode = ilacemode_from_xmltext(file->tag.get_property("INTERLACE_MODE",string), BC_ILACE_MODE_NOTINTERLACED);
+ ilacemode_to_xmltext(string, ILACE_MODE_NOTINTERLACED);
+ interlace_mode = ilacemode_from_xmltext(file->tag.get_property("INTERLACE_MODE",string), ILACE_MODE_NOTINTERLACED);
- ilacefixmethod_to_xmltext(string, BC_ILACE_FIXMETHOD_NONE);
- interlace_fixmethod = ilacefixmethod_from_xmltext(file->tag.get_property("INTERLACE_FIXMETHOD",string), BC_ILACE_FIXMETHOD_NONE);
+ ilacefixmethod_to_xmltext(string, ILACE_FIXMETHOD_NONE);
+ interlace_fixmethod = ilacefixmethod_from_xmltext(file->tag.get_property("INTERLACE_FIXMETHOD",string), ILACE_FIXMETHOD_NONE);
file->tag.get_property("REEL_NAME", reel_name);
reel_number = file->tag.get_property("REEL_NUMBER", reel_number);
file->append_newline();
file->tag.set_title("FOLDER");
+ file->tag.set_property("NUMBER", awindow_folder);
file->append_tag();
- file->append_text(folder);
file->tag.set_title("/FOLDER");
file->append_tag();
file->append_newline();
file->tag.set_property("VCODEC", vcodec);
file->tag.set_property("VIDEO_LENGTH", video_length);
+ file->tag.set_property("SINGLE_FRAME", single_frame);
file->tag.set_property("INTERLACE_AUTOFIX", interlace_autofixoption);
layers = GET_DEFAULT("LAYERS", layers);
if(EQUIV(frame_rate, 0)) frame_rate = GET_DEFAULT("FRAMERATE", frame_rate);
video_length = GET_DEFAULT("VIDEO_LENGTH", (int64_t)0);
+ single_frame = GET_DEFAULT("SINGLE_FRAME", (int64_t)0);
}
ampeg_bitrate = GET_DEFAULT("AMPEG_BITRATE", ampeg_bitrate);
jpeg_quality = GET_DEFAULT("JPEG_QUALITY", jpeg_quality);
aspect_ratio = GET_DEFAULT("ASPECT_RATIO", aspect_ratio);
- interlace_autofixoption = BC_ILACE_AUTOFIXOPTION_AUTO;
- interlace_mode = BC_ILACE_MODE_UNDETECTED;
- interlace_fixmethod = BC_ILACE_FIXMETHOD_UPONE;
+ interlace_autofixoption = ILACE_AUTOFIXOPTION_AUTO;
+ interlace_mode = ILACE_MODE_UNDETECTED;
+ interlace_fixmethod = ILACE_FIXMETHOD_UPONE;
// MPEG format information
vmpeg_iframe_distance = GET_DEFAULT("VMPEG_IFRAME_DISTANCE", vmpeg_iframe_distance);
UPDATE_DEFAULT("LAYERS", layers);
UPDATE_DEFAULT("FRAMERATE", frame_rate);
UPDATE_DEFAULT("VIDEO_LENGTH", video_length);
+ UPDATE_DEFAULT("SINGLE_FRAME", single_frame);
}
fprintf(fp," ff_video_bitrate=%d\n", ff_video_bitrate);
fprintf(fp," ff_video_quality=%d\n", ff_video_quality);
fprintf(fp," audio_data %d channels %d samplerate %d bits %d"
- " byte_order %d signed %d header %d dither %d acodec %c%c%c%c\n",
+ " byte_order %d signed %d header %d dither %d acodec %4.4s\n",
audio_data, channels, sample_rate, bits, byte_order, signed_,
- header, dither, acodec[0], acodec[1], acodec[2], acodec[3]);
+ header, dither, acodec);
fprintf(fp," audio_length %jd\n", audio_length);
char string[BCTEXTLEN];
ilacemode_to_xmltext(string, interlace_mode);
fprintf(fp," video_data %d program %d layers %d framerate %f width %d"
- " height %d vcodec %c%c%c%c aspect_ratio %f ilace_mode %s\n",
+ " height %d vcodec %4.4s aspect_ratio %f ilace_mode %s\n",
video_data, layers, program, frame_rate, width, height,
- vcodec[0], vcodec[1], vcodec[2], vcodec[3], aspect_ratio,string);
- printf(" reel_name %s reel_number %i tcstart %jd tcend %jd tcf %d\n",
+ vcodec, aspect_ratio,string);
+ fprintf(fp," reel_name %s reel_number %i tcstart %jd tcend %jd tcf %d\n",
reel_name, reel_number, tcstart, tcend, tcformat);
- fprintf(fp," video_length %jd \n", video_length);
+ fprintf(fp," video_length %jd repeat %d\n", video_length, single_frame);
return 0;