video_data, layers, program, frame_rate, width, height,
vcodec, aspect_ratio,string);
fprintf(fp," video_length %jd repeat %d\n", video_length, single_frame);
- printf(" mov_sphere=%d jpeg_sphere=%d\n", mov_sphere, jpeg_sphere);
+ fprintf(fp," mov_sphere=%d jpeg_sphere=%d\n", mov_sphere, jpeg_sphere);
return 0;
}
int nw = get_text_width(MEDIUMFONT, _(av_names[i]));
if( tw < nw ) tw = nw;
}
- int pw = BC_PopupMenu::calculate_w(4, tw, -1) + 16;
+ int pw = BC_PopupMenu::calculate_w(4, tw, 1) + 16;
const char *text = _(AVIconDrawing::avicon_names[vicon_drawing]);
add_subwindow(avicon_drawing = new AVIconDrawing(this, fw, fy, pw, text));
avicon_drawing->create_objects();
int AVIconDrawing::draw_face(int dx, int color)
{
int ret = BC_PopupMenu::draw_face(dx, color);
- if( agui->play_off ) {
+ if( agui->play_off && agui->vicon_drawing != AVICON_NO_PLAY ) {
int lx = get_margin(), ly = get_h()/2;
draw_line(lx,ly, get_w()-2*lx,ly);
}
}
AVIconDrawing::AVIconDrawing(AWindowGUI *agui, int x, int y, int w, const char *text)
- : BC_PopupMenu(x-w, y, w, text, -1, 0, 4)
+ : BC_PopupMenu(x-w, y, w, text, 1, 0, 4)
{
this->agui = agui;
}
int x, y, w, h;
wdw->get_fullscreen_geometry(x, y, w, h);
- if( canvas_fullscreen )
- {
+ if( canvas_fullscreen ) {
if( x != canvas_fullscreen->get_x() ||
y != canvas_fullscreen->get_y() ||
w != canvas_fullscreen->get_w() ||
canvas_fullscreen = 0;
}
}
- if(!canvas_fullscreen)
- {
+ if( !canvas_fullscreen )
canvas_fullscreen = new CanvasFullScreen(this, w, h);
- }
- else
- {
- canvas_fullscreen->reposition_window(x, y);
- canvas_fullscreen->show_window();
- }
+ canvas_fullscreen->show_window();
+ canvas_fullscreen->sync_display();
+ canvas_fullscreen->reposition_window(x, y);
}
-
- if(!video_on)
- {
+ if( !video_on ) {
get_canvas()->lock_window("Canvas::create_canvas 1");
draw_refresh();
get_canvas()->unlock_window();
}
- if(video_on) get_canvas()->start_video();
+ if( video_on )
+ get_canvas()->start_video();
get_canvas()->lock_window("Canvas::create_canvas 2");
get_canvas()->focus();
#ifdef EDIT_KEYFRAME
+
void KeyFrameThread::update_values()
{
// Get the current selection before deleting the tables
}
mwindow->gui->unlock_window();
}
-#endif
+#endif
void KeyFrameThread::start_window(Plugin *plugin, KeyFrame *keyframe)
{
}
#ifdef EDIT_KEYFRAME
+
void KeyFrameThread::apply_value()
{
const char *text = 0, *data = 0;
get_gui()->lock_window("KeyFrameThread::apply_value");
delete hash;
}
-#endif
+#endif
-KeyFrameWindow::KeyFrameWindow(MWindow *mwindow,
- KeyFrameThread *thread,
- int x,
- int y,
- char *title_string)
- : BC_Window(title_string,
- x,
- y,
- mwindow->session->keyframedialog_w,
- mwindow->session->keyframedialog_h,
- 320,
- 240,
- 1,
- 0,
- 1)
+KeyFrameWindow::KeyFrameWindow(MWindow *mwindow, KeyFrameThread *thread,
+ int x, int y, char *title_string)
+ : BC_Window(title_string, x, y,
+ mwindow->session->keyframedialog_w,
+ mwindow->session->keyframedialog_h,
+ 320, 240, 1, 0, 1)
{
this->mwindow = mwindow;
this->thread = thread;
#ifdef EDIT_KEYFRAME
-
- add_subwindow(title1 = new BC_Title(theme->keyframe_list_x,
- theme->keyframe_list_y - BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) -
- theme->widget_border, _("Keyframe parameters:"), LARGEFONT));
- add_subwindow(keyframe_list = new KeyFrameList(thread,
- this,
- theme->keyframe_list_x,
- theme->keyframe_list_y,
- theme->keyframe_list_w,
- theme->keyframe_list_h));
+ int ky = theme->keyframe_list_y - theme->widget_border -
+ BC_Title::calculate_h(this, (char*)"Py", LARGEFONT);
+ add_subwindow(title1 = new BC_Title(theme->keyframe_list_x, ky,
+ _("Keyframe parameters:"), LARGEFONT));
+ add_subwindow(keyframe_list = new KeyFrameList(thread, this,
+ theme->keyframe_list_x, theme->keyframe_list_y,
+ theme->keyframe_list_w, theme->keyframe_list_h));
// add_subwindow(title2 = new BC_Title(theme->keyframe_text_x,
-// theme->keyframe_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border,
-// _("Global Text:")));
-// add_subwindow(keyframe_text = new KeyFrameText(thread,
-// this,
-// theme->keyframe_text_x,
-// theme->keyframe_text_y,
+// theme->keyframe_text_y - theme->widget_border -
+// BC_Title::calculate_h(this, "P"), _("Global Text:")));
+// add_subwindow(keyframe_text = new KeyFrameText(thread, this,
+// theme->keyframe_text_x, theme->keyframe_text_y,
// theme->keyframe_text_w));
- add_subwindow(title3 = new BC_Title(theme->keyframe_value_x,
- theme->keyframe_value_y - BC_Title::calculate_h(this, (char*)"P") -
- theme->widget_border, _("Edit value:")));
+ int ey = theme->keyframe_value_y - theme->widget_border -
+ BC_Title::calculate_h(this, "P");
+ add_subwindow(title3 = new BC_Title(theme->keyframe_value_x, ey,
+ _("Edit value:")));
add_subwindow(value_text = new KeyFrameValue(thread, this,
theme->keyframe_value_x, theme->keyframe_value_y, theme->keyframe_value_w));
add_subwindow(all_toggle = new KeyFrameAll(thread, this,
theme->keyframe_all_x, theme->keyframe_all_y));
#endif
- add_subwindow(title4 = new BC_Title(theme->presets_list_x, theme->presets_list_y -
- BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) -
- theme->widget_border, _("Presets:"), LARGEFONT));
+ int ty = theme->presets_list_y - theme->widget_border -
+ BC_Title::calculate_h(this, (char*)"Py", LARGEFONT);
+ add_subwindow(title4 = new BC_Title(theme->presets_list_x, ty,
+ _("Presets:"), LARGEFONT));
add_subwindow(preset_list = new KeyFramePresetsList(thread, this,
theme->presets_list_x, theme->presets_list_y,
theme->presets_list_w, theme->presets_list_h));
- add_subwindow(title5 = new BC_Title(theme->presets_text_x,
- theme->presets_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border,
- _("Preset title:")));
+ int py = theme->presets_text_y - theme->widget_border -
+ BC_Title::calculate_h(this, "Py");
+ add_subwindow(title5 = new BC_Title(theme->presets_text_x, py,
+ _("Preset title:")));
add_subwindow(preset_text = new KeyFramePresetsText(thread, this,
theme->presets_text_x, theme->presets_text_y, theme->presets_text_w));
add_subwindow(delete_preset = new KeyFramePresetsDelete(thread, this,
}
}
-
-
int KeyFrameWindow::resize_event(int w, int h)
{
Theme *theme = mwindow->theme;
theme->get_keyframedialog_sizes(this);
#ifdef EDIT_KEYFRAME
-
- title1->reposition_window(theme->keyframe_list_x,
- theme->keyframe_list_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
+ int ky = theme->keyframe_list_y - theme->widget_border -
+ BC_Title::calculate_h(this, (char*)"Py", LARGEFONT);
+ title1->reposition_window(theme->keyframe_list_x, ky);
// title2->reposition_window(theme->keyframe_text_x,
-// theme->keyframe_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
- title3->reposition_window(theme->keyframe_value_x,
- theme->keyframe_value_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
- keyframe_list->reposition_window(theme->keyframe_list_x,
- theme->keyframe_list_y,
- theme->keyframe_list_w,
- theme->keyframe_list_h);
-// text->reposition_window(theme->keyframe_text_x,
-// theme->keyframe_text_y,
-// theme->keyframe_text_w);
+// theme->keyframe_text_y - theme->widget_border -;
+// BC_Title::calculate_h(this, (char*)"P"));
+ int ey = theme->keyframe_value_y - theme->widget_border -
+ BC_Title::calculate_h(this, "P");
+ title3->reposition_window(theme->keyframe_value_x, ey);
+ keyframe_list->reposition_window(theme->keyframe_list_x, theme->keyframe_list_y,
+ theme->keyframe_list_w, theme->keyframe_list_h);
+// text->reposition_window(theme->keyframe_text_x, theme->keyframe_text_y,
+// theme->keyframe_text_w);
value_text->reposition_window(theme->keyframe_value_x,
theme->keyframe_value_y,
theme->keyframe_value_w);
all_toggle->reposition_window(theme->keyframe_all_x,
theme->keyframe_all_y);
-#endif // EDIT_KEYFRAME
-
-
-
+ int ty = theme->presets_list_y - theme->widget_border -
+ BC_Title::calculate_h(this, (char*)"Py", LARGEFONT);
+ title4->reposition_window(theme->presets_list_x, ty);
+ int py = theme->presets_text_y - theme->widget_border -
+ BC_Title::calculate_h(this, "Py");
+ title5->reposition_window(theme->presets_text_x, py);
+#endif
- title4->reposition_window(theme->presets_list_x,
- theme->presets_list_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
- title5->reposition_window(theme->presets_text_x,
- theme->presets_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border);
preset_list->reposition_window(theme->presets_list_x,
theme->presets_list_y,
theme->presets_list_w,
#ifdef EDIT_KEYFRAME
-
KeyFrameList::KeyFrameList(KeyFrameThread *thread,
KeyFrameWindow *window, int x, int y, int w, int h)
: BC_ListBox(x, y, w, h, LISTBOX_TEXT, thread->keyframe_data,
}
-
-
// KeyFrameText::KeyFrameText(KeyFrameThread *thread,
// KeyFrameWindow *window,
// int x,
// return 0;
// }
-
-
KeyFrameValue::KeyFrameValue(KeyFrameThread *thread,
KeyFrameWindow *window,
int x,
return 0;
}
-
-
-
-
KeyFrameAll::KeyFrameAll(KeyFrameThread *thread,
- KeyFrameWindow *window,
- int x,
- int y)
- : BC_CheckBox(x,
- y,
+ KeyFrameWindow *window, int x, int y)
+ : BC_CheckBox(x, y,
thread->mwindow->session->keyframedialog_all,
_("Apply to all selected keyframes"))
{
#endif // EDIT_KEYFRAME
-
-
-
-
-
-
-
-
KeyFramePresetsList::KeyFramePresetsList(KeyFrameThread *thread,
- KeyFrameWindow *window,
- int x,
- int y,
- int w,
- int h)
- : BC_ListBox(x,
- y,
- w,
- h,
- LISTBOX_TEXT,
- thread->presets_data)
+ KeyFrameWindow *window, int x, int y, int w, int h)
+ : BC_ListBox(x, y, w, h, LISTBOX_TEXT, thread->presets_data)
{
this->thread = thread;
this->window = window;
}
-
-
-
-
-
-
KeyFramePresetsApply::KeyFramePresetsApply(KeyFrameThread *thread,
KeyFrameWindow *window,
int x,
}
-LoadLayoutItem::LoadLayoutItem(LoadLayout *load_layout, const char *text, int no, int hotkey)
+LoadLayoutItem::LoadLayoutItem(LoadLayout *load_layout, const char *text, int idx, int hotkey)
: BC_MenuItem(text, "", hotkey)
{
- this->no = no;
+ this->idx = idx;
this->load_layout = load_layout;
if( hotkey ) {
char hot_txt[BCSTRLEN];
}
}
+
int LoadLayoutItem::handle_event()
{
MWindow *mwindow = load_layout->mwindow;
switch( load_layout->action ) {
case LAYOUT_LOAD:
- mwindow->load_layout(no);
- break;
- case LAYOUT_SAVE:
- mwindow->save_layout(no);
+ mwindow->load_layout(layout_file);
break;
+ case LAYOUT_SAVE: {
+ int wx = 0, wy = 0;
+ mwindow->gui->get_abs_cursor(wx, wy);
+ load_layout->layout_dialog->start_confirm_dialog(wx, wy, idx);
+ break; }
}
return 1;
}
{
this->mwindow = mwindow;
this->action = action;
+ this->layout_dialog = new LoadLayoutDialog(this);
+}
+
+LoadLayout::~LoadLayout()
+{
+ delete layout_dialog;
}
void LoadLayout::create_objects()
{
BC_SubMenu *layout_submenu = new BC_SubMenu();
add_submenu(layout_submenu);
- for( int i=1; i<=4; ++i ) {
+
+ for( int i=0; i<LAYOUTS_MAX; ++i ) {
char text[BCSTRLEN];
- sprintf(text, _("Layout %d"), i);
- LoadLayoutItem *load_layout_item =
- new LoadLayoutItem(this, text, i,
- action==LAYOUT_LOAD ? KEY_F1-1+i : 0);
- layout_submenu->add_submenuitem(load_layout_item);
+ sprintf(text, _("Layout %d"), i+1);
+ LoadLayoutItem *item = new LoadLayoutItem(this, text, i,
+ action==LAYOUT_LOAD ? KEY_F1+i : 0);
+ layout_submenu->add_submenuitem(item);
}
}
+int LoadLayout::activate_submenu()
+{
+ update();
+ return BC_MenuItem::activate_submenu();
+}
+
+void LoadLayout::update()
+{
+ FileSystem fs;
+ fs.set_filter("layout*_rc");
+ int ret = fs.update(File::get_config_path());
+ int sz = !ret ? fs.dir_list.size() : 0;
+ BC_SubMenu *layout_submenu = get_submenu();
+
+ for( int i=0; i<LAYOUTS_MAX; ++i ) {
+ LoadLayoutItem* item = (LoadLayoutItem *)
+ layout_submenu->get_item(i);
+ char layout_text[BCSTRLEN]; layout_text[0] = 0;
+ int n = sz, id = i+1;
+ while( --n >= 0 ) {
+ char *np = fs.dir_list[n]->name;
+ char *cp = strrchr(np, '_'), *bp = 0;
+ int no = strtol(np+6, &bp, 10);
+ if( no != id || !bp ) continue;
+ if( bp == cp ) { n = -1; break; }
+ if( *bp++ == '_' && bp < cp && !strcmp(cp, "_rc") ) {
+ int k = cp - bp; char *tp = layout_text;
+ if( k > LAYOUT_NAME_LEN ) k = LAYOUT_NAME_LEN;
+ while( --k >= 0 ) *tp++ = *bp++;
+ *tp = 0;
+ break;
+ }
+ }
+ strcpy(item->layout_text, layout_text);
+ char *lp = item->layout_file;
+ int k = sprintf(lp, LAYOUT_FILE, id);
+ if( n >= 0 && layout_text[0] )
+ sprintf(lp + k-2, "%s_rc", layout_text);
+ else
+ sprintf(layout_text, _("Layout %d"), id);
+ item->set_text(layout_text);
+ }
+}
+
+LoadLayoutDialog::LoadLayoutDialog(LoadLayout *load_layout)
+{
+ this->load_layout = load_layout;
+ wx = 0; wy = 0;
+ idx = -1;
+ lgui = 0;
+}
+
+LoadLayoutDialog::~LoadLayoutDialog()
+{
+ close_window();
+}
+
+void LoadLayoutDialog::handle_done_event(int result)
+{
+ if( result ) return;
+ char layout_file[BCSTRLEN];
+ BC_SubMenu *layout_submenu = load_layout->get_submenu();
+ LoadLayoutItem* item =
+ (LoadLayoutItem *) layout_submenu->get_item(idx);
+ snprintf(layout_file, sizeof(layout_file), "%s", item->layout_file);
+ load_layout->mwindow->delete_layout(layout_file);
+ int k = sprintf(layout_file, LAYOUT_FILE, idx+1);
+ const char *text = lgui->name_text->get_text();
+ if( text[0] )
+ snprintf(layout_file + k-2, sizeof(layout_file)-k+2, "%s_rc", text);
+ load_layout->mwindow->save_layout(layout_file);
+}
+
+void LoadLayoutDialog::handle_close_event(int result)
+{
+ lgui = 0;
+}
+
+BC_Window *LoadLayoutDialog::new_gui()
+{
+ lgui = new LoadLayoutConfirm(this, wx, wy);
+ lgui->create_objects();
+ return lgui;
+}
+
+void LoadLayoutDialog::start_confirm_dialog(int wx, int wy, int idx)
+{
+ close_window();
+ this->wx = wx; this->wy = wy;
+ this->idx = idx;
+ start();
+}
+
+LoadLayoutNameText::LoadLayoutNameText(LoadLayoutConfirm *confirm,
+ int x, int y, int w, const char *text)
+ : BC_TextBox(x, y, w, 1, text)
+{
+ this->confirm = confirm;
+}
+
+LoadLayoutNameText::~LoadLayoutNameText()
+{
+}
+
+int LoadLayoutNameText::handle_event()
+{
+ const char *text = get_text();
+ int len = strlen(text), k = 0;
+ char new_text[BCTEXTLEN];
+ for( int i=0; i<len; ++i ) {
+ int ch = text[i];
+ if( (ch>='A' && ch<='Z') || (ch>='a' && ch<='z') ||
+ (ch>='0' && ch<='9') || ch=='_' )
+ new_text[k++] = ch;
+ }
+ new_text[k] = 0; len = k;
+ int i = len - LAYOUT_NAME_LEN;
+ if( i >= 0 ) {
+ k = 0;
+ while( i < len ) new_text[k++] = new_text[i++];
+ new_text[k] = 0;
+ }
+ update(new_text);
+ return 1;
+}
+
+LoadLayoutConfirm::LoadLayoutConfirm(LoadLayoutDialog *layout_dialog, int x, int y)
+ : BC_Window(_(PROGRAM_NAME ": Layout"), x, y, 300,140, 300,140, 0)
+{
+ this->layout_dialog = layout_dialog;
+}
+
+LoadLayoutConfirm::~LoadLayoutConfirm()
+{
+}
+
+void LoadLayoutConfirm::create_objects()
+{
+ lock_window("LoadLayoutConfirm::create_objects");
+ int x = 10, y = 10, pad = 10;
+ BC_SubMenu *layout_submenu = layout_dialog->load_layout->get_submenu();
+ LoadLayoutItem *item = (LoadLayoutItem *)
+ layout_submenu->get_item(layout_dialog->idx);
+ BC_Title *title;
+ add_subwindow(title = new BC_Title(x, y, _("Layout Name:")));
+ int x1 = x + title->get_w() + 10;
+ add_subwindow(title = new BC_Title(x1, y, item->get_text()));
+ y += title->get_h() + pad;
+ add_subwindow(name_text = new LoadLayoutNameText(this,
+ x, y, get_w()-x-20, item->layout_text));
+ y += name_text->get_h();
+ x1 = x + 80;
+ char legend[BCTEXTLEN];
+ sprintf(legend, _("a-z,A-Z,0-9_ only, %dch max"), LAYOUT_NAME_LEN);
+ add_subwindow(title = new BC_Title(x1, y, legend));
+ add_subwindow(new BC_OKButton(this));
+ add_subwindow(new BC_CancelButton(this));
+ unlock_window();
+}
+
LoadLayoutItem(LoadLayout *load_layout, const char *text, int no, int hotkey);
int handle_event();
- int no;
+ int idx;
+ char layout_text[BCSTRLEN];
+ char layout_file[BCSTRLEN];
LoadLayout *load_layout;
};
{
public:
LoadLayout(MWindow *mwindow, const char *text, int action);
+ ~LoadLayout();
void create_objects();
+ void update();
+ int activate_submenu();
MWindow *mwindow;
+ LoadLayoutDialog *layout_dialog;
int action;
};
+class LoadLayoutDialog : public BC_DialogThread
+{
+public:
+ LoadLayoutDialog(LoadLayout *load_layout);
+ ~LoadLayoutDialog();
+
+ void start_confirm_dialog(int wx, int wy, int idx);
+ void handle_done_event(int result);
+ void handle_close_event(int result);
+ BC_Window* new_gui();
+
+ LoadLayout *load_layout;
+ LoadLayoutConfirm *lgui;
+ int wx, wy, idx;
+};
+
+class LoadLayoutNameText : public BC_TextBox
+{
+public:
+ LoadLayoutNameText(LoadLayoutConfirm *confirm,
+ int x, int y, int w, const char *text);
+ ~LoadLayoutNameText();
+
+ int handle_event();
+
+ LoadLayoutConfirm *confirm;
+};
+
+class LoadLayoutConfirm : public BC_Window
+{
+public:
+ LoadLayoutConfirm(LoadLayoutDialog *load_dialog, int x, int y);
+ ~LoadLayoutConfirm();
+ void create_objects();
+
+ LoadLayoutDialog *layout_dialog;
+ LoadLayoutNameText *name_text;
+};
+
#endif
#ifndef MAINMENU_INC
#define MAINMENU_INC
-class MainMenu;
#define MENUBARPIXELS 25
-class AEffectMenu;
-class LabelsFollowEdits;
-class PluginsFollowEdits;
-class KeyframesFollowEdits;
-class CursorOnFrames;
-class TypelessKeyframes;
-class SetBRenderActive;
-class LoopPlayback;
-class Redo;
-class ShowVWindow;
-class ShowAWindow;
-class ShowGWindow;
-class ShowCWindow;
-class ShowLWindow;
-class Undo;
-class KeyframeCurveType;
-class KeyframeCurveTypeMenu;
-class KeyframeCurveTypeItem;
-class SplitX;
-class SplitY;
-class MixerViewer;
-class LoadLayoutItem;
-class LoadLayout;
class MainMenu;
class Undo;
class MainDumpsSubMenu;
class MixerViewer;
class LoadLayoutItem;
class LoadLayout;
+class LoadLayoutDialog;
+class LoadLayoutNameText;
+class LoadLayoutConfirm;
#endif
gui->focus();
}
-void MWindow::save_layout(int no)
+void MWindow::load_layout(const char *layout)
{
- char layout_path[BCTEXTLEN];
- snprintf(layout_path, sizeof(layout_path), "%s/" LAYOUT_FILE,
- File::get_config_path(), no);
- session->save_file(layout_path);
-}
-
-void MWindow::load_layout(int no)
-{
- char layout_path[BCTEXTLEN];
- snprintf(layout_path, sizeof(layout_path), "%s/" LAYOUT_FILE,
- File::get_config_path(), no);
- session->load_file(layout_path);
+ char path[BCTEXTLEN];
+ snprintf(path, sizeof(path), "%s/%s", File::get_config_path(), layout);
+ session->load_file(path);
restore_windows();
gui->default_positions();
save_defaults();
}
+void MWindow::save_layout(const char *layout)
+{
+ char path[BCTEXTLEN];
+ snprintf(path, sizeof(path), "%s/%s", File::get_config_path(), layout);
+ session->save_file(path);
+}
+
+void MWindow::delete_layout(const char *layout)
+{
+ char path[BCTEXTLEN];
+ snprintf(path, sizeof(path), "%s/%s", File::get_config_path(), layout);
+ unlink(path);
+}
+
int MWindow::tile_windows(int window_config)
{
int need_reload = 0;
void show_gwindow();
void hide_gwindow();
void restore_windows();
- void save_layout(int no);
- void load_layout(int no);
+ void load_layout(const char *layout);
+ void save_layout(const char *layout);
+ void delete_layout(const char *layout);
int tile_windows(int window_config);
char *get_cwindow_display();
void set_screens(int value);
N_("Cinelerra: File Format")
N_("Cinelerra: Goto position")
N_("Cinelerra: Label Info")
+N_("Cinelerra: Layout")
N_("Cinelerra: Levels")
N_("Cinelerra: Load")
N_("Cinelerra: Loading")
if(debug) printf("MWindowGUI::create_objects %d\n", __LINE__);
- int x = get_w() - MainShBtns::calculate_w(0);
+ int x = get_w() - MainShBtns::calculate_w(-1, 0, -1);
add_subwindow(mainmenu = new MainMenu(mwindow, this, x));
mainmenu->create_objects();
add_subwindow(mainshbtns = new MainShBtns(mwindow, x, -1));
//printf("MWindowGUI::resize_event %d\n", __LINE__);
mwindow->session->mwindow_w = w;
mwindow->session->mwindow_h = h;
- int x = w - MainShBtns::calculate_w(0);
+ int x = w - MainShBtns::calculate_w(-1, 0, -1);
mainmenu->resize_event(x, mainmenu->get_h());
mainshbtns->reposition_window(x, -1);
mwindow->theme->get_mwindow_sizes(this, w, h);
int MWindow::goto_position(double position)
{
- TimelinePane *pane = gui->get_focused_pane();
- int64_t old_view_start = edl->local_session->view_start[pane->number];
- edl->local_session->set_selectionstart(position);
- edl->local_session->set_selectionend(position);
- find_cursor();
- int64_t new_view_start = edl->local_session->view_start[pane->number];
- if(new_view_start != old_view_start)
- samplemovement(new_view_start, pane->number);
- update_plugin_guis();
- gui->update_patchbay();
- gui->update_cursor();
+ position = edl->align_to_frame(position, 0);
+ if( position < 0 ) position = 0;
+ select_point(position);
gui->activate_timeline();
- gui->zoombar->update();
- gui->update_timebar(1);
- cwindow->update(1, 0, 0, 0, 1);
return 0;
}
#define BACKUP_FILE "backup.xml"
#define BACKUP_FILE1 "backup.prev"
#define LAYOUT_FILE "layout%d_rc"
+#define LAYOUT_NAME_LEN 8
+#define LAYOUTS_MAX 4
#define DEFAULT_LV2_PATH CINDAT_DIR "/lv2"
#define FFMPEG_EARLY_TIP _("Currently: Try FFMpeg first\n Click to: Try FFMpeg last")
#define FFMPEG_LATE_TIP _("Currently: Try FFMpeg last\n Click to: Try FFMpeg first")
close_output();
- if( playback_engine && playback_engine->is_playing_back ) {
- double position = interrupted ?
- playback_engine->get_tracking_position() :
- command->get_direction() == PLAY_FORWARD ?
- command->end_position :
- command->start_position;
+ if( playback_engine ) {
+ double position = command->single_frame() ? command->playbackstart :
+ playback_engine->is_playing_back && !interrupted ?
+ ( command->get_direction() == PLAY_FORWARD ?
+ command->end_position : command->start_position ) :
+ playback_engine->get_tracking_position() ;
if( command->displacement ) {
position -= 1./command->get_edl()->session->frame_rate;
if( position < 0 ) position = 0;
VModePatch::VModePatch(MWindow *mwindow, VPatchGUI *patch, int x, int y)
: BC_PopupMenu(x, y, patch->patchbay->mode_icons[0]->get_w() + 20,
- "", 1, mwindow->theme->get_image_set("mode_popup", 0), 10)
+ "", 1, mwindow->theme->get_image_set("mode_popup", 0), 0)
{
this->mwindow = mwindow;
this->patch = patch;
if( color >= 0 ) {
set_color(color);
int margin = get_margin();
- int mx = margin+4, my = 3*margin/8;
+ int mx = margin+8, my = 3*margin/8;
int bh = get_h() - 2*my;
draw_box(mx,my, bh,bh);
}
int set_alt(int value = 1);
void set_ctrl(int value = 1);
- int deactivate_submenus(BC_MenuPopup *exclude);
- int activate_submenu();
+ virtual int deactivate_submenus(BC_MenuPopup *exclude);
+ virtual int activate_submenu();
virtual int handle_event() { return 0; };
int dispatch_button_press();
int dispatch_button_release(int &redraw);