dynamic keyframes, textbox rework, andrea ffmpeg.opts, perpetual chkpt undo, lv2...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / pluginaclientlad.C
index 403ec7a874b0766935bd50a94b0287de3059dc50..15ff05ed0e6ab8b3d542511c1dd45b3c5a2bfc93 100644 (file)
@@ -452,12 +452,11 @@ char* PluginAClientLAD::lad_to_upper(char *string, const char *input)
 
 void PluginAClientLAD::save_data(KeyFrame *keyframe)
 {
-       FileXML output;
-       char string[BCTEXTLEN];
        if( !config.port_data ) config.initialize(server);
-
+       FileXML output;
 // cause data to be stored directly in text
-       output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
+       output.set_shared_output(keyframe->xbuf);
+       char string[BCTEXTLEN];
        output.tag.set_title(lad_to_upper(string, plugin_title()));
 
        const LADSPA_Descriptor *lad_desc = server->lad_descriptor;
@@ -481,14 +480,13 @@ void PluginAClientLAD::save_data(KeyFrame *keyframe)
 
 void PluginAClientLAD::read_data(KeyFrame *keyframe)
 {
-       FileXML input;
-       char string[BCTEXTLEN];
-
-       input.set_shared_input(keyframe->get_data(), strlen(keyframe->get_data()));
        if( !config.port_data ) config.initialize(server);
+       FileXML input;
+       input.set_shared_input(keyframe->xbuf);
 
        while(! input.read_tag() ) {
 //printf("PluginAClientLAD::read_data %s\n", input.tag.get_title());
+               char string[BCTEXTLEN];
                if(! input.tag.title_is(lad_to_upper(string, plugin_title())) ) continue;
                const LADSPA_Descriptor *lad_desc = server->lad_descriptor;
                const LADSPA_PortDescriptor *port_desc = lad_desc->PortDescriptors;
@@ -655,21 +653,14 @@ int PluginAClientLAD::process_realtime(int64_t size,
 }
 
 int MWindow::init_ladspa_index(MWindow *mwindow, Preferences *preferences,
-       const char *index_path, const char *plugin_dir)
+       FILE *fp, 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;
 }