rework audio import_samples + resample + playback speed sampling, fix clear_boarder...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / main.C
index 6833425d0b7d1d30aafc08c945f3e25fbb3475d1..4b04a11b2f6347b17a08831a6a19d822d12916f0 100644 (file)
@@ -121,11 +121,31 @@ public:
 
 long cin_timezone;
 
+static float get_layout_scale()
+{
+       char config_path[BCTEXTLEN];
+       sprintf(config_path,"%s/%s", File::get_config_path(), CONFIG_FILE);
+       FILE *fp = fopen(config_path,"r");
+       if( !fp ) return 0;
+       float scale = 0;
+       char line[BCTEXTLEN];
+       line[BCTEXTLEN-1] = 0;
+       while( fgets(line, BCTEXTLEN-1, fp) ) {
+               if( !strncmp(line, "LAYOUT_SCALE ",12+1) ) {
+                       scale = atof(line+12);
+                       break;
+               }
+       }
+       fclose(fp);
+       return scale;
+}
+
 int main(int argc, char *argv[])
 {
 // handle command line arguments first
        srand(time(0));
        ArrayList<char*> filenames;
+       filenames.set_array_delete();
        FileSystem fs;
 
        time_t st; time(&st);
@@ -258,7 +278,10 @@ int main(int argc, char *argv[])
                }
        }
 
-
+       float scale = operation == DO_GUI ?
+               get_layout_scale() : 1;
+       // runs XInitThreads
+       BC_WindowBase::init_resources(scale);
 
        if( operation == DO_GUI ||
            operation == DO_DEAMON || operation == DO_DEAMON_FG ||
@@ -401,6 +424,7 @@ DISABLE_BUFFER
 
        filenames.remove_all_objects();
        Units::finit();
+       BC_WindowBase::finit_resources();
 
        time_t et; time(&et);
        long dt = et - st;