3#ifndef PRINTLINES_ALLOWED
4#define PRINTLINES_ALLOWED 0
7static const char *FNAME =
"kest_profile.c";
11static int next_preliminary_profile_id = 1;
23 profile->view_page = NULL;
27 profile->
id = next_preliminary_profile_id++;
29 profile->
fname[0] = 0;
35 #ifdef KEST_ENABLE_SEQUENCES
36 #ifdef KEST_ENABLE_GLOBAL_CONTEXT
39 profile->sequence = NULL;
50 #ifdef KEST_ENABLE_REPRESENTATIONS
51 profile->file_rep.representee = profile;
52 profile->file_rep.representer = NULL;
54 profile->representations = NULL;
55 kest_representation_pll_safe_append(&profile->representations, &profile->file_rep);
100 #ifdef KEST_ENABLE_REPRESENTATIONS
101 if (!profile || !rep)
104 kest_representation_pll *nl = kest_representation_pll_append(profile->representations, rep);
107 profile->representations = nl;
111 KEST_PRINTF(
"profile->representations = %p\n", profile->representations);
121 #ifdef KEST_ENABLE_REPRESENTATIONS
125 if (profile->representations)
134 #ifdef KEST_ENABLE_REPRESENTATIONS
146 KEST_PRINTF(
"kest_profile_set_default_name_from_id\n");
154 int id_div = profile->
id;
156 for (id_digits = 0; id_div || !id_digits; id_div = id_div / 10)
167 sprintf(profile->
name,
"Profile %d", profile->
id);
179 KEST_PRINTF(
"kest_profile_append_effect_eff(profile = %p, eff = %p)\n", eff);
240 #ifdef KEST_ENABLE_UI
241 dest->view_page = NULL;
252 #ifdef KEST_ENABLE_UI
253 KEST_PRINTF(
"Gut view page %p...\n", profile->view_page);
254 if (profile->view_page)
255 profile->view_page->free_all(profile->view_page);
257 profile->view_page = NULL;
264 profile->
name = NULL;
292void new_profile_receive_id(kest_message msg, kest_response response)
298 KEST_PRINTF(
"ERROR: Profile ID recieved, but no profile associated !\n");
303 memcpy(&
id, response.data,
sizeof(uint16_t));
305 KEST_PRINTF(
"New profile recieved its ID: %d\n",
id);
323 KEST_PRINTF(
"ERROR: Couldn't create new profile\n");
327 kest_message msg = create_m_message_nodata(KEST_MESSAGE_CREATE_PROFILE);
329 msg.callback = new_profile_receive_id;
330 msg.cb_arg = new_profile;
332 queue_msg_to_teensy(msg);
342#ifdef KEST_ENABLE_GLOBAL_CONTEXT
349 KEST_PRINTF(
"ERROR: Couldn't create new profile\n");
353 #ifdef KEST_ENABLE_UI
363 #ifdef KEST_ENABLE_SDCARD
372 #ifdef KEST_ENABLE_REPRESENTATIONS
385 if (!profile || !batch)
388 KEST_PRINTF(
"kest_profile_create_fpga_transfer_batch(profile = %p, batch = %p)\n", profile, batch);
438 #ifdef KEST_ENABLE_REPRESENTATIONS
void kest_free(void *ptr)
void * kest_alloc(size_t size)
char * kest_strndup(const char *str, size_t n)
kest_profile * kest_context_add_profile_rp(kest_context *cxt)
int effect_rectify_param_ids(kest_effect *effect)
const char * kest_error_code_to_string(int error_code)
#define ERR_FEATURE_DISABLED
int save_profile(kest_profile *profile)
int kest_fpga_queue_program_batch(kest_fpga_transfer_batch batch)
#define IMPLEMENT_LINKED_PTR_LIST(X)
int init_parameter(kest_parameter *param, const char *name, float level, float min, float max)
void clone_parameter(kest_parameter *dest, kest_parameter *src)
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 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)
int kest_profile_if_active_update_fpga(kest_profile *profile)
int kest_profile_program_fpga(kest_profile *profile)
int kest_profile_remove_effect(kest_profile *profile, uint16_t id)
void kest_profile_file_rep_update(void *representer, void *representee)
kest_effect * kest_profile_get_effect_by_id(kest_profile *profile, int id)
int kest_profile_add_representation(kest_profile *profile, kest_representation *rep)
int init_m_profile(kest_profile *profile)
int clone_profile(kest_profile *dest, kest_profile *src)
int kest_profile_save(kest_profile *profile)
int kest_profile_remove_representation(kest_profile *profile, kest_representation *rep)
void free_profile(kest_profile *profile)
int profile_set_id(kest_profile *profile, uint16_t id)
int kest_profile_update_representations(kest_profile *profile)
int kest_profile_set_active(kest_profile *profile)
kest_profile * create_new_profile_with_teensy()
int kest_profile_set_inactive(kest_profile *profile)
void gut_profile(kest_profile *profile)
void kest_free_profile(kest_profile *profile)
kest_effect * kest_profile_append_effect_eff(kest_profile *profile, kest_effect_desc *eff)
int kest_profile_move_effect(kest_profile *profile, int new_pos, int old_pos)
int kest_profile_create_fpga_transfer_batch(kest_profile *profile, kest_fpga_transfer_batch *batch)
int kest_profile_set_default_name_from_id(kest_profile *profile)
#define PROFILE_NAME_MAX_LEN
kest_ui_page * create_profile_view_for(kest_profile *profile)
int queue_representation_list_update(kest_representation_pll *reps)
kest_representation_pll * kest_representation_pll_remove(kest_representation_pll *reps, kest_representation *rep)
char fname[KEST_FILENAME_LEN]