From: Good Guy Date: Sat, 1 Jul 2017 20:17:39 +0000 (-0600) Subject: rendering took msg, bg render active test, crikey show window X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=6f8a01f30489bde88280931c3ef9ea4edeb44d0f;p=goodguy%2Fhistory.git rendering took msg, bg render active test, crikey show window --- diff --git a/cinelerra-5.1/cinelerra/mainprogress.C b/cinelerra-5.1/cinelerra/mainprogress.C index afc21983..4df440dd 100644 --- a/cinelerra-5.1/cinelerra/mainprogress.C +++ b/cinelerra-5.1/cinelerra/mainprogress.C @@ -74,7 +74,7 @@ void MainProgressBar::stop_progress() { mwindow->gui->lock_window("MainProgressBar::stop_progress"); progress_bar->update(0); - mwindow->gui->statusbar->default_message(); + mwindow->gui->default_message(); mwindow->gui->unlock_window(); } } diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 75dc29ac..3a4aee8b 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -1193,7 +1193,7 @@ int MWindow::brender_available(int position) { int result = 0; brender_lock->lock("MWindow::brender_available 1"); - if(brender) + if(brender && brender_active) { if(brender->map_valid) { @@ -1226,8 +1226,10 @@ void MWindow::set_brender_active(int v, int update) } restart_brender(); } - else + else { + edl->session->brender_start = edl->session->brender_end = 0; stop_brender(); + } if( update ) { gui->update_timebar(0); gui->draw_overlays(1); diff --git a/cinelerra-5.1/cinelerra/mwindowgui.C b/cinelerra-5.1/cinelerra/mwindowgui.C index ed12ca65..a39e7f9e 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.C +++ b/cinelerra-5.1/cinelerra/mwindowgui.C @@ -382,6 +382,12 @@ void MWindowGUI::redraw_time_dependancies() mainclock->update(mwindow->edl->local_session->get_selectionstart(1)); } +int MWindowGUI::cursor_enter_event() +{ + reset_default_message(); + return 0; +} + int MWindowGUI::focus_in_event() { for(int i = 0; i < TOTAL_PANES; i++) @@ -918,16 +924,22 @@ int MWindowGUI::visible(int64_t x1, int64_t x2, int64_t view_x1, int64_t view_x2 } -int MWindowGUI::show_message(char *message, int color) +void MWindowGUI::show_message(const char *message, int color) { -// printf("MWindowGUI::show_message %d: %s 0x%08x 0x%08x\n", -// __LINE__, message, color, mwindow->theme->message_normal); - if(color < 0) color = mwindow->theme->message_normal; - statusbar->status_text->set_color(color); - statusbar->status_text->update(message); - return 0; + statusbar->set_message(message, color); +} +void MWindowGUI::set_default_message(const char *message) +{ + statusbar->set_default_message(message); +} +void MWindowGUI::reset_default_message() +{ + statusbar->reset_default_message(); +} +void MWindowGUI::default_message() +{ + statusbar->default_message(); } - // Drag motion called from other window int MWindowGUI::drag_motion() diff --git a/cinelerra-5.1/cinelerra/mwindowgui.h b/cinelerra-5.1/cinelerra/mwindowgui.h index 54623284..5b8d6bfe 100644 --- a/cinelerra-5.1/cinelerra/mwindowgui.h +++ b/cinelerra-5.1/cinelerra/mwindowgui.h @@ -129,6 +129,7 @@ public: void set_meter_format(int mode, int min, int max); int translation_event(); + int cursor_enter_event(); int resize_event(int w, int h); // handle a resize event int button_release_event(); int keypress_event(); @@ -142,7 +143,10 @@ public: int menu_w(); int menu_h(); // Draw on the status bar only. - int show_message(char *message, int color = -1); + void show_message(const char *message, int color = -1); + void set_default_message(const char *message); + void reset_default_message(); + void default_message(); // Pop up a box if the statusbar is taken and show an error. void show_error(char *message, int color = BLACK); int repeat_event(int64_t duration); diff --git a/cinelerra-5.1/cinelerra/render.C b/cinelerra-5.1/cinelerra/render.C index d6db3811..642552d1 100644 --- a/cinelerra-5.1/cinelerra/render.C +++ b/cinelerra-5.1/cinelerra/render.C @@ -511,7 +511,7 @@ void Render::stop_progress() sprintf(string2, _("Rendering took %s"), string); mwindow->gui->lock_window(""); - mwindow->gui->show_message(string2); + mwindow->gui->set_default_message(string2); mwindow->gui->stop_hourglass(); mwindow->gui->unlock_window(); } diff --git a/cinelerra-5.1/cinelerra/statusbar.C b/cinelerra-5.1/cinelerra/statusbar.C index b2f0bcc6..02b92d05 100644 --- a/cinelerra-5.1/cinelerra/statusbar.C +++ b/cinelerra-5.1/cinelerra/statusbar.C @@ -72,7 +72,7 @@ void StatusBar::create_objects() mwindow->theme->mstatus_cancel_x, mwindow->theme->mstatus_cancel_y)); //printf("StatusBar::create_objects 1\n"); - default_message(); + reset_default_message(); flash(); } @@ -103,18 +103,26 @@ void StatusBar::resize_event() flash(0); } -void StatusBar::set_message(char *text) +void StatusBar::set_message(const char *text, int color) { + if( color < 0 ) color = mwindow->theme->message_normal; + status_text->set_color(color); status_text->update(text); } - +void StatusBar::set_default_message(const char *text) +{ + strcpy(default_msg, text); + default_message(); +} +void StatusBar::reset_default_message() +{ + set_default_message(_("Welcome to cinelerra")); +} void StatusBar::default_message() { - status_text->set_color(mwindow->theme->message_normal); - status_text->update(_("Welcome to Cinelerra.")); + set_message(default_msg, mwindow->theme->message_normal); } - StatusBarCancel::StatusBarCancel(MWindow *mwindow, int x, int y) : BC_Button(x, y, mwindow->theme->statusbar_cancel_data) { diff --git a/cinelerra-5.1/cinelerra/statusbar.h b/cinelerra-5.1/cinelerra/statusbar.h index 9541eb20..726a08c2 100644 --- a/cinelerra-5.1/cinelerra/statusbar.h +++ b/cinelerra-5.1/cinelerra/statusbar.h @@ -34,8 +34,11 @@ public: StatusBar(MWindow *mwindow, MWindowGUI *gui); ~StatusBar(); - void set_message(char *text); + void set_message(const char *text, int color=-1); + void set_default_message(const char *text); + void reset_default_message(); void default_message(); + void create_objects(); void resize_event(); @@ -44,6 +47,7 @@ public: BC_ProgressBar *main_progress; StatusBarCancel *main_progress_cancel; BC_Title *status_text; + char default_msg[BCTEXTLEN]; }; class StatusBarCancel : public BC_Button diff --git a/cinelerra-5.1/plugins/crikey/crikeywindow.C b/cinelerra-5.1/plugins/crikey/crikeywindow.C index f8fcd1ff..06693891 100644 --- a/cinelerra-5.1/plugins/crikey/crikeywindow.C +++ b/cinelerra-5.1/plugins/crikey/crikeywindow.C @@ -75,15 +75,15 @@ void CriKeyDrawMode::create_objects() { for( int i=0; iplugin->config.draw_mode); + update(gui->plugin->config.draw_mode, 0); } -void CriKeyDrawMode::update(int mode) +void CriKeyDrawMode::update(int mode, int send) { if( this->mode == mode ) return; this->mode = mode; set_text(draw_modes[mode]); gui->plugin->config.draw_mode = mode; - gui->plugin->send_configure_change(); + if( send ) gui->plugin->send_configure_change(); } int CriKeyKeyModeItem::handle_event() @@ -104,15 +104,15 @@ void CriKeyKeyMode::create_objects() { for( int i=0; iplugin->config.key_mode); + update(gui->plugin->config.key_mode, 0); } -void CriKeyKeyMode::update(int mode) +void CriKeyKeyMode::update(int mode, int send) { if( this->mode == mode ) return; this->mode = mode; set_text(key_modes[mode]); gui->draw_key(mode); - gui->plugin->send_configure_change(); + if( send ) gui->plugin->send_configure_change(); } CriKeyColorButton::CriKeyColorButton(CriKeyWindow *gui, int x, int y) diff --git a/cinelerra-5.1/plugins/crikey/crikeywindow.h b/cinelerra-5.1/plugins/crikey/crikeywindow.h index 0814abaf..5af60d54 100644 --- a/cinelerra-5.1/plugins/crikey/crikeywindow.h +++ b/cinelerra-5.1/plugins/crikey/crikeywindow.h @@ -75,7 +75,7 @@ public: CriKeyDrawMode(CriKeyWindow *gui, int x, int y); void create_objects(); - void update(int mode); + void update(int mode, int send=1); CriKeyWindow *gui; int mode; }; @@ -97,7 +97,7 @@ public: CriKeyKeyMode(CriKeyWindow *gui, int x, int y); void create_objects(); - void update(int mode); + void update(int mode, int send=1); CriKeyWindow *gui; int mode; };