#include "language.h"
#include "localsession.h"
#include "mainclock.h"
+#include "mainsession.h"
#include "mainundo.h"
+#include "manualgoto.h"
#include "mbuttons.h"
#include "meterpanel.h"
#include "mwindow.h"
#include "mwindowgui.h"
#include "playbackengine.h"
+#include "preferences.h"
+#include "scopewindow.h"
#include "theme.h"
#include "timebar.h"
#include "trackcanvas.h"
#include "transportque.h"
+#include "vwindowgui.h"
#include "zoombar.h"
-#include "manualgoto.h"
int use_keyframe,
int use_splice, // Extra buttons
int use_overwrite,
- int use_lift,
- int use_extract,
int use_copy,
int use_paste,
int use_undo,
int use_cut,
int use_commercial,
int use_goto,
- int use_clk2play)
+ int use_clk2play,
+ int use_scope)
{
this->window_id = window_id;
this->editing_mode = editing_mode;
this->use_keyframe = use_keyframe;
this->use_splice = use_splice;
this->use_overwrite = use_overwrite;
- this->use_lift = 0;
- this->use_extract = 0;
this->use_copy = use_copy;
this->use_paste = use_paste;
this->use_undo = use_undo;
this->use_commercial = use_commercial;
this->use_goto = use_goto;
this->use_clk2play = use_clk2play;
+ this->use_scope = use_scope;
this->x = x;
this->y = y;
this->outpoint = 0;
this->splice = 0;
this->overwrite = 0;
- this->lift = 0;
- this->extract = 0;
this->clip = 0;
this->cut = 0;
this->commercial = 0;
this->arrow = 0;
this->ibeam = 0;
this->keyframe = 0;
+ this->span_keyframe = 0;
this->mangoto = 0;
this->click2play = 0;
+ this->scope = 0;
+ this->scope_dialog = 0;
locklabels = 0;
}
EditPanel::~EditPanel()
{
+ delete scope_dialog;
}
void EditPanel::set_meters(MeterPanel *meter_panel)
if( arrow ) arrow->update(new_editing_mode == EDITING_ARROW);
if( ibeam ) ibeam->update(new_editing_mode == EDITING_IBEAM);
if( keyframe ) keyframe->update(mwindow->edl->session->auto_keyframes);
+ if( span_keyframe ) span_keyframe->update(mwindow->edl->session->span_keyframes);
if( locklabels ) locklabels->set_value(mwindow->edl->session->labels_follow_edits);
if( click2play ) {
int value = !is_vwindow() ?
int EditPanel::calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons)
{
- int result = 0;
- int button_w = mwindow->theme->get_image_set("ibeam")[0]->get_w();
- if( use_keyframe ) {
- result += button_w + mwindow->theme->toggle_margin;
- }
-
- result += button_w * total_buttons;
+ int button_w = xS(24); // mwindow->theme->get_image_set("meters")[0]->get_w();
+ int result = button_w * total_buttons;
+ if( use_keyframe )
+ result += 2*(button_w + mwindow->theme->toggle_margin);
return result;
}
int EditPanel::calculate_h(MWindow *mwindow)
{
- return mwindow->theme->get_image_set("ibeam")[0]->get_h();
+ return mwindow->theme->get_image_set("meters")[0]->get_h();
}
void EditPanel::create_buttons()
keyframe = new KeyFrameButton(mwindow, this, x1, y1);
subwindow->add_subwindow(keyframe);
x1 += keyframe->get_w();
+ span_keyframe = new SpanKeyFrameButton(mwindow, this, x1, y1);
+ subwindow->add_subwindow(span_keyframe);
+ x1 += span_keyframe->get_w();
}
if( use_locklabels ) {
- locklabels = new LockLabelsButton(mwindow, x1, y1);
+ locklabels = new LockLabelsButton(mwindow, this, x1, y1);
subwindow->add_subwindow(locklabels);
x1 += locklabels->get_w();
}
x1 += overwrite->get_w();
}
- if( use_lift ) {
- lift = new EditLift(mwindow, this, x1, y1);
- subwindow->add_subwindow(lift);
- x1 += lift->get_w();
- }
-
- if( use_extract ) {
- extract = new EditExtract(mwindow, this, x1, y1);
- subwindow->add_subwindow(extract);
- x1 += extract->get_w();
- }
-
if( use_toclip ) {
clip = new EditToClip(mwindow, this, x1, y1);
subwindow->add_subwindow(clip);
x1 += paste->get_w();
}
- if( use_meters ) {
- if( meter_panel ) {
- meters = new MeterShow(mwindow, meter_panel, x1, y1);
- subwindow->add_subwindow(meters);
- x1 += meters->get_w();
- }
- else
- printf("EditPanel::create_objects: meter_panel == 0\n");
- }
-
if( use_labels ) {
labelbutton = new EditLabelbutton(mwindow, this, x1, y1);
subwindow->add_subwindow(labelbutton);
}
if( use_clk2play ) {
- click2play = new EditClick2Play(mwindow, this, x1, y1+5);
+ click2play = new EditClick2Play(mwindow, this, x1, y1+yS(3));
subwindow->add_subwindow(click2play);
x1 += click2play->get_w();
}
+ if( use_scope ) {
+ scope = new EditPanelScope(mwindow, this, x1, y1-yS(1));
+ subwindow->add_subwindow(scope);
+ x1 += scope->get_w();
+ scope_dialog = new EditPanelScopeDialog(mwindow, this);
+ }
+
+ if( use_meters ) {
+ if( meter_panel ) {
+ meters = new MeterShow(mwindow, meter_panel, x1, y1);
+ subwindow->add_subwindow(meters);
+ x1 += meters->get_w();
+ }
+ else
+ printf("EditPanel::create_objects: meter_panel == 0\n");
+ }
+
if( use_commercial ) {
commercial = new EditCommercial(mwindow, this, x1, y1);
subwindow->add_subwindow(commercial);
}
}
-void EditPanel::stop_transport(const char *lock_msg)
-{
- int have_subwindow_lock = subwindow->get_window_lock();
- if( have_subwindow_lock ) subwindow->unlock_window();
- mwindow->stop_transport();
- if( have_subwindow_lock ) subwindow->lock_window(lock_msg);
-}
-
-
-void EditPanel::toggle_label()
-{
- mwindow->toggle_label(is_mwindow());
-}
-
-void EditPanel::prev_label(int cut)
-{
- int shift_down = subwindow->shift_down();
- int have_mwindow_lock = mwindow->gui->get_window_lock();
- if( have_mwindow_lock ) mwindow->gui->unlock_window();
-
- stop_transport("EditPanel::prev_label 1");
-
- mwindow->gui->lock_window("EditPanel::prev_label 2");
- if( cut )
- mwindow->cut_left_label();
- else
- mwindow->prev_label(shift_down);
- if( !have_mwindow_lock )
- mwindow->gui->unlock_window();
-}
-
-void EditPanel::next_label(int cut)
-{
- int shift_down = subwindow->shift_down();
- int have_mwindow_lock = mwindow->gui->get_window_lock();
- if( have_mwindow_lock ) mwindow->gui->unlock_window();
-
- stop_transport("EditPanel::next_label 1");
-
- mwindow->gui->lock_window("EditPanel::next_label 2");
- if( cut )
- mwindow->cut_right_label();
- else
- mwindow->next_label(shift_down);
- if( !have_mwindow_lock )
- mwindow->gui->unlock_window();
-}
-
-
-
-void EditPanel::prev_edit(int cut)
-{
- int shift_down = subwindow->shift_down();
- int have_mwindow_lock = mwindow->gui->get_window_lock();
- if( have_mwindow_lock ) mwindow->gui->unlock_window();
-
- stop_transport("EditPanel::prev_edit 1");
-
- mwindow->gui->lock_window("EditPanel::prev_edit 2");
-
- if( cut )
- mwindow->cut_left_edit();
- else
- mwindow->prev_edit_handle(shift_down);
-
- if( !have_mwindow_lock )
- mwindow->gui->unlock_window();
-}
-
-void EditPanel::next_edit(int cut)
-{
- int shift_down = subwindow->shift_down();
- int have_mwindow_lock = mwindow->gui->get_window_lock();
- if( have_mwindow_lock ) mwindow->gui->unlock_window();
-
- stop_transport("EditPanel::next_edit 1");
-
- mwindow->gui->lock_window("EditPanel::next_edit 2");
-
- if( cut )
- mwindow->cut_right_edit();
- else
- mwindow->next_edit_handle(shift_down);
-
- if( !have_mwindow_lock )
- mwindow->gui->unlock_window();
-}
-
-
-double EditPanel::get_position()
-{
- EDL *edl = mwindow->edl;
- return !edl ? 0 : edl->local_session->get_selectionstart(1);
-}
-
-void EditPanel::set_position(double position)
-{
- EDL *edl = mwindow->edl;
- if( !edl ) return;
- if( position != get_position() ) {
- if( position < 0 ) position = 0;
- edl->local_session->set_selectionstart(position);
- edl->local_session->set_selectionend(position);
- mwindow->gui->lock_window();
- mwindow->find_cursor();
- mwindow->gui->update(1, NORMAL_DRAW, 1, 1, 1, 1, 0);
- mwindow->gui->unlock_window();
- mwindow->cwindow->update(1, 0, 0, 0, 0);
- }
-}
-
void EditPanel::reposition_buttons(int x, int y)
{
this->x = x;
if( use_keyframe ) {
keyframe->reposition_window(x1, y1);
x1 += keyframe->get_w();
+ span_keyframe->reposition_window(x1, y1);
+ x1 += span_keyframe->get_w();
}
if( use_locklabels ) {
overwrite->reposition_window(x1, y1);
x1 += overwrite->get_w();
}
- if( use_lift ) {
- lift->reposition_window(x1, y1);
- x1 += lift->get_w();
- }
- if( use_extract ) {
- extract->reposition_window(x1, y1);
- x1 += extract->get_w();
- }
if( use_toclip ) {
clip->reposition_window(x1, y1);
x1 += clip->get_w();
x1 += paste->get_w();
}
- if( use_meters ) {
- meters->reposition_window(x1, y1);
- x1 += meters->get_w();
- }
-
if( use_labels ) {
labelbutton->reposition_window(x1, y1);
x1 += labelbutton->get_w();
x1 += mangoto->get_w();
}
if( use_clk2play ) {
- click2play->reposition_window(x1, y1+5);
+ click2play->reposition_window(x1, y1+yS(3));
x1 += click2play->get_w();
}
-}
-
+ if( use_scope ) {
+ scope->reposition_window(x1, y1-yS(1));
+ x1 += scope->get_w();
+ }
+ if( use_meters ) {
+ meters->reposition_window(x1, y1);
+ x1 += meters->get_w();
+ }
+}
void EditPanel::create_objects()
{
return x1 - x;
}
-
-void EditPanel::copy_selection()
-{
- mwindow->copy();
-}
-
-void EditPanel::splice_selection()
-{
-}
-
-void EditPanel::overwrite_selection()
-{
-}
-
-void EditPanel::set_inpoint()
-{
- mwindow->set_inpoint(1);
-}
-
-void EditPanel::set_outpoint()
-{
- mwindow->set_outpoint(1);
-}
-
-void EditPanel::unset_inoutpoint()
-{
- mwindow->unset_inoutpoint(1);
-}
-
-
-EditInPoint::EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("inbutton"))
+// toggle_label
+EditLabelbutton::EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("labelbutton"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("In point ( [ or < )"));
-}
-EditInPoint::~EditInPoint()
-{
-}
-int EditInPoint::handle_event()
-{
- panel->set_inpoint();
- return 1;
-}
-int EditInPoint::keypress_event()
-{
- int key = get_keypress();
- if( ctrl_down() ) {
- if( key == 't' ) {
- panel->unset_inoutpoint();
- return 1;
- }
- }
- else if( !alt_down() ) {
- if( key == '[' || key == '<' ) {
- panel->set_inpoint();
- return 1;
- }
- }
- return 0;
+ set_tooltip(_("Toggle label at current position ( l )"));
}
-EditOutPoint::EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("outbutton"))
+EditLabelbutton::~EditLabelbutton()
{
- this->mwindow = mwindow;
- this->panel = panel;
- set_tooltip(_("Out point ( ] or > )"));
}
-EditOutPoint::~EditOutPoint()
+int EditLabelbutton::keypress_event()
{
+ if( get_keypress() == 'l' && !alt_down() )
+ return handle_event();
+ return 0;
}
-int EditOutPoint::handle_event()
+int EditLabelbutton::handle_event()
{
- panel->set_outpoint();
+ panel->panel_toggle_label();
return 1;
}
-int EditOutPoint::keypress_event()
-{
- int key = get_keypress();
- if( ctrl_down() ) {
- if( key == 't' ) {
- panel->unset_inoutpoint();
- return 1;
- }
- }
- else if( !alt_down() ) {
- if( key == ']' || key == '>' ) {
- panel->set_outpoint();
- return 1;
- }
- }
- return 0;
-}
-
+//next_label
EditNextLabel::EditNextLabel(MWindow *mwindow,
EditPanel *panel, int x, int y)
: BC_Button(x, y, mwindow->theme->get_image_set("nextlabel"))
if( ctrl_down() ) {
int key = get_keypress();
if( (key == RIGHT || key == '.') && !alt_down() ) {
- panel->next_label(0);
+ panel->panel_next_label(0);
return 1;
}
if( key == '>' && alt_down() ) {
- panel->next_label(1);
+ panel->panel_next_label(1);
return 1;
}
}
int EditNextLabel::handle_event()
{
int cut = ctrl_down() && alt_down();
- panel->next_label(cut);
+ panel->panel_next_label(cut);
return 1;
}
+//prev_label
EditPrevLabel::EditPrevLabel(MWindow *mwindow,
EditPanel *panel, int x, int y)
: BC_Button(x, y, mwindow->theme->get_image_set("prevlabel"))
if( ctrl_down() ) {
int key = get_keypress();
if( (key == LEFT || key == ',') && !alt_down() ) {
- panel->prev_label(0);
+ panel->panel_prev_label(0);
return 1;
}
if( key == '<' && alt_down() ) {
- panel->prev_label(1);
+ panel->panel_prev_label(1);
return 1;
}
}
int EditPrevLabel::handle_event()
{
int cut = ctrl_down() && alt_down();
- panel->prev_label(cut);
+ panel->panel_prev_label(cut);
return 1;
}
-
-
-EditNextEdit::EditNextEdit(MWindow *mwindow,
+//prev_edit
+EditPrevEdit::EditPrevEdit(MWindow *mwindow,
EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("nextedit"))
+ : BC_Button(x, y, mwindow->theme->get_image_set("prevedit"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Next edit ( alt -> )"));
+ set_tooltip(_("Previous edit (alt <- )"));
}
-EditNextEdit::~EditNextEdit()
+EditPrevEdit::~EditPrevEdit()
{
}
-int EditNextEdit::keypress_event()
+int EditPrevEdit::keypress_event()
{
if( alt_down() ) {
int key = get_keypress();
- if( (key == RIGHT || key == '.') && !ctrl_down() ) {
- panel->next_edit(0);
+ if( (key == LEFT || key == ',') && !ctrl_down() ) {
+ panel->panel_prev_edit(0);
return 1;
}
- if( key == '.' && ctrl_down() ) {
- panel->next_edit(1);
+ if( key == ',' && ctrl_down() ) {
+ panel->panel_prev_edit(1);
return 1;
}
}
return 0;
}
-int EditNextEdit::handle_event()
+int EditPrevEdit::handle_event()
{
int cut = ctrl_down() && alt_down();
- panel->next_edit(cut);
+ panel->panel_prev_edit(cut);
return 1;
}
-EditPrevEdit::EditPrevEdit(MWindow *mwindow,
+//next_edit
+EditNextEdit::EditNextEdit(MWindow *mwindow,
EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("prevedit"))
+ : BC_Button(x, y, mwindow->theme->get_image_set("nextedit"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Previous edit (alt <- )"));
+ set_tooltip(_("Next edit ( alt -> )"));
}
-EditPrevEdit::~EditPrevEdit()
+EditNextEdit::~EditNextEdit()
{
}
-int EditPrevEdit::keypress_event()
+int EditNextEdit::keypress_event()
{
if( alt_down() ) {
int key = get_keypress();
- if( (key == LEFT || key == ',') && !ctrl_down() ) {
- panel->prev_edit(0);
+ if( (key == RIGHT || key == '.') && !ctrl_down() ) {
+ panel->panel_next_edit(0);
return 1;
}
- if( key == ',' && ctrl_down() ) {
- panel->prev_edit(1);
+ if( key == '.' && ctrl_down() ) {
+ panel->panel_next_edit(1);
return 1;
}
}
return 0;
}
-int EditPrevEdit::handle_event()
+int EditNextEdit::handle_event()
{
int cut = ctrl_down() && alt_down();
- panel->prev_edit(cut);
+ panel->panel_next_edit(cut);
return 1;
}
-
-
-EditLift::EditLift(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->lift_data)
+//copy_selection
+EditCopy::EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("copy"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Lift"));
+ set_tooltip(_("Copy ( c )"));
}
-EditLift::~EditLift()
+EditCopy::~EditCopy()
+{
+}
+
+int EditCopy::keypress_event()
{
+ if( alt_down() ) return 0;
+ if( (get_keypress() == 'c' && !ctrl_down()) ||
+ (panel->is_vwindow() && get_keypress() == 'C') ) {
+ return handle_event();
+ }
+ return 0;
}
-int EditLift::handle_event()
+int EditCopy::handle_event()
{
+ panel->panel_copy_selection();
return 1;
}
+//overwrite_selection
EditOverwrite::EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y)
: BC_Button(x, y, mwindow->theme->overwrite_data)
{
}
int EditOverwrite::handle_event()
{
- panel->overwrite_selection();
+ panel->panel_overwrite_selection();
return 1;
}
int EditOverwrite::keypress_event()
return 0;
}
-EditExtract::EditExtract(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->extract_data)
+//set_inpoint
+//unset_inoutpoint
+EditInPoint::EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("inbutton"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Extract"));
+ set_tooltip(_("In point ( [ or < )"));
}
-EditExtract::~EditExtract()
+EditInPoint::~EditInPoint()
{
}
-int EditExtract::handle_event()
+int EditInPoint::handle_event()
{
-// mwindow->extract_selection();
+ panel->panel_set_inpoint();
return 1;
}
+int EditInPoint::keypress_event()
+{
+ int key = get_keypress();
+ if( ctrl_down() ) {
+ if( key == 't' ) {
+ panel->panel_unset_inoutpoint();
+ return 1;
+ }
+ }
+ else if( !alt_down() ) {
+ if( key == '[' || key == '<' ) {
+ panel->panel_set_inpoint();
+ return 1;
+ }
+ }
+ return 0;
+}
-EditToClip::EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("toclip"))
+//set_outpoint
+//unset_inoutpoint
+EditOutPoint::EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("outbutton"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("To clip ( i )"));
+ set_tooltip(_("Out point ( ] or > )"));
}
-EditToClip::~EditToClip()
+EditOutPoint::~EditOutPoint()
{
}
-int EditToClip::handle_event()
+int EditOutPoint::handle_event()
{
- panel->to_clip();
+ panel->panel_set_outpoint();
return 1;
}
-
-int EditToClip::keypress_event()
+int EditOutPoint::keypress_event()
{
- if( alt_down() ) return 0;
- if( get_keypress() == 'i' ||
- (panel->is_vwindow() && get_keypress() == 'I') ) {
- handle_event();
- return 1;
+ int key = get_keypress();
+ if( ctrl_down() ) {
+ if( key == 't' ) {
+ panel->panel_unset_inoutpoint();
+ return 1;
+ }
+ }
+ else if( !alt_down() ) {
+ if( key == ']' || key == '>' ) {
+ panel->panel_set_outpoint();
+ return 1;
+ }
}
return 0;
}
-EditManualGoto::EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("goto"))
+//splice_selection
+EditSplice::EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->splice_data)
{
this->mwindow = mwindow;
this->panel = panel;
- mangoto = new ManualGoto(mwindow, panel);
- set_tooltip(_("Manual goto ( g )"));
+ set_tooltip(_("Splice ( v )"));
}
-EditManualGoto::~EditManualGoto()
+EditSplice::~EditSplice()
{
- delete mangoto;
}
-int EditManualGoto::handle_event()
+int EditSplice::handle_event()
{
- mangoto->start();
+ panel->panel_splice_selection();
return 1;
}
-
-int EditManualGoto::keypress_event()
+int EditSplice::keypress_event()
{
- if( get_keypress() == 'g' ) {
+ if( alt_down() ) return 0;
+ if( (get_keypress() == 'v' && !ctrl_down()) ||
+ (panel->is_vwindow() && get_keypress() == 'V') ) {
handle_event();
return 1;
}
return 0;
}
-
-EditSplice::EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->splice_data)
+//to_clip
+EditToClip::EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("toclip"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Splice ( v )"));
+ set_tooltip(_("To clip ( i )"));
}
-EditSplice::~EditSplice()
+EditToClip::~EditToClip()
{
}
-int EditSplice::handle_event()
+int EditToClip::handle_event()
{
- panel->splice_selection();
+ panel->panel_to_clip();
return 1;
}
-int EditSplice::keypress_event()
+
+int EditToClip::keypress_event()
{
if( alt_down() ) return 0;
- if( get_keypress() == 'v' ||
- (panel->is_vwindow() && get_keypress() == 'V') ) {
+ if( get_keypress() == 'i' ||
+ (panel->is_vwindow() && get_keypress() == 'I') ) {
handle_event();
return 1;
}
return 0;
}
+//cut
EditCut::EditCut(MWindow *mwindow, EditPanel *panel, int x, int y)
: BC_Button(x, y, mwindow->theme->get_image_set("cut"))
{
int EditCut::handle_event()
{
- int have_mwindow_lock = mwindow->gui->get_window_lock();
- if( !have_mwindow_lock )
- mwindow->gui->lock_window("EditCut::handle_event");
-
- mwindow->cut();
-
- if( !have_mwindow_lock )
- mwindow->gui->unlock_window();
+ panel->panel_cut();
return 1;
}
-EditClick2Play::EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Toggle(x, y, mwindow->theme->get_image_set("playpatch_data"),
- !panel->is_vwindow() ?
- mwindow->edl->session->cwindow_click2play :
- mwindow->edl->session->vwindow_click2play)
+//paste
+EditPaste::EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("paste"))
{
- this->mwindow = mwindow;
- this->panel = panel;
- set_tooltip(_("Click to play (p)"));
+ this->mwindow = mwindow;
+ this->panel = panel;
+ set_tooltip(_("Paste ( v )"));
}
-int EditClick2Play::handle_event()
+EditPaste::~EditPaste()
{
- int value = get_value();
- if( panel->is_vwindow() ) {
- mwindow->edl->session->vwindow_click2play = value;
- mwindow->update_vwindow();
- }
- else
- mwindow->edl->session->cwindow_click2play = value;
- return 1;
}
-int EditClick2Play::keypress_event()
+
+int EditPaste::keypress_event()
{
- int key = get_keypress();
- if( key == 'p' && !ctrl_down() && !shift_down() && !alt_down() ) {
- int value = get_value() ? 0 : 1;
- update(value);
- if( panel->is_vwindow() ) {
- mwindow->edl->session->vwindow_click2play = value;
- mwindow->update_vwindow();
- }
- else
- mwindow->edl->session->cwindow_click2play = value;
- return 1;
- }
+ if( get_keypress() == 'v' && !ctrl_down() )
+ return handle_event();
return 0;
}
+int EditPaste::handle_event()
+{
+ panel->panel_paste();
+ return 1;
+}
-
-EditCommercial::EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("commercial"))
+//fit_selection
+EditFit::EditFit(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("fit"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Commercial ( shift A )"));
+ set_tooltip(_("Fit selection to display ( f )"));
}
-EditCommercial::~EditCommercial()
+EditFit::~EditFit()
{
}
-int EditCommercial::keypress_event()
+int EditFit::keypress_event()
{
- if( ctrl_down() || !shift_down() || alt_down() )
- return 0;
- if( get_keypress() == 'A' )
- return handle_event();
+ if( !alt_down() && get_keypress() == 'f' ) {
+ handle_event();
+ return 1;
+ }
return 0;
}
-
-int EditCommercial::handle_event()
+int EditFit::handle_event()
{
- int have_mwindow_lock = mwindow->gui->get_window_lock();
- if( have_mwindow_lock )
- mwindow->gui->unlock_window();
- mwindow->commit_commercial();
- if( !mwindow->put_commercial() ) {
- mwindow->gui->lock_window("EditCommercial::handle_event 1");
- mwindow->cut();
- if( !have_mwindow_lock )
- mwindow->gui->unlock_window();
- mwindow->activate_commercial();
- return 1;
- }
- mwindow->undo_commercial();
- if( have_mwindow_lock )
- mwindow->gui->lock_window("EditCommercial::handle_event 2");
+ panel->panel_fit_selection();
return 1;
}
-EditCopy::EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("copy"))
+//fit_autos
+EditFitAutos::EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("fitautos"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Copy ( c )"));
+ set_tooltip(_("Fit all autos to display ( Alt + f )"));
}
-EditCopy::~EditCopy()
+EditFitAutos::~EditFitAutos()
{
}
-
-int EditCopy::keypress_event()
+int EditFitAutos::keypress_event()
{
- if( alt_down() ) return 0;
- if( get_keypress() == 'c' ||
- (panel->is_vwindow() && get_keypress() == 'C') ) {
- return handle_event();
+ if( get_keypress() == 'f' && alt_down() ) {
+ panel->panel_fit_autos(!ctrl_down() ? 1 : 0);
+ return 1;
}
return 0;
}
-int EditCopy::handle_event()
+int EditFitAutos::handle_event()
{
- panel->copy_selection();
+ panel->panel_fit_autos(1);
return 1;
}
-EditAppend::EditAppend(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->append_data)
+//set_editing_mode
+ArrowButton::ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Toggle(x, y,
+ mwindow->theme->get_image_set("arrow"),
+ mwindow->edl->session->editing_mode == EDITING_ARROW,
+ "", 0, 0, 0)
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Append to end of track"));
-}
-EditAppend::~EditAppend()
-{
+ set_tooltip(_("Drag and drop editing mode"));
}
-
-int EditAppend::handle_event()
+int ArrowButton::handle_event()
{
+ update(1);
+ panel->ibeam->update(0);
+ panel->panel_set_editing_mode(EDITING_ARROW);
+// Nothing after this
return 1;
}
-
-EditInsert::EditInsert(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->insert_data)
+IBeamButton::IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Toggle(x, y,
+ mwindow->theme->get_image_set("ibeam"),
+ mwindow->edl->session->editing_mode == EDITING_IBEAM,
+ "", 0, 0, 0)
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Insert before beginning of track"));
+ set_tooltip(_("Cut and paste editing mode"));
}
-EditInsert::~EditInsert()
+
+int IBeamButton::handle_event()
{
+ update(1);
+ panel->arrow->update(0);
+ panel->panel_set_editing_mode(EDITING_IBEAM);
+// Nothing after this
+ return 1;
}
-
-int EditInsert::handle_event()
+//set_auto_keyframes
+KeyFrameButton::KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Toggle(x, y,
+ mwindow->theme->get_image_set("autokeyframe"),
+ mwindow->edl->session->auto_keyframes,
+ "", 0, 0, 0)
{
+ this->mwindow = mwindow;
+ this->panel = panel;
+ set_tooltip(_("Generate keyframes while tweeking (j)"));
+}
+int KeyFrameButton::handle_event()
+{
+ panel->panel_set_auto_keyframes(get_value());
return 1;
}
+int KeyFrameButton::keypress_event()
+{
+ int key = get_keypress();
+ if( key == 'j' && !ctrl_down() && !shift_down() && !alt_down() ) {
+ int value = get_value() ? 0 : 1;
+ update(value);
+ panel->panel_set_auto_keyframes(value);
+ return 1;
+ }
+ return 0;
+}
-EditPaste::EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("paste"))
+//set_span_keyframes
+SpanKeyFrameButton::SpanKeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Toggle(x, y,
+ mwindow->theme->get_image_set("spankeyframe"),
+ mwindow->edl->session->span_keyframes,
+ "", 0, 0, 0)
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Paste ( v )"));
+ set_tooltip(_("Allow keyframe spanning"));
}
-EditPaste::~EditPaste()
+
+int SpanKeyFrameButton::handle_event()
{
+ panel->panel_set_span_keyframes(get_value());
+ return 1;
}
-int EditPaste::keypress_event()
+//set_labels_follow_edits
+LockLabelsButton::LockLabelsButton(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Toggle(x, y,
+ mwindow->theme->get_image_set("locklabels"),
+ mwindow->edl->session->labels_follow_edits,
+ "", 0, 0, 0)
{
- if( get_keypress() == 'v' )
- return handle_event();
- return 0;
+ this->mwindow = mwindow;
+ this->panel = panel;
+ set_tooltip(_("Lock labels from moving with edits"));
}
-int EditPaste::handle_event()
-{
- int have_mwindow_lock = mwindow->gui->get_window_lock();
- if( !have_mwindow_lock )
- mwindow->gui->lock_window("EditPaste::handle_event");
-
- mwindow->paste();
- if( !have_mwindow_lock )
- mwindow->gui->unlock_window();
+int LockLabelsButton::handle_event()
+{
+ panel->panel_set_labels_follow_edits(get_value());
return 1;
}
-EditTransition::EditTransition(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->transition_data)
+EditManualGoto::EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("goto"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Set transition"));
+ mangoto = new ManualGoto(mwindow, panel);
+ set_tooltip(_("Manual goto ( g )"));
+}
+EditManualGoto::~EditManualGoto()
+{
+ delete mangoto;
+}
+int EditManualGoto::handle_event()
+{
+ mangoto->start();
+ return 1;
+}
+
+int EditManualGoto::keypress_event()
+{
+ if( get_keypress() == 'g' ) {
+ handle_event();
+ return 1;
+ }
+ return 0;
}
-EditTransition::~EditTransition()
+
+
+EditClick2Play::EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("playpatch_data"),
+ !panel->is_vwindow() ?
+ mwindow->edl->session->cwindow_click2play :
+ mwindow->edl->session->vwindow_click2play)
{
+ this->mwindow = mwindow;
+ this->panel = panel;
+ set_tooltip(_("Click to play (p)"));
}
-int EditTransition::handle_event()
+int EditClick2Play::handle_event()
{
+ int value = get_value();
+ panel->set_click_to_play(value);
return 1;
}
+int EditClick2Play::keypress_event()
+{
+ int key = get_keypress();
+ if( key == 'p' && !ctrl_down() && !shift_down() && !alt_down() ) {
+ int value = get_value() ? 0 : 1;
+ update(value);
+ panel->set_click_to_play(value);
+ return 1;
+ }
+ return 0;
+}
+
-EditPresentation::EditPresentation(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->presentation_data)
+EditCommercial::EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Button(x, y, mwindow->theme->get_image_set("commercial"))
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Set presentation up to current position"));
+ set_tooltip(_("Commercial ( shift A )"));
+}
+EditCommercial::~EditCommercial()
+{
}
-EditPresentation::~EditPresentation()
+int EditCommercial::keypress_event()
{
+ if( ctrl_down() || !shift_down() || alt_down() )
+ return 0;
+ if( get_keypress() == 'A' )
+ return handle_event();
+ return 0;
}
-int EditPresentation::handle_event()
+
+int EditCommercial::handle_event()
{
+ int have_mwindow_lock = mwindow->gui->get_window_lock();
+ if( have_mwindow_lock )
+ mwindow->gui->unlock_window();
+ mwindow->commit_commercial();
+ if( !mwindow->put_commercial() ) {
+ mwindow->gui->lock_window("EditCommercial::handle_event 1");
+ mwindow->cut();
+ if( !have_mwindow_lock )
+ mwindow->gui->unlock_window();
+ mwindow->activate_commercial();
+ return 1;
+ }
+ mwindow->undo_commercial();
+ if( have_mwindow_lock )
+ mwindow->gui->lock_window("EditCommercial::handle_event 2");
return 1;
}
+
EditUndo::EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y)
: BC_Button(x, y, mwindow->theme->get_image_set("undo"))
{
{
mwindow->redo_entry(panel->subwindow);
return 1;
-};
-
-
-
+}
-EditLabelbutton::EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("labelbutton"))
+EditPanelScopeDialog::EditPanelScopeDialog(MWindow *mwindow, EditPanel *panel)
+ : BC_DialogThread()
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Toggle label at current position ( l )"));
+ scope_gui = 0;
+ gui_lock = new Mutex("EditPanelScopeDialog::gui_lock");
}
-EditLabelbutton::~EditLabelbutton()
+EditPanelScopeDialog::~EditPanelScopeDialog()
{
+ close_window();
+ delete gui_lock;
}
-int EditLabelbutton::keypress_event()
+
+void EditPanelScopeDialog::handle_close_event(int result)
{
- if( get_keypress() == 'l' && !alt_down() )
- return handle_event();
- return 0;
+ scope_gui = 0;
}
-int EditLabelbutton::handle_event()
+void EditPanelScopeDialog::handle_done_event(int result)
{
- panel->toggle_label();
- return 1;
-}
-
-
-
-
-
-
+ gui_lock->lock("EditPanelScopeDialog::handle_done_event");
+ scope_gui = 0;
+ gui_lock->unlock();
-EditFit::EditFit(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("fit"))
-{
- this->mwindow = mwindow;
- this->panel = panel;
- set_tooltip(_("Fit selection to display ( f )"));
+ panel->subwindow->lock_window("EditPanelScopeDialog::handle_done_event");
+ panel->scope->update(0);
+ panel->subwindow->unlock_window();
}
-EditFit::~EditFit()
+
+BC_Window* EditPanelScopeDialog::new_gui()
{
+ EditPanelScopeGUI *gui = new EditPanelScopeGUI(mwindow, this);
+ gui->create_objects();
+ scope_gui = gui;
+ return gui;
}
-int EditFit::keypress_event()
+
+void EditPanelScopeDialog::process(VFrame *output_frame)
{
- if( !alt_down() && get_keypress() == 'f' ) {
- handle_event();
- return 1;
+ if( panel->scope_dialog ) {
+ panel->scope_dialog->gui_lock->lock("EditPanelScopeDialog::process");
+ if( panel->scope_dialog->scope_gui ) {
+ EditPanelScopeGUI *gui = panel->scope_dialog->scope_gui;
+ gui->process(output_frame);
+ }
+ panel->scope_dialog->gui_lock->unlock();
}
- return 0;
}
-int EditFit::handle_event()
-{
- mwindow->fit_selection();
- return 1;
-}
-
-
-
-
-
-
-
-
-EditFitAutos::EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Button(x, y, mwindow->theme->get_image_set("fitautos"))
+EditPanelScopeGUI::EditPanelScopeGUI(MWindow *mwindow, EditPanelScopeDialog *dialog)
+ : ScopeGUI(mwindow->theme,
+ mwindow->session->scope_x, mwindow->session->scope_y,
+ mwindow->session->scope_w, mwindow->session->scope_h,
+ mwindow->get_cpus())
{
this->mwindow = mwindow;
- this->panel = panel;
- set_tooltip(_("Fit all autos to display ( Alt + f )"));
-}
-EditFitAutos::~EditFitAutos()
-{
-}
-int EditFitAutos::keypress_event()
-{
- if( !ctrl_down() && alt_down() && get_keypress() == 'f' ) {
- mwindow->fit_autos(1);
- return 1;
- }
- if( ctrl_down() && alt_down() && get_keypress() == 'f' ) {
- mwindow->fit_autos(0);
- return 1;
- }
- return 0;
+ this->dialog = dialog;
}
-int EditFitAutos::handle_event()
+
+EditPanelScopeGUI::~EditPanelScopeGUI()
{
- mwindow->fit_autos(1);
- return 1;
}
-
-
-
-
-
-
-
-
-
-
-
-
-ArrowButton::ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Toggle(x, y,
- mwindow->theme->get_image_set("arrow"),
- mwindow->edl->session->editing_mode == EDITING_ARROW,
- "", 0, 0, 0)
+void EditPanelScopeGUI::create_objects()
{
- this->mwindow = mwindow;
- this->panel = panel;
- set_tooltip(_("Drag and drop editing mode"));
+ MainSession *session = mwindow->session;
+ use_hist = session->use_hist;
+ use_wave = session->use_wave;
+ use_vector = session->use_vector;
+ use_hist_parade = session->use_hist_parade;
+ use_wave_parade = session->use_wave_parade;
+ use_wave_gain = session->use_wave_gain;
+ use_vect_gain = session->use_vect_gain;
+ use_smooth = session->use_smooth;
+ use_refresh = session->use_refresh;
+ use_release = session->use_release;
+ use_graticule = session->use_graticule;
+ ScopeGUI::create_objects();
}
-int ArrowButton::handle_event()
+void EditPanelScopeGUI::toggle_event()
{
- update(1);
- panel->ibeam->update(0);
- mwindow->set_editing_mode(EDITING_ARROW,
- !panel->is_mwindow(), panel->is_mwindow());
-// Nothing after this
- return 1;
+ MainSession *session = mwindow->session;
+ session->use_hist = use_hist;
+ session->use_wave = use_wave;
+ session->use_vector = use_vector;
+ session->use_hist_parade = use_hist_parade;
+ session->use_wave_parade = use_wave_parade;
+ session->use_wave_gain = use_wave_gain;
+ session->use_vect_gain = use_vect_gain;
+ session->use_smooth = use_smooth;
+ session->use_refresh = use_refresh;
+ session->use_release = use_release;
+ session->use_graticule = use_graticule;
}
-
-IBeamButton::IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Toggle(x, y,
- mwindow->theme->get_image_set("ibeam"),
- mwindow->edl->session->editing_mode == EDITING_IBEAM,
- "", 0, 0, 0)
+int EditPanelScopeGUI::translation_event()
{
- this->mwindow = mwindow;
- this->panel = panel;
- set_tooltip(_("Cut and paste editing mode"));
+ ScopeGUI::translation_event();
+ MainSession *session = mwindow->session;
+ session->scope_x = get_x();
+ session->scope_y = get_y();
+ return 0;
}
-int IBeamButton::handle_event()
+int EditPanelScopeGUI::resize_event(int w, int h)
{
- update(1);
- panel->arrow->update(0);
- mwindow->set_editing_mode(EDITING_IBEAM,
- !panel->is_mwindow(), panel->is_mwindow());
-// Nothing after this
- return 1;
+ ScopeGUI::resize_event(w, h);
+ MainSession *session = mwindow->session;
+ session->scope_w = w;
+ session->scope_h = h;
+ return 0;
}
-KeyFrameButton::KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y)
- : BC_Toggle(x, y,
- mwindow->theme->get_image_set("autokeyframe"),
- mwindow->edl->session->auto_keyframes,
- "", 0, 0, 0)
+EditPanelScope::EditPanelScope(MWindow *mwindow, EditPanel *panel, int x, int y)
+ : BC_Toggle(x, y, mwindow->theme ?
+ mwindow->theme->get_image_set("scope_toggle") : 0, 0)
{
this->mwindow = mwindow;
this->panel = panel;
- set_tooltip(_("Generate keyframes while tweeking (j)"));
+ set_tooltip(_("View scope"));
}
-int KeyFrameButton::handle_event()
+EditPanelScope::~EditPanelScope()
{
- mwindow->set_auto_keyframes(get_value(),
- !panel->is_mwindow(), panel->is_mwindow());
- return 1;
}
-int KeyFrameButton::keypress_event()
+void EditPanelScopeGUI::update_scope()
{
- int key = get_keypress();
- if( key == 'j' && !ctrl_down() && !shift_down() && !alt_down() ) {
- int value = get_value() ? 0 : 1;
- update(value);
- mwindow->set_auto_keyframes(value,
- !panel->is_mwindow(), panel->is_mwindow());
- return 1;
+ Canvas *canvas = 0;
+ if( dialog->panel->is_cwindow() ) {
+ CWindowGUI *cgui = (CWindowGUI *)dialog->panel->subwindow;
+ canvas = cgui->canvas;
}
- return 0;
-}
-
-LockLabelsButton::LockLabelsButton(MWindow *mwindow, int x, int y)
- : BC_Toggle(x, y,
- mwindow->theme->get_image_set("locklabels"),
- mwindow->edl->session->labels_follow_edits,
- "", 0, 0, 0)
-{
- this->mwindow = mwindow;
- set_tooltip(_("Lock labels from moving with edits"));
+ else if( dialog->panel->is_vwindow() ) {
+ VWindowGUI *vgui = (VWindowGUI *)dialog->panel->subwindow;
+ canvas = vgui->canvas;
+ }
+ if( canvas && canvas->refresh_frame )
+ process(canvas->refresh_frame);
}
-int LockLabelsButton::handle_event()
+int EditPanelScope::handle_event()
{
- mwindow->set_labels_follow_edits(get_value());
+ unlock_window();
+ int v = get_value();
+ if( v )
+ panel->scope_dialog->start();
+ else
+ panel->scope_dialog->close_window();
+ lock_window("EditPanelScope::handle_event");
return 1;
}