Changeset 339

Show
Ignore:
Timestamp:
01/30/06 21:11:29 (3 years ago)
Author:
conrad
Message:

add a destroy method to the plugin structure, to allow plugin handles (not just
instances) to be destroyed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libremix/trunk/include/remix/remix_plugin.h

    r170 r339  
    8383 
    8484typedef CDList * (*RemixPluginInitFunc) (RemixEnv * env); 
     85typedef int (*RemixPluginDestroyFunc) (RemixEnv * env, RemixPlugin * plugin); 
    8586 
    8687typedef RemixBase * (*RemixInitFunc) (RemixEnv * env, RemixBase * base, 
     
    188189  RemixSuggestFunc suggest; 
    189190  void * plugin_data; 
     191  RemixPluginDestroyFunc destroy; 
    190192}; 
    191193 
  • libremix/trunk/src/libremix/remix_context.c

    r337 r339  
    3333 
    3434static void 
     35remix_plugin_destroy (RemixEnv * env, RemixPlugin * plugin) 
     36{ 
     37  if (plugin->destroy) { 
     38    plugin->destroy (env, plugin); 
     39  } 
     40} 
     41 
     42static void 
    3543remix_context_destroy (RemixEnv * env) 
    3644{ 
     
    3947 
    4048  world->purging = 1; 
     49 
     50  cd_list_apply (env, world->plugins, (CDFunc)remix_plugin_destroy); 
     51  world->plugins = cd_list_free (env, world->plugins); 
     52 
    4153  /* XXX: remix_destroy_list (env, world->plugins); */ 
    4254  /* XXX:  remix_destroy_list (env, world->bases); */ 
  • libremix/trunk/src/libremix/remix_gain.c

    r161 r339  
    180180} 
    181181 
     182static int 
     183remix_gain_plugin_destroy (RemixEnv * env, RemixPlugin * plugin) 
     184{ 
     185  cd_set_free (env, plugin->process_scheme); 
     186  return 0; 
     187} 
     188 
    182189static struct _RemixParameterScheme gain_envelope_scheme = { 
    183190  "Gain envelope", 
     
    206213  NULL, /* suggests */ 
    207214  NULL, /* plugin_data */ 
     215  remix_gain_plugin_destroy /* destroy */ 
    208216}; 
    209217 
  • libremix/trunk/src/libremix/remix_sndfile.c

    r193 r339  
    387387  NULL, /* suggests */ 
    388388  NULL, /* plugin data */ 
     389  NULL  /* destroy */ 
    389390}; 
    390391 
     
    397398  NULL, /* suggests */ 
    398399  NULL, /* plugin data */ 
     400  NULL  /* destroy */ 
    399401}; 
    400402 
  • libremix/trunk/src/plugins/ladspa/remix_ladspa.c

    r168 r339  
    932932      plugin->plugin_data = (void *)d; 
    933933 
     934      plugin->destroy = NULL; 
     935 
    934936      plugins = cd_list_append (env, plugins, CD_POINTER(plugin)); 
    935937    } 
  • libremix/trunk/src/plugins/noise/remix_noise.c

    r161 r339  
    129129  NULL, /* suggests */ 
    130130  NULL, /* plugin data */ 
     131  NULL  /* destroy */ 
    131132}; 
    132133