Example #1
0
void on_add_effect(char *name) {
  gtk_menu_set_active(menu_effect,0);
  Layer *laysel = (Layer*) env->layers.selected();
  Filter *filt;
  if(!laysel) {
    error("no layer selected for effect %s",name); return; }
  /* TODO plugin selection by name inside plugger
     i don't do this now, will develop LiViDO and come back later */
  for(int c=0; (filt = (Filter*)env->plugger.plugs[c]) ; c++) {
    if(filt->list) continue;
    if(strcasecmp(filt->getname(),name)==0) {
      if(!filt->init(&laysel->geo)) {
	error("Filter %s can't initialize",filt->getname());
	continue;
      }
      laysel->filters.append(filt);
      /* filter is automatically selected */
      laysel->filters.sel(0);
      filt->sel(true);
    }
  }
}
Example #2
0
void update_effect_list() {
  gtk_tree_store_clear(effect_store);
  Layer *laysel = (Layer*) env->layers.selected();
  if(!laysel) return;
  laysel->filters.lock();
  Filter *filt = (Filter*)laysel->filters.begin();
  while(filt) {
    gtk_tree_store_append(effect_store,&iter,NULL);
    gtk_tree_store_set(effect_store,&iter,
		       EFFECT_ACTIVE,filt->active,
		       EFFECT_NAME,filt->getname(),
		       EFFECT_OBJ,filt,
		       -1);
    filt = (Filter*)filt->next;
  }
  laysel->filters.unlock();
}
Example #3
0
  /* =================== EFFECT LIST */
void on_effect_select(GtkTreeSelection *sel, gpointer data) {
  func("%s(%p,%p)",__FUNCTION__,sel,data);
  GtkTreeModel *model;
  Filter *effsel;
  if(gtk_tree_selection_get_selected(sel,&model,&effect_iter)) {
    //    gtk_tree_selection_select_iter(sel,&layer_iter);
    gtk_tree_model_get(model,&effect_iter,EFFECT_OBJ,&effsel,-1);
    if(effsel) {
      Layer *laysel = (Layer*) env->layers.selected();
      if(!laysel) return;
      func("selected effect %s on layer %s",
	   effsel->getname(), laysel->get_name());
      laysel->filters.sel(0); /* deselect all */
      effsel->sel(true); /* select the one */
    }
  }
}