restart_status = 0;
screens = 1;
in_destructor = 0;
+ speed_edl = 0;
}
commit_commercial();
if( commercials && !commercials->remove_user() ) commercials = 0;
close_mixers();
-
+ if( speed_edl ) { speed_edl->remove_user(); speed_edl = 0; }
// Save defaults for open plugins
plugin_gui_lock->lock("MWindow::~MWindow");
for(int i = 0; i < plugin_guis->size(); i++) {
else
create_defaults_path(path, CONFIG_FILE);
+ delete defaults;
defaults = new BC_Hash(path);
defaults->load();
}
case PLUGIN_TYPE_FFMPEG: {
server = new_ffmpeg_server(mwindow, path);
break; }
+ case PLUGIN_TYPE_LV2: {
+ server = new_lv2_server(mwindow, path);
+ break; }
}
if( !server ) continue;
plugins.append(server);
fprintf(fp, "%s\n", plugin_path);
init_plugin_index(mwindow, preferences, fp, plugin_path);
init_ffmpeg_index(mwindow, preferences, fp);
+ init_lv2_index(mwindow, preferences, fp);
fclose(fp);
return load_plugin_index(mwindow, index_path, plugin_path);
}
scan_plugin_index(mwindow, preferences, fp, plugin_dir, ".", idx);
}
-int MWindow::init_ladspa_index(MWindow *mwindow, Preferences *preferences,
- const char *index_path, const char *plugin_dir)
-{
- char plugin_path[BCTEXTLEN], *path = FileSystem::basepath(plugin_dir);
- strcpy(plugin_path, path); delete [] path;
- printf("init ladspa index: %s\n", plugin_dir);
- FILE *fp = fopen(index_path,"w");
- if( !fp ) {
- fprintf(stderr,_("MWindow::init_ladspa_index: "
- "can't create plugin index: %s\n"), index_path);
- return 1;
- }
- fprintf(fp, "%d\n", PLUGIN_FILE_VERSION);
- fprintf(fp, "%s\n", plugin_dir);
- init_plugin_index(mwindow, preferences, fp, plugin_path);
- fclose(fp);
- return 0;
-}
-
void MWindow::scan_plugin_index(MWindow *mwindow, Preferences *preferences, FILE *fp,
const char *plug_dir, const char *plug_path, int &idx)
{
void MWindow::init_plugin_tips(ArrayList<PluginServer*> &plugins, const char *lang)
{
- const char *cfg_path = File::get_cindat_path();
- char msg_path[BCTEXTLEN]; int txt = 0;
+ const char *dat_path = File::get_cindat_path();
+ char msg_path[BCTEXTLEN];
FILE *fp = 0;
if( BC_Resources::language[0] ) {
snprintf(msg_path, sizeof(msg_path), "%s/info/plugins.%s",
- cfg_path, lang);
+ dat_path, lang);
fp = fopen(msg_path, "r");
}
if( !fp ) {
- txt = 1;
snprintf(msg_path, sizeof(msg_path), "%s/info/plugins.txt",
- cfg_path);
+ dat_path);
fp = fopen(msg_path, "r");
}
if( !fp ) return;
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) );
+ while( --idx>=0 && strcmp(plugins[idx]->title, title) );
if( idx >= 0 ) {
delete [] plugins[idx]->tip;
plugins[idx]->tip = cstrdup(text);
nested_edl->create_objects();
nested_edl->load_xml(&xml_file, LOAD_ALL);
//printf("MWindow::load_filenames %p %s\n", nested_edl, nested_edl->project_path);
- new_edl->create_nested(nested_edl, filenames->get(i));
+ new_edl->create_nested(nested_edl);
+ new_edl->set_path(filenames->get(i));
nested_edl->Garbage::remove_user();
}
else {
}
-void MWindow::init_shm()
+void MWindow::init_shm(const char *pfn, int64_t min)
{
+ int64_t result = 0;
// Fix shared memory
- FILE *fd = fopen("/proc/sys/kernel/shmmax", "w");
- if(fd) {
- fprintf(fd, "0x7fffffff");
+ FILE *fd = fopen(pfn, "r");
+ if( fd ) {
+ fscanf(fd, "%jd", &result);
fclose(fd);
+ if( result >= min ) return;
}
- fd = 0;
- fd = fopen("/proc/sys/kernel/shmmax", "r");
- if(!fd) {
- MainError::show_error("MWindow::init_shm: couldn't open /proc/sys/kernel/shmmax for reading.\n");
+ fd = fopen(pfn, "w");
+ if( !fd ) return;
+ fprintf(fd, "0x%jx", min);
+ fclose(fd);
+
+ fd = fopen(pfn, "r");
+ if( !fd ) {
+ eprintf(_("MWindow::init_shm: couldn't open %s for reading.\n"), pfn);
return;
}
- int64_t result = 0;
fscanf(fd, "%jd", &result);
fclose(fd);
- fd = 0;
- if(result < 0x7fffffff) {
- eprintf(_("MWindow::init_shm: /proc/sys/kernel/shmmax is %p.\n"
+ if( result < min ) {
+ eprintf(_("MWindow::init_shm: %s is %p.\n"
"you probably need to be root, or:\n"
- "as root, run: echo 0x7fffffff > /proc/sys/kernel/shmmax\n"
+ "as root, run: echo 0x%jx > %s\n"
"before trying to start cinelerra.\n"
- "It should be at least 0x7fffffff for Cinelerra.\n"), (void *)result);
+ "It should be at least 0x%jx for Cinelerra.\n"),
+ pfn, (void *)result, min, pfn, min);
}
}
&MWindowGUI::keyboard_listener);
hide_splash();
- init_shm();
+ init_shm("/proc/sys/kernel/shmmax", 0x7fffffff);
+ init_shm("/proc/sys/kernel/shmmni", 0x4000);
if(debug) PRINT_TRACE
BC_WindowBase::get_resources()->vframe_shm = 1;