@echo g++ -o $@ $(CUTOBJS)
@g++ $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS)
-$(BDWRITE): $(BDWOBJS)
+$(BDWRITE): $(BDWOBJS) $(LIBRARIES)
@echo g++ -o $@ $(BDWOBJS)
@g++ $(CFLAGS) -pthread -o $@ $(BDWOBJS) $(LIBS)
float out_x1, out_y1, out_x2, out_y2, out_x3, out_y3, out_x4, out_y4;
if(server->mode == AffineEngine::STRETCH ||
server->mode == AffineEngine::PERSPECTIVE ||
- server->mode == AffineEngine::ROTATE)
+ server->mode == AffineEngine::ROTATE ||
+ server->mode == AffineEngine::TRANSFORM)
{
out_x1 = (float)server->in_x + (float)server->x1 * server->in_w / 100;
out_y1 = (float)server->in_y + (float)server->y1 * server->in_h / 100;
else
if(server->mode == AffineEngine::PERSPECTIVE ||
server->mode == AffineEngine::SHEER ||
- server->mode == AffineEngine::ROTATE)
+ server->mode == AffineEngine::ROTATE ||
+ server->mode == AffineEngine::TRANSFORM)
{
AffineMatrix matrix;
float temp;
+ if(server->mode != AffineEngine::TRANSFORM)
+ {
+ calculate_matrix(
+ server->in_x,
+ server->in_y,
+ server->in_x + server->in_w,
+ server->in_y + server->in_h,
+ out_x1,
+ out_y1,
+ out_x2,
+ out_y2,
+ out_x3,
+ out_y3,
+ out_x4,
+ out_y4,
+ &matrix);
+ }
+ else
+ {
+ matrix.copy_from(&server->matrix);
+ }
- calculate_matrix(
- server->in_x,
- server->in_y,
- server->in_x + server->in_w,
- server->in_y + server->in_h,
- out_x1,
- out_y1,
- out_x2,
- out_y2,
- out_x3,
- out_y3,
- out_x4,
- out_y4,
- &matrix);
-
-// printf("AffineUnit::process_package 10 %f %f %f %f %f %f %f %f\n",
-// out_x1,
-// out_y1,
-// out_x2,
-// out_y2,
-// out_x3,
-// out_y3,
-// out_x4,
-// out_y4);
+// printf("AffineUnit::process_package %d\n%f %f %f\n%f %f %f\n%f %f %f\n",
+// __LINE__,
+// matrix.values[0][0],
+// matrix.values[0][1],
+// matrix.values[0][2],
+// matrix.values[1][0],
+// matrix.values[1][1],
+// matrix.values[1][2],
+// matrix.values[2][0],
+// matrix.values[2][1],
+// matrix.values[2][2]);
int interpolate = 1;
int reverse = !server->forward;
float tx, ty, tw;
}
}
+void AffineEngine::set_matrix(AffineMatrix *matrix)
+{
+ for(int i = 0; i < 3; i++)
+ {
+ for(int j = 0; j < 3; j++)
+ {
+ this->matrix.values[i][j] = matrix->values[i][j];
+ }
+ }
+}
+
void AffineEngine::set_in_viewport(int x, int y, int w, int h)
{
this->in_x = x;
/*
* CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2014 Adam Williams <broadcast at earthling dot net>
*
* 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
void rotate(VFrame *output,
VFrame *input,
float angle);
+ void set_matrix(AffineMatrix *matrix);
// Set the viewport to transform. The transform is based on the input viewport.
// The output viewport clips the transformed output.
void set_in_viewport(int x, int y, int w, int h);
void init_packages();
LoadClient* new_client();
LoadPackage* new_package();
+
+
VFrame *input, *output, *temp;
int mode;
enum
PERSPECTIVE,
SHEER,
STRETCH,
- ROTATE
+ ROTATE,
+// multiply directly by a matrix.
+ TRANSFORM
};
+// arbitrary matrix
+ AffineMatrix matrix;
// Transformation coordinates
float x1, y1, x2, y2, x3, y3, x4, y4;
// Viewport coordinates
input_position,
len,
edl->session->sample_rate,
- 0,
+ end - start,
PLAY_FORWARD);
}
/*
* CINELERRA
* Copyright (C) 2010 Adam Williams <broadcast at earthling dot net>
- *
+ *
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
ff_video_bitrate = 0;
ff_video_quality = 0;
- jpeg_quality = 100;
+ jpeg_quality = 80;
aspect_ratio = -1;
ampeg_bitrate = 256;
theora_keyframe_frequency = 64;
theora_keyframe_force_frequency = 64;
- mp3_bitrate = 256000;
-
-
- mp4a_bitrate = 256000;
- mp4a_quantqual = 100;
-
-
-
// mpeg parameters
vmpeg_iframe_distance = 45;
vmpeg_pframe_distance = 0;
vmpeg_preset = 0;
vmpeg_field_order = 0;
-// Divx parameters. BC_Hash from encore2
- divx_bitrate = 2000000;
- divx_rc_period = 50;
- divx_rc_reaction_ratio = 45;
- divx_rc_reaction_period = 10;
- divx_max_key_interval = 250;
- divx_max_quantizer = 31;
- divx_min_quantizer = 1;
- divx_quantizer = 5;
- divx_quality = 5;
- divx_fix_bitrate = 1;
- divx_use_deblocking = 1;
-
- h264_bitrate = 2000000;
- h264_quantizer = 5;
- h264_fix_bitrate = 0;
-
- ms_bitrate = 1000000;
- ms_bitrate_tolerance = 500000;
- ms_quantization = 10;
- ms_interlaced = 0;
- ms_gop_size = 45;
- ms_fix_bitrate = 1;
-
ac3_bitrate = 128;
png_use_alpha = 0;
header = asset->header;
dither = asset->dither;
mp3_bitrate = asset->mp3_bitrate;
- mp4a_bitrate = asset->mp4a_bitrate;
- mp4a_quantqual = asset->mp4a_quantqual;
use_header = asset->use_header;
aspect_ratio = asset->aspect_ratio;
vorbis_bitrate = asset->vorbis_bitrate;
vorbis_max_bitrate = asset->vorbis_max_bitrate;
-
+
theora_fix_bitrate = asset->theora_fix_bitrate;
theora_bitrate = asset->theora_bitrate;
theora_quality = asset->theora_quality;
vmpeg_preset = asset->vmpeg_preset;
vmpeg_field_order = asset->vmpeg_field_order;
-
- divx_bitrate = asset->divx_bitrate;
- divx_rc_period = asset->divx_rc_period;
- divx_rc_reaction_ratio = asset->divx_rc_reaction_ratio;
- divx_rc_reaction_period = asset->divx_rc_reaction_period;
- divx_max_key_interval = asset->divx_max_key_interval;
- divx_max_quantizer = asset->divx_max_quantizer;
- divx_min_quantizer = asset->divx_min_quantizer;
- divx_quantizer = asset->divx_quantizer;
- divx_quality = asset->divx_quality;
- divx_fix_bitrate = asset->divx_fix_bitrate;
- divx_use_deblocking = asset->divx_use_deblocking;
-
- h264_bitrate = asset->h264_bitrate;
- h264_quantizer = asset->h264_quantizer;
- h264_fix_bitrate = asset->h264_fix_bitrate;
-
-
- ms_bitrate = asset->ms_bitrate;
- ms_bitrate_tolerance = asset->ms_bitrate_tolerance;
- ms_interlaced = asset->ms_interlaced;
- ms_quantization = asset->ms_quantization;
- ms_gop_size = asset->ms_gop_size;
- ms_fix_bitrate = asset->ms_fix_bitrate;
-
-
ac3_bitrate = asset->ac3_bitrate;
-
+
png_use_alpha = asset->png_use_alpha;
exr_use_alpha = asset->exr_use_alpha;
exr_compression = asset->exr_compression;
}
-int Asset::equivalent(Asset &asset,
- int test_audio,
+int Asset::equivalent(Asset &asset,
+ int test_audio,
int test_video)
{
int result = (!strcmp(asset.path, path) &&
if(test_audio && result)
{
- result = (channels == asset.channels &&
- sample_rate == asset.sample_rate &&
- bits == asset.bits &&
- byte_order == asset.byte_order &&
- signed_ == asset.signed_ &&
- header == asset.header &&
+ result = (channels == asset.channels &&
+ sample_rate == asset.sample_rate &&
+ bits == asset.bits &&
+ byte_order == asset.byte_order &&
+ signed_ == asset.signed_ &&
+ header == asset.header &&
dither == asset.dither &&
!strcmp(acodec, asset.acodec));
if(result && format == FILE_FFMPEG)
result = !strcmp(ff_audio_options, asset.ff_audio_options) &&
ff_audio_bitrate == asset.ff_audio_bitrate;
-
+
}
if(test_video && result)
{
- result = (layers == asset.layers &&
- program == asset.program &&
+ result = (layers == asset.layers &&
+ program == asset.program &&
frame_rate == asset.frame_rate &&
width == asset.width &&
height == asset.height &&
int Asset::operator==(Asset &asset)
{
- return equivalent(asset,
- 1,
+ return equivalent(asset,
+ 1,
1);
}
int Asset::test_path(const char *path)
{
- if(!strcasecmp(this->path, path))
- return 1;
- else
+ if(!strcasecmp(this->path, path))
+ return 1;
+ else
return 0;
}
return 0;
}
-int Asset::read(FileXML *file,
+int Asset::read(FileXML *file,
int expand_relative)
{
int result = 0;
{
const char *string = file->tag.get_property("TYPE");
format = File::strtoformat(string);
- use_header =
+ use_header =
file->tag.get_property("USE_HEADER", use_header);
file->tag.get_property("FFORMAT", fformat);
}
{
if(file->tag.title_is("AUDIO")) audio_data = 1;
channels = file->tag.get_property("CHANNELS", 2);
-// This is loaded from the index file after the EDL but this
+// This is loaded from the index file after the EDL but this
// should be overridable in the EDL.
- if(!sample_rate) sample_rate = file->tag.get_property("RATE", 44100);
+ if(!sample_rate) sample_rate = file->tag.get_property("RATE", 48000);
bits = file->tag.get_property("BITS", 16);
byte_order = file->tag.get_property("BYTE_ORDER", 1);
signed_ = file->tag.get_property("SIGNED", 1);
width = file->tag.get_property("WIDTH", width);
layers = file->tag.get_property("LAYERS", layers);
program = file->tag.get_property("PROGRAM", program);
-// This is loaded from the index file after the EDL but this
+// This is loaded from the index file after the EDL but this
// should be overridable in the EDL.
if(EQUIV(frame_rate, 0)) frame_rate = file->tag.get_property("FRAMERATE", frame_rate);
vcodec[0] = 0;
// Output path is the path of the output file if name truncation is desired.
// It is a "" if complete names should be used.
-int Asset::write(FileXML *file,
- int include_index,
+int Asset::write(FileXML *file,
+ int include_index,
const char *output_path)
{
char new_path[BCTEXTLEN];
// Make path relative
fs.extract_dir(asset_directory, path);
- if(output_path && output_path[0])
+ if(output_path && output_path[0])
fs.extract_dir(output_directory, output_path);
else
output_directory[0] = 0;
// Write the format information
file->tag.set_title("FORMAT");
- file->tag.set_property("TYPE",
+ file->tag.set_property("TYPE",
File::formattostr(format));
file->tag.set_property("USE_HEADER", use_header);
file->tag.set_property("FFORMAT", fformat);
file->append_newline();
// Requiring data to exist caused batch render to lose settings.
-// But the only way to know if an asset doesn't have audio or video data
+// But the only way to know if an asset doesn't have audio or video data
// is to not write the block.
// So change the block name if the asset doesn't have the data.
write_audio(file);
write_video(file);
// index goes after source
- if(index_state->index_status == INDEX_READY && include_index)
- write_index(file);
+ if(index_state->index_status == INDEX_READY && include_index)
+ write_index(file);
file->tag.set_title("/ASSET");
file->append_tag();
file->tag.set_property("DITHER", dither);
if(acodec[0])
file->tag.set_property("ACODEC", acodec);
-
+
file->tag.set_property("AUDIO_LENGTH", audio_length);
// file->tag.set_property("AMPEG_BITRATE", ampeg_bitrate);
// file->tag.set_property("AMPEG_DERIVATIVE", ampeg_derivative);
-//
+//
// file->tag.set_property("VORBIS_VBR", vorbis_vbr);
// file->tag.set_property("VORBIS_MIN_BITRATE", vorbis_min_bitrate);
// file->tag.set_property("VORBIS_BITRATE", vorbis_bitrate);
// file->tag.set_property("VORBIS_MAX_BITRATE", vorbis_max_bitrate);
-//
+//
// file->tag.set_property("MP3_BITRATE", mp3_bitrate);
-//
+//
-const char* Asset::construct_param(const char *param,
- const char *prefix,
+const char* Asset::construct_param(const char *param,
+ const char *prefix,
char *return_value)
{
if(prefix)
#define UPDATE_DEFAULT(x, y) defaults->update(construct_param(x, prefix, string), y);
#define GET_DEFAULT(x, y) defaults->get(construct_param(x, prefix, string), y);
-void Asset::load_defaults(BC_Hash *defaults,
- const char *prefix,
+void Asset::load_defaults(BC_Hash *defaults,
+ const char *prefix,
int do_format,
int do_compression,
int do_path,
channels = GET_DEFAULT("CHANNELS", 2);
- if(!sample_rate) sample_rate = GET_DEFAULT("RATE", 44100);
+ if(!sample_rate) sample_rate = GET_DEFAULT("RATE", 48000);
header = GET_DEFAULT("HEADER", 0);
audio_length = GET_DEFAULT("AUDIO_LENGTH", (int64_t)0);
ff_video_quality = GET_DEFAULT("FF_VIDEO_QUALITY", ff_video_quality);
mp3_bitrate = GET_DEFAULT("MP3_BITRATE", mp3_bitrate);
- mp4a_bitrate = GET_DEFAULT("MP4A_BITRATE", mp4a_bitrate);
- mp4a_quantqual = GET_DEFAULT("MP4A_QUANTQUAL", mp4a_quantqual);
jpeg_quality = GET_DEFAULT("JPEG_QUALITY", jpeg_quality);
aspect_ratio = GET_DEFAULT("ASPECT_RATIO", aspect_ratio);
vmpeg_preset = GET_DEFAULT("VMPEG_PRESET", vmpeg_preset);
vmpeg_field_order = GET_DEFAULT("VMPEG_FIELD_ORDER", vmpeg_field_order);
- h264_bitrate = GET_DEFAULT("H264_BITRATE", h264_bitrate);
- h264_quantizer = GET_DEFAULT("H264_QUANTIZER", h264_quantizer);
- h264_fix_bitrate = GET_DEFAULT("H264_FIX_BITRATE", h264_fix_bitrate);
-
-
- divx_bitrate = GET_DEFAULT("DIVX_BITRATE", divx_bitrate);
- divx_rc_period = GET_DEFAULT("DIVX_RC_PERIOD", divx_rc_period);
- divx_rc_reaction_ratio = GET_DEFAULT("DIVX_RC_REACTION_RATIO", divx_rc_reaction_ratio);
- divx_rc_reaction_period = GET_DEFAULT("DIVX_RC_REACTION_PERIOD", divx_rc_reaction_period);
- divx_max_key_interval = GET_DEFAULT("DIVX_MAX_KEY_INTERVAL", divx_max_key_interval);
- divx_max_quantizer = GET_DEFAULT("DIVX_MAX_QUANTIZER", divx_max_quantizer);
- divx_min_quantizer = GET_DEFAULT("DIVX_MIN_QUANTIZER", divx_min_quantizer);
- divx_quantizer = GET_DEFAULT("DIVX_QUANTIZER", divx_quantizer);
- divx_quality = GET_DEFAULT("DIVX_QUALITY", divx_quality);
- divx_fix_bitrate = GET_DEFAULT("DIVX_FIX_BITRATE", divx_fix_bitrate);
- divx_use_deblocking = GET_DEFAULT("DIVX_USE_DEBLOCKING", divx_use_deblocking);
-
- ms_bitrate = GET_DEFAULT("MS_BITRATE", ms_bitrate);
- ms_bitrate_tolerance = GET_DEFAULT("MS_BITRATE_TOLERANCE", ms_bitrate_tolerance);
- ms_interlaced = GET_DEFAULT("MS_INTERLACED", ms_interlaced);
- ms_quantization = GET_DEFAULT("MS_QUANTIZATION", ms_quantization);
- ms_gop_size = GET_DEFAULT("MS_GOP_SIZE", ms_gop_size);
- ms_fix_bitrate = GET_DEFAULT("MS_FIX_BITRATE", ms_fix_bitrate);
-
ac3_bitrate = GET_DEFAULT("AC3_BITRATE", ac3_bitrate);
png_use_alpha = GET_DEFAULT("PNG_USE_ALPHA", png_use_alpha);
boundaries();
}
-void Asset::save_defaults(BC_Hash *defaults,
+void Asset::save_defaults(BC_Hash *defaults,
const char *prefix,
int do_format,
int do_compression,
UPDATE_DEFAULT("MP3_BITRATE", mp3_bitrate);
- UPDATE_DEFAULT("MP4A_BITRATE", mp4a_bitrate);
- UPDATE_DEFAULT("MP4A_QUANTQUAL", mp4a_quantqual);
-
-
-
-
UPDATE_DEFAULT("JPEG_QUALITY", jpeg_quality);
UPDATE_DEFAULT("ASPECT_RATIO", aspect_ratio);
UPDATE_DEFAULT("VMPEG_PRESET", vmpeg_preset);
UPDATE_DEFAULT("VMPEG_FIELD_ORDER", vmpeg_field_order);
- UPDATE_DEFAULT("H264_BITRATE", h264_bitrate);
- UPDATE_DEFAULT("H264_QUANTIZER", h264_quantizer);
- UPDATE_DEFAULT("H264_FIX_BITRATE", h264_fix_bitrate);
-
- UPDATE_DEFAULT("DIVX_BITRATE", divx_bitrate);
- UPDATE_DEFAULT("DIVX_RC_PERIOD", divx_rc_period);
- UPDATE_DEFAULT("DIVX_RC_REACTION_RATIO", divx_rc_reaction_ratio);
- UPDATE_DEFAULT("DIVX_RC_REACTION_PERIOD", divx_rc_reaction_period);
- UPDATE_DEFAULT("DIVX_MAX_KEY_INTERVAL", divx_max_key_interval);
- UPDATE_DEFAULT("DIVX_MAX_QUANTIZER", divx_max_quantizer);
- UPDATE_DEFAULT("DIVX_MIN_QUANTIZER", divx_min_quantizer);
- UPDATE_DEFAULT("DIVX_QUANTIZER", divx_quantizer);
- UPDATE_DEFAULT("DIVX_QUALITY", divx_quality);
- UPDATE_DEFAULT("DIVX_FIX_BITRATE", divx_fix_bitrate);
- UPDATE_DEFAULT("DIVX_USE_DEBLOCKING", divx_use_deblocking);
-
-
- UPDATE_DEFAULT("MS_BITRATE", ms_bitrate);
- UPDATE_DEFAULT("MS_BITRATE_TOLERANCE", ms_bitrate_tolerance);
- UPDATE_DEFAULT("MS_INTERLACED", ms_interlaced);
- UPDATE_DEFAULT("MS_QUANTIZATION", ms_quantization);
- UPDATE_DEFAULT("MS_GOP_SIZE", ms_gop_size);
- UPDATE_DEFAULT("MS_FIX_BITRATE", ms_fix_bitrate);
UPDATE_DEFAULT("AC3_BITRATE", ac3_bitrate);
video_data, layers, program, frame_rate, width, height,
vcodec[0], vcodec[1], vcodec[2], vcodec[3], aspect_ratio);
fprintf(fp," video_length " _LD " \n", video_length);
- fprintf(fp," ms_bitrate_tolerance=%d\n", ms_bitrate_tolerance);
- fprintf(fp," ms_quantization=%d\n", ms_quantization);
- fprintf(fp," ms_fix_bitrate=%d\n", ms_fix_bitrate);
- fprintf(fp," ms_interlaced=%d\n", ms_interlaced);
- fprintf(fp," h264_bitrate=%d\n", h264_bitrate);
- fprintf(fp," h264_quantizer=%d\n", h264_quantizer);
- fprintf(fp," h264_fix_bitrate=%d\n", h264_fix_bitrate);
return 0;
}
int write_index(FileXML *xml);
-
// Format of file. An enumeration from file.inc.
int format;
+// mp3 compression
+ int mp3_bitrate;
+
// mpeg audio information
int ampeg_bitrate;
// 2 - 3
int theora_keyframe_force_frequency;
-// mp3 compression
- int mp3_bitrate;
-
-// mp4a compression
- int mp4a_bitrate;
- int mp4a_quantqual;
-
-
// Set by package render during file creation. -1 means square pixels.
double aspect_ratio;
int ff_video_bitrate;
int ff_video_quality;
-// Divx video compression
- int divx_bitrate;
- int divx_rc_period;
- int divx_rc_reaction_ratio;
- int divx_rc_reaction_period;
- int divx_max_key_interval;
- int divx_max_quantizer;
- int divx_min_quantizer;
- int divx_quantizer;
- int divx_quality;
- int divx_fix_bitrate;
-
-// h264 video compression
- int h264_bitrate;
- int h264_quantizer;
- int h264_fix_bitrate;
-
-// Divx video decompression
- int divx_use_deblocking;
-
// PNG video compression
int png_use_alpha;
int tiff_cmodel;
int tiff_compression;
-// Microsoft MPEG-4
- int ms_bitrate;
- int ms_bitrate_tolerance;
- int ms_interlaced;
- int ms_quantization;
- int ms_gop_size;
- int ms_fix_bitrate;
-
-
int ac3_bitrate;
// Image file sequences. Background rendering doesn't want to write a
// We still want sequence headers sometimes because loading a directory full of images
// for editing would create new assets for every image.
int use_header;
-
-
};
#include "awindow.h"
#include "awindowgui.h"
#include "awindowmenu.h"
+#include "bcsignals.h"
#include "clipedit.h"
#include "cwindow.h"
#include "cwindowgui.h"
int AssetPopupProjectRemove::handle_event()
{
- mwindow->remove_assets_from_project(1);
+ mwindow->remove_assets_from_project(1,
+ 1,
+ mwindow->session->drag_assets,
+ mwindow->session->drag_clips);
return 1;
}
int count = samples;
snd_pcm_sframes_t delay = 0;
+// static FILE *debug_fd = 0;
+// if(!debug_fd)
+// {
+// debug_fd = fopen("/tmp/debug.pcm", "w");
+// }
+// fwrite(buffer, size, 1, debug_fd);
+// fflush(debug_fd);
+
+
if(!get_output()) return 0;
if( buffer_position == 0 )
timer->update();
static int auto_defaults[AUTOMATION_TOTAL] =
{
0, // MUTE,
- 1, // CAMERA_X
- 1, // CAMERA_Y
+ 0, // CAMERA_X
+ 0, // CAMERA_Y
0, // CAMERA_Z
- 1, // PROJECTOR_X
- 1, // PROJECTOR_Y
+ 0, // PROJECTOR_X
+ 0, // PROJECTOR_Y
0, // PROJECTOR_Z
0, // FADE
0, // PAN
0, // SPEED
};
-
int AutoConf::load_defaults(BC_Hash* defaults)
{
for(int i = 0; i < AUTOMATION_TOTAL; i++)
file->set_interpolate_raw(edl->session->interpolate_raw);
file->set_white_balance_raw(edl->session->white_balance_raw);
-
-// Copy decoding parameters from session to asset so file can see them.
- this->asset->divx_use_deblocking = edl->session->mpeg4_deblock;
SET_TRACE
}
/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include "asset.h"
return result;
}
-int ConfirmSave::test_files(MWindow *mwindow,
- ArrayList<char*> *paths)
+int ConfirmSave::test_files(MWindow *mwindow, ArrayList<char*> *paths)
{
FILE *file;
ArrayList<BC_ListBoxItem*> list;
int result = 0;
- for(int i = 0; i < paths->total; i++)
- {
+ for(int i = 0; i < paths->size(); i++) {
char *path = paths->values[i];
- if( (file=fopen(path, "r")) != 0 )
- {
+ if( (file=fopen(path, "r")) != 0 ) {
fclose(file);
list.append(new BC_ListBoxItem(path));
}
}
- if(list.total)
- {
- if(mwindow)
- {
+ if(list.total) {
+ if(mwindow) {
ConfirmSaveWindow window(mwindow, &list);
window.create_objects();
window.raise_window();
result = window.run_window();
}
- else
- {
+ else {
printf(_("The following files exist:\n"));
- for(int i = 0; i < list.total; i++)
- {
+ for(int i = 0; i < list.total; i++) {
printf(" %s\n", list.values[i]->get_text());
}
printf(_("Won't overwrite existing files.\n"));
list.remove_all_objects();
return result;
}
- else
- {
+ else {
list.remove_all_objects();
return 0;
}
-ConfirmSaveWindow::ConfirmSaveWindow(MWindow *mwindow,
+ConfirmSaveWindow::ConfirmSaveWindow(MWindow *mwindow,
ArrayList<BC_ListBoxItem*> *list)
- : BC_Window(_(PROGRAM_NAME ": File Exists"),
- mwindow->gui->get_abs_cursor_x(1) - 160,
- mwindow->gui->get_abs_cursor_y(1) - 120,
- 320,
+ : BC_Window(_(PROGRAM_NAME ": File Exists"),
+ mwindow->gui->get_abs_cursor_x(1) - 160,
+ mwindow->gui->get_abs_cursor_y(1) - 120,
+ 320,
320)
{
this->list = list;
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
- add_subwindow(title = new BC_Title(x,
- y,
+ add_subwindow(title = new BC_Title(x,
+ y,
_("The following files exist. Overwrite them?")));
y += 30;
- add_subwindow(listbox = new BC_ListBox(x,
- y,
+ add_subwindow(listbox = new BC_ListBox(x,
+ y,
get_w() - x - 10,
get_h() - y - BC_OKButton::calculate_h() - 10,
LISTBOX_TEXT,
// Show ruler
do_ruler(1, 0, 0, 0);
get_canvas()->flash();
+ gui->update_tool();
}
else
switch(gui->ruler_handle)
*/
#include "automation.h"
+#include "cicolors.h"
#include "clip.h"
#include "condition.h"
#include "cpanel.h"
thread,
_(PROGRAM_NAME ": Color"),
200,
- 200)
+ 250)
{
}
int y = margin;
int x2 = 70;
lock_window("CWindowEyedropGUI::create_objects");
- BC_Title *title1, *title2, *title3, *title4;
- add_subwindow(title4 = new BC_Title(x, y, _("Radius:")));
+ BC_Title *title1, *title2, *title3, *title4, *title5, *title6, *title7;
+ add_subwindow(title7 = new BC_Title(x, y, _("Radius:")));
y += BC_TextBox::calculate_h(this, MEDIUMFONT, 1, 1) + margin;
add_subwindow(title1 = new BC_Title(x, y, _("Red:")));
add_subwindow(title2 = new BC_Title(x, y, _("Green:")));
y += title2->get_h() + margin;
add_subwindow(title3 = new BC_Title(x, y, _("Blue:")));
+ y += title3->get_h() + margin;
+
+ add_subwindow(title4 = new BC_Title(x, y, "Y:"));
+ y += title4->get_h() + margin;
+ add_subwindow(title5 = new BC_Title(x, y, "U:"));
+ y += title5->get_h() + margin;
+ add_subwindow(title6 = new BC_Title(x, y, "V:"));
radius = new CWindowCoord(this,
x2,
- title4->get_y(),
+ title7->get_y(),
mwindow->edl->session->eyedrop_radius);
radius->create_objects();
radius->set_boundaries((int64_t)0, (int64_t)255);
add_subwindow(green = new BC_Title(x2, title2->get_y(), "0"));
add_subwindow(blue = new BC_Title(x2, title3->get_y(), "0"));
- y = blue->get_y() + blue->get_h() + margin;
+ add_subwindow(this->y = new BC_Title(x2, title4->get_y(), "0"));
+ add_subwindow(this->u = new BC_Title(x2, title5->get_y(), "0"));
+ add_subwindow(this->v = new BC_Title(x2, title6->get_y(), "0"));
+
+ y = title6->get_y() + this->v->get_h() + margin;
add_subwindow(sample = new BC_SubWindow(x, y, 50, 50));
update();
unlock_window();
green->update(mwindow->edl->local_session->green);
blue->update(mwindow->edl->local_session->blue);
+ float y, u, v;
+ YUV::rgb_to_yuv_f(mwindow->edl->local_session->red,
+ mwindow->edl->local_session->green,
+ mwindow->edl->local_session->blue,
+ y,
+ u,
+ v);
+ this->y->update(y);
+ this->u->update(u);
+ this->v->update(v);
+
int red = (int)(CLIP(mwindow->edl->local_session->red, 0, 1) * 0xff);
int green = (int)(CLIP(mwindow->edl->local_session->green, 0, 1) * 0xff);
int blue = (int)(CLIP(mwindow->edl->local_session->blue, 0, 1) * 0xff);
void update();
CWindowCoord *radius;
- BC_Title *red, *green, *blue;
+ BC_Title *red, *green, *blue, *y, *u, *v;
BC_SubWindow *sample;
};
char output_directory[BCTEXTLEN];
FileSystem fs;
-//printf("Edit::copy 6 %s\n", asset->path);
+//printf("Edit::copy %d %s\n", __LINE__, asset->path);
fs.extract_dir(asset_directory, asset->path);
-//printf("Edit::copy 6 %s\n", asset->path);
+//printf("Edit::copy %d %s\n", __LINE__, asset->path);
if(output_path)
fs.extract_dir(output_directory, output_path);
/*
* CINELERRA
* Copyright (C) 1997-2012 Adam Williams <broadcast at earthling dot net>
- *
+ *
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include "asset.h"
assets = parent_edl->assets;
session = parent_edl->session;
}
-
+
local_session = new LocalSession(this);
labels = new Labels(this, "LABELS");
nested_edls = new NestedEDLs;
{
if(!parent_edl)
session->save_defaults(defaults);
-
+
local_session->save_defaults(defaults);
return 0;
}
return 0;
}
-int EDL::load_xml(FileXML *file,
+int EDL::load_xml(FileXML *file,
uint32_t load_flags)
{
int result = 0;
// Clear objects
folders.remove_all_objects();
- if((load_flags & LOAD_ALL) == LOAD_ALL)
+ if((load_flags & LOAD_ALL) == LOAD_ALL)
{
remove_vwindow_edls();
}
{
do{
result = file->read_tag();
- }while(!result &&
- !file->tag.title_is("XML") &&
+ }while(!result &&
+ !file->tag.title_is("XML") &&
!file->tag.title_is("EDL"));
}
else
if(file->tag.title_is("CLIPBOARD"))
{
- local_session->clipboard_length =
+ local_session->clipboard_length =
file->tag.get_property("LENGTH", (double)0);
}
else
if((load_flags & LOAD_ALL) == LOAD_ALL)
{
-// if(vwindow_edl && !vwindow_edl_shared)
+// if(vwindow_edl && !vwindow_edl_shared)
// vwindow_edl->Garbage::remove_user();
// vwindow_edl_shared = 0;
// vwindow_edl = new_edl;
// It is a "" if complete names should be used.
// Called recursively by copy for clips, thus the string can't be terminated.
// The string is not terminated in this call.
-int EDL::save_xml(FileXML *file,
+int EDL::save_xml(FileXML *file,
const char *output_path,
int is_clip,
int is_vwindow)
{
- copy(0,
- tracks->total_length(),
- 1,
+ copy(0,
+ tracks->total_length(),
+ 1,
is_clip,
is_vwindow,
- file,
+ file,
output_path,
0);
return 0;
remove_vwindow_edls();
-// if(vwindow_edl && !vwindow_edl_shared)
+// if(vwindow_edl && !vwindow_edl_shared)
// vwindow_edl->Garbage::remove_user();
// vwindow_edl = 0;
// vwindow_edl_shared = 0;
}
}
-int EDL::copy_assets(double start,
- double end,
- FileXML *file,
- int all,
+int EDL::copy_assets(double start,
+ double end,
+ FileXML *file,
+ int all,
const char *output_path)
{
ArrayList<Asset*> asset_list;
else
// Copy just the ones being used.
{
- for(current = tracks->first;
- current;
+ for(current = tracks->first;
+ current;
current = NEXT)
{
if(current->record)
{
- current->copy_assets(start,
- end,
+ current->copy_assets(start,
+ end,
&asset_list);
}
}
// Paths relativised here
for(int i = 0; i < asset_list.total; i++)
{
- asset_list.values[i]->write(file,
- 0,
+ asset_list.values[i]->write(file,
+ 0,
output_path);
}
return 0;
}
-int EDL::copy(double start,
- double end,
- int all,
+int EDL::copy(double start,
+ double end,
+ int all,
int is_clip,
int is_vwindow,
- FileXML *file,
+ FileXML *file,
const char *output_path,
int rewind_it)
{
// 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,
+ copy_assets(start,
+ end,
+ file,
+ all,
output_path);
// Clips
{
for(int i = 0; i < total_vwindow_edls(); i++)
{
- get_vwindow_edl(i)->save_xml(file,
+ get_vwindow_edl(i)->save_xml(file,
output_path,
0,
1);
}
for(int i = 0; i < clips.total; i++)
- clips.values[i]->save_xml(file,
+ clips.values[i]->save_xml(file,
output_path,
1,
0);
void EDL::synchronize_params(EDL *edl)
{
local_session->synchronize_params(edl->local_session);
- for(Track *this_track = tracks->first, *that_track = edl->tracks->first;
- this_track && that_track;
+ for(Track *this_track = tracks->first, *that_track = edl->tracks->first;
+ this_track && that_track;
this_track = this_track->next,
that_track = that_track->next)
{
}
}
-int EDL::trim_selection(double start,
+int EDL::trim_selection(double start,
double end,
int edit_labels,
int edit_plugins,
if(start != end)
{
// clear the data
- clear(0,
+ clear(0,
start,
edit_labels,
edit_plugins,
edit_autos);
- clear(end - start,
+ clear(end - start,
tracks->total_length(),
edit_labels,
edit_plugins,
int EDL::equivalent(double position1, double position2)
{
double threshold = (double).5 / session->frame_rate;
- if(session->cursor_on_frames)
+ if(session->cursor_on_frames)
threshold = (double).5 / session->frame_rate;
else
threshold = (double)1 / session->sample_rate;
void EDL::set_inpoint(double position)
{
- if(equivalent(local_session->get_inpoint(), position) &&
+ if(equivalent(local_session->get_inpoint(), position) &&
local_session->get_inpoint() >= 0)
{
local_session->unset_inpoint();
else
{
local_session->set_inpoint(align_to_frame(position, 0));
- if(local_session->get_outpoint() <= local_session->get_inpoint())
+ if(local_session->get_outpoint() <= local_session->get_inpoint())
local_session->unset_outpoint();
}
}
void EDL::set_outpoint(double position)
{
- if(equivalent(local_session->get_outpoint(), position) &&
+ if(equivalent(local_session->get_outpoint(), position) &&
local_session->get_outpoint() >= 0)
{
local_session->unset_outpoint();
else
{
local_session->set_outpoint(align_to_frame(position, 0));
- if(local_session->get_inpoint() >= local_session->get_outpoint())
+ if(local_session->get_inpoint() >= local_session->get_outpoint())
local_session->unset_inpoint();
}
}
-int EDL::clear(double start,
- double end,
+int EDL::clear(double start,
+ double end,
int clear_labels,
int clear_plugins,
int edit_autos)
if(start == end)
{
double distance = 0;
- tracks->clear_handle(start,
+ tracks->clear_handle(start,
end,
- distance,
+ distance,
clear_labels,
clear_plugins,
edit_autos);
if(clear_labels && distance > 0)
- labels->paste_silence(start,
+ labels->paste_silence(start,
start + distance);
}
else
{
- tracks->clear(start,
+ tracks->clear(start,
end,
clear_plugins,
edit_autos);
- if(clear_labels)
- labels->clear(start,
- end,
+ if(clear_labels)
+ labels->clear(start,
+ end,
1);
}
return 0;
}
-void EDL::modify_edithandles(double oldposition,
- double newposition,
+void EDL::modify_edithandles(double oldposition,
+ double newposition,
int currentend,
int handle_mode,
int edit_labels,
int edit_plugins,
int edit_autos)
{
- tracks->modify_edithandles(oldposition,
- newposition,
+ tracks->modify_edithandles(oldposition,
+ newposition,
currentend,
handle_mode,
- edit_labels,
+ edit_labels,
edit_plugins,
edit_autos);
- labels->modify_handles(oldposition,
- newposition,
+ labels->modify_handles(oldposition,
+ newposition,
currentend,
handle_mode,
edit_labels);
}
-void EDL::modify_pluginhandles(double oldposition,
- double newposition,
- int currentend,
+void EDL::modify_pluginhandles(double oldposition,
+ double newposition,
+ int currentend,
int handle_mode,
int edit_labels,
int edit_autos,
Edits *trim_edits)
{
- tracks->modify_pluginhandles(oldposition,
- newposition,
- currentend,
+ tracks->modify_pluginhandles(oldposition,
+ newposition,
+ currentend,
handle_mode,
edit_labels,
edit_autos,
optimize();
}
-void EDL::paste_silence(double start,
- double end,
- int edit_labels,
+void EDL::paste_silence(double start,
+ double end,
+ int edit_labels,
int edit_plugins,
int edit_autos)
{
- if(edit_labels)
+ if(edit_labels)
labels->paste_silence(start, end);
- tracks->paste_silence(start,
- end,
+ tracks->paste_silence(start,
+ end,
edit_plugins,
edit_autos);
}
// int EDL::calculate_output_w(int single_channel)
// {
// if(single_channel) return session->output_w;
-//
+//
// int widest = 0;
// for(int i = 0; i < session->video_channels; i++)
// {
// }
// return widest;
// }
-//
+//
// int EDL::calculate_output_h(int single_channel)
// {
// if(single_channel) return session->output_h;
-//
+//
// int tallest = 0;
// for(int i = 0; i < session->video_channels; i++)
// {
if((float)session->output_w / session->output_h > get_aspect_ratio())
{
- h = (float)h *
+ h = (float)h *
(session->output_w / get_aspect_ratio() / session->output_h);
}
else
{
- w = (float)w *
+ w = (float)w *
(h * get_aspect_ratio() / session->output_w);
}
}
fprintf(fp,"EDL\n");
fprintf(fp," clip_title: %s\n"
" parent_edl: %p\n", local_session->clip_title, parent_edl);
- fprintf(fp," selectionstart %f\n selectionend %f\n loop_start %f\n loop_end %f\n",
- local_session->get_selectionstart(1),
+ fprintf(fp," selectionstart %f\n selectionend %f\n loop_start %f\n loop_end %f\n",
+ local_session->get_selectionstart(1),
local_session->get_selectionend(1),
local_session->loop_start,
local_session->loop_end);
" output_w: %d\n"
" output_h: %d\n"
" aspect_w: %f\n"
- " aspect_h %f\n"
- " color_model %d\n",
+ " aspect_h: %f\n"
+ " color_model: %d\n",
session->video_channels,
session->video_tracks,
session->frame_rate,
fprintf(fp," CLIPS\n");
fprintf(fp," total: %d\n", clips.total);
-
+
for(int i = 0; i < clips.total; i++)
{
fprintf(fp,"\n\n");
fprintf(fp," VWINDOW EDLS\n");
fprintf(fp," total: %d\n", total_vwindow_edls());
-
+
for(int i = 0; i < total_vwindow_edls(); i++)
{
fprintf(fp," %s\n", get_vwindow_edl(i)->local_session->clip_title);
}
-
+
fprintf(fp," ASSETS\n");
assets->dump(fp);
}
return new_edl;
}
-void EDL::insert_asset(Asset *asset,
+void EDL::insert_asset(Asset *asset,
EDL *nested_edl,
- double position,
- Track *first_track,
+ double position,
+ Track *first_track,
RecordLabels *labels)
{
// Insert asset into asset table
if(new_asset)
{
// Insert 1 frame for undefined length
- if(new_asset->video_length < 0)
- length = 1.0 / session->frame_rate;
+ if(new_asset->video_length < 0)
+ length = 1.0 / session->frame_rate;
else
if(new_asset->frame_rate > 0)
length = ((double)new_asset->video_length / new_asset->frame_rate);
current && vtrack < layers;
current = NEXT)
{
- if(!current->record ||
+ if(!current->record ||
current->data_type != TRACK_VIDEO)
continue;
- current->insert_asset(new_asset,
+ current->insert_asset(new_asset,
new_nested_edl,
- length,
- position,
+ length,
+ position,
vtrack);
vtrack++;
length = 1.0;
}
else
- length = (double)new_asset->audio_length /
+ length = (double)new_asset->audio_length /
new_asset->sample_rate;
}
current->data_type != TRACK_AUDIO)
continue;
- current->insert_asset(new_asset,
+ current->insert_asset(new_asset,
new_nested_edl,
- length,
- position,
+ length,
+ position,
atrack);
return result;
}
-void EDL::get_shared_plugins(Track *source,
+void EDL::get_shared_plugins(Track *source,
ArrayList<SharedLocation*> *plugin_locations,
int omit_recordable,
int data_type)
{
if(!track->record || !omit_recordable)
{
- if(track != source &&
+ if(track != source &&
track->data_type == data_type)
{
for(int i = 0; i < track->plugin_set.total; i++)
{
Plugin *plugin = track->get_current_plugin(
- local_session->get_selectionstart(1),
- i,
- PLAY_FORWARD,
+ local_session->get_selectionstart(1),
+ i,
+ PLAY_FORWARD,
1,
0);
if(plugin && plugin->plugin_type == PLUGIN_STANDALONE)
}
}
-void EDL::get_shared_tracks(Track *track,
+void EDL::get_shared_tracks(Track *track,
ArrayList<SharedLocation*> *module_locations,
int omit_recordable,
int data_type)
{
if(!omit_recordable || !current->record)
{
- if(current != track &&
+ if(current != track &&
current->data_type == data_type)
{
module_locations->append(new SharedLocation(tracks->number_of(current), 0));
// Round frames
// Always round down negative numbers
// but round up only if requested
- if(round)
+ if(round)
{
temp = Units::round(temp);
}
}
int EDL::get_use_vconsole(VEdit* *playable_edit,
- int64_t position,
+ int64_t position,
int direction,
PlayableTracks *playable_tracks)
{
// Total number of playable tracks is 1
- if(playable_tracks->size() != 1)
+ if(playable_tracks->size() != 1)
{
result = 1;
}
delete playable_tracks;
}
-if(debug) printf("EDL::get_use_vconsole %d playable_tracks->size()=%d\n",
+if(debug) printf("EDL::get_use_vconsole %d playable_tracks->size()=%d\n",
__LINE__,
playable_tracks->size());
if(result) return 1;
// Test mutual conditions between direct copy rendering and this.
- if(!playable_track->direct_copy_possible(position,
+ if(!playable_track->direct_copy_possible(position,
direction,
1))
return 1;
if(debug) printf("EDL::get_use_vconsole %d\n", __LINE__);
- *playable_edit = (VEdit*)playable_track->edits->editof(position,
+ *playable_edit = (VEdit*)playable_track->edits->editof(position,
direction,
0);
// No edit at current location
{
// Test nested EDL
EDL *nested_edl = (*playable_edit)->nested_edl;
- int64_t nested_position = (int64_t)((position -
+ int64_t nested_position = (int64_t)((position -
(*playable_edit)->startproject +
- (*playable_edit)->startsource) *
+ (*playable_edit)->startsource) *
nested_edl->session->frame_rate /
session->frame_rate);
if(session->output_w != nested_edl->session->output_w ||
session->output_h != nested_edl->session->output_h ||
nested_edl->get_use_vconsole(&playable_edit_temp,
- nested_position,
+ nested_position,
direction,
- 0))
+ 0))
return 1;
-
+
return 0;
}
if(vwindow_edls.number_of(edl) >= 0)
{
edl->Garbage::remove_user();
+
vwindow_edls.remove(edl);
}
}
* 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
* the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
aconfig_in = new AudioInConfig;
vconfig_in = new VideoInConfig;
recording_format = new Asset;
- interpolation_type = CUBIC_LINEAR;
+ interpolation_type = CUBIC_CUBIC;
interpolate_raw = 1;
white_balance_raw = 1;
test_playback_edits = 1;
strcpy(default_atransition, "");
strcpy(default_vtransition, "");
default_transition_length = 1.0;
- folderlist_format = ASSETS_ICONS;
+ folderlist_format = FOLDERS_ICONS;
frame_rate = 25; // just has to be something by default
autos_follow_edits = 1; // this is needed for predictability
labels_follow_edits = 1;
typeless_keyframes = defaults->get("TYPELESS_KEYFRAMES", 0);
cwindow_dest = defaults->get("CWINDOW_DEST", 0);
cwindow_mask = defaults->get("CWINDOW_MASK", 0);
- cwindow_meter = defaults->get("CWINDOW_METER", 1);
+ cwindow_meter = defaults->get("CWINDOW_METER", 0);
cwindow_operation = defaults->get("CWINDOW_OPERATION", 0);
- cwindow_scrollbars = defaults->get("CWINDOW_SCROLLBARS", 1);
+ cwindow_scrollbars = defaults->get("CWINDOW_SCROLLBARS", 0);
cwindow_xscroll = defaults->get("CWINDOW_XSCROLL", 0);
cwindow_yscroll = defaults->get("CWINDOW_YSCROLL", 0);
cwindow_zoom = defaults->get("CWINDOW_ZOOM", (float)1);
// record_speed = defaults->get("RECORD_SPEED", 24);
record_fragment_size = defaults->get("RECORD_FRAGMENT_SIZE", 2048);
record_write_length = defaults->get("RECORD_WRITE_LENGTH", 131072);
+
+// set some defaults that work
+ recording_format->video_data = 1;
+ recording_format->audio_data = 1;
+ recording_format->format = FILE_FFMPEG;
+ strcpy(recording_format->acodec, "mp4.qt");
+ strcpy(recording_format->vcodec, "mp4.qt");
+ recording_format->channels = 2;
+ recording_format->sample_rate = 48000;
+ recording_format->bits = 16;
+ recording_format->dither = 0;
+
record_realtime_toc = defaults->get("RECORD_REALTIME_TOC", 1);
- recording_format->load_defaults(defaults,
- "RECORD_",
- 1,
- 1,
- 1,
- 1,
- 1);
- safe_regions = defaults->get("SAFE_REGIONS", 1);
+ recording_format->load_defaults(defaults, "RECORD_", 1, 1, 1, 1, 1);
+
+ safe_regions = defaults->get("SAFE_REGIONS", 0);
sample_rate = defaults->get("SAMPLERATE", 48000);
scrub_speed = defaults->get("SCRUB_SPEED", (float)2);
show_assets = defaults->get("SHOW_ASSETS", 1);
video_tracks = defaults->get("VTRACKS", 1);
video_write_length = defaults->get("VIDEO_WRITE_LENGTH", 30);
view_follows_playback = defaults->get("VIEW_FOLLOWS_PLAYBACK", 1);
- vwindow_meter = defaults->get("VWINDOW_METER", 1);
+ vwindow_meter = defaults->get("VWINDOW_METER", 0);
decode_subtitles = defaults->get("DECODE_SUBTITLES", decode_subtitles);
int EDLSession::load_video_config(FileXML *file, int append_mode, uint32_t load_flags)
{
- char string[1024];
+ char string[BCTEXTLEN];
if(append_mode) return 0;
interpolation_type = file->tag.get_property("INTERPOLATION_TYPE", interpolation_type);
interpolate_raw = file->tag.get_property("INTERPOLATE_RAW", interpolate_raw);
int EDLSession::save_video_config(FileXML *file)
{
- char string[1024];
+ char string[BCTEXTLEN];
file->tag.set_title("VIDEO");
file->tag.set_property("INTERPOLATION_TYPE", interpolation_type);
file->tag.set_property("INTERPOLATE_RAW", interpolate_raw);
/*
* CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2015 Adam Williams <broadcast at earthling dot net>
*
* 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
argv[argc++] = (char*)"dcraw";
// write to stdout
argv[argc++] = (char*)"-c";
+// no rotation
+ argv[argc++] = (char*)"-j";
// printf("FileCR2::read_frame %d interpolate=%d white_balance=%d\n",
// __LINE__,
/*
* CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2015 Adam Williams <broadcast at earthling dot net>
*
* 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
}
else
{
- completion_lock->unlock();
server->client_lock->unlock();
+ completion_lock->unlock();
}
}
}
virtual ~LoadPackage();
Condition *completion_lock;
-// Range to search in the total scan area
-// int pixel1, pixel2;
};
editmenu->add_item(new SelectAll(mwindow));
editmenu->add_item(new BC_MenuItem("-"));
editmenu->add_item(new MenuEditShuffle(mwindow));
+ editmenu->add_item(new MenuEditReverse(mwindow));
editmenu->add_item(new MenuEditLength(mwindow));
editmenu->add_item(new MenuEditAlign(mwindow));
editmenu->add_item(new MenuTransitionLength(mwindow));
settingsmenu->add_item(keyframes_follow_edits = new KeyframesFollowEdits(mwindow));
settingsmenu->add_item(cursor_on_frames = new CursorOnFrames(mwindow));
settingsmenu->add_item(typeless_keyframes = new TypelessKeyframes(mwindow));
+ settingsmenu->add_item(new BC_MenuItem("-"));
settingsmenu->add_item(new SaveSettingsNow(mwindow));
settingsmenu->add_item(loop_playback = new LoopPlayback(mwindow));
settingsmenu->add_item(new SetBRenderStart(mwindow));
windowmenu->add_item(show_cwindow = new ShowCWindow(mwindow));
windowmenu->add_item(show_gwindow = new ShowGWindow(mwindow));
windowmenu->add_item(show_lwindow = new ShowLWindow(mwindow));
+ windowmenu->add_item(new BC_MenuItem("-"));
windowmenu->add_item(split_x = new SplitX(mwindow));
windowmenu->add_item(split_y = new SplitY(mwindow));
windowmenu->add_item(new TileWindows(mwindow,_("Default positions"),-1,_("Ctrl+P"),'p'));
batchrender_w = defaults->get("BATCHRENDER_W", batchrender_w);
batchrender_h = defaults->get("BATCHRENDER_H", batchrender_h);
- show_vwindow = defaults->get("SHOW_VWINDOW", 1);
+ show_vwindow = defaults->get("SHOW_VWINDOW", 0);
show_awindow = defaults->get("SHOW_AWINDOW", 1);
show_cwindow = defaults->get("SHOW_CWINDOW", 1);
show_lwindow = defaults->get("SHOW_LWINDOW", 0);
}
}
+void MaskAuto::scale_submasks(int orig_scale, int new_scale)
+{
+ for(int i = 0; i < masks.size(); i++)
+ {
+ SubMask *mask = get_submask(i);
+ for (int j = 0; j < mask->points.total; j++)
+ {
+ float orig_x = mask->points.values[j]->x * orig_scale;
+ float orig_y = mask->points.values[j]->y * orig_scale;
+ mask->points.values[j]->x = orig_x / new_scale;
+ mask->points.values[j]->y = orig_y / new_scale;
+
+ orig_x = mask->points.values[j]->control_x1 * orig_scale;
+ orig_y = mask->points.values[j]->control_y1 * orig_scale;
+ mask->points.values[j]->control_x1 = orig_x / new_scale;
+ mask->points.values[j]->control_y1 = orig_y / new_scale;
+
+ orig_x = mask->points.values[j]->control_x2 * orig_scale;
+ orig_y = mask->points.values[j]->control_y2 * orig_scale;
+ mask->points.values[j]->control_x2 = orig_x / new_scale;
+ mask->points.values[j]->control_y2 = orig_y / new_scale;
+ }
+ }
+}
SubMask* get_submask(int number);
// Translates all submasks
void translate_submasks(float translate_x, float translate_y);
+// scale all submasks
+ void scale_submasks(int orig_scale, int new_scale);
ArrayList<SubMask*> masks;
current = (MaskAuto*)NEXT)
{
current->translate_submasks(translate_x, translate_y);
- for(int i = 0; i < current->masks.total; i++)
- {
- SubMask *mask = current->get_submask(i);
- for (int j = 0; j < mask->points.total; j++)
- {
- mask->points.values[j]->x += translate_x;
- mask->points.values[j]->y += translate_y;
- printf("mpx: %f, mpy:%f\n",mask->points.values[j]->x,mask->points.values[j]->y);
- }
- }
-
}
}
+
// Translates all mask points
void translate_masks(float translate_x, float translate_y);
-
private:
void avg_points(MaskPoint *output,
MaskPoint *input1,
}
+MenuEditReverse::MenuEditReverse(MWindow *mwindow)
+ : BC_MenuItem(_("Reverse Edits"))
+{
+ this->mwindow = mwindow;
+}
+
+
+
+int MenuEditReverse::handle_event()
+{
+ mwindow->reverse_edits();
+ return 1;
+}
+
+
};
+class MenuEditReverse : public BC_MenuItem
+{
+public:
+ MenuEditReverse(MWindow *mwindow);
+
+ int handle_event();
+
+ MWindow *mwindow;
+};
+
+
class MenuEditAlign : public BC_MenuItem
{
public:
int vis_id = idx++;
for( int i=0; i<fs.dir_list.total; ++i ) {
- char *fs_path = fs.dir_list.values[i]->path;
+ char *fs_path = fs.dir_list[i]->path;
char *base_path = FileSystem::basepath(fs_path), *bp = base_path;
const char *dp = plug_dir;
while( *bp && *dp && *bp == *dp ) { ++bp; ++dp; }
// Get plugins
for(int i = 0; i < MWindow::plugindb->total; i++)
{
- PluginServer *current = MWindow::plugindb->values[i];
+ PluginServer *current = MWindow::plugindb->get(i);
if(current->audio == do_audio &&
current->video == do_video &&
for(int i = 0; i < results.total - 1; i++)
{
- PluginServer *value1 = results.values[i];
- PluginServer *value2 = results.values[i + 1];
+ PluginServer *value1 = results[i];
+ PluginServer *value2 = results[i + 1];
if(strcmp(_(value1->title), _(value2->title)) > 0)
{
done = 0;
- results.values[i] = value2;
- results.values[i + 1] = value1;
+ results[i] = value2;
+ results[i + 1] = value1;
}
}
}
for(int i = 0; i < plugindb->total; i++)
{
- PluginServer *server = plugindb->values[i];
+ PluginServer *server = plugindb->get(i);
if(server->title &&
!strcasecmp(server->title, title) &&
(data_type < 0 ||
(data_type == TRACK_AUDIO && server->audio) ||
(data_type == TRACK_VIDEO && server->video)))
- return plugindb->values[i];
+ return plugindb->get(i);
}
return 0;
}
int MWindow::plugin_exists(char *plugin_path)
{
for( int i=0; i<plugindb->total; ++i ) {
- PluginServer *server = plugindb->values[i];
+ PluginServer *server = plugindb->get(i);
if( !strcmp(plugin_path, server->get_path()) ) return 1;
}
return 0;
result = 0;
for(int i = 0; i < fs.dir_list.total && !result; i++)
{
- fs.join_names(string, preferences->index_directory, fs.dir_list.values[i]->name);
+ fs.join_names(string, preferences->index_directory, fs.dir_list[i]->name);
if(fs.is_dir(string))
{
- delete fs.dir_list.values[i];
+ delete fs.dir_list[i];
fs.dir_list.remove_number(i);
result = 1;
}
// Get oldest
for(int i = 0; i < fs.dir_list.total; i++)
{
- fs.join_names(string, preferences->index_directory, fs.dir_list.values[i]->name);
+ fs.join_names(string, preferences->index_directory, fs.dir_list[i]->name);
if(i == 0 || fs.get_date(string) <= oldest)
{
// Remove index file
fs.join_names(string,
preferences->index_directory,
- fs.dir_list.values[oldest_item]->name);
+ fs.dir_list[oldest_item]->name);
//printf("MWindow::clean_indexes 1 %s\n", string);
if(remove(string))
perror("delete_indexes");
- delete fs.dir_list.values[oldest_item];
+ delete fs.dir_list[oldest_item];
fs.dir_list.remove_number(oldest_item);
// Remove table of contents if it exists
PluginServer *theme_plugin = 0;
for(int i = 0; i < plugindb->total && !theme_plugin; i++) {
- if( plugindb->values[i]->theme &&
- !strcasecmp(preferences->theme, plugindb->values[i]->title) )
- theme_plugin = plugindb->values[i];
+ if( plugindb->get(i)->theme &&
+ !strcasecmp(preferences->theme, plugindb->get(i)->title) )
+ theme_plugin = plugindb->get(i);
}
if( !theme_plugin )
fprintf(stderr, _("MWindow::init_theme: trying default theme %s\n"),
DEFAULT_THEME);
for(int i = 0; i < plugindb->total && !theme_plugin; i++) {
- if( plugindb->values[i]->theme &&
- !strcasecmp(DEFAULT_THEME, plugindb->values[i]->title) )
- theme_plugin = plugindb->values[i];
+ if( plugindb->get(i)->theme &&
+ !strcasecmp(DEFAULT_THEME, plugindb->get(i)->title) )
+ theme_plugin = plugindb->get(i);
}
}
VWindow *MWindow::get_viewer(int start_it, int idx)
{
vwindows_lock->lock("MWindow::get_viewer");
- VWindow *vwindow = idx >= 0 && idx < vwindows.size() ? vwindows.get(idx) : 0;
+ VWindow *vwindow = idx >= 0 && idx < vwindows.size() ? vwindows[idx] : 0;
if( !vwindow ) idx = vwindows.size();
while( !vwindow && --idx >= 0 ) {
- VWindow *vwin = vwindows.get(idx);
+ VWindow *vwin = vwindows[idx];
if( !vwin->is_running() || !vwin->get_edl() )
vwindow = vwin;
}
cwindow->playback_engine->interrupt_playback(wait);
for(int i = 0; i < vwindows.size(); i++) {
- VWindow *vwindow = vwindows.get(i);
+ VWindow *vwindow = vwindows[i];
if( !vwindow->is_running() ) continue;
vwindow->playback_engine->que->send_command(STOP, CHANGE_NONE, 0, 0);
vwindow->playback_engine->interrupt_playback(wait);
// deleted.
stop_playback(1);
+if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
undo->update_undo_before();
// Define new_edls and new_assets to load
int result = 0, ftype = -1;
- for(int i = 0; i < filenames->total; i++)
+ for(int i = 0; i < filenames->size(); i++)
{
// Get type of file
File *new_file = new File;
- Asset *new_asset = new Asset(filenames->values[i]);
+ Asset *new_asset = new Asset(filenames->get(i));
EDL *new_edl = new EDL;
char string[BCTEXTLEN];
}
else
{
- old_asset = new_edls.values[j]->assets->get_asset(new_asset->path);
+ old_asset = new_edls[j]->assets->get_asset(new_asset->path);
if( old_asset )
{
*new_asset = *old_asset;
{
FileXML xml_file;
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
- xml_file.read_from_file(filenames->values[i]);
+ xml_file.read_from_file(filenames->get(i));
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
if(load_mode == LOADMODE_NESTED)
// Load temporary EDL for nesting.
EDL *nested_edl = new EDL;
nested_edl->create_objects();
- nested_edl->set_path(filenames->values[i]);
+ nested_edl->set_path(filenames->get(i));
nested_edl->load_xml(&xml_file, LOAD_ALL);
//printf("MWindow::load_filenames %p %s\n", nested_edl, nested_edl->project_path);
edl_to_nested(new_edl, nested_edl);
// Load EDL for pasting
new_edl->load_xml(&xml_file, LOAD_ALL);
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
- test_plugins(new_edl, filenames->values[i]);
+ test_plugins(new_edl, filenames->get(i));
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
if(load_mode == LOADMODE_REPLACE ||
load_mode == LOADMODE_REPLACE_CONCATENATE)
{
- strcpy(session->filename, filenames->values[i]);
+ strcpy(session->filename, filenames->get(i));
strcpy(new_edl->local_session->clip_title,
- filenames->values[i]);
+ filenames->get(i));
if(update_filename)
set_filename(new_edl->local_session->clip_title);
}
int got_indexes = 0;
for(int i = 0; i < new_edls.size(); i++)
{
- EDL *new_edl = new_edls.get(i);
+ EDL *new_edl = new_edls[i];
for(int j = 0; j < new_edl->nested_edls->size(); j++)
{
mainindexes->add_next_asset(0,
{
for(int i = 0; i < new_assets.size(); i++)
{
- Asset *new_asset = new_assets.get(i);
+ Asset *new_asset = new_assets[i];
File *new_file = 0;
int got_it = 0;
for(int j = 0; j < new_files.size(); j++)
{
- new_file = new_files.get(j);
+ new_file = new_files[j];
if(!strcmp(new_file->asset->path,
new_asset->path))
{
{
for(int j = 0; j < track->plugin_set.size(); j++)
{
- PluginSet *plugins = track->plugin_set.get(j);
+ PluginSet *plugins = track->plugin_set[j];
Plugin *plugin = plugins->get_first_plugin();
while(plugin)
goto_start();
}
-
- update_project(load_mode);
-
+// need to update undo before project, since mwindow is unlocked & a new load
+// can begin here. Should really prevent loading until we're done.
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
+ undo->update_undo_after(_("load"), LOAD_ALL);
for(int i = 0; i < new_edls.size(); i++)
{
- new_edls.get(i)->remove_user();
+ new_edls[i]->remove_user();
}
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
for(int i = 0; i < new_assets.size(); i++)
{
- new_assets.get(i)->Garbage::remove_user();
+ new_assets[i]->Garbage::remove_user();
}
new_assets.remove_all();
new_files.remove_all_objects();
- undo->update_undo_after(_("load"), LOAD_ALL);
+if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
if(load_mode == LOADMODE_REPLACE ||
load_mode == LOADMODE_REPLACE_CONCATENATE)
{
if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
+ update_project(load_mode);
+
+if(debug) printf("MWindow::load_filenames %d\n", __LINE__);
+
return 0;
}
{
for(int k = 0; k < track->plugin_set.total; k++)
{
- PluginSet *plugin_set = track->plugin_set.values[k];
+ PluginSet *plugin_set = track->plugin_set[k];
for(Plugin *plugin = (Plugin*)plugin_set->first;
plugin;
plugin = (Plugin*)plugin->next)
// Show all vwindows
// if(session->show_vwindow) {
// for(int j = 0; j < vwindows.size(); j++) {
-// VWindow *vwindow = vwindows.get(j);
+// VWindow *vwindow = vwindows[j];
// if( !vwindow->is_running() ) continue;
// if(debug) printf("MWindow::create_objects %d vwindow=%p\n",
// __LINE__,
{
ENABLE_BUFFER
//PRINT_TRACE
-// vwindows.get(DEFAULT_VWINDOW)->start();
+// vwindows[DEFAULT_VWINDOW]->start();
awindow->start();
//PRINT_TRACE
cwindow->start();
int total_running = 0;
session->show_vwindow = 1;
+//printf("MWindow::show_vwindow %d %d\n", __LINE__, vwindows.size());
// Raise all windows which are visible
for(int j = 0; j < vwindows.size(); j++) {
- VWindow *vwindow = vwindows.get(j);
+ VWindow *vwindow = vwindows[j];
if( !vwindow->is_running() ) continue;
vwindow->gui->lock_window("MWindow::show_vwindow");
vwindow->gui->show_window(0);
total_running++;
}
-//printf("MWindow::show_vwindow %d %d\n", __LINE__, vwindows.size());
// If no windows visible
if(!total_running)
{
for(int i = 0; i < plugin_guis->total; i++)
{
// Pointer comparison
- if(plugin_guis->values[i]->plugin == plugin)
+ if(plugin_guis->get(i)->plugin == plugin)
{
- plugin_guis->values[i]->raise_window();
+ plugin_guis->get(i)->raise_window();
done = 1;
break;
}
if(lock) plugin_gui_lock->lock("MWindow::hide_plugin");
for(int i = 0; i < plugin_guis->total; i++)
{
- if(plugin_guis->values[i]->plugin == plugin)
+ if(plugin_guis->get(i)->plugin == plugin)
{
- PluginServer *ptr = plugin_guis->values[i];
+ PluginServer *ptr = plugin_guis->get(i);
plugin_guis->remove(ptr);
if(lock) plugin_gui_lock->unlock();
// Last command executed in client side close
{
for(int i = 0; i < track->plugin_set.size(); i++)
{
- Plugin *plugin = (Plugin*)track->plugin_set.get(i)->first;
+ Plugin *plugin = (Plugin*)track->plugin_set[i]->first;
while(plugin)
{
int got_it = 0;
plugin_gui_lock->lock("MWindow::plugin_gui_open");
for(int i = 0; i < plugin_guis->total; i++)
{
- if(plugin_guis->values[i]->plugin->identical_location(plugin))
+ if(plugin_guis->get(i)->plugin->identical_location(plugin))
{
result = 1;
break;
plugin_gui_lock->lock("MWindow::render_plugin_gui");
for(int i = 0; i < plugin_guis->total; i++)
{
- if(plugin_guis->values[i]->plugin->identical_location(plugin))
+ if(plugin_guis->get(i)->plugin->identical_location(plugin))
{
- plugin_guis->values[i]->render_gui(data);
+ plugin_guis->get(i)->render_gui(data);
break;
}
}
plugin_gui_lock->lock("MWindow::render_plugin_gui");
for(int i = 0; i < plugin_guis->total; i++)
{
- if(plugin_guis->values[i]->plugin->identical_location(plugin))
+ if(plugin_guis->get(i)->plugin->identical_location(plugin))
{
- plugin_guis->values[i]->render_gui(data, size);
+ plugin_guis->get(i)->render_gui(data, size);
break;
}
}
{
int result = 0;
// Get a plugin GUI
- Plugin *src_plugin = plugin_guis->values[i]->plugin;
- PluginServer *src_plugingui = plugin_guis->values[i];
+ Plugin *src_plugin = plugin_guis->get(i)->plugin;
+ PluginServer *src_plugingui = plugin_guis->get(i);
// Search for plugin in EDL. Only the master EDL shows plugin GUIs.
for(Track *track = edl->tracks->first;
j < track->plugin_set.total && !result;
j++)
{
- PluginSet *plugin_set = track->plugin_set.values[j];
+ PluginSet *plugin_set = track->plugin_set[j];
for(Plugin *plugin = (Plugin*)plugin_set->first;
plugin && !result;
plugin = (Plugin*)plugin->next)
{
for(int i = 0; i < plugin_guis->total; i++)
{
- plugin_guis->values[i]->update_title();
+ plugin_guis->get(i)->update_title();
}
}
if(session->show_vwindow) first_vwindow = 1;
// Change visible windows to no source
for(int i = 0; i < first_vwindow && i < vwindows.size(); i++) {
- VWindow *vwindow = vwindows.get(i);
+ VWindow *vwindow = vwindows[i];
if( !vwindow->is_running() ) continue;
vwindow->change_source(-1);
}
// Close remaining windows
for(int i = first_vwindow; i < vwindows.size(); i++) {
- VWindow *vwindow = vwindows.get(i);
+ VWindow *vwindow = vwindows[i];
if( !vwindow->is_running() ) continue;
vwindow->close_window();
}
if(debug) PRINT_TRACE
}
else if(vwindows.size()) {
- VWindow *vwindow = vwindows.get(DEFAULT_VWINDOW);
+ VWindow *vwindow = vwindows[DEFAULT_VWINDOW];
if( vwindow->is_running() ) {
vwindow->gui->lock_window("MWindow::update_project");
vwindow->update(1);
{
for(int i = 0; i < session->drag_assets->total; i++)
{
- Indexable *indexable = session->drag_assets->values[i];
+ Indexable *indexable = session->drag_assets->get(i);
//printf("MWindow::rebuild_indices 1 %s\n", indexable->path);
remove_indexfile(indexable);
// Schedule index build
cwindow->playback_engine->video_cache->remove_all();
for(int i = 0; i < vwindows.size(); i++) {
- VWindow *vwindow = vwindows.get(i);
+ VWindow *vwindow = vwindows[i];
if( !vwindow->is_running() ) continue;
if(vwindow->playback_engine && vwindow->playback_engine->audio_cache)
vwindow->playback_engine->audio_cache->remove_all();
if( cwindow->playback_engine && cwindow->playback_engine->video_cache )
cwindow->playback_engine->video_cache->delete_entry(asset);
for(int i = 0; i < vwindows.size(); i++) {
- VWindow *vwindow = vwindows.get(i);
+ VWindow *vwindow = vwindows[i];
if( !vwindow->is_running() ) continue;
if(vwindow->playback_engine && vwindow->playback_engine->audio_cache)
vwindow->playback_engine->audio_cache->delete_entry(asset);
}
-
-void MWindow::remove_assets_from_project(int push_undo)
+void MWindow::remove_assets_from_project(int push_undo, int redraw,
+ ArrayList<Indexable*> *drag_assets, ArrayList<EDL*> *drag_clips)
{
for(int i = 0; i < session->drag_assets->total; i++) {
- Indexable *indexable = session->drag_assets->values[i];
+ Indexable *indexable = session->drag_assets->get(i);
if(indexable->is_asset) remove_asset_from_caches((Asset*)indexable);
}
// Remove from VWindow.
for(int i = 0; i < session->drag_clips->total; i++) {
for(int j = 0; j < vwindows.size(); j++) {
- VWindow *vwindow = vwindows.get(j);
+ VWindow *vwindow = vwindows[j];
if( !vwindow->is_running() ) continue;
- if(session->drag_clips->values[i] == vwindow->get_edl()) {
+ if(session->drag_clips->get(i) == vwindow->get_edl()) {
vwindow->gui->lock_window("MWindow::remove_assets_from_project 1");
vwindow->delete_source(1, 1);
vwindow->gui->unlock_window();
for(int i = 0; i < session->drag_assets->size(); i++) {
for(int j = 0; j < vwindows.size(); j++) {
- VWindow *vwindow = vwindows.get(j);
+ VWindow *vwindow = vwindows[j];
if( !vwindow->is_running() ) continue;
if(session->drag_assets->get(i) == vwindow->get_source()) {
vwindow->gui->lock_window("MWindow::remove_assets_from_project 2");
}
for(int i = 0; i < session->drag_assets->size(); i++) {
- Indexable *indexable = session->drag_assets->values[i];
+ Indexable *indexable = session->drag_assets->get(i);
remove_indexfile(indexable);
}
//printf("MWindow::rebuild_indices 1 %s\n", indexable->path);
if(push_undo) undo->update_undo_before();
- edl->remove_from_project(session->drag_assets);
- edl->remove_from_project(session->drag_clips);
- save_backup();
+ if(drag_assets) edl->remove_from_project(drag_assets);
+ if(drag_clips) edl->remove_from_project(session->drag_clips);
+ if(redraw) save_backup();
if(push_undo) undo->update_undo_after(_("remove assets"), LOAD_ALL);
- restart_brender();
-
- gui->lock_window("MWindow::remove_assets_from_project 3");
- gui->update(1,
- 1,
- 1,
- 1,
- 0,
- 1,
- 0);
- gui->unlock_window();
-
- awindow->gui->lock_window("MWindow::remove_assets_from_project 4");
- awindow->gui->update_assets();
- awindow->gui->flush();
- awindow->gui->unlock_window();
+ if(redraw)
+ {
+ restart_brender();
+
+ gui->lock_window("MWindow::remove_assets_from_project 3");
+ gui->update(1,
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ 0);
+ gui->unlock_window();
+
+ awindow->gui->lock_window("MWindow::remove_assets_from_project 4");
+ awindow->gui->update_assets();
+ awindow->gui->flush();
+ awindow->gui->unlock_window();
-// Removes from playback here
- sync_parameters(CHANGE_ALL);
+ // Removes from playback here
+ sync_parameters(CHANGE_ALL);
+ }
}
void MWindow::remove_assets_from_disk()
// Remove from disk
for(int i = 0; i < session->drag_assets->total; i++)
{
- remove(session->drag_assets->values[i]->path);
+ remove(session->drag_assets->get(i)->path);
}
- remove_assets_from_project(1);
+ remove_assets_from_project(1,
+ 1,
+ session->drag_assets,
+ session->drag_clips);
}
void MWindow::dump_plugins(FILE *fp)
{
fprintf(fp, "type=%d audio=%d video=%d rt=%d multi=%d"
" synth=%d transition=%d theme=%d %s\n",
- plugindb->values[i]->plugin_type,
- plugindb->values[i]->audio,
- plugindb->values[i]->video,
- plugindb->values[i]->realtime,
- plugindb->values[i]->multichannel,
- plugindb->values[i]->get_synthesis(),
- plugindb->values[i]->transition,
- plugindb->values[i]->theme,
- plugindb->values[i]->title);
+ plugindb->get(i)->plugin_type,
+ plugindb->get(i)->audio,
+ plugindb->get(i)->video,
+ plugindb->get(i)->realtime,
+ plugindb->get(i)->multichannel,
+ plugindb->get(i)->get_synthesis(),
+ plugindb->get(i)->transition,
+ plugindb->get(i)->theme,
+ plugindb->get(i)->title);
}
}
for(int i = 0; i < plugin_guis->total; i++)
{
// Pointer comparison
- plugin_guis->values[i]->save_defaults();
+ plugin_guis->get(i)->save_defaults();
}
awindow->save_defaults(defaults);
cwindow->gui->unlock_window();
for(int j = 0; j < vwindows.size(); j++) {
- VWindow *vwindow = vwindows.get(j);
+ VWindow *vwindow = vwindows[j];
if( !vwindow->is_running() ) continue;
vwindow->gui->lock_window("MWindow::reset_meters 2");
vwindow->gui->meters->reset_meters();
cwindow->gui->unlock_window();
for(int i = 0; i < vwindows.size(); i++) {
- VWindow *vwindow = vwindows.get(i);
+ VWindow *vwindow = vwindows[i];
if( !vwindow->is_running() ) continue;
vwindow->gui->lock_window("MWindow::resync_guis");
vwindow->gui->resize_event(vwindow->gui->get_w(),
{
if( !plugindb ) return;
for(int i = 0; i < plugindb->total; i++)
- plugindb->values[i]->dump(fp);
+ plugindb->get(i)->dump(fp);
}
void paste_audio_transition();
void paste_video_transition();
void shuffle_edits();
+ void reverse_edits();
void align_edits();
void set_edit_length(double length);
// Set length of single transition
// Asset removal from caches
void reset_caches();
void remove_asset_from_caches(Asset *asset);
- void remove_assets_from_project(int push_undo = 0);
+ void remove_assets_from_project(int push_undo /* = 0 */,
+ int redraw /* 1 */,
+ ArrayList<Indexable*> *drag_assets /* mwindow->session->drag_assets */,
+ ArrayList<EDL*> *drag_clips /* mwindow->session->drag_clips */);
void remove_assets_from_disk();
void resize_track(Track *track, int w, int h);
static void trap_hook(FILE *fp, void *vp);
void reset_android_remote();
-
-
// Send new EDL to caches
void age_caches();
#include "edlsession.h"
#include "filexml.h"
#include "floatauto.h"
+#include "floatautos.h"
#include "gwindow.h"
#include "gwindowgui.h"
#include "keyframe.h"
current;
current = NEXT)
{
- if(current->data_type == TRACK_VIDEO &&
- current->record)
+ if(current->data_type == TRACK_VIDEO /* &&
+ current->record */ )
{
current->track_w = w;
current->track_h = h;
gui->unlock_window();
}
+void MWindow::reverse_edits()
+{
+ gui->lock_window("MWindow::reverse_edits 1");
+
+ undo->update_undo_before();
+ double start = edl->local_session->get_selectionstart();
+ double end = edl->local_session->get_selectionend();
+
+ edl->tracks->reverse_edits(start, end);
+
+ save_backup();
+ undo->update_undo_after(_("reverse edits"), LOAD_EDITS | LOAD_TIMEBAR);
+
+ sync_parameters(CHANGE_EDL);
+ restart_brender();
+ gui->update(0, 1, 1, 0, 0, 0, 0);
+ gui->unlock_window();
+}
+
void MWindow::align_edits()
{
gui->lock_window("MWindow::align_edits 1");
for(int i = 0; i < vwindows.size(); i++)
{
- vwindows.get(i)->playback_engine->que->send_command(STOP,
- CHANGE_NONE,
- 0,
- 0);
- vwindows.get(i)->playback_engine->interrupt_playback(0);
+ if(vwindows.get(i)->is_running())
+ {
+ vwindows.get(i)->playback_engine->que->send_command(STOP,
+ CHANGE_NONE,
+ 0,
+ 0);
+ vwindows.get(i)->playback_engine->interrupt_playback(0);
+ }
}
cwindow->gui->lock_window("MWindow::redo_entry");
for(int i = 0; i < vwindows.size(); i++)
{
- vwindows.get(i)->gui->lock_window("MWindow::redo_entry 2");
+ if(vwindows.get(i)->is_running())
+ {
+ if (calling_window_gui != vwindows.get(i)->gui)
+ {
+ vwindows.get(i)->gui->lock_window("MWindow::redo_entry 2");
+ }
+ }
}
gui->lock_window();
for(int i = 0; i < vwindows.size(); i++)
{
- if (calling_window_gui != vwindows.get(i)->gui)
- vwindows.get(i)->gui->unlock_window();
+ if(vwindows.get(i)->is_running())
+ {
+ if (calling_window_gui != vwindows.get(i)->gui)
+ {
+ vwindows.get(i)->gui->unlock_window();
+ }
+ }
}
cwindow->playback_engine->que->send_command(CURRENT_FRAME,
0);
cwindow->playback_engine->interrupt_playback(0);
-
+printf("MWindow::undo_entry %d %d\n", __LINE__, vwindows.size());
for(int i = 0; i < vwindows.size(); i++)
{
- vwindows.get(i)->playback_engine->que->send_command(STOP,
- CHANGE_NONE,
- 0,
- 0);
- vwindows.get(i)->playback_engine->interrupt_playback(0);
+ if(vwindows.get(i)->is_running())
+ {
+ vwindows.get(i)->playback_engine->que->send_command(STOP,
+ CHANGE_NONE,
+ 0,
+ 0);
+ vwindows.get(i)->playback_engine->interrupt_playback(0);
+ }
}
cwindow->gui->lock_window("MWindow::undo_entry 1");
for(int i = 0; i < vwindows.size(); i++)
{
- vwindows.get(i)->gui->lock_window("MWindow::undo_entry 4");
+ if(vwindows.get(i)->is_running())
+ {
+ if (calling_window_gui != vwindows.get(i)->gui)
+ {
+ vwindows.get(i)->gui->lock_window("MWindow::undo_entry 4");
+ }
+ }
}
gui->lock_window("MWindow::undo_entry 2");
for(int i = 0; i < vwindows.size(); i++)
{
- if (calling_window_gui != vwindows.get(i)->gui)
- vwindows.get(i)->gui->unlock_window();
+ if(vwindows.get(i)->is_running())
+ {
+ if (calling_window_gui != vwindows.get(i)->gui)
+ {
+ vwindows.get(i)->gui->unlock_window();
+ }
+ }
}
if (calling_window_gui != gui)
send_command(CURRENT_FRAME, CHANGE_EDL, edl, 1);
}
+
#include "bcdisplayinfo.h"
#include "bchash.h"
#include "bcsignals.h"
+#include "clip.h"
#include "cwindowgui.h"
#include "cwindow.h"
#include "channelinfo.h"
#include "vwindow.h"
#include "zoombar.h"
-#define PANE_DRAG_MARGIN 50
+#define PANE_DRAG_MARGIN MAX(mwindow->theme->pane_w, mwindow->theme->pane_h)
// the main window uses its own private colormap for video
resource_thread->stop_draw(1);
+ if(total_panes() > 1)
+ {
+ if(horizontal_panes())
+ {
+// printf("MWindowGUI::resize_event %d %d %d\n",
+// __LINE__,
+// pane[TOP_RIGHT_PANE]->x,
+// mwindow->theme->mcanvas_w -
+// BC_ScrollBar::get_span(SCROLL_VERT) -
+// PANE_DRAG_MARGIN);
+ if(pane[TOP_RIGHT_PANE]->x >= mwindow->theme->mcanvas_w -
+ BC_ScrollBar::get_span(SCROLL_VERT) -
+ PANE_DRAG_MARGIN)
+ {
+ delete_x_pane(pane[TOP_RIGHT_PANE]->x);
+ mwindow->edl->local_session->x_pane = -1;
+ }
+ }
+ else
+ if(vertical_panes())
+ {
+ if(pane[BOTTOM_LEFT_PANE]->y >= mwindow->theme->mzoom_y -
+ BC_ScrollBar::get_span(SCROLL_HORIZ) -
+ PANE_DRAG_MARGIN)
+ {
+ delete_y_pane(pane[BOTTOM_LEFT_PANE]->y);
+ mwindow->edl->local_session->y_pane = -1;
+ }
+ }
+ else
+ {
+ if(pane[TOP_RIGHT_PANE]->x >= mwindow->theme->mcanvas_w -
+ BC_ScrollBar::get_span(SCROLL_VERT) -
+ PANE_DRAG_MARGIN)
+ {
+ delete_x_pane(pane[TOP_RIGHT_PANE]->x);
+ mwindow->edl->local_session->x_pane = -1;
+ }
+
+ if(pane[BOTTOM_LEFT_PANE]->y >= mwindow->theme->mzoom_y -
+ BC_ScrollBar::get_span(SCROLL_HORIZ) -
+ PANE_DRAG_MARGIN)
+ {
+ delete_y_pane(pane[BOTTOM_LEFT_PANE]->y);
+ mwindow->edl->local_session->y_pane = -1;
+ }
+ }
+ }
if(total_panes() == 1)
{
// get_scrollbars(0);
// canvas->resize_event();
//printf("MWindowGUI::resize_event %d\n", __LINE__);
- flash(0);
+// required to get new widgets to appear after a pane deletion
+ show_window();
return 0;
}
New::New(MWindow *mwindow)
- : BC_MenuItem(_("New..."), "n", 'n')
+ : BC_MenuItem(_("New"), "n", 'n')
{
this->mwindow = mwindow;
script = 0;
int New::handle_event()
{
mwindow->gui->unlock_window();
- thread->start();
+ mwindow->edl->save_defaults(mwindow->defaults);
+ create_new_edl();
+ create_new_project();
+// thread->start();
mwindow->gui->lock_window("New::handle_event");
return 1;
{
this->mwindow = mwindow;
this->new_project = new_project;
+ nwindow = 0;
}
NewThread::~NewThread()
// MAX [max(Sa, Da), MAX(Sc, Dc)]
#define ALPHA_MAX(mx, Sa, Da) (Sa > Da ? Sa : Da)
#define COLOR_MAX(mx, Sc, Sa, Dc, Da) (Sc > Dc ? Sc : Dc)
-#define CHROMA_MAX(mx, Sc, Sa, Dc, Da) (Sc > Dc ? Sc : Dc)
+#define CHROMA_MAX(mx, Sc, Sa, Dc, Da) (mabs(Sc) > mabs(Dc) ? Sc : Dc)
// MIN [min(Sa, Da), MIN(Sc, Dc)]
#define ALPHA_MIN(mx, Sa, Da) (Sa < Da ? Sa : Da)
#define COLOR_MIN(mx, Sc, Sa, Dc, Da) (Sc < Dc ? Sc : Dc)
-#define CHROMA_MIN(mx, Sc, Sa, Dc, Da) (Sc < Dc ? Sc : Dc)
+#define CHROMA_MIN(mx, Sc, Sa, Dc, Da) (mabs(Sc) < mabs(Dc) ? Sc : Dc)
// AVERAGE [(Sa + Da) * 0.5, (Sc + Dc) * 0.5]
#define ALPHA_AVERAGE(mx, Sa, Da) ((Sa + Da) / 2)
// DARKEN [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + min(Sc, Dc)]
#define ALPHA_DARKEN(mx, Sa, Da) (Sa + Da - (Sa * Da) / mx)
#define COLOR_DARKEN(mx, Sc, Sa, Dc, Da) ((Sc * (mx - Da) + Dc * (mx - Sa)) / mx + (Sc < Dc ? Sc : Dc))
-#define CHROMA_DARKEN COLOR_DARKEN
+#define CHROMA_DARKEN(mx, Sc, Sa, Dc, Da) ((Sc * (mx - Da) + Dc * (mx - Sa)) / mx + (mabs(Sc) < mabs(Dc) ? Sc : Dc))
// LIGHTEN [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)]
#define ALPHA_LIGHTEN(mx, Sa, Da) (Sa + Da - Sa * Da / mx)
#define COLOR_LIGHTEN(mx, Sc, Sa, Dc, Da) ((Sc * (mx - Da) + Dc * (mx - Sa)) / mx + (Sc > Dc ? Sc : Dc))
-#define CHROMA_LIGHTEN COLOR_LIGHTEN
+#define CHROMA_LIGHTEN(mx, Sc, Sa, Dc, Da) ((Sc * (mx - Da) + Dc * (mx - Sa)) / mx + (mabs(Sc) > mabs(Dc) ? Sc : Dc))
// DST [Da, Dc]
#define ALPHA_DST(mx, Sa, Da) Da
if(h - y1 >= mwindow->theme->play_h)
{
patchbay->add_subwindow(play = new PlayPatch(mwindow, this, x1 + x, y1 + y));
-//printf("PatchGUI::update 1 %p %p\n", play, &play->status);
+//printf("PatchGUI::update %d %d\n", __LINE__, play->get_h());
x1 += play->get_w();
patchbay->add_subwindow(record = new RecordPatch(mwindow, this, x1 + x, y1 + y));
x1 += record->get_w();
error = 0;
if(plugin_server->realtime)
{
- int64_t len;
+ int64_t len = 0;
MainProgressBar *progress;
char string[BCTEXTLEN], string2[BCTEXTLEN];
sprintf(string, _("%s..."), plugin_server->title);
progress = mwindow->mainprogress->start_progress(string, end - start);
- for(int current_position = start;
+ for(int64_t current_position = start;
current_position < end && !done && !error;
current_position += len)
{
int64_t buffer_size,
int total_buffers)
{
+//printf("PluginClient::plugin_start_loop %d %ld %ld %ld %d\n",
+// __LINE__, start, end, buffer_size, total_buffers);
this->source_start = start;
this->total_len = end - start;
this->start = start;
vclient->input[i] = frame[i];
vclient->output[i] = frame[i];
}
- vclient->source_start = (int64_t)(plugin ?
- plugin->startproject *
- frame_rate /
- vclient->project_frame_rate :
- 0);
+
+ if(plugin)
+ {
+ vclient->source_start = (int64_t)plugin->startproject *
+ frame_rate /
+ vclient->project_frame_rate;
+ }
vclient->direction = direction;
+//PRINT_TRACE
+//printf("plugin=%p source_start=%ld\n", plugin, vclient->source_start);
+
vclient->begin_process_buffer();
if(multichannel)
{
client->source_start = start;
client->total_len = end - start;
client->total_in_buffers = channels;
+
+//PRINT_TRACE
+//printf(" source_start=%ld total_len=%ld\n", client->source_start, client->total_len);
+
return client->plugin_get_parameters();
}
// If we're a VirtualNode, read_data in the virtual plugin node handles
// backward propogation and produces the data.
// If we're a Module, render in the module produces the data.
+//PRINT_TRACE
int result = -1;
if(!multichannel) channel = 0;
*
*/
+#include "bcsignals.h"
#include "edl.h"
#include "edlsession.h"
#include "pluginserver.h"
int64_t start_position,
double frame_rate)
{
+//PRINT_TRACE
for(int i = 0; i < PluginClient::total_in_buffers; i++)
- read_frame(frame[i], i, start_position, frame_rate);
+ read_frame(frame[i], i, start_position, frame_rate, 0);
if(is_multichannel())
process_realtime(frame, frame);
return 0;
int64_t start_position,
double frame_rate)
{
- read_frame(frame, 0, start_position, frame_rate);
+ read_frame(frame, 0, start_position, frame_rate, 0);
process_realtime(frame, frame);
return 0;
}
-// Replaced by pull method
-// void PluginVClient::plugin_process_realtime(VFrame **input,
-// VFrame **output,
-// int64_t current_position,
-// int64_t total_len)
-// {
-// this->source_position = current_position;
-// this->total_len = total_len;
-//
-// if(is_multichannel())
-// process_realtime(input, output);
-// else
-// process_realtime(input[0], output[0]);
-// }
-
int PluginVClient::plugin_start_loop(int64_t start,
int64_t end,
int64_t buffer_size,
int channel,
int64_t start_position,
double frame_rate,
- int use_opengl = 0);
+ int use_opengl /* = 0 */);
// User calls this to request an opengl routine to be run synchronously.
strategy = mwindow->defaults->get("RENDER_STRATEGY", SINGLE_PASS);
load_mode = mwindow->defaults->get("RENDER_LOADMODE", LOADMODE_NEW_TRACKS);
+// some defaults which work
+ asset->video_data = 1;
+ asset->audio_data = 1;
+ asset->format = FILE_FFMPEG;
+ strcpy(asset->acodec, "mp4.qt");
+ strcpy(asset->vcodec, "mp4.qt");
asset->load_defaults(mwindow->defaults,
- "RENDER_",
- 1,
- 1,
- 1,
- 1,
- 1);
-
+ "RENDER_", 1, 1, 1, 1, 1);
return 0;
}
void ScopeGUI::calculate_sizes(int w, int h)
{
int margin = theme->widget_border;
- int text_w = 20;
+ int text_w = get_text_width(SMALLFONT, "000") + margin * 2;
int total_panels = ((use_hist || use_hist_parade) ? 1 : 0) +
((use_wave || use_wave_parade) ? 1 : 0) +
(use_vector ? 1 : 0);
void ScopeGUI::draw_overlays(int overlays, int borders, int flush)
{
+ BC_Resources *resources = BC_WindowBase::get_resources();
+ int text_color = GREEN;
+ if(resources->bg_color == 0xffffff)
+ {
+ text_color = BLACK;
+ }
+
if(overlays && borders)
{
clear_box(0, 0, get_w(), get_h());
if(overlays)
{
set_line_dashes(1);
- set_color(GREEN);
+ set_color(text_color);
set_font(SMALLFONT);
if(histogram && (use_hist || use_hist_parade))
// Waveform overlay
if(waveform && (use_wave || use_wave_parade))
{
- set_color(GREEN);
+ set_color(text_color);
for(int i = 0; i <= WAVEFORM_DIVISIONS; i++)
{
int y = wave_h * i / WAVEFORM_DIVISIONS;
int text_y = y + wave_y + get_text_ascent(SMALLFONT) / 2;
CLAMP(text_y, waveform->get_y() + get_text_ascent(SMALLFONT), waveform->get_y() + waveform->get_h() - 1);
- int x = wave_x - 20;
char string[BCTEXTLEN];
sprintf(string, "%d",
(int)((FLOAT_MAX -
i * (FLOAT_MAX - FLOAT_MIN) / WAVEFORM_DIVISIONS) * 100));
- draw_text(x, text_y, string);
+ int text_x = wave_x - get_text_width(SMALLFONT, string) - theme->widget_border;
+ draw_text(text_x, text_y, string);
int y1 = CLAMP(y, 0, waveform->get_h() - 1);
waveform->draw_line(0, y1, wave_w, y1);
// Vectorscope overlay
if(vectorscope && use_vector)
{
- set_color(GREEN);
+ set_color(text_color);
int radius = MIN(vector_w / 2, vector_h / 2);
for(int i = 1; i <= VECTORSCOPE_DIVISIONS; i += 2)
{
int x = vector_w / 2 - radius * i / VECTORSCOPE_DIVISIONS;
int y = vector_h / 2 - radius * i / VECTORSCOPE_DIVISIONS;
- int text_x = vector_x - 20;
int text_y = y + vector_y + get_text_ascent(SMALLFONT) / 2;
int w = radius * i / VECTORSCOPE_DIVISIONS * 2;
int h = radius * i / VECTORSCOPE_DIVISIONS * 2;
sprintf(string, "%d",
(int)((FLOAT_MAX / VECTORSCOPE_DIVISIONS * i) * 100));
+ int text_x = vector_x - get_text_width(SMALLFONT, string) - theme->widget_border;
draw_text(text_x, text_y, string);
//printf("ScopeGUI::draw_overlays %d %d %d %s\n", __LINE__, text_x, text_y, string);
&default_data);
}
-#define TIMEBAR_HEIGHT 10
-#define PATCHBAY_W 145
-#define STATUS_H 20
-#define ZOOM_H 30
void Theme::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
{
}
}
+// exactly the same as shuffle_edits except for 1 line
+void Track::reverse_edits(double start, double end, int first_track)
+{
+ ArrayList<Edit*> new_edits;
+ ArrayList<Label*> new_labels;
+ int64_t start_units = to_units(start, 0);
+ int64_t end_units = to_units(end, 0);
+// Sample range of all edits selected
+ //int64_t total_start_units = 0;
+ //int64_t total_end_units = 0;
+// Edit before range
+ Edit *start_edit = 0;
+ int have_start_edit = 0;
+
+// Move all edit pointers to list
+ for(Edit *current = edits->first;
+ current; )
+ {
+ if(current->startproject >= start_units &&
+ current->startproject + current->length <= end_units)
+ {
+ if(!have_start_edit) start_edit = current->previous;
+ have_start_edit = 1;
+ //total_start_units = current->startproject;
+ //total_end_units = current->startproject + current->length;
+ new_edits.append(current);
+
+// Move label pointers
+ if(first_track && edl->session->labels_follow_edits)
+ {
+ double start_seconds = from_units(current->startproject);
+ double end_seconds = from_units(current->startproject +
+ current->length);
+ for(Label *label = edl->labels->first;
+ label;
+ label = label->next)
+ {
+ if(label->position >= start_seconds &&
+ label->position < end_seconds)
+ {
+ new_labels.append(label);
+ edl->labels->remove_pointer(label);
+ }
+ }
+ }
+
+// Remove edit pointer
+ Edit *previous = current;
+ current = NEXT;
+ edits->remove_pointer(previous);
+ }
+ else
+ {
+ current = NEXT;
+ }
+ }
+
+// Insert pointers in reverse order
+ while(new_edits.size())
+ {
+ int index = new_edits.size() - 1;
+ Edit *edit = new_edits.get(index);
+ new_edits.remove_number(index);
+ edits->insert_after(start_edit, edit);
+ start_edit = edit;
+
+// Recalculate start position
+// Save old position for moving labels
+ int64_t startproject1 = edit->startproject;
+ int64_t startproject2 = 0;
+ if(edit->previous)
+ {
+ edit->startproject =
+ startproject2 =
+ edit->previous->startproject + edit->previous->length;
+ }
+ else
+ {
+ edit->startproject = startproject2 = 0;
+ }
+
+
+// Insert label pointers
+ if(first_track && edl->session->labels_follow_edits)
+ {
+ double start_seconds1 = from_units(startproject1);
+ double start_seconds2 = from_units(startproject2);
+ //double end_seconds1 = from_units(edit->startproject + edit->length);
+ for(int i = new_labels.size() - 1; i >= 0; i--)
+ {
+ Label *label = new_labels.get(i);
+// Was in old edit position
+ if(label->position >= start_seconds1 &&
+ label->position < start_seconds2)
+ {
+// Move to new edit position
+ double position = label->position -
+ start_seconds1 +
+ start_seconds2;
+ edl->labels->insert_label(position);
+ new_labels.remove_object_number(i);
+ }
+ }
+ }
+
+
+ }
+
+ optimize();
+
+ if(first_track && edl->session->labels_follow_edits)
+ {
+ edl->labels->optimize();
+ }
+}
+
void Track::align_edits(double start,
double end,
ArrayList<double> *times)
// Pad pasted sections to a minimum of this length.
double edl_length);
void shuffle_edits(double start, double end, int first_track);
+ void reverse_edits(double start, double end, int first_track);
void align_edits(double start,
double end,
ArrayList<double> *times);
void clear_transitions(double start, double end);
void shuffle_edits(double start, double end);
+ void reverse_edits(double start, double end);
void align_edits(double start, double end);
void set_edit_length(double start, double end, double length);
void set_transition_length(double start, double end, double length);
}
}
+void Tracks::reverse_edits(double start, double end)
+{
+// This doesn't affect automation or effects
+// Labels follow the first track.
+ int first_track = 1;
+ for(Track *current_track = first;
+ current_track;
+ current_track = current_track->next)
+ {
+ if(current_track->record)
+ {
+ current_track->reverse_edits(start, end, first_track);
+
+ first_track = 0;
+ }
+ }
+}
void Tracks::align_edits(double start, double end)
{
// This doesn't affect automation or effects
int result = 0;
double edl_rate = get_edl()->session->frame_rate;
-//printf("VModule::render %lld\n", start_position);
+//printf("VModule::render %d %ld\n", __LINE__, start_position);
if(use_nudge) start_position += Units::to_int64(track->nudge *
frame_rate /
//printf("VModule::render %d %p %ld %d\n", __LINE__, current_edit, start_position_project, direction);
if(debug_render)
- printf(" VModule::render %d %lld %s transition=%p opengl=%d current_edit=%p output=%p\n",
+ printf(" VModule::render %d %d %ld %s transition=%p opengl=%d current_edit=%p output=%p\n",
+ __LINE__,
use_nudge,
- (long long)start_position_project,
+ start_position_project,
track->title,
transition,
use_opengl,
*
*/
+#include "bcsignals.h"
#include "cache.h"
#include "edl.h"
#include "edlsession.h"
values[module]->process_buffer(realtime_buffers[module],
input_position,
edl->session->frame_rate,
- 0,
+ end - start,
PLAY_FORWARD);
}
#include "vedit.inc"
#include "vframe.inc"
-// CONVERTS FROM SAMPLES TO FRAMES
+
void VTracking::update_tracker(double position)
{
-//printf("VTracking::update_tracker %ld\n", position);
vwindow->gui->lock_window("VTracking::update_tracker");
vwindow->get_edl()->local_session->set_selectionstart(position);
vwindow->get_edl()->local_session->set_selectionend(position);
#include "asset.h"
#include "assets.h"
+#include "bcsignals.h"
#include "clip.h"
#include "clipedit.h"
#include "bchash.h"
void VWindow::delete_source(int do_main_edl, int update_gui)
{
+//printf("VWindow::delete_source %d %d %p %p\n", __LINE__, gui->get_window_lock(), edl, indexable);
if(do_main_edl) mwindow->edl->remove_vwindow_edl(get_edl());
-
if(edl)
{
-//printf("VWindow::delete_source %d %p\n", __LINE__, edl);
edl->Garbage::remove_user();
//printf("VWindow::delete_source %d\n", __LINE__);
edl = 0;
//printf("VWindow::delete_source %d\n", __LINE__);
if(indexable) indexable->Garbage::remove_user();
-//printf("VWindow::delete_source %d\n", __LINE__);
indexable = 0;
if(update_gui) gui->change_source(0, _("Viewer"));
+//printf("VWindow::delete_source %d\n", __LINE__);
}
}
-void VWindow::handle_close_event(int result)
+void VWindow::handle_done_event(int result)
{
+ playback_engine->interrupt_playback(1);
delete_source(1, 0);
- delete playback_engine;
- delete playback_cursor;
- delete clip_edit;
- playback_engine = 0;
- playback_cursor = 0;
- clip_edit = 0;
if( mwindow->in_destructor ) return;
int total = 0;
for(int i = 0; i < mwindow->vwindows.size(); i++)
{
-//printf("VWindow::handle_close_event %d %d\n", __LINE__, mwindow->vwindows.get(i)->is_running());
+//printf("VWindow::handle_done_event %d %d\n", __LINE__, mwindow->vwindows.get(i)->is_running());
if(mwindow->vwindows.get(i)->is_running()) total++;
}
// subtract ourselves
VWindow(MWindow *mwindow);
~VWindow();
- void handle_close_event(int result);
+ void handle_done_event(int result);
BC_Window* new_gui();
void load_defaults();
110,
MIN_ZOOM_TIME,
MAX_ZOOM_TIME,
- ZOOM_TIME)
+ ZOOM_LONG)
{
this->mwindow = mwindow;
this->zoombar = zoombar;
HAVE_ESOUND := y
HAVE_FIREWIRE := y
HAVE_OSS := y
-STATIC_LIBRARIES := y
+STATIC_LIBRARIES := n
OBJDIR := $(shell uname --machine)
LOOP_END = done
+EXTRA_LIBS += -lnuma
#include <stdlib.h>
#include <string.h>
-
int BC_CModels::is_planar(int colormodel)
{
switch(colormodel) {
#endif // !BC_TRANSPARENCY
-
// Access with BC_WindowBase::cmodels
class BC_CModels
{
menu_bar->set_color(resources->menu_title_text);
menu_bar->set_font(MEDIUMFONT);
menu_bar->draw_text(x + 10 + text_offset,
- h - menu_bar->get_text_descent(MEDIUMFONT) + text_offset,
+ h / 2 + menu_bar->get_text_ascent(MEDIUMFONT) / 2 + 1 + text_offset,
text);
if(flash) menu_bar->flash(flush);
/*
* CINELERRA
- * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2008-2015 Adam Williams <broadcast at earthling dot net>
*
* 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
{
if(menu_bar_bg)
{
- draw_9segment(0, 0, get_w(), get_h(), menu_bar_bg);
+ draw_3segmenth(0,
+ 0,
+ get_w(),
+ menu_bar_bg);
+// 9 segment doesn't draw properly
+// draw_9segment(0, 0, get_w(), get_h(), menu_bar_bg);
}
else
{
#include "bcpopup.h"
#include "bcpopupmenu.h"
#include "bcresources.h"
+#include "bcsignals.h"
#include "bcwindowbase.h"
#include "colors.h"
{
if(menu_popup->item_bg[MENUITEM_DN])
{
- menu_popup->get_popup()->draw_9segment(MENUITEM_MARGIN,
+// menu_popup->get_popup()->draw_9segment(MENUITEM_MARGIN,
+// y,
+// menu_popup->get_w() - MENUITEM_MARGIN * 2,
+// h,
+// menu_popup->item_bg[MENUITEM_DN]);
+ menu_popup->get_popup()->draw_3segmenth(MENUITEM_MARGIN,
y,
menu_popup->get_w() - MENUITEM_MARGIN * 2,
- h,
menu_popup->item_bg[MENUITEM_DN]);
}
else
{
if(menu_popup->item_bg[MENUITEM_HI])
{
- menu_popup->get_popup()->draw_9segment(MENUITEM_MARGIN,
+// menu_popup->get_popup()->draw_9segment(MENUITEM_MARGIN,
+// y,
+// menu_popup->get_w() - MENUITEM_MARGIN * 2,
+// h,
+// menu_popup->item_bg[MENUITEM_HI]);
+ menu_popup->get_popup()->draw_3segmenth(MENUITEM_MARGIN,
y,
menu_popup->get_w() - MENUITEM_MARGIN * 2,
- h,
menu_popup->item_bg[MENUITEM_HI]);
}
else
}
if(checked)
{
- menu_popup->get_popup()->draw_check(10 + offset, y + 2 + offset);
+// menu_popup->get_popup()->draw_check(10 + offset, y + 2 + offset);
+ menu_popup->get_popup()->draw_pixmap(menu_popup->check,
+ offset,
+ y + (this->h - menu_popup->check->get_h()) / 2 + offset);
menu_popup->get_popup()->set_font(MEDIUMFONT);
- menu_popup->get_popup()->draw_text(30 + offset, y + h - text_line - 2 + offset, text);
- menu_popup->get_popup()->draw_text(menu_popup->get_key_x() + offset, y + h - text_line - 2 + offset, hotkey_text);
+ menu_popup->get_popup()->draw_text(menu_popup->check->get_w() + offset,
+ y + h - text_line - 2 + offset,
+ text);
+ menu_popup->get_popup()->draw_text(menu_popup->get_key_x() + offset,
+ y + h - text_line - 2 + offset,
+ hotkey_text);
}
else
{
item_bg[0] = 0;
item_bg[1] = 0;
item_bg[2] = 0;
+ check = 0;
}
BC_MenuPopup::~BC_MenuPopup()
delete item_bg[0];
delete item_bg[1];
delete item_bg[2];
+ delete check;
}
int BC_MenuPopup::initialize(BC_WindowBase *top_level,
{
window_bg = new BC_Pixmap(top_level, resources->menu_popup_bg);
}
+
if(resources->menu_item_bg)
{
item_bg[0] = new BC_Pixmap(top_level, resources->menu_item_bg[0], PIXMAP_ALPHA);
item_bg[2] = new BC_Pixmap(top_level, resources->menu_item_bg[2], PIXMAP_ALPHA);
}
+ if(resources->check)
+ {
+ check = new BC_Pixmap(top_level, resources->check, PIXMAP_ALPHA);
+ }
+
return 0;
}
for(i = 0; i < menu_items.total; i++)
{
text_w = 10 + top_level->get_text_width(MEDIUMFONT, menu_items.values[i]->text);
- if(menu_items.values[i]->checked) text_w += 20;
+ if(menu_items.values[i]->checked) text_w += check->get_w() + 1;
key_w = 10 + top_level->get_text_width(MEDIUMFONT, menu_items.values[i]->hotkey_text);
if(text_w > widest_text) widest_text = text_w;
if(!strcmp(menu_items.values[i]->text, "-"))
menu_items.values[i]->h = 5;
else
- menu_items.values[i]->h = top_level->get_text_height(MEDIUMFONT) + 4;
+ {
+// menu_items.values[i]->h = top_level->get_text_height(MEDIUMFONT) + 4;
+ menu_items.values[i]->h = item_bg[0]->get_h();
+ }
menu_items.values[i]->y = h;
menu_items.values[i]->highlighted = 0;
// Images for backgrounds
BC_Pixmap *window_bg;
BC_Pixmap *item_bg[3];
+ BC_Pixmap *check;
};
class BC_SubMenu : public BC_MenuPopup
/*
* CINELERRA
- * Copyright (C) 2009 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2009-2015 Adam Williams <broadcast at earthling dot net>
*
* 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
};
#endif
+#include "images/check_png.h"
+ static VFrame* default_check_image = new VFrame(check_png);
+ check = default_check_image;
+
#include "images/file_text_up_png.h"
#include "images/file_text_hi_png.h"
#include "images/file_text_dn_png.h"
VFrame **checkbox_images;
VFrame **radial_images;
VFrame **label_images;
+// menu check
+ VFrame *check;
VFrame **tumble_data;
int tumble_duration;
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
+#include <utime.h>
+
#include "filesystem.h"
return 0;
}
-int64_t FileSystem::get_date(char *filename)
+int64_t FileSystem::get_date(const char *filename)
{
struct stat file_status;
bzero(&file_status, sizeof(struct stat));
return !result ? file_status.st_mtime : -1;
}
+void FileSystem::set_date(const char *path, int64_t value)
+{
+ struct utimbuf new_time;
+ new_time.actime = value;
+ new_time.modtime = value;
+ utime(path, &new_time);
+}
+
int64_t FileSystem::get_size(char *filename)
{
struct stat file_status;
return dir_list.values[entry];
}
+
// collapse ".", "..", "//" eg. x/./..//y = y
char *FileSystem::basepath(const char *path)
{
int extract_dir(char *out, const char *in); // extract the directory from the path
int extract_name(char *out, const char *in, int test_dir = 1); // extract the name from the path
int join_names(char *out, const char *dir_in, const char *name_in); // combine a directory and filename
- static int64_t get_date(char *filename); // get the date of the filename modification
+ static int64_t get_date(const char *path); // get the date of the filename modification
+ static void set_date(const char *path, int64_t value); // set the date of the file
static int64_t get_size(char *filename); // Get the number of bytes in the file.
int add_end_slash(char *new_dir);
int total_files();
static unsigned char check_png[] =
{
- 0x00, 0x00, 0x01, 0x17,
+ 0x00, 0x00, 0x00, 0xf4,
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
- 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x14, 0x08, 0x06, 0x00, 0x00, 0x00, 0x80, 0x97, 0x6d,
- 0x4a, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xb1, 0x8f, 0x0b, 0xfc, 0x61,
- 0x05, 0x00, 0x00, 0x00, 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0,
- 0xbd, 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x12, 0x00,
- 0x00, 0x0b, 0x12, 0x01, 0xd2, 0xdd, 0x7e, 0xfc, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45,
- 0x07, 0xd0, 0x06, 0x10, 0x16, 0x24, 0x39, 0xb7, 0xf5, 0xa2, 0xdc, 0x00, 0x00, 0x00, 0x94, 0x49,
- 0x44, 0x41, 0x54, 0x78, 0xda, 0xc5, 0x93, 0xcd, 0x0d, 0xc0, 0x20, 0x08, 0x85, 0xb1, 0x71, 0xa0,
- 0x1e, 0x18, 0xc9, 0xb1, 0x3a, 0x92, 0x23, 0x99, 0xd0, 0x43, 0xdb, 0xc4, 0x2a, 0x4f, 0x30, 0xa6,
- 0x29, 0x89, 0x17, 0x7e, 0x3e, 0x10, 0x9f, 0x44, 0x7f, 0x5b, 0xe1, 0x24, 0x85, 0x93, 0x2c, 0x43,
- 0x32, 0x91, 0x64, 0x22, 0xa1, 0xeb, 0xac, 0x41, 0xee, 0x89, 0x64, 0x7a, 0x54, 0x00, 0x79, 0xd7,
- 0x34, 0x09, 0xaa, 0x99, 0x10, 0xd0, 0xcd, 0xda, 0x8b, 0xb8, 0x46, 0xaf, 0x81, 0xe6, 0x5e, 0x3c,
- 0x30, 0x05, 0xac, 0x82, 0x02, 0xe0, 0x49, 0x56, 0x9c, 0x3c, 0xa8, 0xdb, 0x00, 0x28, 0x0c, 0x86,
- 0x56, 0x63, 0x1b, 0xba, 0x1e, 0xf0, 0xaf, 0x09, 0x0e, 0x3d, 0xc2, 0xd0, 0xd0, 0x62, 0xa7, 0x60,
- 0x0e, 0xad, 0x88, 0xa5, 0xb7, 0x29, 0xad, 0x3c, 0xb9, 0x5d, 0x9e, 0xeb, 0x0f, 0x29, 0x12, 0xa9,
- 0xf3, 0x62, 0x1d, 0xd9, 0x39, 0x51, 0xcc, 0x87, 0x47, 0x02, 0x5d, 0x3c, 0x34, 0x1d, 0xbc, 0x90,
- 0xef, 0xec, 0x04, 0x6a, 0x69, 0xcc, 0xe2, 0x9a, 0xb8, 0x52, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x49,
- 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
+ 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x11, 0x08, 0x06, 0x00, 0x00, 0x00, 0xca, 0x66, 0x1c,
+ 0x77, 0x00, 0x00, 0x00, 0x06, 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0,
+ 0xbd, 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0e, 0xc4, 0x00,
+ 0x00, 0x0e, 0xc4, 0x01, 0x95, 0x2b, 0x0e, 0x1b, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45,
+ 0x07, 0xdf, 0x05, 0x13, 0x10, 0x23, 0x3b, 0xb6, 0x74, 0x4e, 0x6e, 0x00, 0x00, 0x00, 0x19, 0x74,
+ 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0x0e, 0x17,
+ 0x00, 0x00, 0x00, 0x5c, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed, 0xd0, 0x41, 0x0e, 0xc0, 0x20,
+ 0x08, 0x44, 0xd1, 0x99, 0xde, 0x8c, 0x93, 0x73, 0x34, 0xba, 0x35, 0x95, 0x26, 0x05, 0x95, 0xba,
+ 0xf0, 0xef, 0x30, 0xc6, 0x17, 0x01, 0x26, 0xa6, 0xaa, 0x9f, 0xef, 0x5e, 0x7f, 0xa0, 0x29, 0xd8,
+ 0x03, 0xa2, 0x28, 0x00, 0x70, 0x04, 0x16, 0x91, 0x6e, 0x2e, 0x81, 0xdb, 0x22, 0x68, 0x6a, 0xd5,
+ 0x1e, 0xd0, 0x9c, 0x19, 0x2a, 0x7a, 0xfc, 0xde, 0x56, 0xc3, 0xf6, 0x72, 0x16, 0x82, 0x39, 0x08,
+ 0xd3, 0x99, 0x4b, 0xe0, 0xf4, 0x5b, 0x9c, 0xb4, 0x6e, 0xa2, 0x38, 0xc3, 0xe9, 0xb4, 0x5b, 0x37,
+ 0x24, 0x2c, 0x21, 0xbb, 0x75, 0xa2, 0x49, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44,
+ 0xae, 0x42, 0x60, 0x82
};
#endif
return get_h() * get_bytes_per_line();
}
+void VFrame::draw_pixel(int x, int y)
+{
+ if(!(x >= 0 && y >= 0 && x < get_w() && y < get_h())) return;
+
+#define DRAW_PIXEL(x, y, components, do_yuv, max, type) \
+{ \
+ type **rows = (type**)get_rows(); \
+ rows[y][x * components] = max - rows[y][x * components]; \
+ if(!do_yuv) \
+ { \
+ rows[y][x * components + 1] = max - rows[y][x * components + 1]; \
+ rows[y][x * components + 2] = max - rows[y][x * components + 2]; \
+ } \
+ else \
+ { \
+ rows[y][x * components + 1] = (max / 2 + 1) - rows[y][x * components + 1]; \
+ rows[y][x * components + 2] = (max / 2 + 1) - rows[y][x * components + 2]; \
+ } \
+ if(components == 4) \
+ rows[y][x * components + 3] = max; \
+}
+
+
+ switch(get_color_model())
+ {
+ case BC_RGB888:
+ DRAW_PIXEL(x, y, 3, 0, 0xff, unsigned char);
+ break;
+ case BC_RGBA8888:
+ DRAW_PIXEL(x, y, 4, 0, 0xff, unsigned char);
+ break;
+ case BC_RGB_FLOAT:
+ DRAW_PIXEL(x, y, 3, 0, 1.0, float);
+ break;
+ case BC_RGBA_FLOAT:
+ DRAW_PIXEL(x, y, 4, 0, 1.0, float);
+ break;
+ case BC_YUV888:
+ DRAW_PIXEL(x, y, 3, 1, 0xff, unsigned char);
+ break;
+ case BC_YUVA8888:
+ DRAW_PIXEL(x, y, 4, 1, 0xff, unsigned char);
+ break;
+ case BC_RGB161616:
+ DRAW_PIXEL(x, y, 3, 0, 0xffff, uint16_t);
+ break;
+ case BC_YUV161616:
+ DRAW_PIXEL(x, y, 3, 1, 0xffff, uint16_t);
+ break;
+ case BC_RGBA16161616:
+ DRAW_PIXEL(x, y, 4, 0, 0xffff, uint16_t);
+ break;
+ case BC_YUVA16161616:
+ DRAW_PIXEL(x, y, 4, 1, 0xffff, uint16_t);
+ break;
+ }
+}
+
+
+void VFrame::draw_line(int x1, int y1, int x2, int y2)
+{
+ int w = labs(x2 - x1);
+ int h = labs(y2 - y1);
+//printf("FindObjectMain::draw_line 1 %d %d %d %d\n", x1, y1, x2, y2);
+
+ if(!w && !h)
+ {
+ draw_pixel(x1, y1);
+ }
+ else
+ if(w > h)
+ {
+// Flip coordinates so x1 < x2
+ if(x2 < x1)
+ {
+ y2 ^= y1;
+ y1 ^= y2;
+ y2 ^= y1;
+ x1 ^= x2;
+ x2 ^= x1;
+ x1 ^= x2;
+ }
+ int numerator = y2 - y1;
+ int denominator = x2 - x1;
+ for(int i = x1; i <= x2; i++)
+ {
+ int y = y1 + (int64_t)(i - x1) * (int64_t)numerator / (int64_t)denominator;
+ draw_pixel(i, y);
+ }
+ }
+ else
+ {
+// Flip coordinates so y1 < y2
+ if(y2 < y1)
+ {
+ y2 ^= y1;
+ y1 ^= y2;
+ y2 ^= y1;
+ x1 ^= x2;
+ x2 ^= x1;
+ x1 ^= x2;
+ }
+ int numerator = x2 - x1;
+ int denominator = y2 - y1;
+ for(int i = y1; i <= y2; i++)
+ {
+ int x = x1 + (int64_t)(i - y1) * (int64_t)numerator / (int64_t)denominator;
+ draw_pixel(x, i);
+ }
+ }
+//printf("FindObjectMain::draw_line 2\n");
+}
+
+void VFrame::draw_rect(int x1, int y1, int x2, int y2)
+{
+ draw_line(x1, y1, x2, y1);
+ draw_line(x2, y1 + 1, x2, y2);
+ draw_line(x2 - 1, y2, x1, y2);
+ draw_line(x1, y2 - 1, x1, y1 + 1);
+}
+
+#define ARROW_SIZE 10
+void VFrame::draw_arrow(int x1, int y1, int x2, int y2)
+{
+ double angle = atan((float)(y2 - y1) / (float)(x2 - x1));
+ double angle1 = angle + (float)145 / 360 * 2 * 3.14159265;
+ double angle2 = angle - (float)145 / 360 * 2 * 3.14159265;
+ int x3;
+ int y3;
+ int x4;
+ int y4;
+ if(x2 < x1)
+ {
+ x3 = x2 - (int)(ARROW_SIZE * cos(angle1));
+ y3 = y2 - (int)(ARROW_SIZE * sin(angle1));
+ x4 = x2 - (int)(ARROW_SIZE * cos(angle2));
+ y4 = y2 - (int)(ARROW_SIZE * sin(angle2));
+ }
+ else
+ {
+ x3 = x2 + (int)(ARROW_SIZE * cos(angle1));
+ y3 = y2 + (int)(ARROW_SIZE * sin(angle1));
+ x4 = x2 + (int)(ARROW_SIZE * cos(angle2));
+ y4 = y2 + (int)(ARROW_SIZE * sin(angle2));
+ }
+
+// Main vector
+ draw_line(x1, y1, x2, y2);
+// draw_line(x1, y1 + 1, x2, y2 + 1);
+
+// Arrow line
+ if(abs(y2 - y1) || abs(x2 - x1)) draw_line(x2, y2, x3, y3);
+// Arrow line
+ if(abs(y2 - y1) || abs(x2 - x1)) draw_line(x2, y2, x4, y4);
+}
// This clears the stacks and the param table
void clear_stacks();
+ void draw_rect(int x1, int y1, int x2, int y2);
+ void draw_line(int x1, int y1, int x2, int y2);
+ void draw_pixel(int x, int y);
+ void draw_arrow(int x1, int y1, int x2, int y2);
+
// 3D scene graphs
// Not integrated with shmem because that only affects codecs
VFrameScene* get_scene();
while( xrpnt < &xr[SBLIMIT][0] ) *xrpnt++ = 0.0;
+ if( -part2remain > num )
+ num = -part2remain;
part2remain += num;
- stream->start_reverse();
- stream->get_bits_reverse(num);
- stream->start_forward();
+
+ if( num > 0 ) {
+ stream->start_reverse();
+ stream->get_bits_reverse(num);
+ stream->start_forward();
+ }
//zmsgs("3 %d %04x\n", stream->bit_number, stream->show_bits(16));
while( part2remain > 16 ) {
dot := exotic
holo := exotic
oil := exotic
+edge := exotic
audioscope := audio_tools
cdripper := audio_tools
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "bcsignals.h"
+#include "clip.h"
+#include "cwindowgui.h"
+#include "4k.h"
+#include "edl.h"
+#include "edlsession.h"
+#include "mainmenu.h"
+#include "mainsession.h"
+#include "mbuttons.h"
+#include "meterpanel.h"
+#include "mwindow.h"
+#include "mwindowgui.h"
+#include "new.h"
+#include "patchbay.h"
+#include "preferencesthread.h"
+#include "recordgui.h"
+#include "recordmonitor.h"
+#include "setformat.h"
+#include "statusbar.h"
+#include "timebar.h"
+#include "trackcanvas.h"
+#include "vframe.h"
+#include "vwindowgui.h"
+
+
+
+
+PluginClient* new_plugin(PluginServer *server)
+{
+ return new FourKMain(server);
+}
+
+
+
+
+
+
+
+FourKMain::FourKMain(PluginServer *server)
+ : PluginTClient(server)
+{
+}
+
+FourKMain::~FourKMain()
+{
+}
+
+const char* FourKMain::plugin_title()
+{
+ return _("4K");
+}
+
+Theme* FourKMain::new_theme()
+{
+ theme = new FourK;
+ extern unsigned char _binary_4k_data_start[];
+ theme->set_data(_binary_4k_data_start);
+ return theme;
+}
+
+
+
+
+
+
+
+
+FourK::FourK()
+ : Theme()
+{
+}
+
+FourK::~FourK()
+{
+}
+
+void FourK::initialize()
+{
+ BC_Resources *resources = BC_WindowBase::get_resources();
+
+ resources->small_font_xft = N_("Sans-13");
+ resources->medium_font_xft = N_("Sans-17");
+ resources->large_font_xft = N_("Sans-17:style=bold");
+
+ resources->text_default = 0xbfbfbf;
+ resources->text_background = 0x373737;
+ resources->text_border1 = 0x202020;
+ resources->text_border2 = 0x373737;
+ resources->text_border3 = 0x373737;
+ resources->text_border4 = 0x969696;
+ resources->text_inactive_highlight = 0x707070;
+
+ resources->bg_color = 0x484848;
+ resources->border_light2 = resources->bg_color;
+ resources->border_shadow2 = resources->bg_color;
+ resources->default_text_color = 0xbfbfbf;
+ resources->menu_title_text = 0xbfbfbf;
+ resources->popup_title_text = 0xbfbfbf;
+ resources->menu_item_text = 0xbfbfbf;
+ resources->menu_highlighted_fontcolor = WHITE;
+ resources->generic_button_margin = 30;
+ resources->pot_needle_color = resources->text_default;
+ resources->pot_offset = 1;
+ resources->progress_text = resources->text_default;
+ resources->meter_font_color = resources->default_text_color;
+
+ resources->menu_light = 0xababab;
+ resources->menu_highlighted = 0x6f6f6f;
+ resources->menu_down = 0x4b4b4b;
+ resources->menu_up = 0x4b4b4b;
+ resources->menu_shadow = 0x202020;
+ resources->popupmenu_margin = 15;
+ resources->popupmenu_triangle_margin = 15;
+
+ resources->listbox_title_color = 0xbfbfbf;
+
+ resources->listbox_title_margin = 20;
+ resources->listbox_title_hotspot = 20;
+ resources->listbox_border1 = 0x1a1a1a;
+ resources->listbox_border2 = 0x373737;
+ resources->listbox_border3 = 0x373737;
+ resources->listbox_border4 = 0x646464;
+ resources->listbox_highlighted = 0x505050;
+ resources->listbox_inactive = 0x373737;
+ resources->listbox_bg = 0;
+ resources->listbox_text = 0xbfbfbf;
+
+ resources->filebox_margin = 130;
+ resources->file_color = 0xbfbfbf;
+ resources->directory_color = 0xa0a0ff;
+
+
+ new_toggle("loadmode_new.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_new");
+ new_toggle("loadmode_none.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_none");
+ new_toggle("loadmode_newcat.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_newcat");
+ new_toggle("loadmode_cat.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_cat");
+ new_toggle("loadmode_newtracks.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_newtracks");
+ new_toggle("loadmode_paste.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_paste");
+ new_toggle("loadmode_resource.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_resource");
+ new_toggle("loadmode_nested.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_nested");
+
+
+
+ resources->filebox_icons_images = new_button("icons.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_text_images = new_button("text.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_newfolder_images = new_button("folder.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_rename_images = new_button("rename.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_updir_images = new_button("updir.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_delete_images = new_button("delete.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_reload_images = new_button("reload.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+
+ resources->filebox_descend_images = new_button("openfolder.png",
+ "filebox_bigbutton_up.png",
+ "filebox_bigbutton_hi.png",
+ "filebox_bigbutton_dn.png");
+
+ resources->usethis_button_images =
+ resources->ok_images = new_button("ok.png",
+ "filebox_bigbutton_up.png",
+ "filebox_bigbutton_hi.png",
+ "filebox_bigbutton_dn.png");
+
+ new_button("ok.png",
+ "new_bigbutton_up.png",
+ "new_bigbutton_hi.png",
+ "new_bigbutton_dn.png",
+ "new_ok_images");
+
+ resources->cancel_images = new_button("cancel.png",
+ "filebox_bigbutton_up.png",
+ "filebox_bigbutton_hi.png",
+ "filebox_bigbutton_dn.png");
+
+ new_button("cancel.png",
+ "new_bigbutton_up.png",
+ "new_bigbutton_hi.png",
+ "new_bigbutton_dn.png",
+ "new_cancel_images");
+
+ resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
+ "0.png",
+ "1.png",
+ "2.png",
+ "3.png",
+ "4.png",
+ "5.png",
+ "6.png",
+ "7.png",
+ "8.png",
+ "9.png",
+ "colon.png",
+ "period.png",
+ "a.png",
+ "b.png",
+ "c.png",
+ "d.png",
+ "e.png",
+ "f.png",
+ "space.png",
+ "dash.png");
+
+ resources->bar_data = new_image("bar", "bar.png");
+ resources->check = new_image("check", "check.png");
+
+ resources->min_menu_w = 96;
+ resources->menu_popup_bg = new_image("menu_popup_bg.png");
+ resources->menu_item_bg = new_image_set(3,
+ "menuitem_up.png",
+ "menuitem_hi.png",
+ "menuitem_dn.png");
+ resources->menu_bar_bg = new_image("menubar_bg.png");
+ resources->menu_title_bg = new_image_set(3,
+ "menubar_up.png",
+ "menubar_hi.png",
+ "menubar_dn.png");
+
+
+ resources->popupmenu_images = 0;
+// new_image_set(3,
+// "menupopup_up.png",
+// "menupopup_hi.png",
+// "menupopup_dn.png");
+
+ resources->toggle_highlight_bg = new_image("toggle_highlight_bg",
+ "text_highlight.png");
+
+ resources->generic_button_images = new_image_set(3,
+ "generic_up.png",
+ "generic_hi.png",
+ "generic_dn.png");
+ resources->horizontal_slider_data = new_image_set(6,
+ "hslider_fg_up.png",
+ "hslider_fg_hi.png",
+ "hslider_fg_dn.png",
+ "hslider_bg_up.png",
+ "hslider_bg_hi.png",
+ "hslider_bg_dn.png");
+ resources->progress_images = new_image_set(2,
+ "progress_bg.png",
+ "progress_hi.png");
+ resources->tumble_data = new_image_set(4,
+ "tumble_up.png",
+ "tumble_hi.png",
+ "tumble_bottom.png",
+ "tumble_top.png");
+ resources->listbox_button = new_button4("listbox_button.png",
+ "editpanel_up.png",
+ "editpanel_hi.png",
+ "editpanel_dn.png",
+ "editpanel_hi.png");
+ resources->listbox_column = new_image_set(3,
+ "column_up.png",
+ "column_hi.png",
+ "column_dn.png");
+ resources->listbox_up = new_image("listbox_up.png");
+ resources->listbox_dn = new_image("listbox_dn.png");
+ resources->pan_data = new_image_set(7,
+ "pan_up.png",
+ "pan_hi.png",
+ "pan_popup.png",
+ "pan_channel.png",
+ "pan_stick.png",
+ "pan_channel_small.png",
+ "pan_stick_small.png");
+ resources->pan_text_color = WHITE;
+
+ resources->pot_images = new_image_set(3,
+ "pot_up.png",
+ "pot_hi.png",
+ "pot_dn.png");
+
+ resources->checkbox_images = new_image_set(5,
+ "checkbox_up.png",
+ "checkbox_hi.png",
+ "checkbox_checked.png",
+ "checkbox_dn.png",
+ "checkbox_checkedhi.png");
+
+ resources->radial_images = new_image_set(5,
+ "radial_up.png",
+ "radial_hi.png",
+ "radial_checked.png",
+ "radial_dn.png",
+ "radial_checkedhi.png");
+
+ resources->xmeter_images = new_image_set(7,
+ "xmeter_normal.png",
+ "xmeter_green.png",
+ "xmeter_red.png",
+ "xmeter_yellow.png",
+ "xmeter_white.png",
+ "xmeter_over.png",
+ "downmix51_2.png");
+ resources->ymeter_images = new_image_set(7,
+ "ymeter_normal.png",
+ "ymeter_green.png",
+ "ymeter_red.png",
+ "ymeter_yellow.png",
+ "ymeter_white.png",
+ "ymeter_over.png",
+ "downmix51_2.png");
+
+ resources->hscroll_data = new_image_set(10,
+ "hscroll_handle_up.png",
+ "hscroll_handle_hi.png",
+ "hscroll_handle_dn.png",
+ "hscroll_handle_bg.png",
+ "hscroll_left_up.png",
+ "hscroll_left_hi.png",
+ "hscroll_left_dn.png",
+ "hscroll_right_up.png",
+ "hscroll_right_hi.png",
+ "hscroll_right_dn.png");
+
+ resources->vscroll_data = new_image_set(10,
+ "vscroll_handle_up.png",
+ "vscroll_handle_hi.png",
+ "vscroll_handle_dn.png",
+ "vscroll_handle_bg.png",
+ "vscroll_left_up.png",
+ "vscroll_left_hi.png",
+ "vscroll_left_dn.png",
+ "vscroll_right_up.png",
+ "vscroll_right_hi.png",
+ "vscroll_right_dn.png");
+ resources->scroll_minhandle = 20;
+
+
+ new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip");
+ new_button("nexttip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "next_tip");
+ new_button("closetip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "close_tip");
+ new_button("swap_extents.png",
+ "editpanel_up.png",
+ "editpanel_hi.png",
+ "editpanel_dn.png",
+ "swap_extents");
+
+
+// Record windows
+
+
+ preferences_category_overlap = 0;
+ preferencescategory_x = 0;
+ preferencescategory_y = 5;
+ preferencestitle_x = 5;
+ preferencestitle_y = 10;
+ preferencesoptions_x = 5;
+ preferencesoptions_y = 0;
+
+// MWindow
+ message_normal = resources->text_default;
+ audio_color = GREEN;
+ mtransport_margin = 16;
+ toggle_margin = 16;
+
+ new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane");
+ new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png");
+ new_image_set("ypane", 3, "ypane_up.png", "ypane_hi.png", "ypane_dn.png");
+
+ new_image("mbutton_bg", "mbutton_bg.png");
+ new_image("timebar_bg", "timebar_bg_flat.png");
+ new_image("timebar_brender", "timebar_brender.png");
+ new_image("clock_bg", "mclock_flat.png");
+ new_image("patchbay_bg", "patchbay_bg.png");
+ new_image("statusbar", "statusbar.png");
+// new_image("mscroll_filler", "mscroll_filler.png");
+
+ new_image_set("zoombar_menu", 3, "zoompopup_up.png", "zoompopup_hi.png", "zoompopup_dn.png");
+ new_image_set("zoombar_tumbler", 4, "zoomtumble_up.png", "zoomtumble_hi.png", "zoomtumble_bottom.png", "zoomtumble_top.png");
+ new_image_set("plugin_on", 5, "plugin_on.png", "plugin_onhi.png", "plugin_onselect.png", "plugin_ondn.png", "plugin_onselecthi.png");
+ new_image_set("plugin_show", 5, "plugin_show.png", "plugin_showhi.png", "plugin_showselect.png", "plugin_showdn.png", "plugin_showselecthi.png");
+
+// CWindow
+ new_image("cpanel_bg", "cpanel_bg.png");
+ new_image("cbuttons_left", "cbuttons_left.png");
+ new_image("cbuttons_right", "cbuttons_right.png");
+ new_image("cmeter_bg", "cmeter_bg.png");
+
+// VWindow
+ new_image("vbuttons_left", "vbuttons_left.png");
+ new_image("vclock", "vclock.png");
+
+ new_image("preferences_bg", "preferences_bg.png");
+
+
+ new_image("new_bg", "new_bg.png");
+ new_image("setformat_bg", "setformat_bg.png");
+
+
+ timebar_view_data = new_image("timebar_view.png");
+
+ setformat_w = get_image("setformat_bg")->get_w();
+ setformat_h = get_image("setformat_bg")->get_h();
+ setformat_x1 = 15;
+ setformat_x2 = 100;
+
+ setformat_x3 = 315;
+ setformat_x4 = 415;
+ setformat_y1 = 20;
+ setformat_y2 = 85;
+ setformat_y3 = 125;
+ setformat_margin = 30;
+ setformat_channels_x = 25;
+ setformat_channels_y = 242;
+ setformat_channels_w = 250;
+ setformat_channels_h = 250;
+
+ loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10;
+ browse_pad = 20;
+
+
+ new_toggle("playpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "playpatch_data");
+
+ new_toggle("recordpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "recordpatch_data");
+
+ new_toggle("gangpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "gangpatch_data");
+
+ new_toggle("drawpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "drawpatch_data");
+
+
+ new_image_set("mutepatch_data",
+ 5,
+ "mutepatch_up.png",
+ "mutepatch_hi.png",
+ "mutepatch_checked.png",
+ "mutepatch_dn.png",
+ "mutepatch_checkedhi.png");
+
+ new_image_set("expandpatch_data",
+ 5,
+ "expandpatch_up.png",
+ "expandpatch_hi.png",
+ "expandpatch_checked.png",
+ "expandpatch_dn.png",
+ "expandpatch_checkedhi.png");
+
+ build_bg_data();
+ build_overlays();
+
+
+
+
+ out_point = new_image_set(5,
+ "out_up.png",
+ "out_hi.png",
+ "out_checked.png",
+ "out_dn.png",
+ "out_checkedhi.png");
+ in_point = new_image_set(5,
+ "in_up.png",
+ "in_hi.png",
+ "in_checked.png",
+ "in_dn.png",
+ "in_checkedhi.png");
+
+ label_toggle = new_image_set(5,
+ "labeltoggle_up.png",
+ "labeltoggle_uphi.png",
+ "label_checked.png",
+ "labeltoggle_dn.png",
+ "label_checkedhi.png");
+
+ new_image_set("histogram_carrot",
+ 5,
+ "histogram_carrot_up.png",
+ "histogram_carrot_hi.png",
+ "histogram_carrot_checked.png",
+ "histogram_carrot_dn.png",
+ "histogram_carrot_checkedhi.png");
+
+
+ statusbar_cancel_data = new_image_set(3,
+ "statusbar_cancel_up.png",
+ "statusbar_cancel_hi.png",
+ "statusbar_cancel_dn.png");
+
+
+ VFrame *editpanel_up = new_image("editpanel_up.png");
+ VFrame *editpanel_hi = new_image("editpanel_hi.png");
+ VFrame *editpanel_dn = new_image("editpanel_dn.png");
+ VFrame *editpanel_checked = new_image("editpanel_checked.png");
+ VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
+
+ new_image("panel_divider", "panel_divider.png");
+ new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "bottom_justify");
+ new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify");
+ new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel");
+
+ new_toggle("histogram.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "histogram_toggle");
+ new_toggle("histogram_rgb.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "histogram_rgb_toggle");
+ new_toggle("waveform.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "waveform_toggle");
+ new_toggle("waveform_rgb.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "waveform_rgb_toggle");
+ new_toggle("scope.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "scope_toggle");
+
+ new_button("picture.png", editpanel_up, editpanel_hi, editpanel_dn, "picture");
+ new_button("histogram.png", editpanel_up, editpanel_hi, editpanel_dn, "histogram");
+
+
+ new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy");
+ new_button("commercial.png", editpanel_up, editpanel_hi, editpanel_dn, "commercial");
+ new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut");
+ new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit");
+ new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos");
+ new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton");
+ new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton");
+ new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "left_justify");
+ new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn, "magnify_button");
+ new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "middle_justify");
+ new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel");
+ new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel");
+ new_button("nextedit.png", editpanel_up, editpanel_hi, editpanel_dn, "nextedit");
+ new_button("prevedit.png", editpanel_up, editpanel_hi, editpanel_dn, "prevedit");
+ new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton");
+ over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn);
+ overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn);
+ new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste");
+ new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo");
+ new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "right_justify");
+ splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn);
+ new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip");
+ new_button("goto.png", editpanel_up, editpanel_hi, editpanel_dn, "goto");
+ new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "top_justify");
+ new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
+ new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
+
+
+ VFrame *transport_up = new_image("transportup.png");
+ VFrame *transport_hi = new_image("transporthi.png");
+ VFrame *transport_dn = new_image("transportdn.png");
+
+ new_button("end.png", transport_up, transport_hi, transport_dn, "end");
+ new_button("fastfwd.png", transport_up, transport_hi, transport_dn, "fastfwd");
+ new_button("fastrev.png", transport_up, transport_hi, transport_dn, "fastrev");
+ new_button("play.png", transport_up, transport_hi, transport_dn, "play");
+ new_button("framefwd.png", transport_up, transport_hi, transport_dn, "framefwd");
+ new_button("framerev.png", transport_up, transport_hi, transport_dn, "framerev");
+ new_button("pause.png", transport_up, transport_hi, transport_dn, "pause");
+ new_button("record.png", transport_up, transport_hi, transport_dn, "record");
+ new_button("singleframe.png", transport_up, transport_hi, transport_dn, "recframe");
+ new_button("reverse.png", transport_up, transport_hi, transport_dn, "reverse");
+ new_button("rewind.png", transport_up, transport_hi, transport_dn, "rewind");
+ new_button("stop.png", transport_up, transport_hi, transport_dn, "stop");
+ new_button("stop.png", transport_up, transport_hi, transport_dn, "stoprec");
+
+
+
+// CWindow icons
+ new_image("cwindow_inactive", "cwindow_inactive.png");
+ new_image("cwindow_active", "cwindow_active.png");
+
+
+
+ new_image_set("category_button",
+ 3,
+ "preferencesbutton_dn.png",
+ "preferencesbutton_dnhi.png",
+ "preferencesbutton_dnlo.png");
+
+ new_image_set("category_button_checked",
+ 3,
+ "preferencesbutton_up.png",
+ "preferencesbutton_uphi.png",
+ "preferencesbutton_dnlo.png");
+
+
+
+
+
+ new_image_set("color3way_point",
+ 3,
+ "color3way_up.png",
+ "color3way_hi.png",
+ "color3way_dn.png");
+
+ new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow");
+ new_toggle("autokeyframe.png", transport_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe");
+ new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam");
+ new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "meters");
+ new_toggle("blank30x30.png",
+ new_image("locklabels_locked.png"),
+ new_image("locklabels_lockedhi.png"),
+ new_image("locklabels_unlocked.png"),
+ new_image("locklabels_dn.png"), // can't have seperate down for each!!??
+ new_image("locklabels_unlockedhi.png"),
+ "locklabels");
+
+ VFrame *cpanel_up = new_image("cpanel_up.png");
+ VFrame *cpanel_hi = new_image("cpanel_hi.png");
+ VFrame *cpanel_dn = new_image("cpanel_dn.png");
+ VFrame *cpanel_checked = new_image("cpanel_checked.png");
+ VFrame *cpanel_checkedhi = new_image("cpanel_checkedhi.png");
+
+
+ new_toggle("camera.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "camera");
+ new_toggle("crop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "crop");
+ new_toggle("eyedrop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "eyedrop");
+ new_toggle("magnify.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "magnify");
+ new_toggle("mask.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "mask");
+ new_toggle("ruler.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "ruler");
+ new_toggle("projector.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "projector");
+ new_toggle("protect.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "protect");
+ new_toggle("titlesafe.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "titlesafe");
+ new_toggle("toolwindow.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "tool");
+
+ // toggle for tangent mode (compositor/tool window)
+ new_toggle("tan_smooth.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_smooth");
+ new_toggle("tan_linear.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_linear");
+
+
+ flush_images();
+
+ title_font = MEDIUMFONT_3D;
+ title_color = 0xbfbfbf;
+ recordgui_fixed_color = YELLOW;
+ recordgui_variable_color = RED;
+
+ channel_position_color = MEYELLOW;
+ resources->meter_title_w = 25;
+
+ // (asset) edit info text color
+ edit_font_color = YELLOW;
+}
+
+#define VWINDOW_METER_MARGIN 5
+
+
+
+
+
+
+
+
+
+
+
+void FourK::build_bg_data()
+{
+// Audio settings
+ channel_position_data = new VFrame(get_image_data("channel_position.png"));
+
+// Track bitmaps
+ new_image("resource1024", "resource1024.png");
+ new_image("resource512", "resource512.png");
+ new_image("resource256", "resource256.png");
+ new_image("resource128", "resource128.png");
+ new_image("resource64", "resource64.png");
+ new_image("resource32", "resource32.png");
+ new_image("plugin_bg_data", "plugin_bg.png");
+ new_image("title_bg_data", "title_bg.png");
+ new_image("vtimebar_bg_data", "vwindow_timebar.png");
+}
+
+
+
+void FourK::build_overlays()
+{
+ keyframe_data = new VFrame(get_image_data("keyframe.png"));
+ camerakeyframe_data = new VFrame(get_image_data("camerakeyframe.png"));
+ maskkeyframe_data = new VFrame(get_image_data("maskkeyframe.png"));
+ modekeyframe_data = new VFrame(get_image_data("modekeyframe.png"));
+ pankeyframe_data = new VFrame(get_image_data("pankeyframe.png"));
+ projectorkeyframe_data = new VFrame(get_image_data("projectorkeyframe.png"));
+}
+
+
+
+
+
+
+
+
+
+void FourK::draw_rwindow_bg(RecordGUI *gui)
+{
+// int y;
+// int margin = 50;
+// int margin2 = 80;
+// gui->draw_9segment(recordgui_batch_x - margin,
+// 0,
+// mwindow->session->rwindow_w - recordgui_status_x + margin,
+// recordgui_buttons_y,
+// rgui_batch);
+// gui->draw_3segmenth(recordgui_options_x - margin2,
+// recordgui_buttons_y - 5,
+// mwindow->session->rwindow_w - recordgui_options_x + margin2,
+// rgui_controls);
+// y = recordgui_buttons_y - 5 + rgui_controls->get_h();
+// gui->draw_9segment(0,
+// y,
+// mwindow->session->rwindow_w,
+// mwindow->session->rwindow_h - y,
+// rgui_list);
+}
+
+void FourK::draw_rmonitor_bg(RecordMonitorGUI *gui)
+{
+// int margin = 45;
+// int panel_w = 300;
+// int x = rmonitor_meter_x - margin;
+// int w = mwindow->session->rmonitor_w - x;
+// if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
+// gui->clear_box(0,
+// 0,
+// mwindow->session->rmonitor_w,
+// mwindow->session->rmonitor_h);
+// gui->draw_9segment(x,
+// 0,
+// w,
+// mwindow->session->rmonitor_h,
+// rmonitor_meters);
+}
+
+
+
+
+
+
+void FourK::draw_mwindow_bg(MWindowGUI *gui)
+{
+// Button bar
+ gui->draw_3segmenth(mbuttons_x,
+ mbuttons_y - 1,
+ mwindow->session->mwindow_w,
+ get_image("mbutton_bg"));
+
+ int pdw = get_image("panel_divider")->get_w();
+ int x = mbuttons_x;
+ x += 9 * get_image("play")->get_w();
+ x += mtransport_margin; // the control buttons
+
+ gui->draw_vframe(get_image("panel_divider"),
+ x - toggle_margin / 2 - pdw / 2 + 2,
+ mbuttons_y - 1);
+ x += 2 * get_image("arrow")->get_w() + toggle_margin; // the mode buttons
+
+ gui->draw_vframe(get_image("panel_divider"),
+ x - toggle_margin / 2 - pdw / 2 + 2,
+ mbuttons_y - 1);
+ x += 2 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons
+
+ gui->draw_vframe(get_image("panel_divider"),
+ x - toggle_margin / 2 - pdw / 2 + 2,
+ mbuttons_y - 1);
+
+// Clock
+ gui->draw_3segmenth(0,
+ mbuttons_y - 1 + get_image("mbutton_bg")->get_h(),
+ get_image("patchbay_bg")->get_w(),
+ get_image("clock_bg"));
+
+// Patchbay
+//printf("FourK::draw_mwindow_bg %d %d %d\n", __LINE__,
+//mclock_h,
+//mtimebar_h);
+ gui->draw_3segmentv(patchbay_x,
+ patchbay_y,
+ patchbay_h,
+ get_image("patchbay_bg"));
+
+// Track canvas
+ gui->set_color(BLACK);
+ gui->draw_box(mcanvas_x + get_image("patchbay_bg")->get_w(),
+ mcanvas_y + mtimebar_h,
+ mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
+ mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h);
+
+// Timebar
+ gui->draw_3segmenth(mtimebar_x,
+ mtimebar_y,
+ mtimebar_w,
+ get_image("timebar_bg"));
+
+// Zoombar
+ gui->set_color(0x373737);
+ gui->draw_box(mzoom_x,
+ mzoom_y,
+ mwindow->session->mwindow_w,
+ 25);
+
+// Scrollbar filler
+// gui->draw_vframe(get_image("mscroll_filler"),
+// mcanvas_x + mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
+// mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ));
+
+// Status
+ gui->draw_3segmenth(mzoom_x,
+ mzoom_y,
+ mzoom_w,
+ get_image("statusbar"));
+
+
+}
+
+void FourK::draw_cwindow_bg(CWindowGUI *gui)
+{
+ gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg"));
+
+ gui->draw_3segmenth(0, ccomposite_h, cstatus_x, get_image("cbuttons_left"));
+
+ if(mwindow->edl->session->cwindow_meter)
+ {
+ gui->draw_3segmenth(cstatus_x,
+ ccomposite_h,
+ cmeter_x - widget_border - cstatus_x,
+ get_image("cbuttons_right"));
+ gui->draw_9segment(cmeter_x - widget_border,
+ 0,
+ mwindow->session->cwindow_w - cmeter_x + widget_border,
+ mwindow->session->cwindow_h,
+ get_image("cmeter_bg"));
+ }
+ else
+ {
+ gui->draw_3segmenth(cstatus_x,
+ ccomposite_h,
+ cmeter_x - widget_border - cstatus_x + 100,
+ get_image("cbuttons_right"));
+ }
+}
+
+void FourK::draw_vwindow_bg(VWindowGUI *gui)
+{
+ gui->draw_3segmenth(0,
+ vcanvas_h,
+ vdivision_x,
+ get_image("vbuttons_left"));
+ if(mwindow->edl->session->vwindow_meter)
+ {
+ gui->draw_3segmenth(vdivision_x,
+ vcanvas_h,
+ vmeter_x - widget_border - vdivision_x,
+ get_image("cbuttons_right"));
+ gui->draw_9segment(vmeter_x - widget_border,
+ 0,
+ mwindow->session->vwindow_w - vmeter_x + widget_border,
+ mwindow->session->vwindow_h,
+ get_image("cmeter_bg"));
+ }
+ else
+ {
+ gui->draw_3segmenth(vdivision_x,
+ vcanvas_h,
+ vmeter_x - widget_border - vdivision_x + 100,
+ get_image("cbuttons_right"));
+ }
+
+// Clock border
+ gui->draw_3segmenth(vtime_x - 20,
+ vtime_y - 1,
+ vtime_w + 40,
+ get_image("vclock"));
+}
+
+
+void FourK::draw_preferences_bg(PreferencesWindow *gui)
+{
+ gui->draw_vframe(get_image("preferences_bg"), 0, 0);
+}
+
+void FourK::draw_new_bg(NewWindow *gui)
+{
+ gui->draw_vframe(get_image("new_bg"), 0, 0);
+}
+
+void FourK::draw_setformat_bg(SetFormatWindow *gui)
+{
+ gui->draw_vframe(get_image("setformat_bg"), 0, 0);
+}
+
+
+
+
+
+
+
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef DEFAULTTHEME_H
+#define DEFAULTTHEME_H
+
+#include "new.inc"
+#include "plugintclient.h"
+#include "preferencesthread.inc"
+#include "statusbar.inc"
+#include "theme.h"
+#include "timebar.inc"
+
+class FourK : public Theme
+{
+public:
+ FourK();
+ ~FourK();
+
+ void initialize();
+ void draw_mwindow_bg(MWindowGUI *gui);
+
+ void draw_rwindow_bg(RecordGUI *gui);
+ void draw_rmonitor_bg(RecordMonitorGUI *gui);
+ void draw_cwindow_bg(CWindowGUI *gui);
+ void draw_vwindow_bg(VWindowGUI *gui);
+ void draw_preferences_bg(PreferencesWindow *gui);
+
+
+ void draw_new_bg(NewWindow *gui);
+ void draw_setformat_bg(SetFormatWindow *gui);
+
+private:
+ void build_bg_data();
+ void build_patches();
+ void build_overlays();
+
+
+
+
+
+};
+
+
+
+class FourKMain : public PluginTClient
+{
+public:
+ FourKMain(PluginServer *server);
+ ~FourKMain();
+
+ const char* plugin_title();
+ Theme* new_theme();
+
+ FourK *theme;
+};
+
+
+#endif
--- /dev/null
+include ../../global_config
+
+PLUGIN = 4k
+OBJS = $(OBJDIR)/4k.o
+OUTPUT_THEME = $(OUTPUT)
+
+AVC_DIR := $(shell cd ../../thirdparty/libavc*; pwd)
+CFLAGS += -I$(AVC_DIR)
+
+include ../../plugin_config
+
+$(OBJDIR)/4k.o: 4k.C
+
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "bcsignals.h"
+#include "clip.h"
+#include "cwindowgui.h"
+#include "5k.h"
+#include "edl.h"
+#include "edlsession.h"
+#include "mainmenu.h"
+#include "mainsession.h"
+#include "mbuttons.h"
+#include "meterpanel.h"
+#include "mwindow.h"
+#include "mwindowgui.h"
+#include "new.h"
+#include "patchbay.h"
+#include "preferencesthread.h"
+#include "recordgui.h"
+#include "recordmonitor.h"
+#include "setformat.h"
+#include "statusbar.h"
+#include "timebar.h"
+#include "trackcanvas.h"
+#include "vframe.h"
+#include "vwindowgui.h"
+
+
+
+
+PluginClient* new_plugin(PluginServer *server)
+{
+ return new FiveKMain(server);
+}
+
+
+
+
+
+
+
+FiveKMain::FiveKMain(PluginServer *server)
+ : PluginTClient(server)
+{
+}
+
+FiveKMain::~FiveKMain()
+{
+}
+
+const char* FiveKMain::plugin_title()
+{
+ return _("5k");
+}
+
+Theme* FiveKMain::new_theme()
+{
+ theme = new FiveK;
+ extern unsigned char _binary_5k_data_start[];
+ theme->set_data(_binary_5k_data_start);
+ return theme;
+}
+
+
+
+
+
+
+
+
+FiveK::FiveK()
+ : Theme()
+{
+}
+
+FiveK::~FiveK()
+{
+}
+
+void FiveK::initialize()
+{
+ BC_Resources *resources = BC_WindowBase::get_resources();
+
+
+ resources->small_font_xft = N_("Sans-18");
+ resources->medium_font_xft = N_("Sans-22");
+ resources->large_font_xft = N_("Sans-22:style=bold");
+
+
+
+
+ resources->text_default = 0xbfbfbf;
+ resources->text_background = 0x373737;
+ resources->text_border1 = 0x202020;
+ resources->text_border2 = 0x373737;
+ resources->text_border3 = 0x373737;
+ resources->text_border4 = 0x969696;
+ resources->text_inactive_highlight = 0x707070;
+
+ resources->bg_color = 0x484848;
+ resources->border_light2 = resources->bg_color;
+ resources->border_shadow2 = resources->bg_color;
+ resources->default_text_color = 0xbfbfbf;
+ resources->menu_title_text = 0xbfbfbf;
+ resources->popup_title_text = 0xbfbfbf;
+ resources->menu_item_text = 0xbfbfbf;
+ resources->menu_highlighted_fontcolor = WHITE;
+ resources->generic_button_margin = 30;
+ resources->pot_needle_color = resources->text_default;
+ resources->pot_offset = 1;
+ resources->progress_text = resources->text_default;
+ resources->meter_font_color = resources->default_text_color;
+
+ resources->menu_light = 0xababab;
+ resources->menu_highlighted = 0x6f6f6f;
+ resources->menu_down = 0x4b4b4b;
+ resources->menu_up = 0x4b4b4b;
+ resources->menu_shadow = 0x202020;
+ resources->popupmenu_margin = 15;
+ resources->popupmenu_triangle_margin = 15;
+
+ resources->listbox_title_color = 0xbfbfbf;
+
+ resources->listbox_title_margin = 20;
+ resources->listbox_title_hotspot = 20;
+ resources->listbox_border1 = 0x1a1a1a;
+ resources->listbox_border2 = 0x373737;
+ resources->listbox_border3 = 0x373737;
+ resources->listbox_border4 = 0x646464;
+ resources->listbox_highlighted = 0x505050;
+ resources->listbox_inactive = 0x373737;
+ resources->listbox_bg = 0;
+ resources->listbox_text = 0xbfbfbf;
+
+ resources->filebox_margin = 130;
+ resources->file_color = 0xbfbfbf;
+ resources->directory_color = 0xa0a0ff;
+
+
+ new_toggle("loadmode_new.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_new");
+ new_toggle("loadmode_none.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_none");
+ new_toggle("loadmode_newcat.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_newcat");
+ new_toggle("loadmode_cat.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_cat");
+ new_toggle("loadmode_newtracks.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_newtracks");
+ new_toggle("loadmode_paste.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_paste");
+ new_toggle("loadmode_resource.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_resource");
+ new_toggle("loadmode_nested.png",
+ "loadmode_up.png",
+ "loadmode_hi.png",
+ "loadmode_checked.png",
+ "loadmode_dn.png",
+ "loadmode_checkedhi.png",
+ "loadmode_nested");
+
+
+
+ resources->filebox_icons_images = new_button("icons.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_text_images = new_button("text.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_newfolder_images = new_button("folder.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_rename_images = new_button("rename.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_updir_images = new_button("updir.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_delete_images = new_button("delete.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+ resources->filebox_reload_images = new_button("reload.png",
+ "fileboxbutton_up.png",
+ "fileboxbutton_hi.png",
+ "fileboxbutton_dn.png");
+
+
+ resources->filebox_descend_images = new_button("openfolder.png",
+ "filebox_bigbutton_up.png",
+ "filebox_bigbutton_hi.png",
+ "filebox_bigbutton_dn.png");
+
+ resources->usethis_button_images =
+ resources->ok_images = new_button("ok.png",
+ "filebox_bigbutton_up.png",
+ "filebox_bigbutton_hi.png",
+ "filebox_bigbutton_dn.png");
+
+ new_button("ok.png",
+ "new_bigbutton_up.png",
+ "new_bigbutton_hi.png",
+ "new_bigbutton_dn.png",
+ "new_ok_images");
+
+ resources->cancel_images = new_button("cancel.png",
+ "filebox_bigbutton_up.png",
+ "filebox_bigbutton_hi.png",
+ "filebox_bigbutton_dn.png");
+
+ new_button("cancel.png",
+ "new_bigbutton_up.png",
+ "new_bigbutton_hi.png",
+ "new_bigbutton_dn.png",
+ "new_cancel_images");
+
+ resources->medium_7segment = new_image_set(TOTAL_7SEGMENT,
+ "0.png",
+ "1.png",
+ "2.png",
+ "3.png",
+ "4.png",
+ "5.png",
+ "6.png",
+ "7.png",
+ "8.png",
+ "9.png",
+ "colon.png",
+ "period.png",
+ "a.png",
+ "b.png",
+ "c.png",
+ "d.png",
+ "e.png",
+ "f.png",
+ "space.png",
+ "dash.png");
+
+ resources->bar_data = new_image("bar", "bar.png");
+ resources->check = new_image("check", "check.png");
+
+ resources->min_menu_w = 96;
+ resources->menu_popup_bg = new_image("menu_popup_bg.png");
+ resources->menu_item_bg = new_image_set(3,
+ "menuitem_up.png",
+ "menuitem_hi.png",
+ "menuitem_dn.png");
+ resources->menu_bar_bg = new_image("menubar_bg.png");
+ resources->menu_title_bg = new_image_set(3,
+ "menubar_up.png",
+ "menubar_hi.png",
+ "menubar_dn.png");
+
+
+ resources->popupmenu_images = 0;
+// new_image_set(3,
+// "menupopup_up.png",
+// "menupopup_hi.png",
+// "menupopup_dn.png");
+
+ resources->toggle_highlight_bg = new_image("toggle_highlight_bg",
+ "text_highlight.png");
+
+ resources->generic_button_images = new_image_set(3,
+ "generic_up.png",
+ "generic_hi.png",
+ "generic_dn.png");
+ resources->horizontal_slider_data = new_image_set(6,
+ "hslider_fg_up.png",
+ "hslider_fg_hi.png",
+ "hslider_fg_dn.png",
+ "hslider_bg_up.png",
+ "hslider_bg_hi.png",
+ "hslider_bg_dn.png");
+ resources->progress_images = new_image_set(2,
+ "progress_bg.png",
+ "progress_hi.png");
+ resources->tumble_data = new_image_set(4,
+ "tumble_up.png",
+ "tumble_hi.png",
+ "tumble_bottom.png",
+ "tumble_top.png");
+ resources->listbox_button = new_button4("listbox_button.png",
+ "editpanel_up.png",
+ "editpanel_hi.png",
+ "editpanel_dn.png",
+ "editpanel_hi.png");
+ resources->listbox_column = new_image_set(3,
+ "column_up.png",
+ "column_hi.png",
+ "column_dn.png");
+ resources->listbox_up = new_image("listbox_up.png");
+ resources->listbox_dn = new_image("listbox_dn.png");
+ resources->pan_data = new_image_set(7,
+ "pan_up.png",
+ "pan_hi.png",
+ "pan_popup.png",
+ "pan_channel.png",
+ "pan_stick.png",
+ "pan_channel_small.png",
+ "pan_stick_small.png");
+ resources->pan_text_color = WHITE;
+
+ resources->pot_images = new_image_set(3,
+ "pot_up.png",
+ "pot_hi.png",
+ "pot_dn.png");
+
+ resources->checkbox_images = new_image_set(5,
+ "checkbox_up.png",
+ "checkbox_hi.png",
+ "checkbox_checked.png",
+ "checkbox_dn.png",
+ "checkbox_checkedhi.png");
+
+ resources->radial_images = new_image_set(5,
+ "radial_up.png",
+ "radial_hi.png",
+ "radial_checked.png",
+ "radial_dn.png",
+ "radial_checkedhi.png");
+
+ resources->xmeter_images = new_image_set(7,
+ "xmeter_normal.png",
+ "xmeter_green.png",
+ "xmeter_red.png",
+ "xmeter_yellow.png",
+ "xmeter_white.png",
+ "xmeter_over.png",
+ "downmix51_2.png");
+ resources->ymeter_images = new_image_set(7,
+ "ymeter_normal.png",
+ "ymeter_green.png",
+ "ymeter_red.png",
+ "ymeter_yellow.png",
+ "ymeter_white.png",
+ "ymeter_over.png",
+ "downmix51_2.png");
+
+ resources->hscroll_data = new_image_set(10,
+ "hscroll_handle_up.png",
+ "hscroll_handle_hi.png",
+ "hscroll_handle_dn.png",
+ "hscroll_handle_bg.png",
+ "hscroll_left_up.png",
+ "hscroll_left_hi.png",
+ "hscroll_left_dn.png",
+ "hscroll_right_up.png",
+ "hscroll_right_hi.png",
+ "hscroll_right_dn.png");
+
+ resources->vscroll_data = new_image_set(10,
+ "vscroll_handle_up.png",
+ "vscroll_handle_hi.png",
+ "vscroll_handle_dn.png",
+ "vscroll_handle_bg.png",
+ "vscroll_left_up.png",
+ "vscroll_left_hi.png",
+ "vscroll_left_dn.png",
+ "vscroll_right_up.png",
+ "vscroll_right_hi.png",
+ "vscroll_right_dn.png");
+ resources->scroll_minhandle = 20;
+
+
+ new_button("prevtip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "prev_tip");
+ new_button("nexttip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "next_tip");
+ new_button("closetip.png", "tipbutton_up.png", "tipbutton_hi.png", "tipbutton_dn.png", "close_tip");
+ new_button("swap_extents.png",
+ "editpanel_up.png",
+ "editpanel_hi.png",
+ "editpanel_dn.png",
+ "swap_extents");
+
+
+// Record windows
+
+
+ preferences_category_overlap = 0;
+ preferencescategory_x = 0;
+ preferencescategory_y = 5;
+ preferencestitle_x = 5;
+ preferencestitle_y = 10;
+ preferencesoptions_x = 5;
+ preferencesoptions_y = 0;
+
+// MWindow
+ message_normal = resources->text_default;
+ audio_color = GREEN;
+ mtransport_margin = 16;
+ toggle_margin = 16;
+
+ new_button("pane.png", "pane_up.png", "pane_hi.png", "pane_dn.png", "pane");
+ new_image_set("xpane", 3, "xpane_up.png", "xpane_hi.png", "xpane_dn.png");
+ new_image_set("ypane", 3, "ypane_up.png", "ypane_hi.png", "ypane_dn.png");
+
+ new_image("mbutton_bg", "mbutton_bg.png");
+ new_image("timebar_bg", "timebar_bg_flat.png");
+ new_image("timebar_brender", "timebar_brender.png");
+ new_image("clock_bg", "mclock_flat.png");
+ new_image("patchbay_bg", "patchbay_bg.png");
+ new_image("statusbar", "statusbar.png");
+// new_image("mscroll_filler", "mscroll_filler.png");
+
+ new_image_set("zoombar_menu", 3, "zoompopup_up.png", "zoompopup_hi.png", "zoompopup_dn.png");
+ new_image_set("zoombar_tumbler", 4, "zoomtumble_up.png", "zoomtumble_hi.png", "zoomtumble_bottom.png", "zoomtumble_top.png");
+ new_image_set("plugin_on", 5, "plugin_on.png", "plugin_onhi.png", "plugin_onselect.png", "plugin_ondn.png", "plugin_onselecthi.png");
+ new_image_set("plugin_show", 5, "plugin_show.png", "plugin_showhi.png", "plugin_showselect.png", "plugin_showdn.png", "plugin_showselecthi.png");
+
+// CWindow
+ new_image("cpanel_bg", "cpanel_bg.png");
+ new_image("cbuttons_left", "cbuttons_left.png");
+ new_image("cbuttons_right", "cbuttons_right.png");
+ new_image("cmeter_bg", "cmeter_bg.png");
+
+// VWindow
+ new_image("vbuttons_left", "vbuttons_left.png");
+ new_image("vclock", "vclock.png");
+
+ new_image("preferences_bg", "preferences_bg.png");
+
+
+ new_image("new_bg", "new_bg.png");
+ new_image("setformat_bg", "setformat_bg.png");
+
+
+ timebar_view_data = new_image("timebar_view.png");
+
+ setformat_w = get_image("setformat_bg")->get_w();
+ setformat_h = get_image("setformat_bg")->get_h();
+ setformat_x1 = 15;
+ setformat_x2 = 100;
+
+ setformat_x3 = 315;
+ setformat_x4 = 415;
+ setformat_y1 = 20;
+ setformat_y2 = 85;
+ setformat_y3 = 125;
+ setformat_margin = 30;
+ setformat_channels_x = 25;
+ setformat_channels_y = 242;
+ setformat_channels_w = 250;
+ setformat_channels_h = 250;
+
+ loadfile_pad = get_image_set("loadmode_new")[0]->get_h() + 10;
+ browse_pad = 20;
+
+
+ new_toggle("playpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "playpatch_data");
+
+ new_toggle("recordpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "recordpatch_data");
+
+ new_toggle("gangpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "gangpatch_data");
+
+ new_toggle("drawpatch.png",
+ "patch_up.png",
+ "patch_hi.png",
+ "patch_checked.png",
+ "patch_dn.png",
+ "patch_checkedhi.png",
+ "drawpatch_data");
+
+
+ new_image_set("mutepatch_data",
+ 5,
+ "mutepatch_up.png",
+ "mutepatch_hi.png",
+ "mutepatch_checked.png",
+ "mutepatch_dn.png",
+ "mutepatch_checkedhi.png");
+
+ new_image_set("expandpatch_data",
+ 5,
+ "expandpatch_up.png",
+ "expandpatch_hi.png",
+ "expandpatch_checked.png",
+ "expandpatch_dn.png",
+ "expandpatch_checkedhi.png");
+
+ build_bg_data();
+ build_overlays();
+
+
+
+
+ out_point = new_image_set(5,
+ "out_up.png",
+ "out_hi.png",
+ "out_checked.png",
+ "out_dn.png",
+ "out_checkedhi.png");
+ in_point = new_image_set(5,
+ "in_up.png",
+ "in_hi.png",
+ "in_checked.png",
+ "in_dn.png",
+ "in_checkedhi.png");
+
+ label_toggle = new_image_set(5,
+ "labeltoggle_up.png",
+ "labeltoggle_uphi.png",
+ "label_checked.png",
+ "labeltoggle_dn.png",
+ "label_checkedhi.png");
+
+ new_image_set("histogram_carrot",
+ 5,
+ "histogram_carrot_up.png",
+ "histogram_carrot_hi.png",
+ "histogram_carrot_checked.png",
+ "histogram_carrot_dn.png",
+ "histogram_carrot_checkedhi.png");
+
+
+ statusbar_cancel_data = new_image_set(3,
+ "statusbar_cancel_up.png",
+ "statusbar_cancel_hi.png",
+ "statusbar_cancel_dn.png");
+
+
+ VFrame *editpanel_up = new_image("editpanel_up.png");
+ VFrame *editpanel_hi = new_image("editpanel_hi.png");
+ VFrame *editpanel_dn = new_image("editpanel_dn.png");
+ VFrame *editpanel_checked = new_image("editpanel_checked.png");
+ VFrame *editpanel_checkedhi = new_image("editpanel_checkedhi.png");
+
+ new_image("panel_divider", "panel_divider.png");
+ new_button("bottom_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "bottom_justify");
+ new_button("center_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "center_justify");
+ new_button("channel.png", editpanel_up, editpanel_hi, editpanel_dn, "channel");
+
+ new_toggle("histogram.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "histogram_toggle");
+ new_toggle("histogram_rgb.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "histogram_rgb_toggle");
+ new_toggle("waveform.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "waveform_toggle");
+ new_toggle("waveform_rgb.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "waveform_rgb_toggle");
+ new_toggle("scope.png",
+ editpanel_up,
+ editpanel_hi,
+ editpanel_checked,
+ editpanel_dn,
+ editpanel_checkedhi,
+ "scope_toggle");
+
+ new_button("picture.png", editpanel_up, editpanel_hi, editpanel_dn, "picture");
+ new_button("histogram.png", editpanel_up, editpanel_hi, editpanel_dn, "histogram");
+
+
+ new_button("copy.png", editpanel_up, editpanel_hi, editpanel_dn, "copy");
+ new_button("commercial.png", editpanel_up, editpanel_hi, editpanel_dn, "commercial");
+ new_button("cut.png", editpanel_up, editpanel_hi, editpanel_dn, "cut");
+ new_button("fit.png", editpanel_up, editpanel_hi, editpanel_dn, "fit");
+ new_button("fitautos.png", editpanel_up, editpanel_hi, editpanel_dn, "fitautos");
+ new_button("inpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "inbutton");
+ new_button("label.png", editpanel_up, editpanel_hi, editpanel_dn, "labelbutton");
+ new_button("left_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "left_justify");
+ new_button("magnify.png", editpanel_up, editpanel_hi, editpanel_dn, "magnify_button");
+ new_button("middle_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "middle_justify");
+ new_button("nextlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "nextlabel");
+ new_button("prevlabel.png", editpanel_up, editpanel_hi, editpanel_dn, "prevlabel");
+ new_button("nextedit.png", editpanel_up, editpanel_hi, editpanel_dn, "nextedit");
+ new_button("prevedit.png", editpanel_up, editpanel_hi, editpanel_dn, "prevedit");
+ new_button("outpoint.png", editpanel_up, editpanel_hi, editpanel_dn, "outbutton");
+ over_button = new_button("over.png", editpanel_up, editpanel_hi, editpanel_dn);
+ overwrite_data = new_button("overwrite.png", editpanel_up, editpanel_hi, editpanel_dn);
+ new_button("paste.png", editpanel_up, editpanel_hi, editpanel_dn, "paste");
+ new_button("redo.png", editpanel_up, editpanel_hi, editpanel_dn, "redo");
+ new_button("right_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "right_justify");
+ splice_data = new_button("splice.png", editpanel_up, editpanel_hi, editpanel_dn);
+ new_button("toclip.png", editpanel_up, editpanel_hi, editpanel_dn, "toclip");
+ new_button("goto.png", editpanel_up, editpanel_hi, editpanel_dn, "goto");
+ new_button("top_justify.png", editpanel_up, editpanel_hi, editpanel_dn, "top_justify");
+ new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
+ new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
+
+
+ VFrame *transport_up = new_image("transportup.png");
+ VFrame *transport_hi = new_image("transporthi.png");
+ VFrame *transport_dn = new_image("transportdn.png");
+
+ new_button("end.png", transport_up, transport_hi, transport_dn, "end");
+ new_button("fastfwd.png", transport_up, transport_hi, transport_dn, "fastfwd");
+ new_button("fastrev.png", transport_up, transport_hi, transport_dn, "fastrev");
+ new_button("play.png", transport_up, transport_hi, transport_dn, "play");
+ new_button("framefwd.png", transport_up, transport_hi, transport_dn, "framefwd");
+ new_button("framerev.png", transport_up, transport_hi, transport_dn, "framerev");
+ new_button("pause.png", transport_up, transport_hi, transport_dn, "pause");
+ new_button("record.png", transport_up, transport_hi, transport_dn, "record");
+ new_button("singleframe.png", transport_up, transport_hi, transport_dn, "recframe");
+ new_button("reverse.png", transport_up, transport_hi, transport_dn, "reverse");
+ new_button("rewind.png", transport_up, transport_hi, transport_dn, "rewind");
+ new_button("stop.png", transport_up, transport_hi, transport_dn, "stop");
+ new_button("stop.png", transport_up, transport_hi, transport_dn, "stoprec");
+
+
+
+// CWindow icons
+ new_image("cwindow_inactive", "cwindow_inactive.png");
+ new_image("cwindow_active", "cwindow_active.png");
+
+
+
+ new_image_set("category_button",
+ 3,
+ "preferencesbutton_dn.png",
+ "preferencesbutton_dnhi.png",
+ "preferencesbutton_dnlo.png");
+
+ new_image_set("category_button_checked",
+ 3,
+ "preferencesbutton_up.png",
+ "preferencesbutton_uphi.png",
+ "preferencesbutton_dnlo.png");
+
+
+
+
+
+ new_image_set("color3way_point",
+ 3,
+ "color3way_up.png",
+ "color3way_hi.png",
+ "color3way_dn.png");
+
+ new_toggle("arrow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "arrow");
+ new_toggle("autokeyframe.png", transport_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "autokeyframe");
+ new_toggle("ibeam.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "ibeam");
+ new_toggle("show_meters.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "meters");
+ new_toggle("blank30x30.png",
+ new_image("locklabels_locked.png"),
+ new_image("locklabels_lockedhi.png"),
+ new_image("locklabels_unlocked.png"),
+ new_image("locklabels_dn.png"), // can't have seperate down for each!!??
+ new_image("locklabels_unlockedhi.png"),
+ "locklabels");
+
+ VFrame *cpanel_up = new_image("cpanel_up.png");
+ VFrame *cpanel_hi = new_image("cpanel_hi.png");
+ VFrame *cpanel_dn = new_image("cpanel_dn.png");
+ VFrame *cpanel_checked = new_image("cpanel_checked.png");
+ VFrame *cpanel_checkedhi = new_image("cpanel_checkedhi.png");
+
+
+ new_toggle("camera.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "camera");
+ new_toggle("crop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "crop");
+ new_toggle("eyedrop.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "eyedrop");
+ new_toggle("magnify.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "magnify");
+ new_toggle("mask.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "mask");
+ new_toggle("ruler.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "ruler");
+ new_toggle("projector.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "projector");
+ new_toggle("protect.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "protect");
+ new_toggle("titlesafe.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "titlesafe");
+ new_toggle("toolwindow.png", cpanel_up, cpanel_hi, cpanel_checked, cpanel_dn, cpanel_checkedhi, "tool");
+
+ // toggle for tangent mode (compositor/tool window)
+ new_toggle("tan_smooth.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_smooth");
+ new_toggle("tan_linear.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_linear");
+
+
+ flush_images();
+
+ title_font = MEDIUMFONT_3D;
+ title_color = 0xbfbfbf;
+ recordgui_fixed_color = YELLOW;
+ recordgui_variable_color = RED;
+
+ channel_position_color = MEYELLOW;
+ resources->meter_title_w = 25;
+
+ // (asset) edit info text color
+ edit_font_color = YELLOW;
+}
+
+#define VWINDOW_METER_MARGIN 5
+
+
+
+
+
+
+
+
+
+
+
+void FiveK::build_bg_data()
+{
+// Audio settings
+ channel_position_data = new VFrame(get_image_data("channel_position.png"));
+
+// Track bitmaps
+ new_image("resource1024", "resource1024.png");
+ new_image("resource512", "resource512.png");
+ new_image("resource256", "resource256.png");
+ new_image("resource128", "resource128.png");
+ new_image("resource64", "resource64.png");
+ new_image("resource32", "resource32.png");
+ new_image("plugin_bg_data", "plugin_bg.png");
+ new_image("title_bg_data", "title_bg.png");
+ new_image("vtimebar_bg_data", "vwindow_timebar.png");
+}
+
+
+
+void FiveK::build_overlays()
+{
+ keyframe_data = new VFrame(get_image_data("keyframe3.png"));
+ camerakeyframe_data = new VFrame(get_image_data("camerakeyframe.png"));
+ maskkeyframe_data = new VFrame(get_image_data("maskkeyframe.png"));
+ modekeyframe_data = new VFrame(get_image_data("modekeyframe.png"));
+ pankeyframe_data = new VFrame(get_image_data("pankeyframe.png"));
+ projectorkeyframe_data = new VFrame(get_image_data("projectorkeyframe.png"));
+}
+
+
+
+
+
+
+
+
+
+void FiveK::draw_rwindow_bg(RecordGUI *gui)
+{
+// int y;
+// int margin = 50;
+// int margin2 = 80;
+// gui->draw_9segment(recordgui_batch_x - margin,
+// 0,
+// mwindow->session->rwindow_w - recordgui_status_x + margin,
+// recordgui_buttons_y,
+// rgui_batch);
+// gui->draw_3segmenth(recordgui_options_x - margin2,
+// recordgui_buttons_y - 5,
+// mwindow->session->rwindow_w - recordgui_options_x + margin2,
+// rgui_controls);
+// y = recordgui_buttons_y - 5 + rgui_controls->get_h();
+// gui->draw_9segment(0,
+// y,
+// mwindow->session->rwindow_w,
+// mwindow->session->rwindow_h - y,
+// rgui_list);
+}
+
+void FiveK::draw_rmonitor_bg(RecordMonitorGUI *gui)
+{
+// int margin = 45;
+// int panel_w = 300;
+// int x = rmonitor_meter_x - margin;
+// int w = mwindow->session->rmonitor_w - x;
+// if(w < rmonitor_meters->get_w()) w = rmonitor_meters->get_w();
+// gui->clear_box(0,
+// 0,
+// mwindow->session->rmonitor_w,
+// mwindow->session->rmonitor_h);
+// gui->draw_9segment(x,
+// 0,
+// w,
+// mwindow->session->rmonitor_h,
+// rmonitor_meters);
+}
+
+
+
+void FiveK::get_mwindow_sizes(MWindowGUI *gui, int w, int h)
+{
+ Theme::get_mwindow_sizes(gui, w, h);
+ mclock_w = get_image("clock_bg")->get_w() - 60;
+}
+
+
+void FiveK::draw_mwindow_bg(MWindowGUI *gui)
+{
+// Button bar
+ gui->draw_3segmenth(mbuttons_x,
+ mbuttons_y - 1,
+ mwindow->session->mwindow_w,
+ get_image("mbutton_bg"));
+
+ int pdw = get_image("panel_divider")->get_w();
+ int x = mbuttons_x;
+ x += 9 * get_image("play")->get_w();
+ x += mtransport_margin; // the control buttons
+
+ gui->draw_vframe(get_image("panel_divider"),
+ x - toggle_margin / 2 - pdw / 2 + 2,
+ mbuttons_y - 1);
+ x += 2 * get_image("arrow")->get_w() + toggle_margin; // the mode buttons
+
+ gui->draw_vframe(get_image("panel_divider"),
+ x - toggle_margin / 2 - pdw / 2 + 2,
+ mbuttons_y - 1);
+ x += 2 * get_image("autokeyframe")->get_w() + toggle_margin; // the state toggle buttons
+
+ gui->draw_vframe(get_image("panel_divider"),
+ x - toggle_margin / 2 - pdw / 2 + 2,
+ mbuttons_y - 1);
+
+// Clock
+ gui->draw_3segmenth(0,
+ mbuttons_y - 1 + get_image("mbutton_bg")->get_h(),
+ get_image("patchbay_bg")->get_w(),
+ get_image("clock_bg"));
+
+// Patchbay
+//printf("FiveK::draw_mwindow_bg %d %d %d\n", __LINE__,
+//mclock_h,
+//mtimebar_h);
+ gui->draw_3segmentv(patchbay_x,
+ patchbay_y,
+ patchbay_h,
+ get_image("patchbay_bg"));
+
+// Track canvas
+ gui->set_color(BLACK);
+ gui->draw_box(mcanvas_x + get_image("patchbay_bg")->get_w(),
+ mcanvas_y + mtimebar_h,
+ mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
+ mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ) - mtimebar_h);
+
+// Timebar
+ gui->draw_3segmenth(mtimebar_x,
+ mtimebar_y,
+ mtimebar_w,
+ get_image("timebar_bg"));
+
+// Zoombar
+ gui->set_color(0x373737);
+ gui->draw_box(mzoom_x,
+ mzoom_y,
+ mwindow->session->mwindow_w,
+ 25);
+
+// Scrollbar filler
+// gui->draw_vframe(get_image("mscroll_filler"),
+// mcanvas_x + mcanvas_w - BC_ScrollBar::get_span(SCROLL_VERT),
+// mcanvas_y + mcanvas_h - BC_ScrollBar::get_span(SCROLL_HORIZ));
+
+// Status
+ gui->draw_3segmenth(mzoom_x,
+ mzoom_y,
+ mzoom_w,
+ get_image("statusbar"));
+
+
+}
+
+void FiveK::draw_cwindow_bg(CWindowGUI *gui)
+{
+ gui->draw_3segmentv(0, 0, ccomposite_h, get_image("cpanel_bg"));
+
+ gui->draw_3segmenth(0, ccomposite_h, cstatus_x, get_image("cbuttons_left"));
+
+ if(mwindow->edl->session->cwindow_meter)
+ {
+ gui->draw_3segmenth(cstatus_x,
+ ccomposite_h,
+ cmeter_x - widget_border - cstatus_x,
+ get_image("cbuttons_right"));
+ gui->draw_9segment(cmeter_x - widget_border,
+ 0,
+ mwindow->session->cwindow_w - cmeter_x + widget_border,
+ mwindow->session->cwindow_h,
+ get_image("cmeter_bg"));
+ }
+ else
+ {
+ gui->draw_3segmenth(cstatus_x,
+ ccomposite_h,
+ cmeter_x - widget_border - cstatus_x + 100,
+ get_image("cbuttons_right"));
+ }
+}
+
+void FiveK::draw_vwindow_bg(VWindowGUI *gui)
+{
+ gui->draw_3segmenth(0,
+ vcanvas_h,
+ vdivision_x,
+ get_image("vbuttons_left"));
+ if(mwindow->edl->session->vwindow_meter)
+ {
+ gui->draw_3segmenth(vdivision_x,
+ vcanvas_h,
+ vmeter_x - widget_border - vdivision_x,
+ get_image("cbuttons_right"));
+ gui->draw_9segment(vmeter_x - widget_border,
+ 0,
+ mwindow->session->vwindow_w - vmeter_x + widget_border,
+ mwindow->session->vwindow_h,
+ get_image("cmeter_bg"));
+ }
+ else
+ {
+ gui->draw_3segmenth(vdivision_x,
+ vcanvas_h,
+ vmeter_x - widget_border - vdivision_x + 100,
+ get_image("cbuttons_right"));
+ }
+
+// Clock border
+ gui->draw_3segmenth(vtime_x - 20,
+ vtime_y - 1,
+ vtime_w + 40,
+ get_image("vclock"));
+}
+
+
+void FiveK::draw_preferences_bg(PreferencesWindow *gui)
+{
+ gui->draw_vframe(get_image("preferences_bg"), 0, 0);
+}
+
+void FiveK::draw_new_bg(NewWindow *gui)
+{
+ gui->draw_vframe(get_image("new_bg"), 0, 0);
+}
+
+void FiveK::draw_setformat_bg(SetFormatWindow *gui)
+{
+ gui->draw_vframe(get_image("setformat_bg"), 0, 0);
+}
+
+
+
+
+
+
+
--- /dev/null
+
+/*
+ * CINELERRA
+ * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef DEFAULTTHEME_H
+#define DEFAULTTHEME_H
+
+#include "new.inc"
+#include "plugintclient.h"
+#include "preferencesthread.inc"
+#include "statusbar.inc"
+#include "theme.h"
+#include "timebar.inc"
+
+class FiveK : public Theme
+{
+public:
+ FiveK();
+ ~FiveK();
+
+ void initialize();
+ void get_mwindow_sizes(MWindowGUI *gui, int w, int h);
+ void draw_mwindow_bg(MWindowGUI *gui);
+
+ void draw_rwindow_bg(RecordGUI *gui);
+ void draw_rmonitor_bg(RecordMonitorGUI *gui);
+ void draw_cwindow_bg(CWindowGUI *gui);
+ void draw_vwindow_bg(VWindowGUI *gui);
+ void draw_preferences_bg(PreferencesWindow *gui);
+
+
+ void draw_new_bg(NewWindow *gui);
+ void draw_setformat_bg(SetFormatWindow *gui);
+
+private:
+ void build_bg_data();
+ void build_patches();
+ void build_overlays();
+
+
+
+
+
+};
+
+
+
+class FiveKMain : public PluginTClient
+{
+public:
+ FiveKMain(PluginServer *server);
+ ~FiveKMain();
+
+ const char* plugin_title();
+ Theme* new_theme();
+
+ FiveK *theme;
+};
+
+
+#endif
--- /dev/null
+include ../../global_config
+
+PLUGIN = 5k
+OBJS = $(OBJDIR)/5k.o
+OUTPUT_THEME = $(OUTPUT)
+
+AVC_DIR := $(shell cd ../../thirdparty/libavc*; pwd)
+CFLAGS += -I$(AVC_DIR)
+
+include ../../plugin_config
+
+$(OBJDIR)/5k.o: 5k.C
+
DIRS = \
1080to480 \
1080to540 \
+ 4k \
+ 5k \
720to480 \
aging \
audioscope \
dissolve \
dot \
downsample \
+ edge \
echo \
echocancel \
fieldframe \
read_frame(frames[lookahead_size],
0,
lookahead_end,
- config.input_rate);
+ config.input_rate,
+ 0);
// Fill difference buffer
if(lookahead_size > 0)
differences[lookahead_size] =
load_configuration();
- read_frame(frame,
- 0,
- start_position,
- frame_rate);
+ read_frame(frame, 0, start_position, frame_rate, 0);
// Temp was used for adaptive deinterlacing where it took deinterlacing
// an entire frame to decide if the deinterlaced output should be used.
break;
case DEINTERLACE_BOBWEAVE:
if (get_source_position()==0)
- read_frame(temp_prevframe,0, get_source_position(), get_framerate());
+ read_frame(temp_prevframe,0, get_source_position(), get_framerate(), 0);
else
- read_frame(temp_prevframe,0, get_source_position()-1, get_framerate());
+ read_frame(temp_prevframe,0, get_source_position()-1, get_framerate(), 0);
deinterlace_bobweave(frame, temp_prevframe, frame, config.dominance);
break;
case DEINTERLACE_TEMPORALSWAP:
if (get_source_position()==0)
- read_frame(temp_prevframe,0, get_source_position(), get_framerate());
+ read_frame(temp_prevframe,0, get_source_position(), get_framerate(), 0);
else
- read_frame(temp_prevframe,0, get_source_position()-1, get_framerate());
+ read_frame(temp_prevframe,0, get_source_position()-1, get_framerate(), 0);
deinterlace_temporalswap(frame, temp_prevframe, frame, config.dominance);
break;
}
read_frame(history[j],
0,
history_frame[j],
- frame_rate);
+ frame_rate,
+ 0);
add_accum(history[j]);
break;
}
read_frame(frame,
0,
i,
- frame_rate);
+ frame_rate,
+ 0);
add_accum(frame);
//printf("SelTempAvgMain::process_buffer 1 %lld %lld %lld\n", prev_frame, start_position, i);
}
read_frame(frame,
0,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
// Transfer accumulation to output with division if average is desired.
--- /dev/null
+include ../../global_config
+
+OBJS := \
+ $(OBJDIR)/edge.o \
+ $(OBJDIR)/edgewindow.o
+
+PLUGIN = edge
+
+include ../../plugin_config
+
+$(OBJDIR)/edge.o: edge.C
+$(OBJDIR)/edgewindow.o: edgewindow.C
+
--- /dev/null
+/*
+ * CINELERRA
+ * Copyright (C) 1997-2015 Adam Williams <broadcast at earthling dot net>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "affine.h"
+#include "bcsignals.h"
+#include "clip.h"
+#include "filexml.h"
+#include "edge.h"
+#include "edgewindow.h"
+#include "language.h"
+#include "transportque.inc"
+#include <string.h>
+
+// Edge detection from the Gimp
+
+REGISTER_PLUGIN(Edge)
+
+EdgeConfig::EdgeConfig()
+{
+ amount = 8;
+}
+
+int EdgeConfig::equivalent(EdgeConfig &that)
+{
+ if(this->amount != that.amount) return 0;
+ return 1;
+}
+
+void EdgeConfig::copy_from(EdgeConfig &that)
+{
+ this->amount = that.amount;
+}
+
+void EdgeConfig::interpolate(
+ EdgeConfig &prev,
+ EdgeConfig &next,
+ long prev_frame,
+ long next_frame,
+ long current_frame)
+{
+ copy_from(next);
+}
+
+void EdgeConfig::limits()
+{
+ CLAMP(amount, 0, 10);
+}
+
+
+Edge::Edge(PluginServer *server)
+ : PluginVClient(server)
+{
+ engine = 0;
+ temp = 0;
+}
+
+Edge::~Edge()
+{
+ if(engine) delete engine;
+ if(temp) delete temp;
+}
+
+const char* Edge::plugin_title() { return N_("Edge"); }
+int Edge::is_realtime() { return 1; }
+
+NEW_WINDOW_MACRO(Edge, EdgeWindow);
+LOAD_CONFIGURATION_MACRO(Edge, EdgeConfig)
+
+void Edge::save_data(KeyFrame *keyframe)
+{
+ FileXML output;
+
+// cause data to be stored directly in text
+ output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+
+ output.tag.set_title("EDGE");
+ output.tag.set_property("AMOUNT", config.amount);
+ output.append_tag();
+ output.append_newline();
+ output.tag.set_title("/EDGE");
+ output.append_tag();
+ output.append_newline();
+ output.terminate_string();
+}
+
+void Edge::read_data(KeyFrame *keyframe)
+{
+ FileXML input;
+
+ input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
+
+ int result = 0;
+ while(!result)
+ {
+ result = input.read_tag();
+
+ if(!result)
+ {
+ if(input.tag.title_is("EDGE"))
+ {
+ config.amount = input.tag.get_property("AMOUNT", config.amount);
+ config.limits();
+
+ }
+ else
+ if(input.tag.title_is("/EDGE"))
+ {
+ result = 1;
+ }
+ }
+ }
+
+}
+
+void Edge::update_gui()
+{
+ if(thread)
+ {
+ if(load_configuration())
+ {
+ thread->window->lock_window("Edge::update_gui");
+ EdgeWindow *window = (EdgeWindow*)thread->window;
+ window->flush();
+ thread->window->unlock_window();
+ }
+ }
+}
+
+
+
+int Edge::process_buffer(VFrame *frame,
+ int64_t start_position,
+ double frame_rate)
+{
+
+// int need_reconfigure =
+ load_configuration();
+ int w = frame->get_w();
+ int h = frame->get_h();
+ int color_model = frame->get_color_model();
+
+// initialize everything
+ if(!temp)
+ {
+ engine = new EdgeEngine(this,
+ PluginClient::get_project_smp() + 1,
+ PluginClient::get_project_smp() + 1);
+
+ temp = new VFrame(0,
+ -1,
+ w,
+ h,
+ color_model,
+ -1);
+
+ }
+
+ read_frame(frame,
+ 0,
+ start_position,
+ frame_rate,
+ 0);
+ engine->process(temp, frame);
+ frame->copy_from(temp);
+
+ return 0;
+}
+
+
+
+
+EdgePackage::EdgePackage()
+ : LoadPackage()
+{
+}
+
+EdgeUnit::EdgeUnit(EdgeEngine *server) : LoadClient(server)
+{
+ this->server = server;
+}
+
+EdgeUnit::~EdgeUnit()
+{
+}
+
+
+float EdgeUnit::edge_detect(float *data, float max, int do_max)
+{
+ const float v_kernel[9] = { 0, 0, 0,
+ 0, 2, -2,
+ 0, 2, -2 };
+ const float h_kernel[9] = { 0, 0, 0,
+ 0, -2, -2,
+ 0, 2, 2 };
+ int i;
+ float v_grad, h_grad;
+ float amount = server->plugin->config.amount;
+
+ for (i = 0, v_grad = 0, h_grad = 0; i < 9; i++)
+ {
+ v_grad += v_kernel[i] * data[i];
+ h_grad += h_kernel[i] * data[i];
+ }
+
+ float result = sqrt (v_grad * v_grad * amount +
+ h_grad * h_grad * amount);
+ if(do_max)
+ CLAMP(result, 0, max);
+ return result;
+}
+
+#define EDGE_MACRO(type, max, components, is_yuv) \
+{ \
+ type **input_rows = (type**)server->src->get_rows(); \
+ type **output_rows = (type**)server->dst->get_rows(); \
+ int comps = MIN(components, 3); \
+ for(int y = pkg->y1; y < pkg->y2; y++) \
+ { \
+ for(int x = 0; x < w; x++) \
+ { \
+/* kernel is in bounds */ \
+ if(y > 0 && x > 0 && y < h - 2 && x < w - 2) \
+ { \
+ for(int chan = 0; chan < comps; chan++) \
+ { \
+/* load kernel */ \
+ for(int kernel_y = 0; kernel_y < 3; kernel_y++) \
+ { \
+ for(int kernel_x = 0; kernel_x < 3; kernel_x++) \
+ { \
+ kernel[3 * kernel_y + kernel_x] = \
+ (type)input_rows[y - 1 + kernel_y][(x - 1 + kernel_x) * components + chan]; \
+ \
+ if(is_yuv && chan > 0) \
+ { \
+ kernel[3 * kernel_y + kernel_x] -= 0x80; \
+ } \
+ \
+ } \
+ } \
+/* do the business */ \
+ output_rows[y][x * components + chan] = edge_detect(kernel, max, sizeof(type) < 4); \
+ if(is_yuv && chan > 0) \
+ { \
+ output_rows[y][x * components + chan] += 0x80; \
+ } \
+ \
+ } \
+ \
+ if(components == 4) output_rows[y][x * components + 3] = \
+ input_rows[y][x * components + 3]; \
+ } \
+ else \
+ { \
+ for(int chan = 0; chan < comps; chan++) \
+ { \
+/* load kernel */ \
+ for(int kernel_y = 0; kernel_y < 3; kernel_y++) \
+ { \
+ for(int kernel_x = 0; kernel_x < 3; kernel_x++) \
+ { \
+ int in_y = y - 1 + kernel_y; \
+ int in_x = x - 1 + kernel_x; \
+ CLAMP(in_y, 0, h - 1); \
+ CLAMP(in_x, 0, w - 1); \
+ kernel[3 * kernel_y + kernel_x] = \
+ (type)input_rows[in_y][in_x * components + chan]; \
+ if(is_yuv && chan > 0) \
+ { \
+ kernel[3 * kernel_y + kernel_x] -= 0x80; \
+ } \
+ } \
+ } \
+/* do the business */ \
+ output_rows[y][x * components + chan] = edge_detect(kernel, max, sizeof(type) < 4); \
+ if(is_yuv && chan > 0) \
+ { \
+ output_rows[y][x * components + chan] += 0x80; \
+ } \
+ } \
+ if(components == 4) output_rows[y][x * components + 3] = \
+ input_rows[y][x * components + 3]; \
+ } \
+ } \
+ } \
+}
+
+
+void EdgeUnit::process_package(LoadPackage *package)
+{
+ EdgePackage *pkg = (EdgePackage*)package;
+ int w = server->src->get_w();
+ int h = server->src->get_h();
+ float kernel[9];
+
+ switch(server->src->get_color_model())
+ {
+ case BC_RGB_FLOAT:
+ EDGE_MACRO(float, 1, 3, 0);
+ break;
+ case BC_RGBA_FLOAT:
+ EDGE_MACRO(float, 1, 4, 0);
+ break;
+ case BC_RGB888:
+ EDGE_MACRO(unsigned char, 0xff, 3, 0);
+ break;
+ case BC_YUV888:
+ EDGE_MACRO(unsigned char, 0xff, 3, 1);
+ break;
+ case BC_RGBA8888:
+ EDGE_MACRO(unsigned char, 0xff, 4, 0);
+ break;
+ case BC_YUVA8888:
+ EDGE_MACRO(unsigned char, 0xff, 4, 1);
+ break;
+ }
+}
+
+
+EdgeEngine::EdgeEngine(Edge *plugin,
+ int total_clients,
+ int total_packages)
+ : LoadServer(total_clients, total_packages)
+{
+ this->plugin = plugin;
+}
+
+EdgeEngine::~EdgeEngine()
+{
+}
+
+
+void EdgeEngine::init_packages()
+{
+ for(int i = 0; i < get_total_packages(); i++)
+ {
+ EdgePackage *pkg = (EdgePackage*)get_package(i);
+ pkg->y1 = plugin->get_input(0)->get_h() * i / LoadServer::get_total_packages();
+ pkg->y2 = plugin->get_input(0)->get_h() * (i + 1) / LoadServer::get_total_packages();
+ }
+}
+
+void EdgeEngine::process(VFrame *dst, VFrame *src)
+{
+ this->dst = dst;
+ this->src = src;
+ process_packages();
+}
+
+
+LoadClient* EdgeEngine::new_client()
+{
+ return new EdgeUnit(this);
+}
+
+LoadPackage* EdgeEngine::new_package()
+{
+ return new EdgePackage;
+}
+
+
--- /dev/null
+/*
+ * CINELERRA
+ * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+
+
+#ifndef EDGE_H
+#define EDGE_H
+
+#include "loadbalance.h"
+#include "pluginvclient.h"
+
+class EdgeEngine;
+class Edge;
+
+class EdgeConfig
+{
+public:
+ EdgeConfig();
+
+ int equivalent(EdgeConfig &that);
+ void copy_from(EdgeConfig &that);
+ void interpolate(EdgeConfig &prev,
+ EdgeConfig &next,
+ long prev_frame,
+ long next_frame,
+ long current_frame);
+ void limits();
+
+
+ int amount;
+};
+
+class EdgePackage : public LoadPackage
+{
+public:
+ EdgePackage();
+ int y1;
+ int y2;
+};
+
+class EdgeUnit : public LoadClient
+{
+public:
+ EdgeUnit(EdgeEngine *server);
+ ~EdgeUnit();
+ float edge_detect(float *data, float max, int do_max);
+ void process_package(LoadPackage *package);
+ EdgeEngine *server;
+};
+
+
+class EdgeEngine : public LoadServer
+{
+public:
+ EdgeEngine(Edge *plugin,
+ int total_clients,
+ int total_packages);
+ ~EdgeEngine();
+
+ void init_packages();
+ void process(VFrame *dst, VFrame *src);
+
+ LoadClient* new_client();
+ LoadPackage* new_package();
+ VFrame *src, *dst;
+ Edge *plugin;
+};
+
+
+class Edge : public PluginVClient
+{
+public:
+ Edge(PluginServer *server);
+ ~Edge();
+// required for all realtime plugins
+ PLUGIN_CLASS_MEMBERS2(EdgeConfig)
+ int is_realtime();
+ void update_gui();
+ void save_data(KeyFrame *keyframe);
+ void read_data(KeyFrame *keyframe);
+ int process_buffer(VFrame *frame,
+ int64_t start_position,
+ double frame_rate);
+
+ EdgeEngine *engine;
+ VFrame *temp;
+};
+
+
+
+#endif
+
+
+
--- /dev/null
+/*
+ * CINELERRA
+ * Copyright (C) 2014 Adam Williams <broadcast at earthling dot net>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "bcdisplayinfo.h"
+#include "clip.h"
+#include "language.h"
+#include "edge.h"
+#include "edgewindow.h"
+#include "theme.h"
+
+EdgeWindow::EdgeWindow(Edge *plugin)
+ : PluginClientWindow(plugin,
+ 320,
+ 120,
+ 320,
+ 120,
+ 0)
+{
+ this->plugin = plugin;
+}
+
+EdgeWindow::~EdgeWindow()
+{
+}
+
+void EdgeWindow::create_objects()
+{
+ int x = 10, y = 10;
+ int margin = plugin->get_theme()->widget_border;
+ BC_Title *title;
+
+
+
+ add_subwindow(title = new BC_Title(x,
+ y,
+ _("Amount:")));
+ y += title->get_h() + margin;
+ add_subwindow(amount = new EdgeAmount(this,
+ x,
+ y,
+ get_w() - x * 2));
+ y += amount->get_h() + margin;
+
+ show_window(1);
+}
+
+
+
+
+
+
+
+EdgeAmount::EdgeAmount(EdgeWindow *gui,
+ int x,
+ int y,
+ int w)
+ : BC_ISlider(x,
+ y,
+ 0,
+ w,
+ w,
+ 0,
+ 10,
+ gui->plugin->config.amount,
+ 0)
+{
+ this->gui = gui;
+}
+
+int EdgeAmount::handle_event()
+{
+ gui->plugin->config.amount = get_value();
+ gui->plugin->send_configure_change();
+ return 1;
+}
+
+
+
+
+
+
--- /dev/null
+/*
+ * CINELERRA
+ * Copyright (C) 2008-2015 Adam Williams <broadcast at earthling dot net>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef EDGEWINDOW_H
+#define EDGEWINDOW_H
+
+
+#include "guicast.h"
+
+class Edge;
+class EdgeWindow;
+
+
+class EdgeAmount : public BC_ISlider
+{
+public:
+ EdgeAmount(EdgeWindow *gui,
+ int x,
+ int y,
+ int w);
+ int handle_event();
+ EdgeWindow *gui;
+};
+
+class EdgeWindow : public PluginClientWindow
+{
+public:
+ EdgeWindow(Edge *plugin);
+ ~EdgeWindow();
+
+ void create_objects();
+
+ Edge *plugin;
+ EdgeAmount *amount;
+};
+
+
+
+#endif
+
read_frame(input,
0,
field1_position,
- frame_rate * 2);
+ frame_rate * 2,
+ 0);
apply_field(frame,
input,
config.field_dominance == TOP_FIELD_FIRST ? 0 : 1);
read_frame(input,
0,
field2_position,
- frame_rate * 2);
+ frame_rate * 2,
+ 0);
apply_field(frame,
input,
config.field_dominance == TOP_FIELD_FIRST ? 1 : 0);
//printf("FindObjectMain::process_surf %d\n", __LINE__);
if(scene_keypoints->total &&
object_keypoints->total &&
- locatePlanarObject(object_keypoints,
- object_descriptors,
- scene_keypoints,
- scene_descriptors,
- src_corners,
- dst_corners,
- &point_pairs,
- &total_pairs))
+ locatePlanarObject(object_keypoints,
+ object_descriptors,
+ scene_keypoints,
+ scene_descriptors,
+ src_corners,
+ dst_corners,
+ &point_pairs,
+ &total_pairs))
{
if( frame_start != frame_number[0] )
{
//printf("InterpolateVideo::fill_border 1 %lld\n", range_start);
- read_frame(frames[0], 0, frame_start, active_input_rate);
+ read_frame(frames[0], 0, frame_start, active_input_rate, 0);
frame_number[0] = frame_start;
}
if( frame_end != frame_number[1] )
{
//printf("InterpolateVideo::fill_border 2 %lld\n", range_start);
- read_frame(frames[1], 0, frame_end, active_input_rate);
+ read_frame(frames[1], 0, frame_end, active_input_rate, 0);
frame_number[1] = frame_end;
}
frame_rate / active_input_rate);
if(requested_range_start == requested_range_end)
{
- read_frame(frame,
- 0,
- range_start,
- active_input_rate);
+ read_frame(frame, 0, range_start, active_input_rate, 0);
}
else
{
read_frame(frame,
0,
current_loop_position,
- frame_rate);
+ frame_rate,
+ 0);
return 0;
}
read_frame(prev_global_ref,
reference_layer,
previous_frame_number,
- frame_rate);
+ frame_rate,
+ 0);
}
read_frame(current_global_ref,
reference_layer,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
read_frame(global_target_src,
target_layer,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
read_frame(prev_rotate_ref,
reference_layer,
previous_frame_number,
- frame_rate);
+ frame_rate,
+ 0);
}
read_frame(current_rotate_ref,
reference_layer,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
read_frame(rotate_target_src,
target_layer,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
}
read_frame(frame[target_layer],
target_layer,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
}
if(config.draw_vectors)
- show_window();
- flush();
+ show_window(1);
}
void MotionWindow::update_mode()
read_frame(prev_global_ref,
reference_layer,
previous_frame_number,
- frame_rate);
+ frame_rate,
+ 0);
}
read_frame(current_global_ref,
reference_layer,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
read_frame(global_target_src,
target_layer,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
}
read_frame(frame[target_layer],
target_layer,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
}
if(config.draw_vectors)
read_frame(frame,
0,
input_frame,
- input_rate);
+ input_rate,
+ 0);
delete fake_keyframe;
{
load_configuration();
- bool do_components, do_alpha;
+ bool do_components = true, do_alpha = true;
switch(config.operation)
{
- case RerouteConfig::REPLACE: do_components = do_alpha=true; break;
- case RerouteConfig::REPLACE_ALPHA: do_components=false; do_alpha=true; break;
- case RerouteConfig::REPLACE_COMPONENTS: do_components=true; do_alpha=false; break;
+ case RerouteConfig::REPLACE: break;
+ case RerouteConfig::REPLACE_ALPHA: do_components = false; break;
+ case RerouteConfig::REPLACE_COMPONENTS: do_alpha = false; break;
}
if(config.output_track == RerouteConfig::TOP)
read_frame(target,
output_track,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
switch(source->get_color_model())
{
#include "bcdisplayinfo.h"
#include "bchash.h"
+#include "bcsignals.h"
#include "filexml.h"
#include "guicast.h"
#include "language.h"
read_frame(frame,
0,
input_position,
- frame_rate);
+ frame_rate,
+ 0);
else
read_frame(frame,
0,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
return 0;
}
// Convert start position to new direction
if(get_direction() == PLAY_FORWARD)
{
+//printf("ReverseVideo::load_configuration %d %ld %ld %ld %ld %ld\n",
+// __LINE__,
+// get_source_position(),
+// get_source_start(),
+// get_total_len(),
+// range_start,
+// range_end);
input_position = get_source_position() - range_start;
input_position = range_end - input_position - 1;
}
"dash.png");
resources->bar_data = new_image("bar", "bar.png");
-
+ resources->check = new_image("check", "check.png");
resources->min_menu_w = 96;
resources->menu_popup_bg = new_image("menu_popup_bg.png");
read_frame(history[j],
0,
history_frame[j],
- frame_rate);
+ frame_rate,
+ 0);
if(config.mode == TimeAvgConfig::AVERAGE ||
config.mode == TimeAvgConfig::ACCUMULATE)
{
read_frame(frame,
0,
i,
- frame_rate);
+ frame_rate,
+ 0);
add_accum(frame);
printf("TimeAvgMain::process_buffer %d prev_frame=" _LD " start_position=" _LD " i=" _LD "\n",
__LINE__, prev_frame, start_position, i);
read_frame(framelist[0],
0,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
this->input = framelist[0];
this->output = outframes[0];
need_reconfigure |= load_configuration();
read_frame(tfframe,
1,
start_position,
- frame_rate);
+ frame_rate,
+ 0);
if (config.track_usage == TimeFrontConfig::OTHERTRACK_INTENSITY)
{
switch (tfframe->get_color_model())
read_frame(framelist[i],
0,
start_position - i,
- frame_rate);
+ frame_rate,
+ 0);
}
}
-
TitleTranslatePackage::TitleTranslatePackage()
: LoadPackage()
{
-
#define TRANSLATE(type, max, components, ofs) \
{ \
unsigned char **in_rows = plugin->text_mask->get_rows(); \
if(!FT_Load_Char(freetype_face, c, FT_LOAD_RENDER)) {
if(pass == 0) {
current_w = current_x + freetype_face->glyph->bitmap.width;
- if(freetype_face->glyph->bitmap_top > current_ascent)
+ if((int)freetype_face->glyph->bitmap_top > current_ascent)
current_ascent = freetype_face->glyph->bitmap_top;
- if(freetype_face->glyph->bitmap.rows > total_h)
+ if((int)freetype_face->glyph->bitmap.rows > total_h)
total_h = freetype_face->glyph->bitmap.rows;
- if(freetype_face->glyph->bitmap.rows > current_h)
+ if((int)freetype_face->glyph->bitmap.rows > current_h)
current_h = freetype_face->glyph->bitmap.rows;
}
else {
int out_y = (total_h - height[font_number]) / 2 +
ascent[font_number] - freetype_face->glyph->bitmap_top;
for(int in_y = 0;
- in_y < freetype_face->glyph->bitmap.rows &&
+ in_y < (int)freetype_face->glyph->bitmap.rows &&
out_y < total_h;
in_y++, out_y++) {
unsigned char *out_row = font_entry->image->get_rows()[out_y] +
unsigned char *in_row = freetype_face->glyph->bitmap.buffer +
freetype_face->glyph->bitmap.pitch * in_y;
- for(int out_x = 0; out_x < freetype_face->glyph->bitmap.width &&
+ for(int out_x = 0; out_x < (int)freetype_face->glyph->bitmap.width &&
out_x < total_w;
out_x++) {
*out_row = (*in_row * r +
{
FT_Set_Pixel_Sizes(temp_freetype_face, 128, 0);
int gindex = FT_Get_Char_Index(temp_freetype_face, char_code);
- if((!gindex == 0) && (!char_code != 10))
+ if( gindex != 0 && char_code == 10 )
{
strcpy(path_new, path_old);
notfindit = 0;
{
FT_Set_Pixel_Sizes(temp_freetype_face, 128, 0);
int gindex = FT_Get_Char_Index(temp_freetype_face, char_code);
- if((!gindex == 0) && (!char_code != 10))
+ if( gindex != 0 && char_code == 10 )
{
sprintf(path_new, "%s", tmpstring);
notfindit = 0;
: BC_TumbleTextBox(win,
(int)*value,
(int)0,
- (int)100,
+ (int)10000,
x,
y,
100)
if(!engine) engine = new UnsharpEngine(this,
get_project_smp() + 1, get_project_smp() + 1);
- read_frame(frame, 0, get_source_position(), get_framerate());
+ read_frame(frame, 0, get_source_position(), get_framerate(), 0);
engine->do_unsharp(frame);
return 0;
}