Example #1
0
void renderer_add_patch(struct patch *p)
{
	struct patch *p1;
	struct patch *new_patch;
	
	renderer_lock_patch();
	p1 = mashup_head;
	while(p1 != NULL) {
		if(p1->original == p) {
			renderer_unlock_patch();
			return;
		}
		p1 = p1->next;
	}
	new_patch = patch_copy(p);
	if(!mashup_en) {
		p1 = mashup_head;
		mashup_head = new_patch;
		current_patch = mashup_head;
		patch_free(p1);
	} else {
		new_patch->next = mashup_head;
		mashup_head = new_patch;
	}
	mashup_en++;
	renderer_unlock_patch();
}
Example #2
0
static void
test_entry_free (test_entry_t *entry)
{
	GSList *tmp;

	free (entry->data);
	for (tmp = entry->patches; tmp; tmp = tmp->next)
		patch_free (tmp->data);
	g_slist_free (entry->patches);
}
Example #3
0
void renderer_pulse_patch(struct patch *p)
{
	struct patch *oldpatch;
	
	renderer_lock_patch();
	if(!mashup_en && (mashup_head->next == NULL)) {
		oldpatch = mashup_head;
		mashup_head = patch_copy(p);
		current_patch = mashup_head;
		patch_free(oldpatch);
	}
	renderer_unlock_patch();
}
Example #4
0
void renderer_del_patch(struct patch *p)
{
	struct patch *p1, *p2;
	
	renderer_lock_patch();
	mashup_en--;
	if(mashup_en < 0)
		mashup_en = 0;
	/* Never delete the only patch */
	if(mashup_head->next == NULL) {
		renderer_unlock_patch();
		return;
	}
	if(mashup_head->original == p) {
		if(mashup_head == current_patch)
			renderer_get_patch(1);
		p1 = mashup_head->next;
		patch_free(mashup_head);
		mashup_head = p1;
	} else {
		p1 = mashup_head;
		while((p1->next != NULL) && (p1->next->original != p))
			p1 = p1->next;
		if(p1->next == NULL) {
			/* not found */
			renderer_unlock_patch();
			return;
		}
		if(p1->next == current_patch)
			renderer_get_patch(1);
		p2 = p1->next->next;
		patch_free(p1->next);
		p1->next = p2;
	}
	renderer_unlock_patch();
}
Example #5
0
void renderer_stop(void)
{
	struct patch *p;
	
	rsswall_stop();
	sampler_stop();
	eval_stop();
	raster_stop();

	while(mashup_head != NULL) {
		p = mashup_head->next;
		patch_free(mashup_head);
		mashup_head = p;
	}
	current_patch = NULL;
}
Example #6
0
static void fullscreen_callback(mtk_event *e, void *arg)
{
	struct patch *p;
	char *dummy_filename = "FS";
	char *code = "video_a=1;decay=0;";

	p = patch_compile_filename(dummy_filename, code, dummy_rmc);
	if(p == NULL)
		return;

	close(video_fd);
	input_delete_callback(preview_update);
	resmgr_release(RESOURCE_VIDEOIN);

	guirender(appid, p, stop_callback);

	patch_free(p);
}