X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=714e9dddd17d7d6b8441959f1cf1688598c1d0fb;hb=420671be045c7fcc1624d68395cb833a5cc2de31;hp=ec4836175fc18d9033d205e6cb6429a49036ef01;hpb=198530fac4797a9338e91f342939468efffa4eb2;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index ec483617..714e9ddd 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -235,6 +235,7 @@ MWindow::~MWindow() delete create_bd; create_bd = 0; delete create_dvd; create_dvd = 0; delete batch_render; batch_render = 0; + delete render; render = 0; commit_commercial(); if( commercials && !commercials->remove_user() ) commercials = 0; @@ -292,15 +293,13 @@ MWindow::~MWindow() finit_error(); keyframe_threads->remove_all_objects(); colormodels.remove_all_objects(); - delete gui; gui = 0; - delete render; render = 0; delete awindow; awindow = 0; delete lwindow; lwindow = 0; delete twindow; twindow = 0; delete wwindow; wwindow = 0; delete gwindow; gwindow = 0; - // must be last or nouveau chokes delete cwindow; cwindow = 0; + delete gui; gui = 0; //delete file_server; file_server = 0; // reusable delete mainindexes; mainindexes = 0; delete mainprogress; mainprogress = 0; @@ -369,7 +368,7 @@ void MWindow::create_defaults_path(char *string, const char *config_file) // set the .bcast path FileSystem fs; - sprintf(string, "%s", BCASTDIR); + sprintf(string, "%s/", File::get_config_path()); fs.complete_path(string); if(!fs.is_dir(string)) fs.create_dir(string); @@ -400,13 +399,23 @@ const char *MWindow::default_std() } } - for( int i=0; ntsc_zones[i]; ++i ) { - if( !strcmp(ntsc_zones[i], p) ) - return "NTSC"; + if( p ) { + for( int i=0; ntsc_zones[i]; ++i ) { + if( !strcmp(ntsc_zones[i], p) ) + return "NTSC"; + } + } + + p = getenv("TZ"); + if( p ) { + for( int i=0; ntsc_zones[i]; ++i ) { + if( !strcmp(ntsc_zones[i], p) ) + return "NTSC"; + } } //__timezone: Seconds west of UTC. 240sec/deg - double tz_deg = __timezone / 240.; + double tz_deg = -__timezone / 240.; // from Honolulu = -10, to New York = -5, 15deg/hr lat -150..-75 return tz_deg >= -10*15 && tz_deg <= -5*15 ? "NTSC" : "PAL"; } @@ -587,8 +596,7 @@ int MWindow::init_ladspa_plugins(MWindow *mwindow, Preferences *preferences) char *path = getenv("LADSPA_PATH"); char ladspa_path[BCTEXTLEN]; if( !path ) { - get_exe_path(ladspa_path); - strcat(ladspa_path, "/ladspa"); + strncpy(ladspa_path, File::get_ladspa_path(), sizeof(ladspa_path)); path = ladspa_path; } for( int len=0; *path; path+=len ) { @@ -893,6 +901,11 @@ void MWindow::show_warning(int *do_warning, const char *text) wwindow->show_warning(do_warning, text); } +int MWindow::wait_warning() +{ + return wwindow->wait_result(); +} + void MWindow::init_theme() { Timer timer; @@ -2424,7 +2437,7 @@ void MWindow::hide_plugin(Plugin *plugin, int lock) ptr->hide_gui(); delete_plugin(ptr); //sleep(1); -// return; + return; } } if(lock) plugin_gui_lock->unlock(); @@ -2866,17 +2879,18 @@ void MWindow::save_backup() FileXML file; edl->optimize(); edl->set_path(session->filename); - edl->save_xml(&file, BACKUP_PATH, 0, 0); + char backup_path[BCTEXTLEN]; + snprintf(backup_path, sizeof(backup_path), "%s/%s", + File::get_config_path(), BACKUP_FILE); + edl->save_xml(&file, backup_path, 0, 0); file.terminate_string(); - char path[BCTEXTLEN]; FileSystem fs; - strcpy(path, BACKUP_PATH); - fs.complete_path(path); + fs.complete_path(backup_path); - if(file.write_to_file(path)) + if(file.write_to_file(backup_path)) { char string2[256]; - sprintf(string2, _("Couldn't open %s for writing."), BACKUP_PATH); + sprintf(string2, _("Couldn't open %s for writing."), backup_path); gui->show_message(string2); } } @@ -2886,13 +2900,14 @@ void MWindow::load_backup() ArrayList path_list; path_list.set_array_delete(); char *out_path; - char string[BCTEXTLEN]; - strcpy(string, BACKUP_PATH); + char backup_path[BCTEXTLEN]; + snprintf(backup_path, sizeof(backup_path), "%s/%s", + File::get_config_path(), BACKUP_FILE); FileSystem fs; - fs.complete_path(string); + fs.complete_path(backup_path); - path_list.append(out_path = new char[strlen(string) + 1]); - strcpy(out_path, string); + path_list.append(out_path = new char[strlen(backup_path) + 1]); + strcpy(out_path, backup_path); load_filenames(&path_list, LOADMODE_REPLACE, 0); edl->local_session->clip_title[0] = 0; @@ -2915,6 +2930,9 @@ int MWindow::create_aspect_ratio(float &w, float &h, int width, int height) { w = 1; h = 1; if(!width || !height) return 1; + if( width == 720 && (height == 480 || height == 576) ) { + w = 4; h = 3; return 0; // for NTSC and PAL + } double ar = (double)width / height; // square-ish pixels if( EQUIV(ar, 1.0000) ) return 0;