}
transitions = defaults->get("SHOW_TRANSITIONS", 1);
plugins = defaults->get("SHOW_PLUGINS", 1);
+ hard_edges = defaults->get("SHOW_HARD_EDGES", 1);
return 0;
}
}
transitions = file->tag.get_property("SHOW_TRANSITIONS", 1);
plugins = file->tag.get_property("SHOW_PLUGINS", 1);
+ hard_edges = file->tag.get_property("SHOW_HARD_EDGES", 1);
}
int AutoConf::save_defaults(BC_Hash* defaults)
}
defaults->update("SHOW_TRANSITIONS", transitions);
defaults->update("SHOW_PLUGINS", plugins);
+ defaults->update("SHOW_HARD_EDGES", hard_edges);
return 0;
}
void AutoConf::save_xml(FileXML *file)
{
- for(int i = 0; i < AUTOMATION_TOTAL; i++)
- {
+ for(int i = 0; i < AUTOMATION_TOTAL; i++) {
file->tag.set_property(xml_titles[i], autos[i]);
}
file->tag.set_property("SHOW_TRANSITIONS", transitions);
file->tag.set_property("SHOW_PLUGINS", plugins);
+ file->tag.set_property("SHOW_HARD_EDGES", hard_edges);
}
int AutoConf::set_all(int value)
{
- for(int i = 0; i < AUTOMATION_TOTAL; i++)
- {
+ for(int i = 0; i < AUTOMATION_TOTAL; i++) {
autos[i] = value;
}
transitions = value;
plugins = value;
+ hard_edges = value;
return 0;
}
void AutoConf::copy_from(AutoConf *src)
{
- for(int i = 0; i < AUTOMATION_TOTAL; i++)
- {
+ for(int i = 0; i < AUTOMATION_TOTAL; i++) {
autos[i] = src->autos[i];
}
transitions = src->transitions;
plugins = src->plugins;
+ hard_edges = src->hard_edges;
}
// Other viewable things
int transitions;
int plugins;
+ int hard_edges;
};
#endif
NON_AUTOMATION_TITLES,
NON_AUTOMATION_TRANSITIONS,
NON_AUTOMATION_PLUGIN_AUTOS,
+ NON_AUTOMATION_HARD_EDGES,
NON_AUTOMATION_TOTAL
};
//printf("Edits::insert_new_edit 1\n");
Edit *new_edit = create_edit();
- if( current ) new_edit->hard_right = current->hard_left;
if( current ) current = PREVIOUS;
- if( current ) new_edit->hard_left = current->hard_right;
//printf("Edits::insert_new_edit 1\n");
insert_after(current, new_edit);
new_edit->startproject = position;
new_edit->copy_from(edit);
new_edit->length = new_edit->startproject + new_edit->length - position;
edit->length = position - edit->startproject;
+ if( !new_edit->length )
+ new_edit->hard_left = new_edit->hard_right = 0;
+ else if( !edit->length )
+ edit->hard_left = edit->hard_right = 0;
+ else {
+ new_edit->hard_right = edit->hard_right;
+ new_edit->hard_left = edit->hard_right = 0;
+ }
new_edit->startproject = position;
new_edit->startsource += edit->length;
// delete 0 length edits
for( current = first; !result && current; ) {
- Edit* next = current->next;
+ Edit* prev = current->previous, *next = current->next;
if( current->length == 0 ) {
if( next && current->transition && !next->transition) {
next->transition = current->transition;
next->transition->edit = next;
current->transition = 0;
}
+ if( !current->silence() ) {
+ if( current->hard_left && next && !next->silence() )
+ next->hard_left = 1;
+ if( current->hard_right && prev && !prev->silence())
+ prev->hard_right = 1;
+ }
delete current;
result = 1;
break;
Edit *next_edit = 0;
for( ; current && (next_edit=current->next); current=NEXT ) {
// both edges are not hard edges
- if( current->hard_right || next_edit->hard_left ) continue;
+ if( current->hard_right || next_edit->hard_left )
+ continue;
// next edit is a glitch
if( is_glitch(next_edit) )
break;
N_("Titles"),
N_("Transitions"),
N_("Plugin Keyframes"),
+ N_("Hard Edges"),
};
const char *GWindowGUI::auto_text[AUTOMATION_TOTAL] =
{1, AUTOMATION_MODE},
{1, AUTOMATION_PAN},
{1, AUTOMATION_MASK},
+ {-1, NON_AUTOMATION_HARD_EDGES},
{0, -1}, // bar
{1, AUTOMATION_CAMERA_X},
{1, AUTOMATION_CAMERA_Y},
{
if( tp->isauto > 0 ) return _(auto_text[tp->ref]);
if( !tp->isauto ) return _(non_auto_text[tp->ref]);
- return _("XYZ");
+ switch( tp->ref ) {
+ case NONAUTOTOGGLES_CAMERA_XYZ:
+ case NONAUTOTOGGLES_PROJECTOR_XYZ:
+ return _("XYZ");
+ case NON_AUTOMATION_HARD_EDGES:
+ return _("Hard Edges");
+ }
+ return "()";
}
void GWindowGUI::calculate_extents(BC_WindowBase *gui, int *w, int *h)
else
draw_vframe(vframe, get_w()-vframe->get_w()-10, y);
}
- else if( tp->isauto < 0 ) {
+ else {
const char *accel = 0;
switch( ref ) {
case NONAUTOTOGGLES_CAMERA_XYZ:
projector_xyz = toggle;
accel = _("Shift-F2");
break;
+ case NON_AUTOMATION_HARD_EDGES:
+ VFrame *vframe = mwindow->theme->hardedge_data;
+ draw_vframe(vframe, get_w()-vframe->get_w()-10, y);
+ hard_edges = toggle;
+ break;
}
if( accel ) {
int x1 = get_w() - BC_Title::calculate_w(this, accel) - 10;
{
if( info->isauto > 0 )
return &mwindow->edl->session->auto_conf->autos[info->ref];
- if( !info->isauto ) {
- switch( info->ref ) {
- case NON_AUTOMATION_ASSETS: return &mwindow->edl->session->show_assets;
- case NON_AUTOMATION_TITLES: return &mwindow->edl->session->show_titles;
- case NON_AUTOMATION_TRANSITIONS: return &mwindow->edl->session->auto_conf->transitions;
- case NON_AUTOMATION_PLUGIN_AUTOS: return &mwindow->edl->session->auto_conf->plugins;
- }
+ switch( info->ref ) {
+ case NON_AUTOMATION_ASSETS: return &mwindow->edl->session->show_assets;
+ case NON_AUTOMATION_TITLES: return &mwindow->edl->session->show_titles;
+ case NON_AUTOMATION_TRANSITIONS: return &mwindow->edl->session->auto_conf->transitions;
+ case NON_AUTOMATION_PLUGIN_AUTOS: return &mwindow->edl->session->auto_conf->plugins;
+ case NON_AUTOMATION_HARD_EDGES: return &mwindow->edl->session->auto_conf->hard_edges;
}
return 0;
}
switch( info->ref ) {
case NONAUTOTOGGLES_CAMERA_XYZ: group = AUTOMATION_CAMERA_X; break;
case NONAUTOTOGGLES_PROJECTOR_XYZ: group = AUTOMATION_PROJECTOR_X; break;
+ case NON_AUTOMATION_HARD_EDGES: *gui->get_main_value(info) = value; break;
}
if( group >= 0 ) {
gui->xyz_check(group, value);
NONAUTOTOGGLES_TITLES,
NONAUTOTOGGLES_TRANSITIONS,
NONAUTOTOGGLES_PLUGIN_AUTOS,
+ NONAUTOTOGGLES_HARD_EDGES,
NONAUTOTOGGLES_CAMERA_XYZ,
NONAUTOTOGGLES_PROJECTOR_XYZ,
NONAUTOTOGGLES_BAR1,
MWindow *mwindow;
GWindowToggle *toggles[NONAUTOTOGGLES_COUNT + AUTOMATION_TOTAL];
- GWindowToggle *camera_xyz, *projector_xyz;
+ GWindowToggle *camera_xyz, *projector_xyz, *hard_edges;
};
class GWindowToggle : public BC_CheckBox
MainErrorGUI::MainErrorGUI(MWindow *mwindow, MainError *thread, int x, int y)
- : BC_Window(_(PROGRAM_NAME ": Errors"),
+ : BC_Window(_(PROGRAM_NAME ": Messages"),
x,
y,
mwindow->session->ewindow_w,
BC_Button *button;
add_subwindow(button = new BC_OKButton(this));
int x = 10, y = 10;
- add_subwindow(title = new BC_Title(x, y, _("The following errors occurred:")));
+ add_subwindow(title = new BC_Title(x, y, _("Message log:")));
y += title->get_h() + 5;
add_subwindow(list = new BC_ListBox(x, y,
get_w() - 20, button->get_y() - y - 5,
void PrefsUseHWDev::create_objects()
{
BC_PopupTextBox::create_objects();
+ set_tooltip(_("vdpau - Nvidia, Nouveau, Amdgpu\n"
+ "vaapi - Broadcom, Intel HD graphics, Radeon\n"
+ "cuda - Nvidia + Cuda SDK"));
hw_dev_names.append(new BC_ListBoxItem(_("none")));
+#ifdef HAVE_VAAPI
hw_dev_names.append(new BC_ListBoxItem("vaapi"));
+#endif
+#ifdef HAVE_VDPAU
hw_dev_names.append(new BC_ListBoxItem("vdpau"));
- hw_dev_names.append(new BC_ListBoxItem(""));
+#endif
+#ifdef HAVE_NV
+ hw_dev_names.append(new BC_ListBoxItem("cuda"));
+#endif
update_list(&hw_dev_names);
update(&pwindow->thread->preferences->use_hw_dev[0]);
}
perror("fork");
return;
}
- if( pid > 0 ) {
- int stat; waitpid(pid, &stat, 0);
- if( warn && stat ) {
- char msg[BCTEXTLEN];
- sprintf(msg, "%s: error exit status %d", name, stat);
- MainError::show_error(msg);
- }
+ char msg[BCTEXTLEN];
+ if( !pid ) {
+ argv.append(0);
+ execvp(argv[0], &argv[0]);
return;
}
- argv.append(0);
- execvp(argv[0], &argv[0]);
+ // warn <0:always, =0:never, >0:on err
+ if( !warn ) return;
+ int stat; waitpid(pid, &stat, 0);
+ if( !stat ) {
+ if( warn > 0 ) return;
+ sprintf(msg, "%s: completed", name);
+ }
+ else
+ sprintf(msg, "%s: error exit status %d", name, stat);
+ MainError::show_error(msg);
}
ShBtnPref::ShBtnPref(const char *nm, const char *cmds, int warn, int run_script)
{
}
+
+ShBtnErrWarnItem::ShBtnErrWarnItem(ShBtnErrWarn *popup,
+ const char *text, int warn)
+ : BC_MenuItem(text)
+{
+ this->popup = popup;
+ this->warn = warn;
+}
+
+int ShBtnErrWarnItem::handle_event()
+{
+ popup->set_text(get_text());
+ popup->st_window->warn = warn;
+ return 1;
+}
+
ShBtnErrWarn::ShBtnErrWarn(ShBtnTextWindow *st_window, int x, int y)
- : BC_CheckBox(x, y, &st_window->warn, _("Warn on err exit"))
+ : BC_PopupMenu(x, y, 120, st_window->warn < 0 ? _("Always"):
+ !st_window->warn ? _("Never") : _("On Error"))
{
this->st_window = st_window;
}
-
ShBtnErrWarn::~ShBtnErrWarn()
{
}
+int ShBtnErrWarn::handle_event()
+{
+ return 0;
+}
+
+void ShBtnErrWarn::create_objects()
+{
+ add_item(new ShBtnErrWarnItem(this,_("Always"), -1));
+ add_item(new ShBtnErrWarnItem(this,_("Never"), 0));
+ add_item(new ShBtnErrWarnItem(this,_("On Error"), 1));
+}
+
ShBtnRunScript::ShBtnRunScript(ShBtnTextWindow *st_window, int x, int y)
: BC_CheckBox(x, y, &st_window->run_script, _("run /path/script.sh + argvs"))
cmd_text = new BC_ScrollTextBox(this, x1, y, get_w()-x1-20, 4, pref->commands);
cmd_text->create_objects();
y += cmd_text->get_h() + 16;
+ add_subwindow(title = new BC_Title(x1,y, _("OnExit Notify:")));
+ x1 += title->get_w() + 10;
add_subwindow(st_err_warn = new ShBtnErrWarn(this, x1, y));
+ st_err_warn->create_objects();
x1 += st_err_warn->get_w() + 20;
add_subwindow(st_run_script = new ShBtnRunScript(this, x1, y));
y = get_h() - ShBtnTextOK::calculate_h() - 10;
~ShBtnTextOK();
};
-class ShBtnErrWarn : public BC_CheckBox
+class ShBtnErrWarnItem : public BC_MenuItem
+{
+public:
+ ShBtnErrWarnItem(ShBtnErrWarn *popup, const char *text, int warn);
+ ShBtnErrWarnItem();
+ int handle_event();
+
+ ShBtnErrWarn *popup;
+ int warn;
+};
+
+class ShBtnErrWarn : public BC_PopupMenu
{
public:
ShBtnErrWarn(ShBtnTextWindow *st_window, int x, int y);
~ShBtnErrWarn();
+ void create_objects();
+ int handle_event();
+
ShBtnTextWindow *st_window;
};
class ShBtnEditButton;
class ShBtnTextDialog;
class ShBtnTextOK;
+class ShBtnErrWarnItem;
class ShBtnErrWarn;
class ShBtnTextWindow;
class ShBtnPrefItem;
lift_data = 0;
maskkeyframe_data = 0;
modekeyframe_data = 0;
+ hardedge_data = 0;
movedn_data = 0;
moveup_data = 0;
newbin_data = 0;
VFrame **lift_data;
VFrame *maskkeyframe_data;
VFrame *modekeyframe_data;
+ VFrame *hardedge_data;
VFrame **movedn_data;
VFrame **moveup_data;
VFrame **newbin_data;
void TrackCanvas::draw_hard_edges()
{
+ if( !mwindow->edl->session->auto_conf->hard_edges )
+ return;
int64_t x, y, w, h;
for(Track *track = mwindow->edl->tracks->first; track; track = track->next) {
fi
for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \
VIDEO4LINUX2 ESOUND PACTL OPENEXR LV2 \
- COMMERCIAL LIBZMPEG SHUTTLE SHUTTLE_USB; do
+ COMMERCIAL LIBZMPEG SHUTTLE SHUTTLE_USB \
+ VAAPI VDPAU CUDA NV; do
eval vv="\$WANT_$v"
if test "x$vv" != "xno"; then
CFG_CFLAGS+=" -DHAVE_$v"
// if(flush) parent_window->flush();
}
+void BC_PopupTextBox::set_tooltip(const char *text)
+{
+ listbox->set_tooltip(text);
+}
+
BC_TumbleTextBoxText::BC_TumbleTextBoxText(BC_TumbleTextBox *popup,
int get_h();
int get_show_query();
void set_show_query(int v);
+ void set_tooltip(const char *text);
void update(const char *text);
void update_list(ArrayList<BC_ListBoxItem*> *data);
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}
delete keyframe_data;
delete maskkeyframe_data;
delete modekeyframe_data;
+ delete hardedge_data;
delete pankeyframe_data;
delete projectorkeyframe_data;
}
camerakeyframe_data = new VFramePng(get_image_data("camerakeyframe.png"));
maskkeyframe_data = new VFramePng(get_image_data("maskkeyframe.png"));
modekeyframe_data = new VFramePng(get_image_data("modekeyframe.png"));
+ hardedge_data = new VFramePng(get_image_data("hardedge.png"));
pankeyframe_data = new VFramePng(get_image_data("pankeyframe.png"));
projectorkeyframe_data = new VFramePng(get_image_data("projectorkeyframe.png"));
}