X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=8824b86872be7cd9430fbdddff51c639a2035935;hb=4784a8d70bc39f9b7e467f93304d2df3f23fd2df;hp=8fc55bca298377f259094e6101bd75ae39c038c5;hpb=4b6c39e6cf4a3fd9c1b347db6de686ab55d6cac8;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index 8fc55bca..8824b868 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -733,6 +733,66 @@ void MWindow::add_plugins(ArrayList &plugins) plugins.remove_all(); } +void MWindow::init_plugin_tips(ArrayList &plugins) +{ + const char *cfg_path = File::get_cindat_path(); + char msg_path[BCTEXTLEN]; int txt = 0; + FILE *fp = 0; + if( BC_Resources::language[0] ) { + snprintf(msg_path, sizeof(msg_path), "%s/info/plugins.%s", + cfg_path, BC_Resources::language); + fp = fopen(msg_path, "r"); + } + if( !fp ) { + txt = 1; + snprintf(msg_path, sizeof(msg_path), "%s/info/plugins.txt", + cfg_path); + fp = fopen(msg_path, "r"); + } + if( !fp ) return; + char text[BCTEXTLEN]; + char *tp = text, *ep = tp + sizeof(text)-1; + char title[BCTEXTLEN]; + title[0] = 0; + int no = 0; + for(;;) { + ++no; int done = 1; + char line[BCTEXTLEN], *cp = line; + if( fgets(line,sizeof(line)-1,fp) ) { + if( *cp == '#' ) continue; + done = *cp == ' ' || *cp == '\t' ? 0 : -1; + } + if( done ) { + if( tp > text && *--tp == '\n' ) *tp = 0; + if( title[0] ) { + tp = !txt ? title : _(title); + int idx = plugins.size(); + while( --idx>=0 && strcmp(plugins[idx]->title, tp) ); + if( idx >= 0 ) { + delete [] plugins[idx]->tip; + plugins[idx]->tip = cstrdup(text); + } + title[0] = 0; + } + if( done > 0 ) break; + tp = text; *tp = 0; + char *dp = strchr(cp, ':'); + if( !dp ) { + printf("plugin tips: error on line %d\n", no); + continue; + } + char *bp = title; + while( cp < dp ) *bp++ = *cp++; + *bp = 0; + ++cp; + } + + while( *cp == ' ' || *cp == '\t' ) ++cp; + for( ; tpremove_all_objects(); @@ -962,12 +1022,13 @@ void MWindow::init_theme() fprintf(stderr, _("MWindow::init_theme: prefered theme %s not found.\n"), preferences->theme); - if( !theme_plugin && strcasecmp(preferences->theme, DEFAULT_THEME) ) { + const char *default_theme = _(DEFAULT_THEME); + if( !theme_plugin && strcasecmp(preferences->theme, default_theme) ) { fprintf(stderr, _("MWindow::init_theme: trying default theme %s\n"), - DEFAULT_THEME); + default_theme); for(int i = 0; i < plugindb->total && !theme_plugin; i++) { if( plugindb->get(i)->theme && - !strcasecmp(DEFAULT_THEME, plugindb->get(i)->title) ) + !strcasecmp(default_theme, plugindb->get(i)->title) ) theme_plugin = plugindb->get(i); } } @@ -1469,6 +1530,7 @@ SET_TRACE case FILE_NOT_FOUND: sprintf(string, _("Failed to open %s"), new_asset->path); gui->show_message(string, theme->message_error); + gui->update_default_message(); break; // Unknown format @@ -1665,10 +1727,7 @@ if(debug) printf("MWindow::load_filenames %d\n", __LINE__); edl->session->autos_follow_edits); } - paste_edls(&new_edls, - load_mode, - 0, - -1, + paste_edls(&new_edls, load_mode, 0, -1, edl->session->labels_follow_edits, edl->session->plugins_follow_edits, edl->session->autos_follow_edits, @@ -1952,6 +2011,7 @@ void MWindow::create_objects(int want_gui, if(debug) PRINT_TRACE init_ladspa_plugins(this, preferences); if(debug) PRINT_TRACE + init_plugin_tips(*plugindb); if(splash_window) splash_window->operation->update(_("Initializing GUI")); if(debug) PRINT_TRACE @@ -1980,6 +2040,9 @@ void MWindow::create_objects(int want_gui, Timer timer; + init_awindow(); + if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); + init_compositor(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); @@ -1991,24 +2054,21 @@ void MWindow::create_objects(int want_gui, init_gui(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); - init_awindow(); - if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); - init_levelwindow(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); - if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); - init_indexes(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); init_channeldb(); - if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); + init_gwindow(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); + init_render(); if(debug) printf("MWindow::create_objects %d total_time=%d\n", __LINE__, (int)timer.get_difference()); + init_brender(); init_exportedl(); init_commercials(); @@ -3135,8 +3195,8 @@ void MWindow::remove_asset_from_caches(Asset *asset) void MWindow::remove_assets_from_project(int push_undo, int redraw, ArrayList *drag_assets, ArrayList *drag_clips) { - for(int i = 0; i < session->drag_assets->total; i++) { - Indexable *indexable = session->drag_assets->get(i); + for(int i = 0; i < drag_assets->total; i++) { + Indexable *indexable = drag_assets->get(i); if(indexable->is_asset) remove_asset_from_caches((Asset*)indexable); } @@ -3153,11 +3213,11 @@ void MWindow::remove_assets_from_project(int push_undo, int redraw, } } - for(int i = 0; i < session->drag_assets->size(); i++) { + for(int i = 0; i < drag_assets->size(); i++) { for(int j = 0; j < vwindows.size(); j++) { VWindow *vwindow = vwindows[j]; if( !vwindow->is_running() ) continue; - if(session->drag_assets->get(i) == vwindow->get_source()) { + if(drag_assets->get(i) == vwindow->get_source()) { vwindow->gui->lock_window("MWindow::remove_assets_from_project 2"); vwindow->delete_source(1, 1); vwindow->gui->unlock_window(); @@ -3165,29 +3225,22 @@ void MWindow::remove_assets_from_project(int push_undo, int redraw, } } - for(int i = 0; i < session->drag_assets->size(); i++) { - Indexable *indexable = session->drag_assets->get(i); + for(int i = 0; i < drag_assets->size(); i++) { + Indexable *indexable = drag_assets->get(i); remove_indexfile(indexable); } //printf("MWindow::rebuild_indices 1 %s\n", indexable->path); if(push_undo) undo->update_undo_before(); if(drag_assets) edl->remove_from_project(drag_assets); - if(drag_clips) edl->remove_from_project(session->drag_clips); + if(drag_clips) edl->remove_from_project(drag_clips); if(redraw) save_backup(); if(push_undo) undo->update_undo_after(_("remove assets"), LOAD_ALL); - if(redraw) - { + if(redraw) { restart_brender(); gui->lock_window("MWindow::remove_assets_from_project 3"); - gui->update(1, - 1, - 1, - 1, - 0, - 1, - 0); + gui->update(1, 1, 1, 1, 0, 1, 0); gui->unlock_window(); // Removes from playback here