double position = mwindow->edl->local_session->get_selectionstart(1);
Autos *fade_autos = atrack->automation->autos[AUTOMATION_FADE];
int need_undo = !fade_autos->auto_exists_for_editing(position);
-
mwindow->undo->update_undo_before(_("fade"), need_undo ? 0 : this);
FloatAuto *current = (FloatAuto*)fade_autos->get_auto_for_editing(position);
- float change = v - current->get_value();
- current->set_value(v);
-
+ float change = v - current->get_value(edge);
+ current->bump_value(v, edge, span);
if( track->is_ganged() && track->is_armed() )
- patchbay->synchronize_faders(change, TRACK_AUDIO, track);
+ patchbay->synchronize_faders(change, TRACK_AUDIO, track, edge, span);
mwindow->undo->update_undo_after(_("fade"), LOAD_AUTOMATION);
change_source = 0;
return 1;
}
-AKeyFadePatch::AKeyFadePatch(MWindow *mwindow, APatchGUI *patch, int x, int y)
- : BC_SubWindow(x,y, xS(200),yS(20), GWindowGUI::auto_colors[AUTOMATION_FADE])
+AKeyFadePatch::AKeyFadePatch(MWindow *mwindow, APatchGUI *gui,
+ int bump, int x, int y)
+ : BC_SubWindow(x,y, xS(200)+4,yS(bump ? 50 : 24)+4,
+ GWindowGUI::auto_colors[AUTOMATION_FADE])
{
this->mwindow = mwindow;
- this->patch = patch;
+ this->gui = gui;
+}
+AKeyFadePatch::~AKeyFadePatch()
+{
}
void AKeyFadePatch::create_objects()
{
- int x = 0, y = 0;
- float v = mwindow->get_float_auto(patch, AUTOMATION_FADE)->get_value();
+ int x = 2, x1 = x, y = 0, dy = 0;
+ FloatAuto *fade_auto = mwindow->get_float_auto(gui, AUTOMATION_FADE);
+ float v = fade_auto->get_value(gui->edge);
add_subwindow(akey_fade_text = new AKeyFadeText(this, x, y, xS(64), v));
x += akey_fade_text->get_w();
+ dy = bmax(dy, akey_fade_text->get_h());
VFrame **lok_images = mwindow->theme->get_image_set("lok");
- int w1 = get_w() - x - lok_images[0]->get_w();
+ int w1 = get_w()-2 - x - lok_images[0]->get_w();
add_subwindow(akey_fade_slider = new AKeyFadeSlider(this, x, y, w1, v));
x += akey_fade_slider->get_w();
+ dy = bmax(dy, akey_fade_slider->get_h());
add_subwindow(akey_fade_ok = new AKeyFadeOK(this, x, y, lok_images));
+ dy = bmax(dy, akey_fade_ok->get_h());
+ if( fade_auto->is_bump() ) {
+ y += dy;
+ set_color(get_resources()->get_bg_color());
+ draw_box(0,y, get_w(),get_h());
+ add_subwindow(auto_edge = new AKeyPatchAutoEdge(mwindow, this, x1, y));
+ x1 += auto_edge->get_w() + xS(15);
+ add_subwindow(auto_span = new AKeyPatchAutoSpan(mwindow, this, x1, y));
+ }
+ draw_3d_border(0,0, get_w(), get_h(), 0);
activate();
show_window();
}
+void AKeyFadePatch::set_edge(int edge)
+{
+ gui->edge = edge;
+ FloatAuto *fade_auto = mwindow->get_float_auto(gui, AUTOMATION_FADE);
+ float v = fade_auto->get_value(edge);
+ update(v);
+}
+
+void AKeyFadePatch::set_span(int span)
+{
+ gui->span = span;
+}
+
void AKeyFadePatch::update(float v)
{
akey_fade_text->update(v);
akey_fade_slider->update(v);
- patch->update_faders(v);
+ gui->update_faders(v);
}
AKeyFadeOK::AKeyFadeOK(AKeyFadePatch *akey_fade_patch, int x, int y, VFrame **images)
int AKeyFadeOK::handle_event()
{
- MWindowGUI *mgui = akey_fade_patch->mwindow->gui;
- delete mgui->keyvalue_popup;
- mgui->keyvalue_popup = 0;
+ MWindow *mwindow = akey_fade_patch->mwindow;
+ mwindow->gui->close_keyvalue_popup();
return 1;
}
}
AKeyFadeSlider::AKeyFadeSlider(AKeyFadePatch *akey_fade_patch, int x, int y, int w, float v)
- : AFadePatch(akey_fade_patch->patch, x, y, w, v)
+ : AFadePatch(akey_fade_patch->gui, x, y, w, v)
{
this->akey_fade_patch = akey_fade_patch;
}
double position = mwindow->edl->local_session->get_selectionstart(1);
Autos *pan_autos = patch->atrack->automation->autos[AUTOMATION_PAN];
int need_undo = !pan_autos->auto_exists_for_editing(position);
-
mwindow->undo->update_undo_before(_("pan"), need_undo ? 0 : this);
-
current = (PanAuto*)pan_autos->get_auto_for_editing(position);
-
current->handle_x = get_stick_x();
current->handle_y = get_stick_y();
memcpy(current->values, get_values(), sizeof(float) * mwindow->edl->session->audio_channels);
-
mwindow->undo->update_undo_after(_("pan"), LOAD_AUTOMATION);
-
mwindow->sync_parameters(CHANGE_PARAMS);
-
if( need_undo && mwindow->edl->session->auto_conf->autos[AUTOMATION_PAN] ) {
mwindow->gui->draw_overlays(1);
}
{
}
+AKeyPatchAutoEdge::AKeyPatchAutoEdge(MWindow *mwindow,
+ AKeyFadePatch *patch, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("bump_edge"),
+ patch->gui->span,_("Edge"))
+{
+ this->mwindow = mwindow;
+ this->patch = patch;
+ set_tooltip(_("Bump uses left edge"));
+}
+
+int AKeyPatchAutoEdge::handle_event()
+{
+ patch->set_edge(get_value());
+ return 1;
+}
+
+AKeyPatchAutoSpan::AKeyPatchAutoSpan(MWindow *mwindow,
+ AKeyFadePatch *patch, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("bump_span"),
+ patch->gui->span,_("Span"))
+{
+ this->mwindow = mwindow;
+ this->patch = patch;
+ set_tooltip(_("Bump spans to next"));
+}
+
+int AKeyPatchAutoSpan::handle_event()
+{
+ patch->set_span(get_value());
+ return 1;
+}
+
class AKeyFadePatch : public BC_SubWindow
{
public:
- AKeyFadePatch(MWindow *mwindow, APatchGUI *patch, int x, int y);
+ AKeyFadePatch(MWindow *mwindow, APatchGUI *patch,
+ int bump, int x, int y);
+ ~AKeyFadePatch();
void create_objects();
+ void set_edge(int edge);
+ void set_span(int span);
void update(float v);
MWindow *mwindow;
- APatchGUI *patch;
+ APatchGUI *gui;
AKeyFadeOK *akey_fade_ok;
AKeyFadeText *akey_fade_text;
AKeyFadeSlider *akey_fade_slider;
+ AKeyPatchAutoEdge *auto_edge;
+ AKeyPatchAutoSpan *auto_span;
};
class AKeyFadeOK : public BC_Button
~AMixPatch();
};
+class AKeyPatchAutoEdge : public BC_Toggle
+{
+public:
+ AKeyPatchAutoEdge(MWindow *mwindow, AKeyFadePatch *patch, int x, int y);
+ int handle_event();
+ MWindow *mwindow;
+ AKeyFadePatch *patch;
+};
+
+class AKeyPatchAutoSpan : public BC_Toggle
+{
+public:
+ AKeyPatchAutoSpan(MWindow *mwindow, AKeyFadePatch *patch, int x, int y);
+ int handle_event();
+ MWindow *mwindow;
+ AKeyFadePatch *patch;
+};
+
#endif
class AKeyPanPatch;
class AMeterPatch;
class AMixPatch;
+class AKeyPatchAutoEdge;
+class AKeyPatchAutoSpan;
#endif
Auto* Autos::get_auto_at_position(double position)
{
- int64_t unit_position = track->to_units(position, 0);
+ int64_t unit_position = track->to_units(position, 1);
for(Auto *current = first;
current;
get_prev_auto(track->to_units(position, 0), PLAY_FORWARD, result);
if( create > 0 ) create = edl->session->auto_keyframes;
if( create && (!result || result->is_default ||
- !EQUIV(track->from_units(result->position), position)) ) {
+ !EQUIV(track->from_units(result->position), position)) ) {
//printf("Autos::get_auto_for_editing %p %p %p\n", default_auto, first, result);
position = edl->align_to_frame(position, 0);
result = insert_auto(track->to_units(position, 0));
// Set curve mode
if( !templ && result->is_floatauto() ) {
FloatAuto *floatauto = (FloatAuto *)result;
- floatauto->curve_mode =
+ FloatAuto::t_mode new_mode =
edl->local_session->playback_start >= 0 &&
edl->local_session->playback_end < 0 ? FloatAuto::SMOOTH :
(FloatAuto::t_mode) edl->local_session->floatauto_type;
+ floatauto->change_curve_mode(new_mode, 0);
}
}
else
if( y_auto )
*y_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iy],
create_y, &y_created, redraw);
- if( z_auto ) *z_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iz],
+ if( z_auto )
+ *z_auto = (FloatAuto*) calculate_affected_auto(track->automation->autos[iz],
create_z, &z_created, redraw);
}
redraw = 1;
}
- float x_val = gui->affected_x->get_value();
- float y_val = gui->affected_y->get_value();
- float z_val = gui->affected_z->get_value();
+ CWindowToolGUI *tool_gui = !gui->tool_panel ? 0 : gui->tool_panel->tool_gui;
+ int edge = tool_gui ? tool_gui->edge : 0;
+ int span = tool_gui ? tool_gui->span : 0;
+
+ float x_val = gui->affected_x->get_value(edge);
+ float y_val = gui->affected_y->get_value(edge);
+ float z_val = gui->affected_z->get_value(edge);
if( gui->translating_zoom ) {
float z = gui->center_z + (cursor_y - gui->y_origin) / yS(128);
redraw = 1;
redraw_canvas = 1;
}
- gui->affected_z->set_value(z);
+ gui->affected_z->bump_value(z, edge, span);
}
else {
float dx = cursor_x - gui->x_origin;
}
float x = gui->center_x + dx;
float y = gui->center_y + dy;
- gui->affected_x->set_value(x);
- gui->affected_y->set_value(y);
+ gui->affected_x->bump_value(x, edge, span);
+ gui->affected_y->bump_value(y, edge, span);
if( !EQUIV(x_val, x) || !EQUIV(y_val, y) ) {
rerender = 1;
redraw = 1;
this->mwindow = mwindow;
this->thread = thread;
current_operation = 0;
+ span = 1; edge = 0;
}
CWindowToolGUI::~CWindowToolGUI()
return 0;
}
+void CWindowToolGUI::update_auto(Track *track, int idx, CWindowCoord *vp)
+{
+ FloatAuto *float_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto(
+ track->automation->autos[idx], 1);
+ if( !float_auto ) return;
+ float v = float_auto->get_value(edge);
+ float t = atof(vp->get_text());
+ if( v == t ) return;
+ float_auto->bump_value(t, edge, span);
+ if( idx == AUTOMATION_PROJECTOR_Z || idx == AUTOMATION_CAMERA_Z ) {
+ mwindow->gui->lock_window("CWindowToolGUI::update_auto");
+ mwindow->gui->draw_overlays(1);
+ mwindow->gui->unlock_window();
+ }
+ update();
+ update_preview();
+}
void CWindowToolGUI::update_preview(int changed_edl)
{
const char* tooltip;
};
-const _CVD Camera_Crv_Smooth =
- { FloatAuto::SMOOTH,
- true,
- "tan_smooth",
- N_("\"smooth\" Curve on current Camera Keyframes")
- };
-const _CVD Camera_Crv_Linear =
- { FloatAuto::LINEAR,
- true,
- "tan_linear",
- N_("\"linear\" Curve on current Camera Keyframes")
- };
-const _CVD Projector_Crv_Smooth =
- { FloatAuto::SMOOTH,
- false,
- "tan_smooth",
- N_("\"smooth\" Curve on current Projector Keyframes")
- };
-const _CVD Projector_Crv_Linear =
- { FloatAuto::LINEAR,
- false,
- "tan_linear",
- N_("\"linear\" Curve on current Projector Keyframes")
- };
+const _CVD Camera_Crv_Smooth = { FloatAuto::SMOOTH, true, "tan_smooth",
+ N_("\"smooth\" Curve on current Camera Keyframes") };
+const _CVD Camera_Crv_Linear = { FloatAuto::LINEAR, true, "tan_linear",
+ N_("\"linear\" Curve on current Camera Keyframes") };
+const _CVD Camera_Crv_Tangent = { FloatAuto::TFREE, true, "tan_tangent",
+ N_("\"tangent\" Curve on current Camera Keyframes") };
+const _CVD Camera_Crv_Free = { FloatAuto::FREE, true, "tan_free",
+ N_("\"free\" Curve on current Camera Keyframes") };
+const _CVD Camera_Crv_Bump = { FloatAuto::BUMP, true, "tan_bump",
+ N_("\"bump\" Curve on current Camera Keyframes") };
+
+const _CVD Projector_Crv_Smooth = { FloatAuto::SMOOTH, false, "tan_smooth",
+ N_("\"smooth\" Curve on current Projector Keyframes") };
+const _CVD Projector_Crv_Linear = { FloatAuto::LINEAR, false, "tan_linear",
+ N_("\"linear\" Curve on current Projector Keyframes") };
+const _CVD Projector_Crv_Tangent = { FloatAuto::TFREE, false, "tan_tangent",
+ N_("\"tangent\" Curve on current Projector Keyframes") };
+const _CVD Projector_Crv_Free = { FloatAuto::FREE, false, "tan_free",
+ N_("\"free\" Curve on current Projector Keyframes") };
+const _CVD Projector_Crv_Bump = { FloatAuto::BUMP, false, "tan_bump",
+ N_("\"bump\" Curve on current Projector Keyframes") };
// Implementation Class für Keyframe Curve Mode buttons
//
class CWindowCurveToggle : public BC_Toggle
{
public:
- CWindowCurveToggle(_CVD mode, MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ CWindowCurveToggle(const _CVD &mode,
+ MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
void check_toggle_state(FloatAuto *x, FloatAuto *y, FloatAuto *z);
int handle_event();
private:
- _CVD cfg;
+ const _CVD &cfg;
MWindow *mwindow;
CWindowToolGUI *gui;
};
-CWindowCurveToggle::CWindowCurveToggle(_CVD mode, MWindow *mwindow, CWindowToolGUI *gui, int x, int y)
+CWindowCurveToggle::CWindowCurveToggle(const _CVD &mode,
+ MWindow *mwindow, CWindowToolGUI *gui, int x, int y)
: BC_Toggle(x, y, mwindow->theme->get_image_set(mode.icon_id), false),
cfg(mode)
{
FloatAuto *x_auto = 0, *y_auto = 0, *z_auto = 0;
BC_Title *title;
BC_Button *button;
+ span = 1; edge = 0;
lock_window("CWindowCameraGUI::create_objects");
if( track ) {
add_subwindow(button = new CWindowCameraRight(mwindow, this, x1, y));
// additional Buttons to control the curve mode of the "current" keyframe
x1 += button->get_w() + xs15;
- add_subwindow(this->t_smooth = new CWindowCurveToggle(Camera_Crv_Smooth, mwindow, this, x1, y));
- x1 += button->get_w() + xs10;
- add_subwindow(this->t_linear = new CWindowCurveToggle(Camera_Crv_Linear, mwindow, this, x1, y));
+ add_subwindow(t_smooth = new CWindowCurveToggle(Camera_Crv_Smooth, mwindow, this, x1, y));
+ x1 += t_smooth->get_w() + xs10;
+ add_subwindow(t_linear = new CWindowCurveToggle(Camera_Crv_Linear, mwindow, this, x1, y));
+ x1 += t_linear->get_w() + xs10;
+ add_subwindow(t_tangent = new CWindowCurveToggle(Camera_Crv_Tangent, mwindow, this, x1, y));
+ x1 += t_tangent->get_w() + xs10;
+ add_subwindow(t_free = new CWindowCurveToggle(Camera_Crv_Free, mwindow, this, x1, y));
+ x1 += t_free->get_w() + xs10;
+ add_subwindow(t_bump = new CWindowCurveToggle(Camera_Crv_Bump, mwindow, this, x1, y));
y += button->get_h();
x1 = xs10;
x1 += button->get_w();
add_subwindow(button = new CWindowCameraBottom(mwindow, this, x1, y));
x1 += button->get_w() + xs15;
- add_subwindow(this->add_keyframe = new CWindowCameraAddKeyframe(mwindow, this, x1, y));
- x1 += button->get_w() + xs10;
- add_subwindow(this->reset = new CWindowCameraReset(mwindow, this, x1, y));
+ add_subwindow(add_keyframe = new CWindowCameraAddKeyframe(mwindow, this, x1, y));
+ x1 += add_keyframe->get_w() + xs15;
+ add_subwindow(auto_edge = new CWindowCurveAutoEdge(mwindow, this, x1, y));
+ x1 += auto_edge->get_w() + xs10;
+ add_subwindow(auto_span = new CWindowCurveAutoSpan(mwindow, this, x1, y));
+ x1 += auto_span->get_w() + xs15;
+ add_subwindow(reset = new CWindowCameraReset(mwindow, this, x1, y));
// fill in current auto keyframe values, set toggle states.
this->update();
void CWindowCameraGUI::handle_event()
{
- FloatAuto *x_auto = 0;
- FloatAuto *y_auto = 0;
- FloatAuto *z_auto = 0;
Track *track = mwindow->cwindow->calculate_affected_track();
- if(track)
- {
- mwindow->undo->update_undo_before(_("camera"), this);
- if(event_caller == x)
- {
- x_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto(
- track->automation->autos[AUTOMATION_CAMERA_X], 1);
- if(x_auto)
- {
- x_auto->set_value(atof(x->get_text()));
- update();
- update_preview();
- }
- }
- else
- if(event_caller == y)
- {
- y_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto(
- track->automation->autos[AUTOMATION_CAMERA_Y], 1);
- if(y_auto)
- {
- y_auto->set_value(atof(y->get_text()));
- update();
- update_preview();
- }
- }
- else
- if(event_caller == z)
- {
- z_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto(
- track->automation->autos[AUTOMATION_CAMERA_Z], 1);
- if(z_auto)
- {
- float zoom = atof(z->get_text());
- if(zoom > 100.) zoom = 100.;
- else
- if(zoom < 0.01) zoom = 0.01;
- // Doesn't allow user to enter from scratch
- // if(zoom != atof(z->get_text()))
- // z->update(zoom);
-
- z_auto->set_value(zoom);
- mwindow->gui->lock_window("CWindowCameraGUI::handle_event");
- mwindow->gui->draw_overlays(1);
- mwindow->gui->unlock_window();
- update();
- update_preview();
- }
- }
-
- mwindow->undo->update_undo_after(_("camera"), LOAD_ALL);
- }
+ if( !track ) return;
+ mwindow->undo->update_undo_before(_("camera"), this);
+ if( event_caller == x )
+ update_auto(track, AUTOMATION_CAMERA_X, x);
+ else if( event_caller == y )
+ update_auto(track, AUTOMATION_CAMERA_Y, y);
+ else if( event_caller == z )
+ update_auto(track, AUTOMATION_CAMERA_Z, z);
+ mwindow->undo->update_undo_after(_("camera"), LOAD_ALL);
}
void CWindowCameraGUI::update()
FloatAuto *y_auto = 0;
FloatAuto *z_auto = 0;
Track *track = mwindow->cwindow->calculate_affected_track();
+ int bg_color = get_resources()->text_background;
+ int hi_color = bg_color ^ 0x444444;
if( track ) {
mwindow->cwindow->calculate_affected_autos(track,
&x_auto, &y_auto, &z_auto, 1, 0, 0, 0);
}
if( x_auto ) {
- float xvalue = x_auto->get_value();
+ int color = (edge || span) && x_auto->curve_mode == FloatAuto::BUMP ?
+ hi_color : bg_color;
+ x->get_textbox()->set_back_color(color);
+ float xvalue = x_auto->get_value(edge);
x->update_gui(xvalue);
}
if( y_auto ) {
- float yvalue = y_auto->get_value();
+ int color = (edge || span) && y_auto->curve_mode == FloatAuto::BUMP ?
+ hi_color : bg_color;
+ y->get_textbox()->set_back_color(color);
+ float yvalue = y_auto->get_value(edge);
y->update_gui(yvalue);
}
if( z_auto ) {
- float zvalue = z_auto->get_value();
+ int color = (edge || span) && z_auto->curve_mode == FloatAuto::BUMP ?
+ hi_color : bg_color;
+ z->get_textbox()->set_back_color(color);
+ float zvalue = z_auto->get_value(edge);
z->update_gui(zvalue);
thread->gui->lock_window("CWindowCameraGUI::update");
thread->gui->composite_panel->cpanel_zoom->update(zvalue);
if( x_auto && y_auto && z_auto ) {
t_smooth->check_toggle_state(x_auto, y_auto, z_auto);
t_linear->check_toggle_state(x_auto, y_auto, z_auto);
+ t_tangent->check_toggle_state(x_auto, y_auto, z_auto);
+ t_free->check_toggle_state(x_auto, y_auto, z_auto);
+ t_bump->check_toggle_state(x_auto, y_auto, z_auto);
}
}
return gui->press(&CWindowCanvas::reset_camera);
}
+CWindowCurveAutoEdge::CWindowCurveAutoEdge(MWindow *mwindow,
+ CWindowToolGUI *gui, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("bump_edge"), gui->edge)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+ set_tooltip(_("Bump edit edge left/right"));
+}
+
+int CWindowCurveAutoEdge::handle_event()
+{
+ gui->edge = get_value();
+ gui->update();
+ return 1;
+}
+
+CWindowCurveAutoSpan::CWindowCurveAutoSpan(MWindow *mwindow,
+ CWindowToolGUI *gui, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("bump_span"), gui->span)
+{
+ this->mwindow = mwindow;
+ this->gui = gui;
+ set_tooltip(_("Bump spans to next/prev"));
+}
+
+int CWindowCurveAutoSpan::handle_event()
+{
+ gui->span = get_value();
+ gui->update();
+ return 1;
+}
+
CWindowProjectorGUI::CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread)
: CWindowToolGUI(mwindow, thread, _(PROGRAM_NAME ": Projector"), xS(340), yS(170))
FloatAuto *z_auto = 0;
BC_Title *title;
BC_Button *button;
+ span = 1; edge = 0;
lock_window("CWindowProjectorGUI::create_objects");
if( track ) {
add_subwindow(button = new CWindowProjectorRight(mwindow, this, x1, y));
// additional Buttons to control the curve mode of the "current" keyframe
x1 += button->get_w() + xs15;
- add_subwindow(this->t_smooth = new CWindowCurveToggle(Projector_Crv_Smooth, mwindow, this, x1, y));
- x1 += button->get_w() + xs10;
- add_subwindow(this->t_linear = new CWindowCurveToggle(Projector_Crv_Linear, mwindow, this, x1, y));
+ add_subwindow(t_smooth = new CWindowCurveToggle(Projector_Crv_Smooth, mwindow, this, x1, y));
+ x1 += t_smooth->get_w() + xs10;
+ add_subwindow(t_linear = new CWindowCurveToggle(Projector_Crv_Linear, mwindow, this, x1, y));
+ x1 += t_linear->get_w() + xs15;
+ add_subwindow(t_tangent = new CWindowCurveToggle(Projector_Crv_Tangent, mwindow, this, x1, y));
+ x1 += t_tangent->get_w() + xs10;
+ add_subwindow(t_free = new CWindowCurveToggle(Projector_Crv_Free, mwindow, this, x1, y));
+ x1 += t_free->get_w() + xs10;
+ add_subwindow(t_bump = new CWindowCurveToggle(Projector_Crv_Bump, mwindow, this, x1, y));
y += button->get_h();
x1 = xs10;
x1 += button->get_w();
add_subwindow(button = new CWindowProjectorBottom(mwindow, this, x1, y));
x1 += button->get_w() + xs15;
- add_subwindow(this->add_keyframe = new CWindowProjectorAddKeyframe(mwindow, this, x1, y));
- x1 += button->get_w() + xs10;
- add_subwindow(this->reset = new CWindowProjectorReset(mwindow, this, x1, y));
+ add_subwindow(add_keyframe = new CWindowProjectorAddKeyframe(mwindow, this, x1, y));
+ x1 += add_keyframe->get_w() + xs15;
+ add_subwindow(auto_span = new CWindowCurveAutoSpan(mwindow, this, x1, y));
+ x1 += auto_span->get_w() + xs10;
+ add_subwindow(auto_edge = new CWindowCurveAutoEdge(mwindow, this, x1, y));
+ x1 += auto_edge->get_w() + xs15;
+ add_subwindow(reset = new CWindowProjectorReset(mwindow, this, x1, y));
// fill in current auto keyframe values, set toggle states.
this->update();
void CWindowProjectorGUI::handle_event()
{
- FloatAuto *x_auto = 0;
- FloatAuto *y_auto = 0;
- FloatAuto *z_auto = 0;
Track *track = mwindow->cwindow->calculate_affected_track();
-
- if(track)
- {
- mwindow->undo->update_undo_before(_("projector"), this);
- if(event_caller == x)
- {
- x_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto(
- track->automation->autos[AUTOMATION_PROJECTOR_X], 1);
- if(x_auto)
- {
- x_auto->set_value(atof(x->get_text()));
- update();
- update_preview();
- }
- }
- else
- if(event_caller == y)
- {
- y_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto(
- track->automation->autos[AUTOMATION_PROJECTOR_Y], 1);
- if(y_auto)
- {
- y_auto->set_value(atof(y->get_text()));
- update();
- update_preview();
- }
- }
- else
- if(event_caller == z)
- {
- z_auto = (FloatAuto*)mwindow->cwindow->calculate_affected_auto(
- track->automation->autos[AUTOMATION_PROJECTOR_Z], 1);
- if(z_auto)
- {
- float zoom = atof(z->get_text());
- if(zoom > 100.) zoom = 100.;
- else if(zoom < 0.01) zoom = 0.01;
-// if (zoom != atof(z->get_text()))
-// z->update(zoom);
- z_auto->set_value(zoom);
-
- mwindow->gui->lock_window("CWindowProjectorGUI::handle_event");
- mwindow->gui->draw_overlays(1);
- mwindow->gui->unlock_window();
-
- update();
- update_preview();
- }
- }
- mwindow->undo->update_undo_after(_("projector"), LOAD_ALL);
- }
+ if( !track ) return;
+ mwindow->undo->update_undo_before(_("projector"), this);
+ if( event_caller == x )
+ update_auto(track, AUTOMATION_PROJECTOR_X, x);
+ else if( event_caller == y )
+ update_auto(track, AUTOMATION_PROJECTOR_Y, y);
+ else if( event_caller == z )
+ update_auto(track, AUTOMATION_PROJECTOR_Z, z);
+ mwindow->undo->update_undo_after(_("projector"), LOAD_ALL);
}
void CWindowProjectorGUI::update()
FloatAuto *y_auto = 0;
FloatAuto *z_auto = 0;
Track *track = mwindow->cwindow->calculate_affected_track();
+ int bg_color = get_resources()->text_background;
+ int hi_color = bg_color ^ 0x444444;
if( track ) {
mwindow->cwindow->calculate_affected_autos(track,
&x_auto, &y_auto, &z_auto, 0, 0, 0, 0);
}
if( x_auto ) {
- float xvalue = x_auto->get_value();
+ int color = (edge || span) && x_auto->curve_mode == FloatAuto::BUMP ?
+ hi_color : bg_color;
+ x->get_textbox()->set_back_color(color);
+ float xvalue = x_auto->get_value(edge);
x->update_gui(xvalue);
}
if( y_auto ) {
- float yvalue = y_auto->get_value();
+ int color = (edge || span) && y_auto->curve_mode == FloatAuto::BUMP ?
+ hi_color : bg_color;
+ y->get_textbox()->set_back_color(color);
+ float yvalue = y_auto->get_value(edge);
y->update_gui(yvalue);
}
if( z_auto ) {
- float zvalue = z_auto->get_value();
+ int color = (edge || span) && z_auto->curve_mode == FloatAuto::BUMP ?
+ hi_color : bg_color;
+ z->get_textbox()->set_back_color(color);
+ float zvalue = z_auto->get_value(edge);
z->update_gui(zvalue);
thread->gui->lock_window("CWindowProjectorGUI::update");
thread->gui->composite_panel->cpanel_zoom->update(zvalue);
if( x_auto && y_auto && z_auto ) {
t_smooth->check_toggle_state(x_auto, y_auto, z_auto);
t_linear->check_toggle_state(x_auto, y_auto, z_auto);
+ t_tangent->check_toggle_state(x_auto, y_auto, z_auto);
+ t_free->check_toggle_state(x_auto, y_auto, z_auto);
+ t_bump->check_toggle_state(x_auto, y_auto, z_auto);
}
}
// Update EDL and preview only
void update_preview(int changed_edl=0);
+ void update_auto(Track *track, int idx, CWindowCoord *vp);
void draw_preview(int changed_edl);
int current_operation;
virtual int close_event();
MWindow *mwindow;
CWindowTool *thread;
CWindowCoord *event_caller;
+ int edge, span;
};
class CWindowCoord : public BC_TumbleTextBox
CWindowCoord *coord;
};
+class CWindowCurveAutoEdge : public BC_Toggle
+{
+public:
+ CWindowCurveAutoEdge(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+ int handle_event();
+
+ MWindow *mwindow;
+ CWindowToolGUI *gui;
+};
+
+class CWindowCurveAutoSpan : public BC_Toggle
+{
+public:
+ CWindowCurveAutoSpan(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
+
+ int handle_event();
+ MWindow *mwindow;
+ CWindowToolGUI *gui;
+};
+
class CWindowCropApply : public BC_GenericButton
{
CWindowCoord *x, *y, *z;
CWindowCameraAddKeyframe *add_keyframe;
CWindowCameraReset *reset;
- CWindowCurveToggle *t_smooth, *t_linear;
+ CWindowCurveToggle *t_smooth, *t_linear, *t_tangent, *t_free, *t_bump;
+ CWindowCurveAutoSpan *auto_span;
+ CWindowCurveAutoEdge *auto_edge;
};
class CWindowCameraLeft : public BC_Button
CWindowCoord *x, *y, *z;
CWindowProjectorAddKeyframe *add_keyframe;
CWindowProjectorReset *reset;
- CWindowCurveToggle *t_smooth, *t_linear;
+ CWindowCurveToggle *t_smooth, *t_linear, *t_tangent, *t_free, *t_bump;
+ CWindowCurveAutoSpan *auto_span;
+ CWindowCurveAutoEdge *auto_edge;
};
class CWindowProjectorLeft : public BC_Button
class CWindowCoord;
class CWindowCoordSlider;
class CWindowCoordRange;
+class CWindowCurveAutoEdge;
+class CWindowCurveAutoSpan;
class CWindowCropApply;
class CWindowCropOpMode;
class CWindowCropOpItem;
fidx = aud->fidx;
nudge = aud->nudge;
st = aud->st;
+ AVDictionaryEntry *tref = av_dict_get(fmt_ctx->metadata, "time_reference", 0, 0);
+ if( tref && aud && aud->sample_rate )
+ return strtod(tref->value, 0) / aud->sample_rate;
break; }
case TRACK_VIDEO: {
codec_type = AVMEDIA_TYPE_VIDEO;
: Auto(edl, (Autos*)autos)
{
value = 0;
+ value1 = 0;
control_in_value = 0;
control_out_value = 0;
control_in_position = 0;
int FloatAuto::identical(FloatAuto *src)
{
return EQUIV(value, src->value) &&
+ (curve_mode != BUMP || EQUIV(value1, src->value1)) &&
EQUIV(control_in_value, src->control_in_value) &&
EQUIV(control_out_value, src->control_out_value);
// ctrl positions ignored, as they may depend on neighbours
int FloatAuto::equals(FloatAuto *that)
{
return this->value == that->value &&
+ (this->curve_mode != BUMP || this->value1 == that->value1) &&
this->control_in_value == that->control_in_value &&
this->control_out_value == that->control_out_value &&
this->control_in_position == that->control_in_position &&
}
-/* Note: the following is essentially display-code and has been moved to:
- * TrackCanvas::value_to_percentage(float auto_value, int autogrouptype)
- *
-float FloatAuto::value_to_percentage()
-{
-}
-float FloatAuto::value_to_percentage()
-{
-}
-float FloatAuto::value_to_percentage()
-{
-}
-*/
-
-
void FloatAuto::copy_from(Auto *that)
{
copy_from((FloatAuto*)that);
{
Auto::copy_from(that);
this->value = that->value;
+ this->value1 = that->value1;
this->control_in_value = that->control_in_value;
this->control_out_value = that->control_out_value;
this->control_in_position = that->control_in_position;
}
-void FloatAuto::change_curve_mode(t_mode new_mode)
+void FloatAuto::change_curve_mode(t_mode new_mode, int adjust)
{
if(new_mode == TFREE && !(control_in_position && control_out_position))
new_mode = FREE; // only if curves on both sides...
+ else if(new_mode == BUMP )
+ value1 = value; // continuous
curve_mode = new_mode;
- adjust_curves();
+ if( adjust )
+ adjust_curves();
}
void FloatAuto::toggle_curve_mode()
{
switch (curve_mode) {
- case SMOOTH: change_curve_mode(TFREE); break;
- case LINEAR: change_curve_mode(FREE); break;
- case TFREE : change_curve_mode(LINEAR); break;
- case FREE : change_curve_mode(SMOOTH); break;
+ case SMOOTH: change_curve_mode(LINEAR); break;
+ case LINEAR: change_curve_mode(TFREE); break;
+ case TFREE : change_curve_mode(FREE); break;
+ case FREE : change_curve_mode(BUMP); break;
+ case BUMP : change_curve_mode(SMOOTH); break;
}
}
-
-void FloatAuto::set_value(float value)
+// edge=0:left edge, 1:right edge, -1:both edges
+void FloatAuto::set_value(float value, int edge)
{
float float_min = ((FloatAutos*)autos)->float_min;
- if( value < float_min ) value = float_min;
float float_max = ((FloatAutos*)autos)->float_max;
- if( value > float_max ) value = float_max;
- this->value = value;
+ bclamp(value, float_min, float_max);
+ if( curve_mode != BUMP || edge <= 0 ) this->value = value;
+ if( curve_mode == BUMP && edge != 0 ) this->value1 = value;
this->adjust_curves();
if(previous) ((FloatAuto*)previous)->adjust_curves();
if(next) ((FloatAuto*)next)->adjust_curves();
{
switch(curve_mode) {
case TFREE: control_out_value = control_out_position*newvalue / control_in_position;
- case FREE: control_in_value = newvalue;
+ case FREE:
+ case BUMP: control_in_value = newvalue;
default: return; // otherwise calculated automatically...
}
}
{
switch(curve_mode) {
case TFREE: control_in_value = control_in_position*newvalue / control_out_position;
- case FREE: control_out_value=newvalue;
+ case FREE:
+ case BUMP: control_out_value = newvalue;
default: return;
}
}
if(!left || !right) return;
dx = right->position - left->position;
- float dv = right->value - left->value;
+ float lval = left->get_value(0);
+ float rval = right->get_value(1);
+ float dv = rval - lval;
dvdx = (dx == 0) ? 0 : dv/dx;
}
// define new position and value in one step, do necessary re-adjustments
{
float float_min = ((FloatAutos*)autos)->float_min;
- if( value < float_min ) value = float_min;
float float_max = ((FloatAutos*)autos)->float_max;
- if( value > float_max ) value = float_max;
+ bclamp(value, float_min, float_max);
this->value = value;
this->position = position;
adjust_ctrl_positions();
else
file->tag.set_property("POSITION", position - start);
file->tag.set_property("VALUE", value);
+ file->tag.set_property("VALUE1", value1);
file->tag.set_property("CONTROL_IN_VALUE", control_in_value / 2.0); // compatibility, see below
file->tag.set_property("CONTROL_OUT_VALUE", control_out_value / 2.0);
file->tag.set_property("TANGENT_MODE", (int)curve_mode);
void FloatAuto::load(FileXML *file)
{
- value = file->tag.get_property("VALUE", value);
float float_min = ((FloatAutos*)autos)->float_min;
- if( value < float_min ) value = float_min;
float float_max = ((FloatAutos*)autos)->float_max;
- if( value > float_max ) value = float_max;
+ value = file->tag.get_property("VALUE", value);
+ bclamp(value, float_min, float_max);
+ value1 = file->tag.get_property("VALUE1", value1);
+ bclamp(value, float_min, float_max);
control_in_value = file->tag.get_property("CONTROL_IN_VALUE", control_in_value);
control_out_value = file->tag.get_property("CONTROL_OUT_VALUE", control_out_value);
curve_mode = (t_mode)file->tag.get_property("TANGENT_MODE", (int)FREE);
case FloatAuto::SMOOTH: return _("Smooth");
case FloatAuto::LINEAR: return _("Linear");
case FloatAuto::TFREE: return _("Tangent");
- case FloatAuto::FREE: return _("Disjoint");
- }
- return _("Error");
+ case FloatAuto::FREE: return _("Disjoint");
+ case FloatAuto::BUMP: return _("Bump");
+ }
+ return _("Error");
+}
+
+void FloatAuto::bump_update(int64_t pos, float dv, int edge, int span)
+{
+ float *mins = autos->edl->local_session->automation_mins;
+ float *maxs = autos->edl->local_session->automation_maxs;
+ int group = autos->autogrouptype;
+ float min = mins[group], max = maxs[group];
+ int last_edge = edge;
+ FloatAuto *fauto = this;
+ fauto->position = pos;
+ if( fauto->is_bump() && span ) {
+ do {
+ float v = fauto->get_value(edge) + dv;
+ bclamp(v, min, max);
+ fauto->set_value(v, edge);
+ fauto = (FloatAuto*)(!edge ? fauto->next : fauto->previous);
+ } while( fauto && !fauto->is_bump() );
+ last_edge = !edge ? 1 : 0;
+ }
+ if( fauto ) {
+ float v = fauto->get_value(last_edge) + dv;
+ bclamp(v, min, max);
+ fauto->set_value(v, last_edge);
+ }
+}
+
+void FloatAuto::bump_value(float v, int edge, int span)
+{
+ float dv = v - get_value(edge);
+ bump_update(position, dv, edge, span);
}
void copy(int64_t start, int64_t end, FileXML *file, int default_only);
void load(FileXML *xml);
-// "the value" (=payload of this keyframe)
- float get_value() {return this->value;}
- void set_value(float newval);
+// for curves, edge==0: the right value, for bumps, edge!=0: the left value1
+ float get_value(int edge=0) {
+ return curve_mode==BUMP && edge ? this->value1 : this->value;
+ }
+// edge==0: set value, for bumps: edge>0, set value1, edge<0: set both
+ void set_value(float value, int edge=-1);
+ void bump_update(int64_t pos, float dv, int edge, int span);
+ void bump_value(float v, int edge, int span);
// Possible policies to handle the tagents for the
// bézier curves connecting adjacent automation points
SMOOTH, // curves are coupled in order to yield a smooth curve
LINEAR, // curves always pointing directly to neighbouring automation points
TFREE, // curves on both sides coupled but editable by dragging the handles
- FREE // curves on both sides are independent and editable via GUI
+ FREE, // curves on both sides are independent and editable via GUI
+ BUMP, // curves and values both sides are independent and editable via GUI
};
t_mode curve_mode;
- void change_curve_mode(t_mode); // recalculates curves as well
+ void change_curve_mode(t_mode, int adjust=1); // recalculates curves as well
void toggle_curve_mode(); // cycles through all modes (e.g. by ctrl-click)
+ int is_bump() { return curve_mode == BUMP ? 1 : 0; }
// Control values (y coords of bézier control point), relative to value
float get_control_in_value() {check_pos(); return this->control_in_value;}
void adjust_to_new_coordinates(int64_t position, float value);
// text name for curve mode
static const char *curve_name(int curve_mode);
-
private:
void adjust_curves(); // recalc. ctrk in and out points, if automatic curve mode (SMOOTH or LINEAR)
void adjust_ctrl_positions(FloatAuto *p=0, FloatAuto *n=0); // recalc. x location of ctrl points, notify neighbours
void handle_automatic_curve_after_copy();
// Control values are relative to value
- float value, control_in_value, control_out_value;
+ float value, control_in_value, control_out_value, value1;
// X control positions relative to value position for drawing.
// In native units of the track.
int64_t control_in_position, control_out_position;
next = (FloatAuto*)get_next_auto(position, direction, (Auto* &)next, 0);
// Constant
- if(!next && !previous) return ((FloatAuto*)default_auto)->get_value();
- if(!previous) return next->get_value();
- if(!next) return previous->get_value();
- if(next == previous) return previous->get_value();
-
- if(direction == PLAY_FORWARD)
- {
- if(EQUIV(previous->get_value(), next->get_value())) {
+ if( !next && !previous )
+ return ((FloatAuto*)default_auto)->get_value();
+ if( next == previous )
+ return previous->get_value();
+
+ if( direction == PLAY_FORWARD) {
+ if( !previous ) return next->get_value(1);
+ if( !next ) return previous->get_value(0);
+ if( EQUIV(previous->get_value(0), next->get_value(1)) ) {
if( (previous->curve_mode == FloatAuto::LINEAR &&
next->curve_mode == FloatAuto::LINEAR) ||
(EQUIV(previous->get_control_out_value(), 0) &&
- EQUIV(next->get_control_in_value(), 0))) {
- return previous->get_value();
+ EQUIV(next->get_control_in_value(), 0)) ) {
+ return previous->get_value(0);
}
}
}
else if(direction == PLAY_REVERSE) {
- if(EQUIV(previous->get_value(), next->get_value())) {
+ if( !previous ) return next->get_value(0);
+ if( !next ) return previous->get_value(1);
+ if( EQUIV(previous->get_value(0), next->get_value(1)) ) {
if( (previous->curve_mode == FloatAuto::LINEAR &&
next->curve_mode == FloatAuto::LINEAR) ||
(EQUIV(previous->get_control_in_value(), 0) &&
- EQUIV(next->get_control_out_value(), 0))) {
- return previous->get_value();
+ EQUIV(next->get_control_out_value(), 0)) ) {
+ return previous->get_value(1);
}
}
}
// at this point: previous and next not NULL, positions differ, value not constant.
- return calculate_bezier(previous, next, position);
+ return calculate_bezier(previous, next, position, direction);
}
-float FloatAutos::calculate_bezier(FloatAuto *previous, FloatAuto *next, int64_t position)
+float FloatAutos::calculate_bezier(FloatAuto *previous, FloatAuto *next,
+ int64_t position, int direction)
{
- if(next->position - previous->position == 0) return previous->get_value();
+ int edge = direction == PLAY_FORWARD ? 0 : 1;
+ if( next->position == previous->position )
+ return previous->get_value(edge);
- float y0 = previous->get_value();
- float y3 = next->get_value();
+ float y0 = previous->get_value(edge);
+ float y3 = next->get_value(1-edge);
// control points
- float y1 = previous->get_value() + previous->get_control_out_value();
- float y2 = next->get_value() + next->get_control_in_value();
+ float y1 = y0 + (direction == PLAY_FORWARD ?
+ previous->get_control_out_value() :
+ previous->get_control_in_value());
+ float y2 = y3 + (direction == PLAY_FORWARD ?
+ next->get_control_in_value() :
+ next->get_control_out_value());
float t = (float)(position - previous->position) /
(next->position - previous->position);
return 0;
return previous->get_control_out_value() / previous->get_control_out_position();
}
- float y0 = previous->get_value();
- float y3 = next->get_value();
+ float y0 = previous->get_value(0);
+ float y3 = next->get_value(1);
// control points
- float y1 = previous->get_value() + previous->get_control_out_value();
- float y2 = next->get_value() + next->get_control_in_value();
+ float y1 = y0 + previous->get_control_out_value();
+ float y2 = y3 + next->get_control_in_value();
// normalized scale
float t = (float)(position - previous->position) / scale;
float orig_value;
orig_value = ((FloatAuto*)default_auto)->value * orig_scale;
((FloatAuto*)default_auto)->value = orig_value / new_scale;
+ orig_value = ((FloatAuto*)default_auto)->value1 * orig_scale;
+ ((FloatAuto*)default_auto)->value1 = orig_value / new_scale;
for( FloatAuto *current= (FloatAuto*)first; current; current=(FloatAuto*)NEXT ) {
orig_value = current->value * orig_scale;
current->value = orig_value / new_scale;
+ orig_value = current->value1 * orig_scale;
+ current->value1 = orig_value / new_scale;
orig_value = current->control_in_value * orig_scale;
current->control_in_value = orig_value / new_scale;
orig_value = current->control_out_value * orig_scale;
if( prev ) prev_pos = prev->position;
FloatAuto *next = (FloatAuto*)get_next_auto(pos, direction, znext, 0);
if( next ) next_pos = next->position;
- if( !prev && !next ) prev = next = (FloatAuto*)default_auto;
- else if( !prev ) prev = next;
- else if( !next ) next = prev;
-
+ if( !prev && !next ) prev = (FloatAuto*)default_auto;
double dt = next_pos - prev_pos;
double t0 = (pos - prev_pos) / dt;
if( (pos = next_pos) > end ) pos = end;
double t1 = (pos - prev_pos) / dt;
- double y0 = prev->get_value(), y1 = y0 + prev->get_control_out_value();
- double y3 = next->get_value(), y2 = y3 + next->get_control_in_value();
+ double y0 = !prev ? next->get_value(1) : prev->get_value(0);
+ double y1 = y0 + (!prev ? 0 : prev->get_control_out_value());
+ double y3 = !next ? prev->get_value(0) : next->get_value(1);
+ double y2 = y3 + (!next ? 0 : next->get_control_in_value());
if( y0 != y1 || y1 != y2 || y2 != y3 ) {
// bezier definite integral t0..t1
double f4 = -y0/4 + 3*y1/4 - 3*y2/4 + y3/4;
#include "guicast.h"
#include "filexml.inc"
#include "floatauto.inc"
+#include "transportque.inc"
class FloatAutos : public Autos
{
~FloatAutos();
- void draw_joining_line(BC_SubWindow *canvas, int vertical, int center_pixel, int x1, int y1, int x2, int y2);
+ void draw_joining_line(BC_SubWindow *canvas, int vertical, int center_pixel,
+ int x1, int y1, int x2, int y2);
int get_testy(float slope, int cursor_x, int ax, int ay);
// Return 1 if the automation is constant.
// constant - set to the value if it is constant
- int automation_is_constant(int64_t start,
- int64_t length,
- int direction,
- double &constant);
+ int automation_is_constant(int64_t start, int64_t length, int direction,
+ double &constant);
double get_automation_constant(int64_t start, int64_t end);
// Get value at a specific point. This needs previous and next stores
// because it is used for every pixel in the timeline drawing function.
- float get_value(int64_t position,
- int direction,
- FloatAuto* &previous,
- FloatAuto* &next);
+ float get_value(int64_t position, int direction,
+ FloatAuto* &previous, FloatAuto* &next);
// Helper: just calc the bezier function without doing any lookup of nodes
- static float calculate_bezier(FloatAuto *previous, FloatAuto *next, int64_t position);
- static float calculate_bezier_derivation(FloatAuto *previous, FloatAuto *next, int64_t position);
- void get_extents(float *min,
- float *max,
- int *coords_undefined,
- int64_t unit_start,
- int64_t unit_end);
+ static float calculate_bezier(FloatAuto *previous, FloatAuto *next,
+ int64_t position, int direction=PLAY_FORWARD);
+ static float calculate_bezier_derivation(FloatAuto *previous, FloatAuto *next,
+ int64_t position);
+ void get_extents(float *min, float *max, int *coords_undefined,
+ int64_t unit_start, int64_t unit_end);
void set_automation_mode(int64_t start, int64_t end, int mode);
void set_proxy(int orig_scale, int new_scale);
hard_edges = toggle;
break;
}
- if( accel ) {
+ if( accel ) {
int x1 = get_w() - BC_Title::calculate_w(this, accel) - xs10;
add_subwindow(new BC_Title(x1, y, accel));
}
key_mbar = 0;
key_mode_displayed = false;
key_edit_displayed = false;
+ popx = popy = 0;
}
KeyframePopup::~KeyframePopup()
delete key_linear;
delete key_free_t;
delete key_free;
+ delete key_bump;
}
if( !key_edit_displayed ) {
delete key_edit;
key_linear = new KeyframePopupCurveMode(mwindow, this, FloatAuto::LINEAR);
key_free_t = new KeyframePopupCurveMode(mwindow, this, FloatAuto::TFREE );
key_free = new KeyframePopupCurveMode(mwindow, this, FloatAuto::FREE );
+ key_bump = new KeyframePopupCurveMode(mwindow, this, FloatAuto::BUMP );
}
int KeyframePopup::update(Plugin *plugin, KeyFrame *keyframe)
{
+ gui->get_relative_cursor(popx, popy);
key_show->set_text(_("Show Plugin Settings"));
this->keyframe_plugin = plugin;
this->keyframe_auto = keyframe;
int KeyframePopup::update(Automation *automation, Autos *autos, Auto *auto_keyframe)
{
+ gui->get_relative_cursor(popx, popy);
key_show->set_text(_(GWindowGUI::auto_text[autos->autoidx]));
this->keyframe_plugin = 0;
this->keyframe_automation = automation;
add_item(key_linear);
add_item(key_free_t);
add_item(key_free);
+ add_item(key_bump);
key_mode_displayed = true;
}
else if(key_mode_displayed && (!autos || autos->get_type() != AUTOMATION_TYPE_FLOAT))
{ // remove additional menu entries
+ remove_item(key_bump);
remove_item(key_free);
remove_item(key_free_t);
remove_item(key_linear);
key_linear->toggle_mode((FloatAuto*)auto_keyframe);
key_free_t->toggle_mode((FloatAuto*)auto_keyframe);
key_free ->toggle_mode((FloatAuto*)auto_keyframe);
+ key_bump ->toggle_mode((FloatAuto*)auto_keyframe);
}
activate();
}
{
MWindowGUI *mgui = mwindow->gui;
CWindowGUI *cgui = mwindow->cwindow->gui;
- int cx = mgui->get_relative_cursor_x()+15, cy = mgui->get_relative_cursor_y()-15;
- delete mgui->keyvalue_popup;
- mgui->keyvalue_popup = 0;
+ int cx = popup->popx, cy = popup->popy;
+ int xmargin = mgui->get_w() - xS(200);
+ int ymargin = mgui->get_h() - yS(50);
+ if( cx > xmargin ) cx = xmargin;
+ if( cy > ymargin ) cy = ymargin;
+ xmargin = xS(15); ymargin = yS(15);
+ if( cx < xmargin ) cx = xmargin;
+ if( cy < ymargin ) cy = ymargin;
+ mgui->close_keyvalue_popup();
if( popup->keyframe_plugin ) {
mwindow->update_plugin_guis();
mgui->add_subwindow(mode);
mode->create_objects();
mode->activate_menu();
- mgui->keyvalue_popup = mode;
+ mgui->open_keyvalue_popup(mode);
break; }
case AUTOMATION_PAN: {
mgui->add_subwindow(pan);
pan->create_objects();
pan->activate(cx, cy);
- mgui->keyvalue_popup = pan;
+ mgui->open_keyvalue_popup(pan);
break; }
case AUTOMATION_FADE: {
+ FloatAuto *fade_auto = mwindow->get_float_auto(patchgui, AUTOMATION_FADE);
+ int bump = fade_auto->is_bump();
switch( patchgui->data_type ) {
case TRACK_AUDIO: {
- AKeyFadePatch *fade = new AKeyFadePatch(mwindow, (APatchGUI *)patchgui, cx, cy);
+ AKeyFadePatch *fade = new AKeyFadePatch(mwindow,
+ (APatchGUI *)patchgui, bump, cx, cy);
mgui->add_subwindow(fade);
fade->create_objects();
- mgui->keyvalue_popup = fade;
+ mgui->open_keyvalue_popup(fade);
break; }
case TRACK_VIDEO: {
- VKeyFadePatch *fade = new VKeyFadePatch(mwindow, (VPatchGUI *)patchgui, cx, cy);
+ VKeyFadePatch *fade = new VKeyFadePatch(mwindow,
+ (VPatchGUI *)patchgui, bump, cx, cy);
mgui->add_subwindow(fade);
fade->create_objects();
- mgui->keyvalue_popup = fade;
+ mgui->open_keyvalue_popup(fade);
break; }
}
break; }
case AUTOMATION_SPEED: {
- KeySpeedPatch *speed = new KeySpeedPatch(mwindow, patchgui, cx, cy);
+ FloatAuto *speed_auto = mwindow->get_float_auto(patchgui, AUTOMATION_SPEED);
+ int bump = speed_auto->is_bump();
+ KeySpeedPatch *speed = new KeySpeedPatch(mwindow, patchgui, bump, cx, cy);
mgui->add_subwindow(speed);
speed->create_objects();
- mgui->keyvalue_popup = speed;
+ mgui->open_keyvalue_popup(speed);
break; }
case AUTOMATION_MUTE: {
KeyMutePatch *mute = new KeyMutePatch(mwindow, (APatchGUI *)patchgui, cx, cy);
mgui->add_subwindow(mute);
mute->create_objects();
- mgui->keyvalue_popup = mute;
+ mgui->open_keyvalue_popup(mute);
break; }
}
break; }
KeyframePopupCurveMode::~KeyframePopupCurveMode() { }
-const char* KeyframePopupCurveMode::get_labeltext(int mode)
+const char *KeyframePopupCurveMode::get_labeltext(int mode)
{
switch(mode) {
case FloatAuto::SMOOTH: return _("smooth curve");
case FloatAuto::LINEAR: return _("linear segments");
case FloatAuto::TFREE: return _("tangent edit");
case FloatAuto::FREE: return _("disjoint edit");
+ case FloatAuto::BUMP: return _("bump edit");
}
return _("misconfigured");
}
int KeyMuteValue::button_release_event()
{
BC_CheckBox::button_release_event();
- MWindowGUI *mgui = key_mute_patch->mwindow->gui;
- delete mgui->keyvalue_popup;
- mgui->keyvalue_popup = 0;
+ key_mute_patch->mwindow->gui->close_keyvalue_popup();
return 1;
}
return 1;
}
-KeySpeedPatch::KeySpeedPatch(MWindow *mwindow, PatchGUI *patch, int x, int y)
- : BC_SubWindow(x,y, 200,20, GWindowGUI::auto_colors[AUTOMATION_SPEED])
+KeySpeedPatch::KeySpeedPatch(MWindow *mwindow, PatchGUI *gui,
+ int bump, int x, int y)
+ : BC_SubWindow(x,y, xS(200)+4, yS(bump ? 50 : 24)+4,
+ GWindowGUI::auto_colors[AUTOMATION_SPEED])
{
this->mwindow = mwindow;
- this->patch = patch;
+ this->gui = gui;
+}
+KeySpeedPatch::~KeySpeedPatch()
+{
}
void KeySpeedPatch::create_objects()
{
- int x = 0, y = 0;
- float v = mwindow->get_float_auto(patch, AUTOMATION_SPEED)->get_value();
- add_subwindow(key_speed_text = new KeySpeedText(this, x, y, 64, v));
+ int x = 2, x1 = x, y = 2, dy = 0;
+ FloatAuto *speed_auto = mwindow->get_float_auto(gui, AUTOMATION_SPEED);
+ float v = speed_auto->get_value(gui->edge);
+ add_subwindow(key_speed_text = new KeySpeedText(this, x, y, xS(64), v));
x += key_speed_text->get_w();
+ dy = bmax(dy, key_speed_text->get_h());
VFrame **lok_images = mwindow->theme->get_image_set("lok");
- int w1 = get_w() - x - lok_images[0]->get_w();
+ int w1 = get_w()-2 - x - lok_images[0]->get_w();
add_subwindow(key_speed_slider = new KeySpeedSlider(this, x, y, w1, v));
x += key_speed_slider->get_w();
+ dy = bmax(dy, key_speed_slider->get_h());
add_subwindow(key_speed_ok = new KeySpeedOK(this, x, y, lok_images));
+ dy = bmax(dy, key_speed_ok->get_h());
+ if( speed_auto->is_bump() ) {
+ y += dy;
+ set_color(get_resources()->get_bg_color());
+ draw_box(0,y, get_w(),get_h());
+ add_subwindow(auto_edge = new KeySpeedAutoEdge(mwindow, this, x1, y));
+ x1 += auto_edge->get_w() + xS(15);
+ add_subwindow(auto_span = new KeySpeedAutoSpan(mwindow, this, x1, y));
+ }
+ draw_3d_border(0,0, get_w(), get_h(), 0);
activate();
show_window();
mwindow->speed_before();
}
+void KeySpeedPatch::set_edge(int edge)
+{
+ gui->edge = edge;
+ FloatAuto *speed_auto = mwindow->get_float_auto(gui, AUTOMATION_SPEED);
+ float v = speed_auto->get_value(edge);
+ update(v);
+}
+
+void KeySpeedPatch::set_span(int span)
+{
+ gui->span = span;
+}
+
void KeySpeedPatch::update(float v)
{
key_speed_text->update(v);
void KeySpeedPatch::update_speed(float v)
{
- patch->change_source = 1;
- double position = mwindow->edl->local_session->get_selectionstart(1);
- Track *track = patch->track;
+ Track *track = gui->track;
+ if( !track->is_armed() ) return;
Autos *speed_autos = track->automation->autos[AUTOMATION_SPEED];
+ double position = mwindow->edl->local_session->get_selectionstart(1);
+ FloatAuto *current = (FloatAuto*)speed_autos->get_auto_for_editing(position);
+ float change = v - current->get_value(gui->edge);
+ if( !change ) return;
+ gui->change_source = 1;
int need_undo = !speed_autos->auto_exists_for_editing(position);
-
mwindow->undo->update_undo_before(_("speed"), need_undo ? 0 : this);
- FloatAuto *current = (FloatAuto*)speed_autos->get_auto_for_editing(position);
- float change = v - current->get_value();
- current->set_value(v);
- if( track->is_ganged() && track->is_armed() ) {
- TrackCanvas *track_canvas = patch->patchbay->pane->canvas;
+ current->bump_value(v, gui->edge, gui->span);
+ if( track->is_ganged() ) {
+ TrackCanvas *track_canvas = gui->patchbay->pane->canvas;
track_canvas->fill_ganged_autos(-1, change, track, current);
track_canvas->update_ganged_autos(0, track, current);
track_canvas->clear_ganged_autos();
}
- mwindow->undo->update_undo_after(_("speed"), LOAD_AUTOMATION+LOAD_EDITS);
- patch->change_source = 0;
+ mwindow->undo->update_undo_after(_("speed"),
+ LOAD_AUTOMATION + LOAD_EDITS + LOAD_TIMEBAR);
+ gui->change_source = 0;
mwindow->sync_parameters(CHANGE_PARAMS);
if(mwindow->edl->session->auto_conf->autos[AUTOMATION_SPEED]) {
MWindow *mwindow = key_speed_patch->mwindow;
mwindow->speed_after(1);
mwindow->resync_guis();
- MWindowGUI *mgui = mwindow->gui;
- delete mgui->keyvalue_popup;
- mgui->keyvalue_popup = 0;
+ mwindow->gui->close_keyvalue_popup();
return 1;
}
return 1;
}
+KeySpeedAutoEdge::KeySpeedAutoEdge(MWindow *mwindow,
+ KeySpeedPatch *patch, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("bump_edge"),
+ patch->gui->span,_("Edge"))
+{
+ this->mwindow = mwindow;
+ this->patch = patch;
+ set_tooltip(_("Bump uses left edge"));
+}
+
+int KeySpeedAutoEdge::handle_event()
+{
+ patch->set_edge(get_value());
+ return 1;
+}
+
+KeySpeedAutoSpan::KeySpeedAutoSpan(MWindow *mwindow,
+ KeySpeedPatch *patch, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("bump_span"),
+ patch->gui->span,_("Span"))
+{
+ this->mwindow = mwindow;
+ this->patch = patch;
+ set_tooltip(_("Bump spans to next"));
+}
+
+int KeySpeedAutoSpan::handle_event()
+
+{
+ patch->set_span(get_value());
+ return 1;
+}
+
Automation *keyframe_automation;
Auto *keyframe_auto;
BC_MenuItem *key_mbar;
+ int popx, popy;
private:
KeyframePopupDelete *key_delete;
KeyframePopupCurveMode *key_linear;
KeyframePopupCurveMode *key_free_t;
KeyframePopupCurveMode *key_free;
+ KeyframePopupCurveMode *key_bump;
bool key_edit_displayed;
bool key_mode_displayed;
class KeySpeedPatch : public BC_SubWindow
{
public:
- KeySpeedPatch(MWindow *mwindow, PatchGUI *patch, int x, int y);
+ KeySpeedPatch(MWindow *mwindow, PatchGUI *gui,
+ int bump, int x, int y);
+ ~KeySpeedPatch();
void create_objects();
void update(float v);
+ void set_edge(int edge);
+ void set_span(int span);
void update_speed(float v);
MWindow *mwindow;
- PatchGUI *patch;
+ PatchGUI *gui;
KeySpeedSlider *key_speed_slider;
KeySpeedText *key_speed_text;
KeySpeedOK *key_speed_ok;
+ KeySpeedAutoEdge *auto_edge;
+ KeySpeedAutoSpan *auto_span;
};
class KeySpeedOK : public BC_Button
KeySpeedPatch *key_speed_patch;
};
+class KeySpeedAutoEdge : public BC_Toggle
+{
+public:
+ KeySpeedAutoEdge(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
+ int handle_event();
+ MWindow *mwindow;
+ KeySpeedPatch *patch;
+};
+
+class KeySpeedAutoSpan : public BC_Toggle
+{
+public:
+ KeySpeedAutoSpan(MWindow *mwindow, KeySpeedPatch *patch, int x, int y);
+ int handle_event();
+ MWindow *mwindow;
+ KeySpeedPatch *patch;
+};
+
#endif
class KeySpeedOK;
class KeySpeedText;
class KeySpeedSlider;
+class KeySpeedAutoEdge;
+class KeySpeedAutoSpan;
#endif
keyframemenu->add_item(new CopyKeyframes(mwindow));
keyframemenu->add_item(new PasteKeyframes(mwindow));
keyframemenu->add_item(new ClearKeyframes(mwindow));
- keyframemenu->add_item(new StraightenKeyframes(mwindow));
- keyframemenu->add_item(new BendKeyframes(mwindow));
+ keyframemenu->add_item(set_auto_curves = new SetAutomationCurveMode(mwindow));
+ set_auto_curves->create_objects();
keyframemenu->add_item(keyframe_curve_type = new KeyframeCurveType(mwindow));
keyframe_curve_type->create_objects();
keyframe_curve_type->update(mwindow->edl->local_session->floatauto_type);
+ keyframemenu->add_item(keyframe_create = new KeyframeCreate(mwindow));
+ keyframe_create->create_objects();
keyframemenu->add_item(new BC_MenuItem("-"));
keyframemenu->add_item(new CopyDefaultKeyframe(mwindow));
keyframemenu->add_item(new PasteDefaultKeyframe(mwindow));
}
-
-StraightenKeyframes::StraightenKeyframes(MWindow *mwindow)
- : BC_MenuItem(_("Change to linear"))
+SetAutomationCurveItem::SetAutomationCurveItem(SetAutomationCurveMode *set_curve_mode, int id)
+ : BC_MenuItem(FloatAuto::curve_name(id))
{
- this->mwindow = mwindow;
+ this->set_curve_mode = set_curve_mode;
+ this->id = id;
}
-int StraightenKeyframes::handle_event()
+int SetAutomationCurveItem::handle_event()
{
- mwindow->set_automation_mode(FloatAuto::LINEAR);
+ set_curve_mode->mwindow->set_automation_mode((FloatAuto::t_mode)id);
return 1;
}
+SetAutoCurveModeMenu::SetAutoCurveModeMenu(SetAutomationCurveMode *curve_mode)
+: BC_SubMenu()
+{
+ this->curve_mode = curve_mode;
+}
-
-
-BendKeyframes::BendKeyframes(MWindow *mwindow)
- : BC_MenuItem(_("Change to smooth"))
+SetAutomationCurveMode::SetAutomationCurveMode(MWindow *mwindow)
+ : BC_MenuItem(_("Set curve modes..."))
{
this->mwindow = mwindow;
+ curve_mode_menu = 0;
}
-int BendKeyframes::handle_event()
+void SetAutomationCurveMode::create_objects()
{
- mwindow->set_automation_mode(FloatAuto::SMOOTH);
- return 1;
+ add_submenu(curve_mode_menu = new SetAutoCurveModeMenu(this));
+ for( int id=FloatAuto::SMOOTH; id<=FloatAuto::BUMP; ++id )
+ curve_mode_menu->add_item(new SetAutomationCurveItem(this, id));
}
-
KeyframeCurveType::KeyframeCurveType(MWindow *mwindow)
: BC_MenuItem(_("Create curve type..."))
{
void KeyframeCurveType::create_objects()
{
add_submenu(curve_menu = new KeyframeCurveTypeMenu(this));
- for( int i=FloatAuto::SMOOTH; i<=FloatAuto::FREE; ++i ) {
+ for( int i=FloatAuto::SMOOTH; i<=FloatAuto::BUMP; ++i ) {
KeyframeCurveTypeItem *curve_type_item = new KeyframeCurveTypeItem(i, this);
curve_menu->add_submenuitem(curve_type_item);
}
}
+KeyframeCreateItem::KeyframeCreateItem(KeyframeCreate *keyframe_create,
+ const char *text, int mask)
+ : BC_MenuItem(text)
+{
+ this->keyframe_create = keyframe_create;
+ this->mask = mask;
+}
+
+int KeyframeCreateItem::handle_event()
+{
+ MWindow *mwindow = keyframe_create->mwindow;
+ int mode = mwindow->edl->local_session->floatauto_type;
+ int mask = this->mask;
+ if( !mask ) { // visible
+ int *autos = mwindow->edl->session->auto_conf->autos;
+ int modes = (1<<AUTOMATION_FADE) + (1<<AUTOMATION_SPEED) +
+ (7<<AUTOMATION_CAMERA_X) + (7<<AUTOMATION_PROJECTOR_X);
+ for( int i=0; i<AUTOMATION_TOTAL; modes>>=1, ++i ) {
+ if( !(modes & 1) ) continue;
+ if( autos[i] ) mask |= (1<<i);
+ }
+ }
+ mwindow->create_keyframes(mask, mode);
+ return 1;
+}
+
+KeyframeCreateMenu::KeyframeCreateMenu(KeyframeCreate *keyframe_create)
+: BC_SubMenu()
+{
+ this->keyframe_create = keyframe_create;
+}
+
+KeyframeCreate::KeyframeCreate(MWindow *mwindow)
+ : BC_MenuItem(_("Create keyframes..."))
+{
+ this->mwindow = mwindow;
+ keyframe_create_menu = 0;
+}
+
+void KeyframeCreate::create_objects()
+{
+ add_submenu(keyframe_create_menu = new KeyframeCreateMenu(this));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Visible"), 0));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Fade"),
+ (1<<AUTOMATION_FADE)));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Speed"),
+ (1<<AUTOMATION_SPEED)));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Camera XYZ"),
+ (7<<AUTOMATION_CAMERA_X)));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Projector XYZ"),
+ (7<<AUTOMATION_PROJECTOR_X)));
+ keyframe_create_menu->add_item(new KeyframeCreateItem(this, _("Fade+Speed+XYZ"),
+ (1<<AUTOMATION_FADE) + (1<<AUTOMATION_SPEED) +
+ (7<<AUTOMATION_CAMERA_X) + (7<<AUTOMATION_PROJECTOR_X)));
+}
+
+
CutDefaultKeyframe::CutDefaultKeyframe(MWindow *mwindow)
: BC_MenuItem(_("Cut default keyframe"), _("Alt-x"), 'x')
{
int total_aeffects, total_veffects;
KeyframeCurveType *keyframe_curve_type;
+ KeyframeCreate *keyframe_create;
+ SetAutomationCurveMode *set_auto_curves;
LabelsFollowEdits *labels_follow_edits;
PluginsFollowEdits *plugins_follow_edits;
KeyframesFollowEdits *keyframes_follow_edits;
MWindow *mwindow;
};
-class StraightenKeyframes : public BC_MenuItem
+
+class SetAutomationCurveItem : public BC_MenuItem
{
public:
- StraightenKeyframes(MWindow *mwindow);
+ SetAutomationCurveItem(SetAutomationCurveMode *set_curve_mode, int id);
int handle_event();
- MWindow *mwindow;
+ SetAutomationCurveMode *set_curve_mode;
+ int id;
};
-class BendKeyframes : public BC_MenuItem
+class SetAutoCurveModeMenu : public BC_SubMenu
{
public:
- BendKeyframes(MWindow *mwindow);
- int handle_event();
+ SetAutoCurveModeMenu(SetAutomationCurveMode *curve_mode);
+ SetAutomationCurveMode *curve_mode;
+};
+
+class SetAutomationCurveMode : public BC_MenuItem
+{
+public:
+ SetAutomationCurveMode(MWindow *mwindow);
+ void create_objects();
+
MWindow *mwindow;
+ SetAutoCurveModeMenu *curve_mode_menu;
};
+
class KeyframeCurveType : public BC_MenuItem
{
public:
int handle_event();
};
+class KeyframeCreateItem : public BC_MenuItem
+{
+public:
+ KeyframeCreateItem(KeyframeCreate *keyframe_create, const char *text, int mask);
+ int handle_event();
+
+ KeyframeCreate *keyframe_create;
+ int mask;
+};
+
+class KeyframeCreateMenu : public BC_SubMenu
+{
+public:
+ KeyframeCreateMenu(KeyframeCreate *keyframe_create);
+ KeyframeCreate *keyframe_create;
+};
+
+class KeyframeCreate : public BC_MenuItem
+{
+public:
+ KeyframeCreate(MWindow *mwindow);
+ void create_objects();
+
+ MWindow *mwindow;
+ KeyframeCreateMenu *keyframe_create_menu;
+};
+
+
class CutDefaultKeyframe : public BC_MenuItem
{
public:
class CopyKeyframes;
class PasteKeyframes;
class ClearKeyframes;
-class StraightenKeyframes;
-class BendKeyframes;
+class SetAutomationCurveItem;
+class SetAutoCurveModeMenu;
+class SetAutomationCurveMode;
class KeyframeCurveType;
class KeyframeCurveTypeMenu;
class KeyframeCurveTypeItem;
+class KeyframeCreateItem;
+class KeyframeCreateMenu;
+class KeyframeCreate;
class CutDefaultKeyframe;
class CopyDefaultKeyframe;
class PasteDefaultKeyframe;
int MainUndo::undo()
{
+ mwindow->gui->close_keyvalue_popup();
mwindow->undo_commercial();
+
UndoStackItem *current = undo_stack->current;
if( current ) {
undo_stack->current = next_undo();
int MainUndo::redo()
{
+ mwindow->gui->close_keyvalue_popup();
UndoStackItem *current = next_redo();
if( current ) {
undo_stack->current = current;
// Here the master EDL loads
int MainUndo::load_from_undo(FileXML *file, uint32_t load_flags)
{
- delete mwindow->gui->keyvalue_popup;
- mwindow->gui->keyvalue_popup = 0;
-
if( load_flags & LOAD_SESSION ) {
mwindow->gui->unlock_window();
mwindow->close_mixers();
{
session->show_cwindow = 1;
cwindow->show_window();
+ cwindow->gui->tool_panel->raise_tool();
gui->mainmenu->show_cwindow->set_checked(1);
}
if( load_mode == LOADMODE_REPLACE ||
load_mode == LOADMODE_REPLACE_CONCATENATE ) {
edl->session->timecode_offset = 0;
- delete gui->keyvalue_popup;
- gui->keyvalue_popup = 0;
+ gui->close_keyvalue_popup();
gui->load_panes();
}
// in the clipboard.
int paste_default_keyframe();
int clear_default_keyframe();
+ void create_keyframes(int mask, int mode);
FloatAuto* get_float_auto(PatchGUI *patch,int idx);
IntAuto* get_int_auto(PatchGUI *patch,int idx);
edl->optimize();
save_backup();
- undo_after(_("clear"), LOAD_EDITS | LOAD_TIMEBAR);
+ undo_after(_("clear"),
+ LOAD_AUTOMATION + LOAD_EDITS + LOAD_TIMEBAR);
restart_brender();
update_plugin_guis();
edl->local_session->set_selectionend(dst_start + overwrite_len);
save_backup();
- undo_after(_("overwrite"), LOAD_EDITS);
+ undo_after(_("overwrite"),
+ LOAD_AUTOMATION + LOAD_EDITS + LOAD_TIMEBAR);
restart_brender();
update_plugin_guis();
save_backup();
- undo_after(_("paste"), LOAD_EDITS | LOAD_TIMEBAR);
+ undo_after(_("paste"),
+ LOAD_AUTOMATION + LOAD_EDITS + LOAD_TIMEBAR);
restart_brender();
update_plugin_guis();
gui->update(1, FORCE_REDRAW, 1, 1, 0, 1, 0);
save_backup();
- undo_after(_("paste assets"), LOAD_EDITS);
+ undo_after(_("paste assets"),
+ LOAD_AUTOMATION + LOAD_EDITS + LOAD_TIMEBAR);
restart_brender();
gui->update(1, FORCE_REDRAW, 1, 0, 0, 1, 0);
sync_parameters(CHANGE_EDL);
edl->session->autos_follow_edits);
edl->optimize();
save_backup();
- undo_after(_("silence"), LOAD_EDITS | LOAD_TIMEBAR);
+ undo_after(_("silence"),
+ LOAD_AUTOMATION + LOAD_EDITS + LOAD_TIMEBAR);
update_plugin_guis();
restart_brender();
edl->local_session->set_selectionend(start + source_end - source_start);
save_backup();
- undo_after(_("splice"), LOAD_EDITS | LOAD_TIMEBAR);
+ undo_after(_("splice"),
+ LOAD_AUTOMATION + LOAD_EDITS + LOAD_TIMEBAR);
update_plugin_guis();
restart_brender();
gui->update(1, NORMAL_DRAW, 1, 1, 0, 1, 0);
edl->session->autos_follow_edits);
save_backup();
- undo_after(_("trim selection"), LOAD_EDITS | LOAD_TIMEBAR);
+ undo_after(_("trim selection"),
+ LOAD_AUTOMATION + LOAD_EDITS + LOAD_TIMEBAR);
update_plugin_guis();
gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 0);
cwindow->update(1, 0, 0, 0, 1);
int MWindow::normalize_speed(EDL *old_edl, EDL *new_edl)
{
- int result = 0;
+ int result = 0, first_track = 1;
+ int plugins_follow_edits = edl->session->plugins_follow_edits;
+ int autos_follow_edits = edl->session->autos_follow_edits;
+ int labels_follow_edits = edl->session->labels_follow_edits;
Track *old_track = old_edl->tracks->first;
Track *new_track = new_edl->tracks->first;
for( ; old_track && new_track; old_track=old_track->next, new_track=new_track->next ) {
}
Edit *old_edit = old_track->edits->first;
Edit *new_edit = new_track->edits->first;
- for( ; old_edit && new_edit; old_edit=old_edit->next, new_edit=new_edit->next ) {
- int64_t edit_start = old_edit->startproject, edit_end = edit_start + old_edit->length;
+ while( old_edit && new_edit ) {
+ int64_t edit_start = old_edit->startproject;
+ int64_t edit_end = edit_start + old_edit->length;
if( old_speed || new_speed ) {
double orig_start = old_speeds->automation_integral(0, edit_start, PLAY_FORWARD);
double orig_end = old_speeds->automation_integral(0, edit_end, PLAY_FORWARD);
- edit_start = new_speeds->speed_position(orig_start);
- edit_end = new_speeds->speed_position(orig_end);
+ edit_start = new_track->frame_align(new_speeds->speed_position(orig_start), 1);
+ edit_end = new_track->frame_align(new_speeds->speed_position(orig_end), 1);
result = 1;
}
new_edit->startproject = edit_start;
new_edit->length = edit_end - edit_start;
+ old_edit = old_edit->next;
+ new_edit = new_edit->next;
+ }
+ if( first_track && old_track->is_armed() ) {
+ if( labels_follow_edits ) {
+ Labels *old_labels = old_edl->labels;
+ Labels *new_labels = new_edl->labels;
+ Label *old_label = old_labels ? old_labels->first : 0;
+ Label *new_label = new_labels ? new_labels->first : 0;
+ while( old_label && new_label ) {
+ int64_t label_pos = old_track->to_units(old_label->position, 1);
+ if( old_speed || new_speed ) {
+ double orig_pos = old_speeds->automation_integral(0, label_pos, PLAY_FORWARD);
+ label_pos = new_track->frame_align(new_speeds->speed_position(orig_pos), 1);
+ result = 1;
+ }
+ new_label->position = new_track->from_units(label_pos);
+ old_label = old_label->next;
+ new_label = new_label->next;
+ }
+ }
+ first_track = 0;
+ }
+ if( autos_follow_edits ) {
+ for( int i=0; i<AUTOMATION_TOTAL; ++i ) {
+ Autos *old_autos = old_track->automation->autos[i];
+ Autos *new_autos = new_track->automation->autos[i];
+ Auto *old_auto = old_autos ? old_autos->first : 0;
+ Auto *new_auto = new_autos ? new_autos->first : 0;
+ while( old_auto && new_auto ) {
+ int64_t auto_pos = old_auto->position;
+ if( old_speed || new_speed ) {
+ double orig_pos = old_speeds->automation_integral(0, auto_pos, PLAY_FORWARD);
+ auto_pos = new_track->frame_align(new_speeds->speed_position(orig_pos), 1);
+ result = 1;
+ }
+ new_auto->position = auto_pos;
+ old_auto = old_auto->next;
+ new_auto = new_auto->next;
+ }
+ }
+ }
+ if( !plugins_follow_edits ) continue;
+ int old_size = old_track->plugin_set.size();
+ int new_size = new_track->plugin_set.size();
+ int n = bmin(old_size, new_size);
+ for( int i=0; i<n; ++i ) {
+ PluginSet *old_plugin_set = old_track->plugin_set[i];
+ Plugin *old_plugin = (Plugin *)(old_plugin_set ? old_plugin_set->first : 0);
+ PluginSet *new_plugin_set = new_track->plugin_set[i];
+ Plugin *new_plugin = (Plugin *)(new_plugin_set ? new_plugin_set->first : 0);
+ while( old_plugin && new_plugin ) {
+ int64_t plugin_start = old_plugin->startproject;
+ int64_t plugin_end = plugin_start + old_plugin->length;
+ if( old_speed || new_speed ) {
+ double orig_start = old_speeds->automation_integral(0, plugin_start, PLAY_FORWARD);
+ double orig_end = old_speeds->automation_integral(0, plugin_end, PLAY_FORWARD);
+ plugin_start = new_track->frame_align(new_speeds->speed_position(orig_start), 1);
+ plugin_end = new_track->frame_align(new_speeds->speed_position(orig_end), 1);
+ result = 1;
+ }
+ new_plugin->startproject = plugin_start;
+ new_plugin->length = plugin_end - plugin_start;
+ if( autos_follow_edits ) {
+ KeyFrames *old_keyframes = old_plugin->keyframes;
+ Auto *old_auto = old_keyframes ? old_keyframes->first : 0;
+ KeyFrames *new_keyframes = new_plugin->keyframes;
+ Auto *new_auto = new_keyframes ? new_keyframes->first : 0;
+ while( old_auto && new_auto ) {
+ int64_t auto_pos = old_auto->position;
+ if( old_speed || new_speed ) {
+ double orig_pos = old_speeds->automation_integral(0, auto_pos, PLAY_FORWARD);
+ auto_pos = new_track->frame_align(new_speeds->speed_position(orig_pos), 1);
+ result = 1;
+ }
+ new_auto->position = auto_pos;
+ old_auto = old_auto->next;
+ new_auto = new_auto->next;
+ }
+ }
+ old_plugin = (Plugin *)old_plugin->next;
+ new_plugin = (Plugin *)new_plugin->next;
+ }
}
}
return result;
save_backup();
}
+void MWindow::create_keyframes(int mask, int mode)
+{
+ undo_before();
+ double start = edl->local_session->get_selectionstart();
+ edl->tracks->create_keyframes(start, mask, mode);
+ double end = edl->local_session->get_selectionend();
+ if( end != start )
+ edl->tracks->create_keyframes(end, mask, mode);
+ undo_after(_("create kyfrms"), LOAD_AUTOMATION);
+
+ restart_brender();
+ gui->update(1, NORMAL_DRAW, 0, 0, 1, 0, 0);
+ gui->activate_timeline();
+ cwindow->refresh_frame(CHANGE_EDL);
+ save_backup();
+}
+
}
}
+void MWindowGUI::close_keyvalue_popup()
+{
+ if( !keyvalue_popup ) return;
+ delete keyvalue_popup;
+ keyvalue_popup = 0;
+}
+
+void MWindowGUI::open_keyvalue_popup(BC_SubWindow *popup)
+{
+ close_keyvalue_popup();
+ keyvalue_popup = popup;
+}
+
PaneButton::PaneButton(MWindow *mwindow, int x, int y)
: BC_Button(x, y, mwindow->theme->get_image_set("pane"))
{
void set_meter_format(int mode, int min, int max);
void update_mixers(Track *track, int v);
void stop_transport(const char *lock_msg);
+ void close_keyvalue_popup();
+ void open_keyvalue_popup(BC_SubWindow *popup);
int translation_event();
int resize_event(int w, int h); // handle a resize event
return 0;
}
-void PatchBay::synchronize_faders(float change, int data_type, Track *skip)
+void PatchBay::synchronize_faders(float dv, int data_type, Track *skip, int edge, int span)
{
- for(Track *current = mwindow->edl->tracks->first;
- current;
- current = NEXT)
- {
- if(current->data_type == data_type &&
- current->armed_gang(skip) &&
- current->is_armed() &&
- current != skip)
- {
- FloatAutos *fade_autos = (FloatAutos*)current->automation->autos[AUTOMATION_FADE];
- double position = mwindow->edl->local_session->get_selectionstart(1);
-
-
- FloatAuto *keyframe = (FloatAuto*)fade_autos->get_auto_for_editing(position);
-
- float new_value = keyframe->get_value() + change;
- if(data_type == TRACK_AUDIO)
- CLAMP(new_value,
- mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_AUDIO_FADE],
- mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_AUDIO_FADE]);
- else
- CLAMP(new_value,
- mwindow->edl->local_session->automation_mins[AUTOGROUPTYPE_VIDEO_FADE],
- mwindow->edl->local_session->automation_maxs[AUTOGROUPTYPE_VIDEO_FADE]);
-
- keyframe->set_value(new_value);
-
- PatchGUI *patch = get_patch_of(current);
- if(patch) patch->update(patch->x, patch->y);
- }
+ for( Track *current=mwindow->edl->tracks->first; current; current=NEXT ) {
+ if( current == skip ) continue;
+ if( skip && !current->armed_gang(skip) ) continue;
+ if( current->data_type != data_type ) continue;
+ if( !current->is_armed() ) continue;
+ FloatAutos *fade_autos = (FloatAutos*)current->automation->autos[AUTOMATION_FADE];
+ double position = mwindow->edl->local_session->get_selectionstart(1);
+ FloatAuto *float_auto = (FloatAuto*)fade_autos->get_auto_for_editing(position);
+ int64_t pos = float_auto->position;
+ float_auto->bump_update(pos, dv, edge, span);
+ PatchGUI *patch = get_patch_of(current);
+ if( patch ) patch->update(patch->x, patch->y);
}
}
void update_meters(ArrayList<double> *module_levels);
void stop_meters();
void synchronize_nudge(int64_t value, Track *skip);
- void synchronize_faders(float value, int data_type, Track *skip);
+ void synchronize_faders(float value, int data_type, Track *skip, int edge, int span);
void set_meter_format(int mode, int min, int max);
void reset_meters();
change_source = 0;
track_id = track ? track->get_id() : -1;
mixer = 0;
+ edge = 0;
+ span = 1;
}
PatchGUI::~PatchGUI()
#include "guicast.h"
#include "mwindow.inc"
#include "patchbay.inc"
+#include "patchgui.inc"
#include "intauto.inc"
#include "track.inc"
-
-
-class TitlePatch;
-class PlayPatch;
-class RecordPatch;
-class AutoPatch;
-class GangPatch;
-class DrawPatch;
-class MutePatch;
-class ZoomPatch;
-class MasterPatch;
-class ExpandPatch;
-class NudgePatch;
-class MixPatch;
-
class PatchGUI
{
public:
BC_Toggle *toggle,
int *output);
virtual int update(int x, int y);
- virtual void synchronize_fade(float change) {};
- void synchronize_faders(float change, int audio, int video);
+ void synchronize_faders(float change, int audio, int video, int edge, int span);
char* calculate_nudge_text(int *changed);
int64_t calculate_nudge(const char *string);
NudgePatch *nudge;
MixPatch *mix;
char string_return[BCTEXTLEN];
+ int edge, span;
};
PatchGUI *patch;
};
-
#endif
#define PATCHGUI_INC
class PatchGUI;
+class PlayPatch;
+class RecordPatch;
+class TitlePatch;
+class AutoPatch;
+class GangPatch;
+class DrawPatch;
+class MutePatch;
+class ZoomPatch;
+class MasterPatch;
+class ExpandPatch;
+class NudgePatch;
+class MixPatch;
#endif
int Track::has_speed()
{
FloatAutos *autos = (FloatAutos*)automation->autos[AUTOMATION_SPEED];
- if(autos)
- {
- if(autos->first)
- {
- for(FloatAuto *current = (FloatAuto*)autos->first;
- current;
- current = (FloatAuto*)current->next)
- {
- if(!EQUIV(current->get_value(), 1.0) ||
- !EQUIV(current->get_control_in_value(), 0.0) ||
- !EQUIV(current->get_control_out_value(), 0.0))
- {
- return 1;
- }
- }
+ if( autos ) {
+ FloatAuto *current = (FloatAuto*)autos->first;
+ for( ; current; current=(FloatAuto*)current->next ) {
+ if( !EQUIV(current->get_value(0), 1.0) ||
+ !EQUIV(current->get_control_in_value(), 0.0) ||
+ !EQUIV(current->get_control_out_value(), 0.0))
+ return 1;
+ if( current->curve_mode == FloatAuto::BUMP &&
+ !EQUIV(current->get_value(1), 1.0) )
+ return 1;
}
}
-
return 0;
}
return 0;
}
-int Track::paste_automation(double selectionstart, double total_length,
- double frame_rate, int64_t sample_rate,
- FileXML *file, int default_only, int active_only)
+int Track::paste_automation(FileXML *file,
+ double selectionstart, double src_length, double src_rate,
+ int default_only, int active_only)
{
// Only used for pasting automation alone.
- double scale = data_type == TRACK_AUDIO ?
- edl->session->sample_rate / sample_rate :
- edl->session->frame_rate / frame_rate ;
-
- total_length *= scale;
- int64_t start = to_units(selectionstart, 0);
- int64_t length = to_units(total_length, 1);
+ double dst_rate = data_type == TRACK_AUDIO ?
+ edl->session->sample_rate : edl->session->frame_rate;
+ double scale = dst_rate / src_rate;
+ int64_t start = to_units(selectionstart, 1);
+ int64_t length = to_units(selectionstart + src_length, 1) - start;
int result = 0;
int current_pluginset = 0;
//printf("Track::paste_automation 1\n");
return k;
}
+void Track::create_keyframes(double position, int mask, int mode)
+{
+ for( int idx=0; idx<AUTOMATION_TOTAL; mask>>=1,++idx ) {
+ if( !(mask & 1) ) continue;
+ Autos *autos = automation->autos[idx];
+ if( !autos ) continue;
+ FloatAuto *float_auto = (FloatAuto *)
+ autos->get_auto_for_editing(position, -1);
+ float_auto->change_curve_mode((FloatAuto::t_mode)mode, 0);
+ }
+}
+
virtual int copy_automation_derived(AutoConf *auto_conf,
double selectionstart, double selectionend,
FileXML *file) { return 0; };
- int paste_automation(double selectionstart, double total_length,
- double frame_rate, int64_t sample_rate, FileXML *file,
+ int paste_automation(FileXML *file,
+ double selectionstart, double src_length, double src_rate,
int default_only, int active_only);
virtual int paste_automation_derived(double selectionstart, double selectionend,
double total_length, FileXML *file, int shift_autos, int ¤t_pan) { return 0; };
// If the edit under position is playable.
// Used by PlayableTracks::is_playable.
int playable_edit(int64_t position, int direction);
+ void create_keyframes(double position, int mask, int mode);
// ===================================== for handles, titles, etc
}
-void TrackCanvas::draw_floatauto(FloatAuto *current, int x, int y,
- int in_x, int in_y, int out_x, int out_y,
- int center_pixel, int data_h, int color)
+void TrackCanvas::draw_floatauto(FloatAuto *current,
+ int x_offset, int center_pixel, int data_h, int color,
+ double unit_start, double zoom_units, double yscale,
+ int autogrouptype)
{
+ double xx, yy;
+ calculate_auto_position(1, &xx, &yy, 0, 0, 0, 0,
+ current, unit_start, zoom_units, yscale, autogrouptype);
+ int x = (int)xx + x_offset;
int x1 = x - HANDLE_W / 2; // Center
int x2 = x + HANDLE_W / 2;
- int y1 = center_pixel + y - HANDLE_H / 2;
- int y2 = center_pixel + y + HANDLE_H / 2;
+ int y = (int)yy + center_pixel;
+ int y1 = y - HANDLE_H / 2;
+ int y2 = y + HANDLE_H / 2;
int ymin = center_pixel - data_h / 2;
int ymax = center_pixel + data_h / 2;
CLAMP(y1, ymin, ymax);
// show bezier control points (only) if this
// floatauto doesn't adjust it's tangents automatically
if(current->curve_mode != FloatAuto::FREE &&
- current->curve_mode != FloatAuto::TFREE)
+ current->curve_mode != FloatAuto::TFREE &&
+ current->curve_mode != FloatAuto::BUMP)
return;
-
- if(in_x != x)
- draw_floatauto_ctrlpoint(x, y, in_x, in_y, center_pixel, data_h, color);
- if(out_x != x)
- draw_floatauto_ctrlpoint(x, y, out_x, out_y, center_pixel, data_h, color);
+ double in_xx, in_yy, out_xx, out_yy;
+ calculate_auto_position(1, &xx, &yy, &in_xx, &in_yy, 0, 0,
+ current, unit_start, zoom_units, yscale, autogrouptype);
+ int ix = xx, iy = yy, in_x = in_xx, in_y = in_yy;
+ if( in_x != ix )
+ draw_floatauto_ctrlpoint(ix, iy, in_x, in_y, center_pixel, data_h, color);
+ calculate_auto_position(0, &xx, &yy, 0, 0, &out_xx, &out_yy,
+ current, unit_start, zoom_units, yscale, autogrouptype);
+ int ox = xx, oy = yy, out_x = out_xx, out_y = out_yy;
+ if( out_x != ox )
+ draw_floatauto_ctrlpoint(ox, oy, out_x, out_y, center_pixel, data_h, color);
+ if( current->curve_mode == FloatAuto::BUMP && iy != oy )
+ draw_bline(ix, iy+center_pixel, ox, oy+center_pixel);
}
inline int quantize(float f) { return (int)floor(f + 0.5); }
-int TrackCanvas::test_floatauto(FloatAuto *current, int x, int y, int in_x,
- int in_y, int out_x, int out_y, int center_pixel, int data_h,
- int cursor_x, int cursor_y, int buttonpress, int autogrouptype)
+int TrackCanvas::test_floatauto(FloatAuto *current, int buttonpress,
+ int center_pixel, int data_h, int cursor_x, int cursor_y,
+ double unit_start, double zoom_units, double yscale,
+ int autogrouptype)
{
int result = 0;
-
- int x1 = x - HANDLE_W / 2;
- int x2 = x + HANDLE_W / 2;
- int y1 = center_pixel + y - HANDLE_W / 2;
- int y2 = center_pixel + y + HANDLE_W / 2;
+ double xx, yy, in_xx, in_yy, out_xx, out_yy;
+ calculate_auto_position(1, &xx, &yy, &in_xx, &in_yy, 0, 0,
+ current, unit_start, zoom_units, yscale, autogrouptype);
+ int ix = xx, iy = yy, in_x = in_xx, in_y = in_yy;
+
+ int x1 = ix - HANDLE_W / 2;
+ int x2 = ix + HANDLE_W / 2;
+ int y1 = center_pixel + iy - HANDLE_W / 2;
+ int y2 = center_pixel + iy + HANDLE_W / 2;
int ymin = center_pixel - data_h/2;
int ymax = center_pixel + data_h/2;
CLAMP(y1, ymin, ymax);
CLAMP(in_y1, ymin, ymax);
CLAMP(in_y2, ymin, ymax);
+ calculate_auto_position(0, &xx, &yy, 0, 0, &out_xx, &out_yy,
+ current, unit_start, zoom_units, yscale, autogrouptype);
+ int ox = xx, oy = yy, out_x = out_xx, out_y = out_yy;
int out_x1 = out_x - HANDLE_W / 2;
int out_x2 = out_x + HANDLE_W / 2;
int out_y1 = center_pixel + out_y - HANDLE_W / 2;
float lever = 0.0; // we use the tangent as a draggable lever. 1.0 is at the ctrl point
// Test in control
- if( in_x != x && current->position > 0 &&
+ if( in_x != ix && current->position > 0 &&
(FloatAuto::FREE == current->curve_mode ||
- FloatAuto::TFREE == current->curve_mode))
+ FloatAuto::TFREE == current->curve_mode ||
+ FloatAuto::BUMP == current->curve_mode))
// act on in control handle only if
// tangent is significant and is editable (not automatically choosen)
{
- lever = test_curve_line(x, y, in_x, in_y, cursor_x, cursor_y-center_pixel);
+ lever = test_curve_line(ix, iy, in_x, in_y, cursor_x, cursor_y-center_pixel);
// either cursor in ctrl-point handle or cursor on tangent line
if( WITHIN(in_x1,in_x2,in_y1,in_y2) || lever > 0.0 ) {
result = 1;
}
// Test out control
- if(out_x != x &&
+ if(out_x != ox &&
(FloatAuto::FREE == current->curve_mode ||
- FloatAuto::TFREE == current->curve_mode))
+ FloatAuto::TFREE == current->curve_mode ||
+ FloatAuto::BUMP == current->curve_mode))
// act on out control only if tangent is significant and is editable
{
- lever = test_curve_line(x, y, out_x, out_y, cursor_x, cursor_y-center_pixel);
+ lever = test_curve_line(ox, oy, out_x, out_y, cursor_x, cursor_y-center_pixel);
if(WITHIN(out_x1,out_x2,out_y1,out_y2) || lever > 0.0 ) {
result = 1;
if(buttonpress && (buttonpress != 3)) {
if(buttonpress && (buttonpress != 3) && result)
{
mwindow->undo->update_undo_before();
+ double position = current->autos->track->from_units(current->position);
+ mwindow->edl->local_session->set_selectionstart(position);
+ mwindow->edl->local_session->set_selectionend(position);
}
return result;
static int is_linear(FloatAuto *prev, FloatAuto *next)
{
- if( !prev || !next ) return 1;
+ if( !prev || !next ) return 0;
if( prev->curve_mode == FloatAuto::LINEAR ) return 1;
int64_t ipos = prev->get_control_in_position();
int64_t opos = prev->get_control_out_position();
if( !ipos && !opos ) return 1;
if( !ipos || !opos ) return 0;
- float ival = prev->get_control_in_value();
+ float ival = next->get_control_in_value();
float oval = prev->get_control_out_value();
- float cval = prev->get_value(), nval = next->get_value();
+ float cval = prev->get_value(0), nval = next->get_value(1);
if( !ival && !oval && EQUIV(cval, nval) ) return 1;
float ig = ival / ipos, og = oval / opos;
int64_t cpos = prev->position, npos = next->position;
float g = (nval - cval) / (npos - cpos);
- if( EQUIV(ig, g) && EQUIV(og, g) ) return 1;
+ if( !EQUIV(g, 0) && EQUIV(ig, g) && EQUIV(og, g) ) return 1;
return 0;
}
// Get the float value & y for position x on the canvas
#define X_TO_FLOATLINE(x) \
- int64_t position1 = (int64_t)(unit_start + x * zoom_units); \
- int64_t position2 = (int64_t)(unit_start + x * zoom_units) + 1; \
+ double position = unit_start + x * zoom_units; \
+ int64_t position1 = (int64_t)position, position2 = position1 + 1; \
/* Call by reference fails for some reason here */ \
float value1 = autos->get_value(position1, PLAY_FORWARD, previous1, next1); \
float value2 = autos->get_value(position2, PLAY_FORWARD, previous1, next1); \
- double position = unit_start + x * zoom_units; \
- double value = 0; \
- if(position2 > position1) \
- { \
- value = value1 + \
- (value2 - value1) * \
- (position - position1) / \
- (position2 - position1); \
- } \
- else \
- { \
- value = value1; \
- } \
+ double value = value1 + (value2 - value1) * (position - position1); \
AUTOMATIONCLAMPS(value, autogrouptype); \
int y = center_pixel + \
(int)(((value - automation_min) / automation_range - 0.5) * -yscale);
if( (y1 < ytop && y1 >= ybot) && (y2 < ytop || y2 >= ybot) ) return;
// check for line draw
if( is_linear(previous, next) ) {
+ if( previous && previous->curve_mode == FloatAuto::BUMP ) {
+ double ax, ay;
+ calculate_auto_position(0, &ax, &ay, 0, 0, 0, 0, previous,
+ unit_start, zoom_units, yscale, autogrouptype);
+ x1 = ax; y1 = ay; y1 += center_pixel;
+ }
draw_line(x1, y1, x2, y2);
return;
}
return result;
}
-
-void TrackCanvas::fill_ganged_autos(int all, float change, Track *skip, FloatAuto *fauto)
+// gang=-1 for keyframepopup update, all tracks where fautos exist
+// gang=0 for trackcanvas drag update, all gang matching tracks, create new fautos if needed
+// gang=1 for trackcanvas drag update, all gang tracks, create new fautos if needed
+void TrackCanvas::fill_ganged_autos(int gang, float change, Track *skip, FloatAuto *fauto)
{
if( !skip->is_ganged() ) return;
// Handles the special case of modifying a fadeauto
// when there are ganged faders on several tracks
double position = skip->from_units(fauto->position);
int autoidx = fauto->autos->autoidx;
-
+ PatchGUI *patch = gang < 0 ? pane->patchbay->get_patch_of(skip) : 0;
+ int edge = patch ? patch->edge : 0;
+ int span = patch ? patch->span : 0;
for(Track *current = mwindow->edl->tracks->first; current; current = NEXT) {
- if( (all || current->data_type == skip->data_type) &&
+ if( (gang || current->data_type == skip->data_type) &&
current->armed_gang(skip) && current->is_armed() &&
current != skip ) {
FloatAutos *fade_autos = (FloatAutos*)current->automation->autos[autoidx];
- float auto_min = mwindow->edl->local_session->automation_mins[fade_autos->autogrouptype];
- float auto_max = mwindow->edl->local_session->automation_maxs[fade_autos->autogrouptype];
- int64_t current_position = current->to_units(position, 1);
FloatAuto *keyframe = (FloatAuto*)fade_autos->get_auto_at_position(position);
+ int64_t current_position = current->to_units(position, 1);
if( keyframe ) {
// keyframe exists, just change it
- float value = keyframe->get_value();
- float new_value = value + change;
- CLAMP(new_value, auto_min, auto_max);
- keyframe->adjust_to_new_coordinates(current_position, new_value);
+ keyframe->bump_update(current_position, change, edge, span);
}
- else if( all >= 0 ) {
+ else if( gang >= 0 && ( get_double_click() ||
+ mwindow->edl->session->auto_keyframes ) ) {
// create keyframe on neighbouring track at the point in time given by fauto
FloatAuto *previous = 0, *next = 0;
float value = fade_autos->get_value(current_position, PLAY_FORWARD, previous, next);
float new_value = value + change;
- CLAMP(new_value, auto_min, auto_max);
+ float auto_min = mwindow->edl->local_session->automation_mins[fade_autos->autogrouptype];
+ float auto_max = mwindow->edl->local_session->automation_maxs[fade_autos->autogrouptype];
+ bclamp(new_value, auto_min, auto_max);
keyframe = (FloatAuto*)fade_autos->insert_auto(current_position);
- keyframe->set_value(new_value);
+ keyframe->set_value(new_value, edge);
}
- if( !keyframe ) continue;
+ else
+ continue;
mwindow->session->drag_auto_gang->append((Auto *)keyframe);
}
}
for (int i = 0; i < mwindow->session->drag_auto_gang->total; i++) {
FloatAuto *keyframe = (FloatAuto *)mwindow->session->drag_auto_gang->values[i];
int64_t keyframe_position = keyframe->autos->track->to_units(position, 1);
- float new_value = keyframe->get_value() + change;
- CLAMP(new_value,
- mwindow->edl->local_session->automation_mins[keyframe->autos->autogrouptype],
- mwindow->edl->local_session->automation_maxs[keyframe->autos->autogrouptype]);
- keyframe->adjust_to_new_coordinates(keyframe_position, new_value);
+ keyframe->bump_update(keyframe_position, change, 0, 0);
+ keyframe->set_control_in_value(fauto->get_control_in_value());
+ keyframe->set_control_out_value(fauto->get_control_out_value());
}
}
}
-void TrackCanvas::calculate_auto_position(double *x, double *y,
+void TrackCanvas::calculate_auto_position(int edge, double *x, double *y,
double *in_x, double *in_y, double *out_x, double *out_y,
Auto *current, double unit_start, double zoom_units, double yscale,
int autogrouptype)
automation_range = SPEED_MIN;
FloatAuto *ptr = (FloatAuto*)current;
*x = (double)(ptr->position - unit_start) / zoom_units;
- *y = ((ptr->get_value() - automation_min) / automation_range - 0.5) * -yscale;
+ *y = ((ptr->get_value(edge) - automation_min) / automation_range - 0.5) * -yscale;
if(in_x) {
// *in_x = EQUIV(ptr->control_in_value, 0.0) ? *x : *x - mwindow->theme->control_pixels;
}
if(in_y) {
- *in_y = (((ptr->get_value() + ptr->get_control_in_value()) -
+ *in_y = (((ptr->get_value(edge) + ptr->get_control_in_value()) -
automation_min) / automation_range - 0.5) * -yscale;
}
}
if(out_y) {
- *out_y = (((ptr->get_value() + ptr->get_control_out_value()) -
+ *out_y = (((ptr->get_value(edge) + ptr->get_control_out_value()) -
automation_min) / automation_range - 0.5) * -yscale;
}
}
double view_start, unit_start;
double view_end, unit_end, yscale;
double zoom_sample, zoom_units;
- double in_x2, in_y2, out_x2, out_y2;
double slope;
//int skip = 0;
double ax = 0, ay = 0, ax2 = 0, ay2 = 0;
if( first_auto ) {
- calculate_auto_position(&ax, &ay, 0, 0, 0, 0,
+ calculate_auto_position(0, &ax, &ay, 0, 0, 0, 0,
first_auto, unit_start, zoom_units, yscale, autogrouptype);
}
if( current )
draw_auto = 1;
if(current) {
- calculate_auto_position(&ax2, &ay2, &in_x2, &in_y2, &out_x2, &out_y2,
+ calculate_auto_position(1, &ax2, &ay2, 0, 0, 0, 0,
current, unit_start, zoom_units, yscale, autogrouptype);
}
else {
// Draw or test handle
if( current && !result && current != autos->default_auto ) {
if( !draw && track->is_armed() ) {
- result = test_floatauto((FloatAuto*)current, (int)ax2, (int)ay2,
- (int)in_x2, (int)in_y2, (int)out_x2, (int)out_y2,
+ result = test_floatauto((FloatAuto*)current, buttonpress,
(int)center_pixel, (int)yscale, cursor_x, cursor_y,
- buttonpress, autogrouptype);
+ unit_start, zoom_units, yscale, autogrouptype);
if( result )
auto_instance = current;
}
if( draw && draw_auto ) {
- draw_floatauto((FloatAuto*)current, (int)ax2 + x_offset, (int)ay2,
- (int)in_x2 + x_offset, (int)in_y2,
- (int)out_x2 + x_offset, (int)out_y2,
- (int)center_pixel + y_offset, (int)yscale, color);
+ draw_floatauto((FloatAuto*)current, x_offset,
+ (int)center_pixel + y_offset, (int)yscale, color,
+ unit_start, zoom_units, yscale, autogrouptype);
}
}
if( current ) {
previous = current;
+ calculate_auto_position(0, &ax2, &ay2, 0, 0, 0, 0, previous,
+ unit_start, zoom_units, yscale, autogrouptype);
current = NEXT;
}
-
ax = ax2; ay = ay2;
} while( current && current->position <= unit_end && !result );
return 0;
double ax = 0, ay = 0;
- calculate_auto_position(&ax, &ay, 0, 0, 0, 0,
+ calculate_auto_position(0, &ax, &ay, 0, 0, 0, 0,
auto_keyframe, unit_start, zoom_units, yscale, autogrouptype);
set_color(color);
// not really editing the node, rather start editing the curve
// tangent is editable and drag movement is significant
if( (FloatAuto::FREE == current->curve_mode ||
- FloatAuto::TFREE==current->curve_mode) &&
+ FloatAuto::TFREE==current->curve_mode ||
+ FloatAuto::BUMP==current->curve_mode) &&
(fabs(x) > HANDLE_W / 2 || fabs(y) > HANDLE_W / 2))
mwindow->session->drag_handle = x < 0 ? 1 : 2;
}
// Snap to nearby values
old_value = current->get_value();
if(shift_down()) {
- double value1, value2, distance1=-1, distance2=-1;
-
+ double distance1=-1, distance2=-1;
if(current->previous) {
int autogrouptype = current->previous->autos->autogrouptype;
value = percentage_to_value(percentage, 0, 0, autogrouptype);
- value1 = ((FloatAuto*)current->previous)->get_value();
+ double value1 = ((FloatAuto*)current->previous)->get_value(0);
distance1 = fabs(value - value1);
- current->set_value(value1);
+ current->set_value(value1, 1);
}
if(current->next) {
int autogrouptype = current->next->autos->autogrouptype;
value = percentage_to_value(percentage, 0, 0, autogrouptype);
- value2 = ((FloatAuto*)current->next)->get_value();
+ double value2 = ((FloatAuto*)current->next)->get_value(1);
distance2 = fabs(value - value2);
if(!current->previous || distance2 < distance1) {
- current->set_value(value2);
+ current->set_value(value2, 0);
}
}
if(!current->previous && !current->next) {
- current->set_value( ((FloatAutos*)current->autos)->default_);
+ current->set_value(((FloatAutos*)current->autos)->default_, 0);
}
value = current->get_value();
}
void draw_inout_points();
void draw_auto(Auto *current, int x, int y,
int center_pixel, int data_h);
- void draw_floatauto(FloatAuto *current, int x, int y,
- int in_x, int in_y, int out_x, int out_y,
- int center_pixel, int data_h, int color);
+ void draw_floatauto(FloatAuto *current,
+ int x_offset, int center_pixel, int data_h, int color,
+ double unit_start, double zoom_units, double yscale,
+ int autogrouptype);
int test_auto(Auto *current, int x, int y,
int center_pixel, int data_h,
int cursor_x, int cursor_y, int buttonpress);
- int test_floatauto(FloatAuto *current, int x, int y,
- int in_x, int in_y, int out_x, int out_y,
- int center_pixel, int data_h,
- int cursor_x, int cursor_y, int buttonpress,
+ int test_floatauto(FloatAuto *current, int buttonpress,
+ int center_pixel, int data_h, int cursor_x, int cursor_y,
+ double unit_start, double zoom_units, double yscale,
int autogrouptype);
void draw_floatline(int center_pixel,
FloatAuto *previous,
// if reference is nonzero and a FloatAuto,
// the result is made relative to the value in reference.
float percentage_to_value(float percentage,
- int is_toggle,
- Auto *reference,
- int autogrouptype);
-
+ int is_toggle, Auto *reference, int autogrouptype);
// Get x and y of a FloatAuto relative to center_pixel
- void calculate_auto_position(double *x,
- double *y,
- double *in_x,
- double *in_y,
- double *out_x,
- double *out_y,
- Auto *current,
- double unit_start,
- double zoom_units,
- double yscale,
- int autogrouptype);
-
- void fill_ganged_autos(int all, float change, Track *skip, FloatAuto *fauto);
+ void calculate_auto_position(int edge, double *x, double *y,
+ double *in_x, double *in_y, double *out_x, double *out_y,
+ Auto *current, double unit_start, double zoom_units,
+ double yscale, int autogrouptype);
+ void fill_ganged_autos(int gang, float change, Track *skip, FloatAuto *fauto);
void update_ganged_autos(float change, Track *skip, FloatAuto *fauto);
void clear_ganged_autos();
}
}
+void Tracks::create_keyframes(double position, int mask, int mode)
+{
+ for( Track *track=first; track; track=track->next ) {
+ if( !track->is_armed() ) continue;
+ track->create_keyframes(position, mask, mode);
+ }
+}
+
void set_transition_length(Transition *transition, double length);
void paste_transitions(double start, double end, int track_type, char* title);
void update_idxbl_length(int id, double dt);
+ void create_keyframes(double position, int mask, int mode);
// ================================== accounting
Track* number(int number); // pointer to track number
Track *get(int idx, int data_type);
-
private:
};
Track* current_atrack = 0;
Track* current_vtrack = 0;
Track* dst_track = 0;
- int src_type;
int result = 0;
double length;
double frame_rate = edl->session->frame_rate;
string[0] = 0;
// Search for start
- do{
- result = file->read_tag();
- }while(!result &&
- !file->tag.title_is("AUTO_CLIPBOARD"));
+ do {
+ result = file->read_tag();
+ } while(!result && !file->tag.title_is("AUTO_CLIPBOARD"));
if(!result)
{
frame_rate = file->tag.get_property("FRAMERATE", frame_rate);
sample_rate = file->tag.get_property("SAMPLERATE", sample_rate);
-
do
{
result = file->read_tag();
if(file->tag.title_is("TRACK"))
{
file->tag.get_property("TYPE", string);
- if(!strcmp(string, "AUDIO"))
- {
- src_type = TRACK_AUDIO;
- }
- else
- {
- src_type = TRACK_VIDEO;
- }
-
+ double src_rate = !strcmp(string, "AUDIO") ?
+ sample_rate : frame_rate;
+ double src_length = length / src_rate;
// paste to any media type
if(typeless)
{
if(dst_track)
{
- double frame_rate2 = frame_rate;
- double sample_rate2 = sample_rate;
-
- if(src_type != dst_track->data_type)
- {
- frame_rate2 = sample_rate;
- sample_rate2 = frame_rate;
- }
-
- dst_track->paste_automation(selectionstart,
- length,
- frame_rate2,
- sample_rate2,
- file,
- default_only,
- active_only);
+ dst_track->paste_automation(file,
+ selectionstart, src_length, src_rate,
+ default_only, active_only);
}
}
}
FloatAutos *speed_autos = (FloatAutos*)track->automation->autos[AUTOMATION_SPEED];
speed_position += speed_autos->automation_integral(edit_startproject,
direction_position-edit_startproject, PLAY_FORWARD);
-//printf("VModule::import_frame %d %lld %lld\n", __LINE__, position, (int64_t)speed_position);
+//printf("VModule::import_frame %d %jd %jd\n", __LINE__, position, (int64_t)speed_position);
position = (int64_t)speed_position;
}
double position = mwindow->edl->local_session->get_selectionstart(1);
Autos *fade_autos = vtrack->automation->autos[AUTOMATION_FADE];
int need_undo = !fade_autos->auto_exists_for_editing(position);
-
mwindow->undo->update_undo_before(_("fade"), need_undo ? 0 : this);
FloatAuto *current = (FloatAuto*)fade_autos->get_auto_for_editing(position);
- float change = v - current->get_value();
- current->set_value(v);
-
+ float change = v - current->get_value(edge);
+ current->bump_value(v, edge, span);
if( track->is_ganged() && track->is_armed() )
- patchbay->synchronize_faders(change, TRACK_AUDIO, track);
+ patchbay->synchronize_faders(change, TRACK_VIDEO, track, edge, span);
mwindow->undo->update_undo_after(_("fade"), LOAD_AUTOMATION);
change_source = 0;
return 1;
}
-VKeyFadePatch::VKeyFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y)
- : BC_SubWindow(x,y, xS(200),yS(20), GWindowGUI::auto_colors[AUTOMATION_FADE])
+VKeyFadePatch::VKeyFadePatch(MWindow *mwindow, VPatchGUI *gui,
+ int bump, int x, int y)
+ : BC_SubWindow(x,y, xS(200),yS(bump ? 50 : 24),
+ GWindowGUI::auto_colors[AUTOMATION_FADE])
{
this->mwindow = mwindow;
- this->patch = patch;
+ this->gui = gui;
+}
+VKeyFadePatch::~VKeyFadePatch()
+{
}
void VKeyFadePatch::create_objects()
{
- int x = 0, y = 0;
- int64_t v = mwindow->get_float_auto(patch, AUTOMATION_FADE)->get_value();
+ int x = 0, x1 = x, y = 0, dy = 0;
+ FloatAuto *fade_auto = mwindow->get_float_auto(gui, AUTOMATION_FADE);
+ int64_t v = fade_auto->get_value(gui->edge);
add_subwindow(vkey_fade_text = new VKeyFadeText(this, x, y, xS(64), v));
x += vkey_fade_text->get_w();
+ dy = bmax(dy, vkey_fade_text->get_h());
VFrame **lok_images = mwindow->theme->get_image_set("lok");
int w1 = get_w() - x - lok_images[0]->get_w();
add_subwindow(vkey_fade_slider = new VKeyFadeSlider(this, x, y, w1, v));
x += vkey_fade_slider->get_w();
+ dy = bmax(dy, vkey_fade_slider->get_h());
add_subwindow(vkey_fade_ok = new VKeyFadeOK(this, x, y, lok_images));
+ dy = bmax(dy, vkey_fade_ok->get_h());
+ if( fade_auto->is_bump() ) {
+ y += dy;
+ set_color(get_resources()->get_bg_color());
+ draw_box(0,y, get_w(),get_h());
+ add_subwindow(auto_edge = new VKeyPatchAutoEdge(mwindow, this, x1, y));
+ x1 += auto_edge->get_w() + xS(15);
+ add_subwindow(auto_span = new VKeyPatchAutoSpan(mwindow, this, x1, y));
+ }
+ draw_3d_border(0,0, get_w(), get_h(), 0);
activate();
show_window();
}
+void VKeyFadePatch::set_edge(int edge)
+{
+ gui->edge = edge;
+ FloatAuto *fade_auto = mwindow->get_float_auto(gui, AUTOMATION_FADE);
+ int64_t v = fade_auto->get_value(edge);
+ update(v);
+}
+
+void VKeyFadePatch::set_span(int span)
+{
+ gui->span = span;
+}
+
void VKeyFadePatch::update(int64_t v)
{
vkey_fade_text->update(v);
vkey_fade_slider->update(v);
- patch->update_faders(v);
+ gui->update_faders(v);
}
VKeyFadeOK::VKeyFadeOK(VKeyFadePatch *vkey_fade_patch, int x, int y, VFrame **images)
int VKeyFadeOK::handle_event()
{
- MWindowGUI *mgui = vkey_fade_patch->mwindow->gui;
- delete mgui->keyvalue_popup;
- mgui->keyvalue_popup = 0;
+ MWindow *mwindow = vkey_fade_patch->mwindow;
+ mwindow->gui->close_keyvalue_popup();
return 1;
}
VKeyFadeSlider::VKeyFadeSlider(VKeyFadePatch *vkey_fade_patch,
int x, int y, int w, int64_t v)
- : VFadePatch(vkey_fade_patch->patch, x,y, w, v)
+ : VFadePatch(vkey_fade_patch->gui, x,y, w, v)
{
this->vkey_fade_patch = vkey_fade_patch;
}
double position = mwindow->edl->local_session->get_selectionstart(1);
Autos *mode_autos = patch->vtrack->automation->autos[AUTOMATION_MODE];
int need_undo = !mode_autos->auto_exists_for_editing(position);
-
mwindow->undo->update_undo_before(_("mode"), need_undo ? 0 : this);
-
current = (IntAuto*)mode_autos->get_auto_for_editing(position);
current->value = mode;
-
mwindow->undo->update_undo_after(_("mode"), LOAD_AUTOMATION);
-
mwindow->sync_parameters(CHANGE_PARAMS);
if( mwindow->edl->session->auto_conf->autos[AUTOMATION_MODE] ) {
{
}
+VKeyPatchAutoEdge::VKeyPatchAutoEdge(MWindow *mwindow,
+ VKeyFadePatch *patch, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("bump_edge"),
+ patch->gui->span,_("Edge"))
+{
+ this->mwindow = mwindow;
+ this->patch = patch;
+ set_tooltip(_("Bump uses left edge"));
+}
+
+int VKeyPatchAutoEdge::handle_event()
+{
+ patch->set_edge(get_value());
+ return 1;
+}
+
+VKeyPatchAutoSpan::VKeyPatchAutoSpan(MWindow *mwindow,
+ VKeyFadePatch *patch, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("bump_span"),
+ patch->gui->span,_("Span"))
+{
+ this->mwindow = mwindow;
+ this->patch = patch;
+ set_tooltip(_("Bump spans to next"));
+}
+
+int VKeyPatchAutoSpan::handle_event()
+{
+ patch->set_span(get_value());
+ return 1;
+}
+
class VKeyFadePatch : public BC_SubWindow
{
public:
- VKeyFadePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y);
+ VKeyFadePatch(MWindow *mwindow, VPatchGUI *gui,
+ int bump, int x, int y);
+ ~VKeyFadePatch();
void create_objects();
+ void set_edge(int edge);
+ void set_span(int span);
void update(int64_t v);
MWindow *mwindow;
- VPatchGUI *patch;
+ VPatchGUI *gui;
VKeyFadeOK *vkey_fade_ok;
VKeyFadeText *vkey_fade_text;
VKeyFadeSlider *vkey_fade_slider;
+ VKeyPatchAutoEdge *auto_edge;
+ VKeyPatchAutoSpan *auto_span;
};
class VKeyFadeOK : public BC_Button
~VMixPatch();
};
+class VKeyPatchAutoEdge : public BC_Toggle
+{
+public:
+ VKeyPatchAutoEdge(MWindow *mwindow, VKeyFadePatch *patch, int x, int y);
+ int handle_event();
+ MWindow *mwindow;
+ VKeyFadePatch *patch;
+};
+
+class VKeyPatchAutoSpan : public BC_Toggle
+{
+public:
+ VKeyPatchAutoSpan(MWindow *mwindow, VKeyFadePatch *patch, int x, int y);
+ int handle_event();
+ MWindow *mwindow;
+ VKeyFadePatch *patch;
+};
+
#endif
class VModeSubMenuItem;
class VKeyModePatch;
class VMixPatch;
+class VKeyPatchAutoEdge;
+class VKeyPatchAutoSpan;
#define MAX_VIDEO_FADE 100
new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
VFrame *transport_up = new_image("transportup.png");
VFrame *transport_hi = new_image("transporthi.png");
// 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");
+ new_toggle("tan_tangent.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_tangent");
+ new_toggle("tan_free.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_free");
+ new_toggle("tan_bump.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
//new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
//wrench_data = new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn);
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
+
// CWindow icons
new_image("cwindow_inactive", "cwindow_inactive.png");
new_image("cwindow_active", "cwindow_active.png");
// 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");
+ new_toggle("tan_tangent.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_tangent");
+ new_toggle("tan_free.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_free");
+ new_toggle("tan_bump.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
VFrame *transport_up = new_image("transportup.png");
VFrame *transport_hi = new_image("transporthi.png");
// 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");
+ new_toggle("tan_tangent.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_tangent");
+ new_toggle("tan_free.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_free");
+ new_toggle("tan_bump.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
new_button("wrench.png", "editpanelW_up.png", "editpanelW_hi.png", "editpanelW_dn.png", "wrench");
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
+
//Make transparent borders
#define TRANSPORT_LEFT_IMAGES "transport_left_up.png", "transport_left_hi.png", "transport_left_dn.png"
#define TRANSPORT_CENTER_IMAGES "transport_center_up.png", "transport_center_hi.png", "transport_center_dn.png"
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");
-
-// Maybe we can live without the commented part
-// MIHA: Commented out in favor of default version M4>>
-// new_toggle("camera.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi,"camera");
-// new_toggle("crop.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi,"crop");
-// new_toggle("eyedrop.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi,"eyedrop");
-// new_toggle("magnify.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi,"magnify");
-// new_toggle("mask.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi,"mask");
-// new_toggle("projector.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi,"projector");
-// new_toggle("protect.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi,"protect");
-// new_toggle("titlesafe.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi,"titlesafe");
-// new_toggle("toolwindow.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi,"tool");
-// MIHA: Commented out in favor of default version M4<<
-
// 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");
+ new_toggle("tan_tangent.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_tangent");
+ new_toggle("tan_free.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_free");
+ new_toggle("tan_bump.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
VFrame *transport_up = new_image("transportup.png");
VFrame *transport_hi = new_image("transporthi.png");
// 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");
+ new_toggle("tan_tangent.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_tangent");
+ new_toggle("tan_free.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_free");
+ new_toggle("tan_bump.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
new_button("wrench.png",
editpanel_up, editpanel_hi, editpanel_dn,
"wrench");
+
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
+
VFrame *transport_up = new_image("transportup.png");
VFrame *transport_hi = new_image("transporthi.png");
VFrame *transport_dn = new_image("transportdn.png");
editpanel_up, editpanel_hi, editpanel_checked,
editpanel_dn, editpanel_checkedhi,
"tan_linear");
+ new_toggle("tan_tangent.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "tan_tangent");
+ new_toggle("tan_free.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "tan_free");
+ new_toggle("tan_bump.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
"mask_scale_x");
new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
VFrame *transport_up = new_image("transportup.png");
VFrame *transport_hi = new_image("transporthi.png");
// 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");
+ new_toggle("tan_tangent.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_tangent");
+ new_toggle("tan_free.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_free");
+ new_toggle("tan_bump.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
editpanel_up, editpanel_hi, editpanel_dn,
"wrench");
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
+
VFrame *transport_up = new_image("transportup.png");
VFrame *transport_hi = new_image("transporthi.png");
VFrame *transport_dn = new_image("transportdn.png");
editpanel_up, editpanel_hi, editpanel_checked,
editpanel_dn, editpanel_checkedhi,
"tan_linear");
+ new_toggle("tan_tangent.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "tan_tangent");
+ new_toggle("tan_free.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "tan_free");
+ new_toggle("tan_bump.png",
+ editpanel_up, editpanel_hi, editpanel_checked,
+ editpanel_dn, editpanel_checkedhi,
+ "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
VFrame *transport_up = new_image("transportup.png");
VFrame *transport_hi = new_image("transporthi.png");
// 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");
+ new_toggle("tan_tangent.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_tangent");
+ new_toggle("tan_free.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_free");
+ new_toggle("tan_bump.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
VFrame *transport_up = new_image("transportup.png");
VFrame *transport_hi = new_image("transporthi.png");
// 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");
+ new_toggle("tan_tangent.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_tangent");
+ new_toggle("tan_free.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_free");
+ new_toggle("tan_bump.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
new_button("undo.png", editpanel_up, editpanel_hi, editpanel_dn, "undo");
new_button("wrench.png", editpanel_up, editpanel_hi, editpanel_dn, "wrench");
+ VFrame **edge_on = new_toggle("edge_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_on");
+ VFrame **edge_off = new_toggle("edge_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "edge_off");
+ new_image_set_images("bump_edge", 5,
+ new VFrame(*edge_off[0]), new VFrame(*edge_off[1]),
+ new VFrame(*edge_on[0]), new VFrame(*edge_off[3]),
+ new VFrame(*edge_on[4]));
+ VFrame **span_on = new_toggle("span_on.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_on");
+ VFrame **span_off = new_toggle("span_off.png",
+ editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "span_off");
+ new_image_set_images("bump_span", 5,
+ new VFrame(*span_off[0]), new VFrame(*span_off[1]),
+ new VFrame(*span_on[0]), new VFrame(*span_off[3]),
+ new VFrame(*span_on[4]));
VFrame *transport_up = new_image("transportup.png");
VFrame *transport_hi = new_image("transporthi.png");
// 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");
+ new_toggle("tan_tangent.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_tangent");
+ new_toggle("tan_free.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_free");
+ new_toggle("tan_bump.png", editpanel_up, editpanel_hi, editpanel_checked, editpanel_dn, editpanel_checkedhi, "tan_bump");
new_toggle("mask_scale_x.png", "mask_scale_up.png", "mask_scale_uphi.png",
"mask_scale_chkd.png", "mask_scale_xdown.png", "mask_scale_chkdhi.png",
strcpy(font, "fixed");
strcpy(encoding, DEFAULT_ENCODING);
style = FONT_ALIAS;
- size = 24;
+ size = 48;
color = BLACK;
alpha = 0xff;
outline_size = 0.;
next_keyframe_position = 0;
prev_keyframe_position = 0;
timecode = 0;
- dropshadow = 2;
+ dropshadow = 0;
background = 0;
strcpy(background_path, "");
timecode_format = DEFAULT_TIMECODEFORMAT;