lv2 fixes, dcraw upgrade, arch/libdv
[goodguy/history.git] / cinelerra-5.1 / cinelerra / mwindow.C
index 243f29a99afc00d58607321154c8275dfc7caac2..9de65dba075855f78b5c4aa1234f471cbb4350d1 100644 (file)
@@ -210,7 +210,6 @@ MWindow::MWindow()
        strcpy(cin_lang,"en");
        channeldb_buz =  new ChannelDB;
        channeldb_v4l2jpeg =  new ChannelDB;
-       //file_server = 0;
        plugin_guis = 0;
        dead_plugins = 0;
        keyframe_threads = 0;
@@ -319,7 +318,6 @@ MWindow::~MWindow()
        delete gwindow;         gwindow = 0;
        delete cwindow;         cwindow = 0;
        delete gui;             gui = 0;
-       //delete file_server;  file_server = 0; // reusable
        delete mainindexes;     mainindexes = 0;
        delete mainprogress;    mainprogress = 0;
        delete audio_cache;     audio_cache = 0;  // delete the cache after the assets
@@ -883,10 +881,25 @@ int MWindow::plugin_exists(char *plugin_path)
        return !plugindb ? 0 : plugin_exists(plugin_path, *plugindb);
 }
 
+void MWindow::remove_plugin_index()
+{
+       char index_path[BCTEXTLEN];
+       MWindow::create_defaults_path(index_path, PLUGIN_FILE);
+       ::remove(index_path);
+}
+
 void MWindow::init_preferences()
 {
        preferences = new Preferences;
        preferences->load_defaults(defaults);
+       const char *lv2_path = getenv("LV2_PATH");
+       if( lv2_path && strcmp(lv2_path, preferences->lv2_path) ) {
+               strncpy(preferences->lv2_path, lv2_path, sizeof(preferences->lv2_path));
+               remove_plugin_index();
+       }
+       else if( !lv2_path && preferences->lv2_path[0] ) {
+               File::setenv_path("LV2_PATH",preferences->lv2_path, 0);
+       }
        session = new MainSession(this);
        session->load_defaults(defaults);
        // set x11_host, screens, window_config
@@ -2327,9 +2340,6 @@ void MWindow::create_objects(int want_gui,
        BC_Resources::init_fontconfig(string);
        if(debug) PRINT_TRACE
 
-// Initialize before too much else is running
-// Preferences & theme are required for building MPEG table of contents
-
 // Default project created here
        init_edl();
        if(debug) PRINT_TRACE