コード例 #1
0
void
icon_editor_image_data_get(void **data, int *w, int *h)
{
  Evas_List *l;
  if (!editor || !editor->edf || !editor->group) return;
  for (l = editor->group->parts; l; l = l->next)
  {
    Edje_Part *part = l->data;

    if (!strcmp(part->name, "icon"))
    {
      int id = part->default_desc->image.id;
      Edje_Edit_Image *im = evas_list_nth(editor->edf->images, id);

      printf("data get: w x h = %d x %d\n", im->w, im->h);
      if (data) *data = im->data;
      if (w) *w = im->w;
      if (h) *h = im->h;
    }
  }
}
コード例 #2
0
ファイル: mux_midi.c プロジェクト: eriser/ayemux
void _ex_Binding(Etk_Object *obj, void *data){
	Etk_Tree_Row *irow;	
	Etk_Combobox_Item *active_item;
	midi_t * midibinding;
	char midi_label[255];
	irow = etk_tree_selected_row_get(rack_tree);
	active_item = etk_combobox_active_item_get(combobox);
	midibinding = (midi_t *)evas_list_nth(live_plugin->midi_data, (int)etk_tree_row_data_get(irow)-1);

	midibinding->type = (int)etk_combobox_item_data_get(active_item);
	midibinding->channel = spinner_data;
	midibinding->program = spinner1_data;
	midibinding->trow = irow;
	if(midibinding->type==1){
		sprintf(midi_label, "ch# %i PC %i", midibinding->channel, midibinding->program);
	}
	if(midibinding->type==2){
		sprintf(midi_label, "ch# %i CC %i", midibinding->channel, midibinding->program);
	}
	etk_tree_row_fields_set(irow, ETK_FALSE, col2, midi_label, NULL);
	etk_widget_hide(ETK_WIDGET(midi_win));
}
コード例 #3
0
void
icon_editor_image_data_set(void *data, int w, int h)
{
  Evas_List *l;
  if (!editor || !editor->edf || !editor->group) return;
  for (l = editor->group->parts; l; l = l->next)
  {
    Edje_Part *part = l->data;

    if (!strcmp(part->name, "icon"))
    {
      int id = part->default_desc->image.id;
      Edje_Edit_Image *im = evas_list_nth(editor->edf->images, id);

      /* make sure we have different data before freeing */
      if (im->data && im->data != data) free(im->data);
      im->data = data;
      im->w = w;
      im->h = h;
    }
  }
}
コード例 #4
0
ファイル: mux_midi.c プロジェクト: eriser/ayemux
void show_midi_window(void *data){
	Etk_Widget *vbox, *vbox1, *hbox;
	Etk_Widget *frame;
	Etk_Widget *button;
	Etk_Widget *label;
	Etk_Combobox_Item *item;
	midi_t * midibinding;
	
	if (midi_win){
		etk_widget_show(ETK_WIDGET(midi_win));
		return;
	}
	
	midibinding = (midi_t *)evas_list_nth(live_plugin->midi_data, (int)etk_tree_row_data_get(etk_tree_selected_row_get(rack_tree))-1);
	if(midibinding->channel != 0){
		spinner_data = midibinding->channel;
	}else{
		spinner_data = 1;
	}
	spinner1_data = midibinding->program;
		
	midi_win = etk_window_new();
	etk_window_title_set(ETK_WINDOW(midi_win), "Set Midi Properties");
	etk_window_resize(ETK_WINDOW(midi_win), 200, 0);
	etk_signal_connect("delete-event", ETK_OBJECT(midi_win), ETK_CALLBACK(etk_window_hide_on_delete), NULL);
	vbox = etk_vbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(midi_win), vbox);

	frame = etk_frame_new("Set Midi Binding for Rack State");
	etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 5);
	
	hbox = etk_hbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(frame), hbox);
	label = etk_label_new("ch#");
	etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 3);	
	
	spinner = etk_spinner_new(1.0, 16.0, midibinding->channel, 1.0, 5.0);
	etk_box_append(ETK_BOX(hbox), spinner, ETK_BOX_START, ETK_BOX_NONE, 7);
	etk_signal_connect("value-changed", ETK_OBJECT(spinner), ETK_CALLBACK(_ex_changed_value), 1);

	combobox = etk_combobox_new_default();
	etk_box_append(ETK_BOX(hbox), combobox, ETK_BOX_START, ETK_BOX_NONE, 2);
	item = etk_combobox_item_append(ETK_COMBOBOX(combobox), "Program Change");
	etk_combobox_item_data_set(item, 1);
	if(midibinding->type==1){
		etk_combobox_active_item_set(combobox, item);
	}	
	item = etk_combobox_item_append(ETK_COMBOBOX(combobox), "Control Change");
	etk_combobox_item_data_set(item, 2);
	if(midibinding->type==2){
		etk_combobox_active_item_set(combobox, item);
	}

	spinner1 = etk_spinner_new(0.0, 127.0, midibinding->program, 1.0, 5.0);
	etk_box_append(ETK_BOX(hbox), spinner1, ETK_BOX_START, ETK_BOX_NONE, 7);
	etk_signal_connect("value-changed", ETK_OBJECT(spinner1), ETK_CALLBACK(_ex_changed_value), 2);

	/*
	button = etk_button_new_with_label("Learn");
	etk_box_append(ETK_BOX(hbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);	
	*/

	button = etk_button_new_with_label("Add Binding");
	etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);
	etk_signal_connect("clicked", ETK_OBJECT(button), _ex_Binding, data);
	
	
	
	etk_widget_show_all(midi_win);   
}
コード例 #5
0
ファイル: mux_midi.c プロジェクト: eriser/ayemux
void midi_delete(void *data){
	midi_t * midibinding;
	midibinding = (live_plugin_state_t *)evas_list_nth(live_plugin->midi_data, (int)data-1);
	live_plugin->midi_data = evas_list_remove(live_plugin->midi_data, midibinding);
}