From: Good Guy Date: Fri, 15 Mar 2019 21:08:54 +0000 (-0600) Subject: fix popup_menu icon placement, add layout_name feature, preset edit resize wdw fix... X-Git-Tag: 2019-08~82 X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=4710b00debcb86b8ff626c4af3473afe338408ae;p=goodguy%2Fcinelerra.git fix popup_menu icon placement, add layout_name feature, preset edit resize wdw fix, xin rmt ctl fix full scrn, sphere-o-boom --- diff --git a/cinelerra-5.1/cinelerra/asset.C b/cinelerra-5.1/cinelerra/asset.C index ad5c5c8d..e2fc242a 100644 --- a/cinelerra-5.1/cinelerra/asset.C +++ b/cinelerra-5.1/cinelerra/asset.C @@ -949,7 +949,7 @@ int Asset::dump(FILE *fp) 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; } diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index a88acce6..265f31ae 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -1490,7 +1490,7 @@ void AWindowGUI::create_objects() 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(); @@ -3335,7 +3335,7 @@ int AVIconDrawingItem::handle_event() 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); } @@ -3343,7 +3343,7 @@ int AVIconDrawing::draw_face(int dx, int color) } 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; } diff --git a/cinelerra-5.1/cinelerra/canvas.C b/cinelerra-5.1/cinelerra/canvas.C index 14e4351d..85316aaa 100644 --- a/cinelerra-5.1/cinelerra/canvas.C +++ b/cinelerra-5.1/cinelerra/canvas.C @@ -767,8 +767,7 @@ void Canvas::create_canvas() 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() || @@ -777,26 +776,21 @@ void Canvas::create_canvas() 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(); diff --git a/cinelerra-5.1/cinelerra/keyframegui.C b/cinelerra-5.1/cinelerra/keyframegui.C index 49c90229..03c8804b 100644 --- a/cinelerra-5.1/cinelerra/keyframegui.C +++ b/cinelerra-5.1/cinelerra/keyframegui.C @@ -74,6 +74,7 @@ KeyFrameThread::~KeyFrameThread() #ifdef EDIT_KEYFRAME + void KeyFrameThread::update_values() { // Get the current selection before deleting the tables @@ -139,8 +140,8 @@ void KeyFrameThread::update_values() } mwindow->gui->unlock_window(); } -#endif +#endif void KeyFrameThread::start_window(Plugin *plugin, KeyFrame *keyframe) { @@ -378,6 +379,7 @@ void KeyFrameThread::apply_preset(const char *title, int is_factory) } #ifdef EDIT_KEYFRAME + void KeyFrameThread::apply_value() { const char *text = 0, *data = 0; @@ -446,25 +448,16 @@ printf("KeyFrameThread::apply_value %d: plugin doesn't exist\n", __LINE__); 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; @@ -481,42 +474,40 @@ void KeyFrameWindow::create_objects() #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, @@ -546,8 +537,6 @@ void KeyFrameWindow::update_editing() } } - - int KeyFrameWindow::resize_event(int w, int h) { Theme *theme = mwindow->theme; @@ -556,35 +545,33 @@ int KeyFrameWindow::resize_event(int w, int h) 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, @@ -607,7 +594,6 @@ int KeyFrameWindow::resize_event(int w, int h) #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, @@ -639,8 +625,6 @@ int KeyFrameList::column_resize_event() } - - // KeyFrameText::KeyFrameText(KeyFrameThread *thread, // KeyFrameWindow *window, // int x, @@ -661,8 +645,6 @@ int KeyFrameList::column_resize_event() // return 0; // } - - KeyFrameValue::KeyFrameValue(KeyFrameThread *thread, KeyFrameWindow *window, int x, @@ -684,16 +666,9 @@ int KeyFrameValue::handle_event() 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")) { @@ -710,26 +685,9 @@ int KeyFrameAll::handle_event() #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; @@ -815,12 +773,6 @@ int KeyFramePresetsSave::handle_event() } - - - - - - KeyFramePresetsApply::KeyFramePresetsApply(KeyFrameThread *thread, KeyFrameWindow *window, int x, diff --git a/cinelerra-5.1/cinelerra/mainmenu.C b/cinelerra-5.1/cinelerra/mainmenu.C index da1dbd33..2fb2fcf9 100644 --- a/cinelerra-5.1/cinelerra/mainmenu.C +++ b/cinelerra-5.1/cinelerra/mainmenu.C @@ -1617,10 +1617,10 @@ int TileMixers::handle_event() } -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]; @@ -1630,16 +1630,19 @@ LoadLayoutItem::LoadLayoutItem(LoadLayout *load_layout, const char *text, int no } } + 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; } @@ -1649,19 +1652,185 @@ LoadLayout::LoadLayout(MWindow *mwindow, const char *text, int action) { 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; iadd_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; iget_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='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(); +} + diff --git a/cinelerra-5.1/cinelerra/mainmenu.h b/cinelerra-5.1/cinelerra/mainmenu.h index 2e965f41..64c86591 100644 --- a/cinelerra-5.1/cinelerra/mainmenu.h +++ b/cinelerra-5.1/cinelerra/mainmenu.h @@ -721,7 +721,9 @@ public: 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; }; @@ -729,10 +731,53 @@ class LoadLayout : public BC_MenuItem { 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 diff --git a/cinelerra-5.1/cinelerra/mainmenu.inc b/cinelerra-5.1/cinelerra/mainmenu.inc index e372c2b6..81dd0c10 100644 --- a/cinelerra-5.1/cinelerra/mainmenu.inc +++ b/cinelerra-5.1/cinelerra/mainmenu.inc @@ -22,32 +22,8 @@ #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; @@ -119,5 +95,8 @@ class SplitY; class MixerViewer; class LoadLayoutItem; class LoadLayout; +class LoadLayoutDialog; +class LoadLayoutNameText; +class LoadLayoutConfirm; #endif diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 979d7e87..da6056d9 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -2920,25 +2920,30 @@ void MWindow::restore_windows() 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; diff --git a/cinelerra-5.1/cinelerra/mwindow.h b/cinelerra-5.1/cinelerra/mwindow.h index e2a0a73b..3add4e79 100644 --- a/cinelerra-5.1/cinelerra/mwindow.h +++ b/cinelerra-5.1/cinelerra/mwindow.h @@ -140,8 +140,9 @@ public: 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); diff --git a/cinelerra-5.1/cinelerra/mwindow.inc b/cinelerra-5.1/cinelerra/mwindow.inc index 017ca2e2..8e3f97bd 100644 --- a/cinelerra-5.1/cinelerra/mwindow.inc +++ b/cinelerra-5.1/cinelerra/mwindow.inc @@ -95,6 +95,7 @@ N_("Cinelerra: File format") N_("Cinelerra: File Format") N_("Cinelerra: Goto position") N_("Cinelerra: Label Info") +N_("Cinelerra: Layout") N_("Cinelerra: Levels") N_("Cinelerra: Load") N_("Cinelerra: Loading") diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index 7cdd58f7..b3209c83 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -270,7 +270,7 @@ void MWindowGUI::create_objects() 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)); @@ -411,7 +411,7 @@ int MWindowGUI::resize_event(int w, int h) //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); diff --git a/cinelerra-5.1/cinelerra/mwindowmove.C b/cinelerra-5.1/cinelerra/mwindowmove.C index d64b6c1b..9d8dae5c 100644 --- a/cinelerra-5.1/cinelerra/mwindowmove.C +++ b/cinelerra-5.1/cinelerra/mwindowmove.C @@ -500,21 +500,10 @@ int MWindow::goto_start() 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; } diff --git a/cinelerra-5.1/cinelerra/preferences.inc b/cinelerra-5.1/cinelerra/preferences.inc index d1a30f95..00686a45 100644 --- a/cinelerra-5.1/cinelerra/preferences.inc +++ b/cinelerra-5.1/cinelerra/preferences.inc @@ -27,6 +27,8 @@ #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") diff --git a/cinelerra-5.1/cinelerra/renderengine.C b/cinelerra-5.1/cinelerra/renderengine.C index faba9615..aa16aafa 100644 --- a/cinelerra-5.1/cinelerra/renderengine.C +++ b/cinelerra-5.1/cinelerra/renderengine.C @@ -467,12 +467,12 @@ void RenderEngine::run() 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; diff --git a/cinelerra-5.1/cinelerra/vpatchgui.C b/cinelerra-5.1/cinelerra/vpatchgui.C index 5fa6eb94..f5c572d8 100644 --- a/cinelerra-5.1/cinelerra/vpatchgui.C +++ b/cinelerra-5.1/cinelerra/vpatchgui.C @@ -258,7 +258,7 @@ int VKeyFadeSlider::handle_event() 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; diff --git a/cinelerra-5.1/cinelerra/zoombar.C b/cinelerra-5.1/cinelerra/zoombar.C index e98f7002..51d0df73 100644 --- a/cinelerra-5.1/cinelerra/zoombar.C +++ b/cinelerra-5.1/cinelerra/zoombar.C @@ -489,7 +489,7 @@ int AutoTypeMenu::draw_face(int dx, int color) 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); } diff --git a/cinelerra-5.1/guicast/bcmenuitem.h b/cinelerra-5.1/guicast/bcmenuitem.h index 5b40a05c..5c04b0fa 100644 --- a/cinelerra-5.1/guicast/bcmenuitem.h +++ b/cinelerra-5.1/guicast/bcmenuitem.h @@ -52,8 +52,8 @@ public: 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); diff --git a/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_dn.png b/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_dn.png index 5b1e133b..ebb6e276 100644 Binary files a/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_dn.png and b/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_dn.png differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_hi.png b/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_hi.png index 3bba6408..b9e4a60b 100644 Binary files a/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_hi.png and b/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_hi.png differ diff --git a/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_up.png b/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_up.png index 07731825..7267a3e5 100644 Binary files a/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_up.png and b/cinelerra-5.1/plugins/theme_neophyte/data/shbtn_up.png differ