#include "pluginpopup.h"
#include "pluginset.h"
#include "preferences.h"
+#include "proxy.h"
#include "record.h"
#include "recordgui.h"
#include "renderengine.h"
cwindow_remote_handler = 0;
record_remote_handler = 0;
android_control = 0;
+// *** CONTEXT_HELP ***
+ context_help_set_keyword("Program Window");
}
int MWindowGUI::focus_in_event()
{
for(int i = 0; i < TOTAL_PANES; i++)
- if(pane[i]) pane[i]->cursor->focus_in_event();
+ if(pane[i] && pane[i]->cursor) pane[i]->cursor->focus_in_event();
return 1;
}
int MWindowGUI::focus_out_event()
{
for(int i = 0; i < TOTAL_PANES; i++)
- if(pane[i]) pane[i]->cursor->focus_out_event();
+ if(pane[i] && pane[i]->cursor) pane[i]->cursor->focus_out_event();
return 1;
}
//printf("MWindowGUI::resize_event %d\n", __LINE__);
mwindow->session->mwindow_w = w;
mwindow->session->mwindow_h = h;
- int x1 = get_w() - MainShBtns::calculate_w(-1, 0, -1) - xS(5);
+ int x1 = w - MainShBtns::calculate_w(-1, 0, -1) - xS(5);
mainshbtns->reposition_window(x1, -1);
int x2 = x1 - mwindow->theme->stack_button_w - xS(5);
stack_button->reposition_window(x2, stack_button->get_y());
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->canvas)
{
pane[i]->canvas->deactivate();
}
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->canvas)
{
pane[i]->canvas->draw_overlays();
if(flash_it) pane[i]->canvas->flash();
void MWindowGUI::update_proxy_toggle()
{
- int value = mwindow->edl->session->proxy_scale == 1 ? 1 : 0;
+ int value = mwindow->edl->session->proxy_state == PROXY_ACTIVE ? 0 : 1;
proxy_toggle->set_value(value);
- if( mwindow->edl->session->proxy_scale == 1 &&
- mwindow->edl->session->proxy_disabled_scale == 1 )
+ if( mwindow->edl->session->proxy_state == PROXY_INACTIVE )
proxy_toggle->hide();
else
proxy_toggle->show();
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->canvas)
{
pane[i]->canvas->refresh_plugintoggles();
}
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->canvas)
{
pane[i]->canvas->draw_indexes(indexable);
}
void MWindowGUI::draw_canvas(int redraw, int hide_cursor)
{
resource_thread->stop_draw(0);
-
- int mode = redraw ? FORCE_REDRAW : NORMAL_DRAW;
+ int mode = NORMAL_DRAW;
+ if( redraw ) {
+ mode = FORCE_REDRAW;
+ resource_pixmaps.remove_all_objects();
+ }
for(int i = 0; i < TOTAL_PANES; i++) {
if( pane[i] )
pane[i]->canvas->draw(mode, hide_cursor);
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->canvas)
{
pane[i]->canvas->flash(flush);
}
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->cursor)
{
pane[i]->cursor->draw(do_plugintoggles);
}
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->cursor)
{
pane[i]->cursor->show(do_plugintoggles);
}
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->cursor)
{
pane[i]->cursor->hide(do_plugintoggles);
}
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->cursor)
{
pane[i]->cursor->update();
}
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->cursor)
{
pane[i]->cursor->playing_back = value;
}
{
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i])
+ if(pane[i] && pane[i]->canvas)
{
pane[i]->canvas->update_cursor(flush);
}
if( do_canvas != NO_DRAW && do_canvas != IGNORE_THREAD )
resource_thread->stop_draw(1);
+ if( do_canvas == FORCE_REDRAW )
+ resource_pixmaps.remove_all_objects();
+
for(int i = 0; i < TOTAL_PANES; i++)
{
if(pane[i]) pane[i]->update(scrollbars,
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i]) pane[i]->canvas->drag_motion(
- &over_track,
- &over_edit,
- &over_pluginset,
- &over_plugin);
+ if(pane[i] && pane[i]->canvas)
+ pane[i]->canvas->drag_motion(&over_track, &over_edit,
+ &over_pluginset, &over_plugin);
}
if(mwindow->session->track_highlighted != over_track)
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i]) result |= pane[i]->canvas->drag_stop(
- &redraw);
+ if(pane[i] && pane[i]->canvas)
+ result |= pane[i]->canvas->drag_stop(&redraw);
}
mwindow->edl->optimize();
mwindow->cwindow->gui->unlock_window();
mwindow->awindow->gui->unlock_window();
//printf("MWindowGUI::default_positions 2\n");
+ mwindow->tile_mixers();
}
int result = 0;
for(int i = 0; i < TOTAL_PANES; i++)
{
- if(pane[i]) result = pane[i]->cursor->repeat_event(duration);
+ if(pane[i] && pane[i]->cursor)
+ result = pane[i]->cursor->repeat_event(duration);
}
return result;
}
if( result ) return result;
Track *this_track = 0, *first_track = 0;
- int collapse = 0, packed = 0, overwrite = 0, plugins = 0;
+ int packed = 0, overwrite = 0, plugins = 0;
double position = 0;
switch( get_keypress() ) {
result = 1;
break;
+ case '\'':
+ if( ctrl_down() && alt_down() ) {
+ mwindow->select_edits(1);
+ result = 1;
+ }
+ break;
+
case 'e':
+ if( ctrl_down() || alt_down() ) break;
mwindow->toggle_editing_mode();
result = 1;
break;
result = 1;
break;
case 'M':
- collapse = 1;
+ mwindow->cut_selected_edits(0, 1);
+ result = 1;
+ break;
case BACKSPACE:
case 'm':
- mwindow->cut_selected_edits(0, collapse);
+ mwindow->cut_selected_edits(0, 0);
result = 1;
break;
case 'z':
- collapse = 1;
+ if( !alt_down() ) {
+ // z and ctrl-z both are undo, z mainmenu item
+ if( mwindow->session->current_operation == NO_OPERATION )
+ mwindow->undo_entry(this);
+ result = 1;
+ }
+ else if( ctrl_down() ) {
+ mwindow->cut_selected_edits(1, 1);
+ result = 1;
+ }
+ break;
case 'x':
if( !ctrl_down() || alt_down() ) break;
- mwindow->cut_selected_edits(1, collapse);
+ mwindow->cut_selected_edits(1, 0);
result = 1;
break;
if(result)
cursor_motion_event();
+ if(!result)
+ result = context_help_check_and_show();
+
return result;
}
}
}
+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"))
{
this->mwindow = mwindow;
this->mbuttons = mbuttons;
set_tooltip(get_value() ? FFMPEG_EARLY_TIP : FFMPEG_LATE_TIP);
+// *** CONTEXT_HELP ***
+ context_help_set_keyword("FFmpeg Early Probe Explanation");
}
FFMpegToggle::~FFMpegToggle()
{
this->mwindow = mwindow;
set_tooltip(_("Close EDL"));
+// *** CONTEXT_HELP ***
+ context_help_set_keyword("OpenEDL");
}
int StackButton::handle_event()
: BC_Toggle(x, y, ( !mwindow->edl->session->proxy_use_scaler ?
mwindow->theme->proxy_p_toggle :
mwindow->theme->proxy_s_toggle ),
- mwindow->edl->session->proxy_disabled_scale != 1)
+ mwindow->edl->session->proxy_state == PROXY_DISABLED)
{
this->mwindow = mwindow;
this->mbuttons = mbuttons;
scaler_images = mwindow->edl->session->proxy_use_scaler;
- set_tooltip(mwindow->edl->session->proxy_disabled_scale==1 ?
+ set_tooltip(mwindow->edl->session->proxy_state!=PROXY_DISABLED ?
_("Disable proxy") : _("Enable proxy"));
+// *** CONTEXT_HELP ***
+ context_help_set_keyword("Proxy");
}
void ProxyToggle::show()
mwindow->enable_proxy();
mwindow->gui->lock_window("ProxyToggle::handle_event");
set_tooltip(!disabled ? _("Disable proxy") : _("Enable proxy"));
+ ProxyDialog *dialog = mwindow->gui->mainmenu->proxy->dialog;
+ if( dialog && dialog->gui ) {
+ dialog->gui->lock_window("ProxyToggle::handle_event");
+ dialog->gui->update();
+ dialog->gui->unlock_window();
+ }
return 1;
}
return handle_event();
}
}
- return 0;
+ return context_help_check_and_show();
}