예제 #1
0
/**
 * @brief: Automatically saves all open notes into the storage.
 */
void
autosave(void)
{
	int             x, y, w, h;
	Note           *note;
	Evas_List      *tmp = gbl_notes;
	NoteStor       *n;

	dml("Autosaving", 1);

	while (tmp != NULL) {
		note = evas_list_data(tmp);
		ecore_evas_geometry_get(note->win, &x, &y, &w, &h);
		n = alloc_note_stor();
		n->width = w;
		n->height = h;
		n->x = x;
		n->y = y;
		n->shaded = note->shaded;
		n->content = strdup(get_content_by_note(tmp));
		append_note_stor(n);
		free_note_stor(n);
		tmp = evas_list_next(tmp);
	}

	dml("Autosaved Notes", 1);

	return;
}
예제 #2
0
파일: mux_midi.c 프로젝트: eriser/ayemux
void pedal_set(snd_seq_event_t *ev){
	live_plugin_jack_t *live_plugin_jack;
	control_port_t *control_port;	
	Evas_List *l2, *l3;
	for (l2 = live_plugin->plugin_data; l2; l2 = evas_list_next(l2)){
		live_plugin_jack = (live_plugin_jack_t *)l2->data;
		for (l3 = live_plugin_jack->control_ports; l3; l3 = evas_list_next(l3)){
			control_port = (control_port_t *)l3->data;
			printf("hit midi %i %i \n", control_port->midi_pedal_link, ev->data.control.channel);
			if(control_port->midi_pedal_link == ev->data.control.channel+1){
				printf("hit midi %i \n", control_port->midi_pedal_link);
				 control_port->current_real_value = control_port->min_value + (((control_port->max_value - control_port->min_value)/128.0f)*ev->data.control.value);
				adjust_rack_ui_controls();
			}
		}
	}
}
예제 #3
0
파일: mux_midi.c 프로젝트: eriser/ayemux
void midi_set(snd_seq_event_t *ev, int type){
	/* loop through all patches */
	live_plugin_t * lp;
	midi_t * mb;
	int c;
	Evas_List *list_a, *list_b, *list_c;
	for (list_a = patches->patch_data; list_a; list_a = evas_list_next(list_a)){
		lp = (live_plugin_t *)list_a->data;
		c=0;
		for (list_b = lp->midi_data; list_b; list_b = evas_list_next(list_b)){
			mb = (midi_t *)list_b->data;
			c++;
			/* test to match */
			if((mb->type == type)&(mb->channel==(ev->data.control.channel+1))&(mb->program==(ev->data.control.value+1))){
				midi_change_rack(lp, c, mb->trow);
				return;
			}
		}
	}
}
예제 #4
0
static void
fill_gui_list(app_t *app)
{
    int i, j, last, n_items, last_evas, c;
    Evas_List *itr;
    float p;

    j = 0;
    i = app->current - 2;
    last_evas = app->n_evas_items;
    last = app->current + last_evas - 2;
    n_items = evas_list_count(app->items);

    if (n_items < 1)
        return;

    e_box_freeze(app->e_box);
    /* if required, fill head with empty items */
    for (; i < 0; i++, j++)
        _set_item_text(app, j, "");

    /* if required, fill tail with empty items */
    for (; last > n_items; last--, last_evas--)
        _set_item_text(app, last_evas - 1, "");

    itr = evas_list_nth_list(app->items, i);
    for (; i < last; i++, j++, itr = evas_list_next(itr)) {
        char *text;

        text = evas_list_data(itr);
        _set_item_text(app, j, text);
    }
    e_box_thaw(app->e_box);

    /* dim arrows */
    p = ((float)(app->current + 1)) / ((float)n_items);
    c = 255 * p;
    evas_object_color_set(app->arrow_up, c, c, c, c);

    p = (float)app->current / ((float)n_items);
    c = 255 * (1.0 - p);
    evas_object_color_set(app->arrow_down, c, c, c, c);
}
예제 #5
0
void waiting_iface_free(Boot_Process_List** l)
{
    EXALT_ASSERT_RETURN_VOID(l!=NULL);
    EXALT_ASSERT_RETURN_VOID((*l)!=NULL);

    //evas_list_free() doesn't free the data, we free them
    {
        Evas_List* levas = (*l)->l;
        while(levas)
        {
            Boot_Process_Elt* data = evas_list_data(levas);
            EXALT_FREE(data->interface);
            EXALT_FREE(data);
            levas = evas_list_next(levas);
        }
    }

    evas_list_free((*l)->l);
    EXALT_FREE(*l);
}
예제 #6
0
/*
 * @brief return true is the interface eth is in the list
 * @param l the list of interface
 * @param eth the interface
 * @return Returns 1 if yes, else 0
 */
int waiting_iface_is(const Boot_Process_List* l,const Exalt_Ethernet* eth)
{
    int find = 0;
    Evas_List *elt;
    Boot_Process_Elt *data;

    EXALT_ASSERT_RETURN(l!=NULL);
    EXALT_ASSERT_RETURN(eth!=NULL);

    elt = l->l;
    while(!find && elt)
    {
        data = evas_list_data(elt);
        if(data->interface && strcmp(exalt_eth_get_name(eth),data->interface) == 0)
            find = 1;
        else
            elt = evas_list_next(elt);
    }
    return find;
}
예제 #7
0
/*
 * @brief return 1 if no more interface have to be wait
 * If an interface is in the list but not detect by the computer, the system will not wait this interface
 * @param l the list of interface
 * @return Returns 1 if all interfaces are init, else 0
 */
int waiting_iface_is_done(const Boot_Process_List* l)
{
    Evas_List *elt;
    Boot_Process_Elt *data;
    int find =  0;

    if(!l)
        return 1;

    elt = l->l;

    while(!find && elt)
    {
        data = evas_list_data(elt);
        if(exalt_eth_get_ethernet_byname(data->interface))
            find = 1;
        else
            elt = evas_list_next(elt);
    }

    return !find;
}
예제 #8
0
/*
 * @brief remove a interface in the list
 * @param l the list of interface
 * @param eth the interface
 */
void waiting_iface_done(Boot_Process_List* l,const Exalt_Ethernet* eth)
{
    int find = 0;
    Evas_List *elt;
    Boot_Process_Elt *data;

    EXALT_ASSERT_RETURN_VOID(l!=NULL);

    elt = l->l;

    while(!find && elt)
    {
        data = evas_list_data(elt);
        if(data->interface && strcmp(exalt_eth_get_name(eth),data->interface) == 0)
            find = 1;
        else
            elt = evas_list_next(elt);
    }
    if(!find)
        //the iface is not in the list
        return ;

    l->l = evas_list_remove(l->l,evas_list_data(elt));
}