VWindowGUI::~VWindowGUI()
{
- vwindow->playback_engine->interrupt_playback(1);
+ vwindow->stop_playback(1);
sources.remove_all_objects();
labels.remove_all_objects();
delete canvas;
delete cache;
delete canvas->refresh_frame;
canvas->refresh_frame = vframe;
- canvas->draw_refresh(1);
+ canvas->refresh(1);
}
void VWindowGUI::change_source(EDL *edl, const char *title)
int VWindowGUI::keypress_event()
{
int result = 0;
- switch(get_keypress())
- {
- case 'w':
- case 'W':
- close_event();
+ switch( get_keypress() ) {
+ case 'w':
+ case 'W':
+ close_event();
+ result = 1;
+ break;
+ case 'z':
+ mwindow->undo_entry(this);
+ break;
+ case 'Z':
+ mwindow->redo_entry(this);
+ break;
+ case 'f':
+ unlock_window();
+ if( canvas->get_fullscreen() )
+ canvas->stop_fullscreen();
+ else
+ canvas->start_fullscreen();
+ lock_window("VWindowGUI::keypress_event 1");
+ break;
+ case ESC:
+ unlock_window();
+ if( canvas->get_fullscreen() )
+ canvas->stop_fullscreen();
+ lock_window("VWindowGUI::keypress_event 2");
+ break;
+ case KEY_F1:
+ case KEY_F2:
+ case KEY_F3:
+ case KEY_F4:
+ if( ctrl_down() && shift_down() ) {
+ resend_event(mwindow->gui);
result = 1;
break;
- case 'z':
- mwindow->undo_entry(this);
- break;
- case 'Z':
- mwindow->redo_entry(this);
- break;
- case 'f':
- unlock_window();
- if(mwindow->session->vwindow_fullscreen)
- canvas->stop_fullscreen();
- else
- canvas->start_fullscreen();
- lock_window("VWindowGUI::keypress_event 1");
- break;
- case ESC:
- unlock_window();
- if(mwindow->session->vwindow_fullscreen)
- canvas->stop_fullscreen();
- lock_window("VWindowGUI::keypress_event 2");
- break;
+ }
}
- if(!result) result = transport->keypress_event();
+ if( !result )
+ result = transport->keypress_event();
return result;
}
-void VWindowGUI::stop_transport(const char *lock_msg)
-{
- if( !transport->is_stopped() ) {
- if( lock_msg ) unlock_window();
- transport->handle_transport(STOP, 1, 0, 0);
- if( lock_msg ) lock_window(lock_msg);
- }
-}
-
int VWindowGUI::button_press_event()
{
if( vwindow->get_edl() != 0 && canvas->get_canvas() &&
int need_highlight = cursor_above() && get_cursor_over_window() ? 1 : 0;
if( highlighted == need_highlight ) return;
highlighted = need_highlight;
- canvas->draw_refresh();
+ canvas->refresh(1);
}
int VWindowGUI::drag_stop()
if( highlighted &&
mwindow->session->current_operation == DRAG_ASSET ) {
highlighted = 0;
- canvas->draw_refresh();
+ canvas->refresh(1);
unlock_window();
Indexable *indexable =
return 0;
}
+void VWindowGUI::stop_transport()
+{
+ if( !transport->is_stopped() ) {
+ unlock_window();
+ transport->handle_transport(STOP, 1);
+ lock_window("VWindowGUI::panel_stop_transport");
+ }
+}
void VWindowGUI::update_meters()
{
0, // use_keyframe
1, // use_splice
1, // use_overwrite
- 0, // use_lift
- 0, // use_extract
1, // use_copy
0, // use_paste
0, // use_undo
{
}
-void VWindowEditing::copy_selection()
+#define relock_vm(s) \
+ vwindow->gui->unlock_window(); \
+ mwindow->gui->lock_window("VWindowEditing::" s)
+#define relock_mv(s) \
+ mwindow->gui->unlock_window(); \
+ vwindow->gui->lock_window("VWindowEditing::" s)
+
+double VWindowEditing::get_position()
{
- vwindow->copy(subwindow->shift_down());
+ EDL *edl = vwindow->get_edl();
+ double position = !edl ? 0 : edl->local_session->get_selectionstart(1);
+ return position;
}
-void VWindowEditing::splice_selection()
+void VWindowEditing::set_position(double position)
{
- if(vwindow->get_edl())
- {
- mwindow->gui->lock_window("VWindowEditing::splice_selection");
- mwindow->splice(vwindow->get_edl(), subwindow->shift_down());
- mwindow->gui->unlock_window();
+ EDL *edl = vwindow->get_edl();
+ if( !edl ) return;
+ if( get_position() != position ) {
+ if( position < 0 ) position = 0;
+ edl->local_session->set_selectionstart(position);
+ edl->local_session->set_selectionend(position);
+ vwindow->update_position();
}
}
-void VWindowEditing::overwrite_selection()
+void VWindowEditing::set_click_to_play(int v)
{
- if(vwindow->get_edl())
- {
- mwindow->gui->lock_window("VWindowEditing::overwrite_selection");
- mwindow->overwrite(vwindow->get_edl(), subwindow->shift_down());
- mwindow->gui->unlock_window();
- }
+ click2play->update(v);
+ relock_vm("set_click_to_play");
+ mwindow->edl->session->vwindow_click2play = v;
+ mwindow->update_vwindow();
+ relock_mv("set_click_to_play");
}
-void VWindowEditing::toggle_label()
+void VWindowEditing::panel_stop_transport()
{
- if(vwindow->get_edl())
- {
- EDL *edl = vwindow->get_edl();
- edl->labels->toggle_label(edl->local_session->get_selectionstart(1),
- edl->local_session->get_selectionend(1));
- vwindow->gui->timebar->update(1);
- }
+ vwindow->gui->stop_transport();
}
-void VWindowEditing::prev_label(int cut)
+void VWindowEditing::panel_toggle_label()
{
- if(vwindow->get_edl())
- {
- EDL *edl = vwindow->get_edl();
- vwindow->gui->unlock_window();
- vwindow->playback_engine->interrupt_playback(1);
- vwindow->gui->lock_window("VWindowEditing::prev_label");
+ if( !vwindow->get_edl() ) return;
+ EDL *edl = vwindow->get_edl();
+ edl->labels->toggle_label(edl->local_session->get_selectionstart(1),
+ edl->local_session->get_selectionend(1));
+ vwindow->gui->timebar->update(1);
+}
- Label *current = edl->labels->prev_label(
- edl->local_session->get_selectionstart(1));
+void VWindowEditing::panel_next_label(int cut)
+{
+ if( !vwindow->get_edl() ) return;
+ vwindow->interrupt_playback(1);
+ EDL *edl = vwindow->get_edl();
+ Label *current = edl->labels->next_label(
+ edl->local_session->get_selectionstart(1));
+ double position = current ? current->position :
+ edl->tracks->total_length();
+ edl->local_session->set_selectionstart(position);
+ edl->local_session->set_selectionend(position);
+ vwindow->update_position();
+ vwindow->gui->timebar->update(1);
+}
- if(!current)
- {
- edl->local_session->set_selectionstart(0);
- edl->local_session->set_selectionend(0);
- vwindow->update_position(CHANGE_NONE, 0, 1, 0);
- vwindow->gui->timebar->update(1);
- }
- else
- {
- edl->local_session->set_selectionstart(current->position);
- edl->local_session->set_selectionend(current->position);
- vwindow->update_position(CHANGE_NONE, 0, 1, 0);
- vwindow->gui->timebar->update(1);
- }
- }
+void VWindowEditing::panel_prev_label(int cut)
+{
+ if( !vwindow->get_edl() ) return;
+ vwindow->interrupt_playback(1);
+
+ EDL *edl = vwindow->get_edl();
+ Label *current = edl->labels->prev_label(
+ edl->local_session->get_selectionstart(1));
+ double position = !current ? 0 : current->position;
+ edl->local_session->set_selectionstart(position);
+ edl->local_session->set_selectionend(position);
+ vwindow->update_position();
+ vwindow->gui->timebar->update(1);
}
-void VWindowEditing::next_label(int cut)
+void VWindowEditing::panel_prev_edit(int cut) {} // not used
+void VWindowEditing::panel_next_edit(int cut) {} // not used
+
+void VWindowEditing::panel_copy_selection()
{
- if(vwindow->get_edl())
- {
- EDL *edl = vwindow->get_edl();
- Label *current = edl->labels->next_label(
- edl->local_session->get_selectionstart(1));
- if(!current)
- {
- vwindow->gui->unlock_window();
- vwindow->playback_engine->interrupt_playback(1);
- vwindow->gui->lock_window("VWindowEditing::next_label 1");
-
- double position = edl->tracks->total_length();
- edl->local_session->set_selectionstart(position);
- edl->local_session->set_selectionend(position);
- vwindow->update_position(CHANGE_NONE, 0, 1, 0);
- vwindow->gui->timebar->update(1);
- }
- else
- {
- vwindow->gui->unlock_window();
- vwindow->playback_engine->interrupt_playback(1);
- vwindow->gui->lock_window("VWindowEditing::next_label 2");
-
- edl->local_session->set_selectionstart(current->position);
- edl->local_session->set_selectionend(current->position);
- vwindow->update_position(CHANGE_NONE, 0, 1, 0);
- vwindow->gui->timebar->update(1);
- }
- }
+ vwindow->copy(vwindow->gui->shift_down());
}
-double VWindowEditing::get_position()
+void VWindowEditing::panel_overwrite_selection()
{
- EDL *edl = vwindow->get_edl();
- double position = !edl ? 0 : edl->local_session->get_selectionstart(1);
- return position;
+ if( !vwindow->get_edl() ) return;
+ relock_vm("overwrite_selection");
+ mwindow->overwrite(vwindow->get_edl(), vwindow->gui->shift_down());
+ relock_mv("overwrite_selection");
}
-void VWindowEditing::set_position(double position)
+void VWindowEditing::panel_splice_selection()
{
- EDL *edl = vwindow->get_edl();
- if( !edl ) return;
- if( get_position() != position ) {
- if( position < 0 ) position = 0;
- edl->local_session->set_selectionstart(position);
- edl->local_session->set_selectionend(position);
- vwindow->update_position(CHANGE_NONE, 0, 1);
- }
+ if( !vwindow->get_edl() ) return;
+ relock_vm("splice_selection");
+ mwindow->splice(vwindow->get_edl(), vwindow->gui->shift_down());
+ relock_mv("splice_selection");
}
-void VWindowEditing::set_inpoint()
+void VWindowEditing::panel_set_inpoint()
{
vwindow->set_inpoint();
}
-void VWindowEditing::set_outpoint()
+void VWindowEditing::panel_set_outpoint()
{
vwindow->set_outpoint();
}
-void VWindowEditing::unset_inoutpoint()
+void VWindowEditing::panel_unset_inoutpoint()
{
vwindow->unset_inoutpoint();
}
-
-void VWindowEditing::to_clip()
+void VWindowEditing::panel_to_clip()
{
EDL *edl = vwindow->get_edl();
if( !edl ) return;
mwindow->to_clip(edl, _("viewer window: "), subwindow->shift_down());
}
+// not used
+void VWindowEditing::panel_cut() {}
+void VWindowEditing::panel_paste() {}
+void VWindowEditing::panel_fit_selection() {}
+void VWindowEditing::panel_fit_autos(int all) {}
+void VWindowEditing::panel_set_editing_mode(int mode) {}
+void VWindowEditing::panel_set_auto_keyframes(int v) {}
+void VWindowEditing::panel_set_labels_follow_edits(int v) {}
+
+
VWindowSource::VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y)
: BC_PopupTextBox(vwindow,
&vwindow->sources,
void VWindowCanvas::close_source()
{
- gui->unlock_window();
- gui->vwindow->playback_engine->interrupt_playback(1);
- gui->lock_window("VWindowCanvas::close_source");
+ gui->vwindow->interrupt_playback(1);
gui->vwindow->delete_source(1, 1);
}
}
}
-int VWindowCanvas::get_fullscreen()
-{
- return mwindow->session->vwindow_fullscreen;
-}
-
-void VWindowCanvas::set_fullscreen(int value)
-{
- mwindow->session->vwindow_fullscreen = value;
-}
-