3#ifndef PRINTLINES_ALLOWED
4#define PRINTLINES_ALLOWED 0
7static const char *FNAME =
"kest_pipeline.c";
21 if (!pipeline || !eff)
29 kest_effect_pll *node =
kest_alloc(
sizeof(kest_effect_pll));
46 int least_free_id = 0;
47 kest_effect_pll *current = pipeline->
effects;
53 if (current->data->id >= least_free_id)
54 least_free_id = current->data->id + 1;
58 current = current->next;
63 effect->
id = least_free_id;
76 kest_effect_pll *current = pipeline->
effects;
77 kest_effect_pll *prev = NULL;
81 if (current->data && current->data->id ==
id)
87 prev->next = current->next;
89 pipeline->
effects = current->next;
93 KEST_PRINTF(
"kest_pipeline_remove_effect found and vanquished the effect\n");
98 current = current->next;
102 KEST_PRINTF(
"kest_pipeline_remove_effect finished without finding the effect\n");
114 kest_effect_pll *target = NULL;
117 kest_effect_pll *current = pipeline->
effects;
118 kest_effect_pll *prev = NULL;
120 while (current && i < old_pos)
123 current = current->next;
133 prev->next = target->next;
135 pipeline->
effects = target->next;
141 while (current && i < new_pos)
144 current = current->next;
148 target->next = current;
165 kest_effect_pll *current = pipeline->
effects;
171 current = current->next;
184 kest_effect_pll *current = src->
effects;
191 KEST_PRINTF(
"Cloning effect %d... current = %p, current->next = %p\n", i, current, current->next);
201 nl = kest_effect_pll_append(dest->
effects, effect);
207 current = current->next;
225 KEST_PRINTF(
"kest_pipeline_create_fpga_transfer_batch(pipeline = %p, batch = %p)\n", pipeline, batch);
276 KEST_PRINTF(
"searching pipelime %p for a effect with ID %d.\n", pipeline,
id);
278 kest_effect_pll *current = pipeline->
effects;
280 KEST_PRINTF(
"Beginning on the list%s\n", (!current) ?
"..... which is empty! :0\n" :
"");
294 if (current->data && current->data->id ==
id)
296 KEST_PRINTF(
"This is the desired effect! Great. Return it\n");
297 return current->data;
299 current = current->next;
303 KEST_PRINTF(
"The desired effect was not found :(\n");
void kest_free(void *ptr)
void * kest_alloc(size_t size)
void free_effect(kest_effect *effect)
int init_effect_from_effect_desc(kest_effect *effect, kest_effect_desc *eff)
int clone_effect(kest_effect *dest, kest_effect *src)
const char * kest_error_code_to_string(int error_code)
#define ERR_INVALID_TRANSFORMER_ID
int kest_fpga_batch_append_effects(kest_fpga_transfer_batch *batch, kest_effect_pll *list, kest_eff_resource_report *res, int *pos)
int kest_fpga_batch_append(kest_fpga_transfer_batch *seq, uint8_t x)
void kest_free_fpga_transfer_batch(kest_fpga_transfer_batch batch)
kest_fpga_transfer_batch kest_new_fpga_transfer_batch()
#define COMMAND_BEGIN_PROGRAM
#define COMMAND_END_PROGRAM
int kest_pipeline_move_effect(kest_pipeline *pipeline, int new_pos, int old_pos)
kest_effect * kest_pipeline_append_effect_eff(kest_pipeline *pipeline, kest_effect_desc *eff)
kest_effect * kest_pipeline_get_effect_by_id(kest_pipeline *pipeline, int id)
int kest_pipeline_get_n_effects(kest_pipeline *pipeline)
int init_m_pipeline(kest_pipeline *pipeline)
int kest_pipeline_remove_effect(kest_pipeline *pipeline, uint16_t id)
int kest_pipeline_create_fpga_transfer_batch(kest_pipeline *pipeline, kest_fpga_transfer_batch *batch)
void gut_pipeline(kest_pipeline *pipeline)
int clone_pipeline(kest_pipeline *dest, kest_pipeline *src)
kest_eff_resource_report empty_m_eff_resource_report()
kest_effect_pll * effects