Exemplo n.º 1
0
static void *create_effect_plugin_data(const SoundPluginType *plugin_type, struct SoundPlugin *plugin, hash_t *state, float samplerate, int blocksize, bool is_loading){
  dsp *dsp = new CLASSNAME;
  dsp->instanceInit(samplerate);
  Data *data = create_effect_plugin_data2(samplerate, dsp);

#ifndef FAUST_SYSTEM_EFFECT
  if (plugin != NULL) { // plugin==NULL during instrument type initialization, when we create test data. (took a long time to hunt down this bug)
    data->qtgui_parent = FAUST_create_qdialog();
    create_gui(data->qtgui_parent, data, plugin);
  }
#endif
  
  return data;
}
Exemplo n.º 2
0
static void *create_instrument_plugin_data(const SoundPluginType *plugin_type, struct SoundPlugin *plugin, hash_t *state, float samplerate, int blocksize, bool is_loading){
  dsp *dsps[MAX_POLYPHONY];
  for(int i=0;i<MAX_POLYPHONY;i++){
    dsps[i] = new CLASSNAME;
    dsps[i]->instanceInit(samplerate);
  }

  Data *data = create_instrument_plugin_data2(samplerate, dsps);

  create_automation_values(data);

  data->qtgui_parent = FAUST_create_qdialog();

  create_gui(data->qtgui_parent, data, plugin);

  return data;
}
Exemplo n.º 3
0
static bool FAUST_handle_fff_reply(struct SoundPlugin *plugin, const FFF_Reply &reply, bool is_initializing){
  struct Patch *patch = (struct Patch*)plugin->patch;
  Devdata *devdata = (Devdata*)plugin->data;
  
  if (reply.data==NULL){    
    fprintf(stderr,"Error-message: -%s-\n", devdata->reply.error_message.toUtf8().constData());
    devdata->reply.error_message = reply.error_message;
    return false;
  }

  FFF_Reply old_reply = devdata->reply;

  // handle gui
  {
    if (devdata->qtgui_parent == NULL)
      devdata->qtgui_parent = FAUST_create_qdialog();
    
    if (old_reply.data != NULL && old_reply.data->qtgui!=NULL){
      old_reply.data->qtgui->stop();
      devdata->qtgui_parent->layout()->removeWidget(old_reply.data->qtgui);
    }

    create_gui(devdata->qtgui_parent, reply.data, plugin);

    if (devdata->qtgui_parent->isVisible())
      reply.data->qtgui->run();    
  }
  
  hash_t *effects_state = is_initializing ? NULL : PLUGIN_get_effects_state(plugin);

  PLAYER_lock();{
    devdata->reply = reply;
  }PLAYER_unlock();

  if (effects_state != NULL)
    PLUGIN_set_effects_from_state(plugin, effects_state);

  if (old_reply.data != NULL)
    PATCH_handle_fxs_when_fx_names_have_changed(patch);
  
  FFF_request_free(devdata->id, old_reply);

  return true;
}