void cbox_song_clear(struct cbox_song *song) { while(song->tracks) cbox_object_destroy(song->tracks->data); while(song->patterns) cbox_object_destroy(song->patterns->data); while(song->master_track_items) { struct cbox_master_track_item *mti = song->master_track_items->data; song->master_track_items = g_list_remove(song->master_track_items, mti); cbox_master_track_item_destroy(mti); } }
gboolean cbox_object_try_default_process_cmd(struct cbox_command_target *ct, struct cbox_command_target *fb, struct cbox_osc_command *cmd, const char *subcmd, gboolean *result, GError **error) { // XXXKF this assumes objhdr ptr == object ptr - needs to add the header offset in cmd target? struct cbox_objhdr *obj = ct->user_data; if (!strcmp(subcmd, "/status") && !strcmp(cmd->arg_types, "")) { if (!cbox_object_default_status(obj, fb, error)) { *result = FALSE; return TRUE; } return FALSE; } if (!strcmp(subcmd, "/delete") && !strcmp(cmd->arg_types, "")) { cbox_object_destroy(obj); *result = TRUE; return TRUE; } if (!strcmp(subcmd, "/get_uuid") && !strcmp(cmd->arg_types, "")) { if (!cbox_check_fb_channel(fb, cmd->command, error)) { *result = FALSE; return TRUE; } *result = cbox_uuid_report(&obj->instance_uuid, fb, error); return TRUE; } if (!strcmp(subcmd, "/get_class_name") && !strcmp(cmd->arg_types, "")) { if (!cbox_check_fb_channel(fb, cmd->command, error)) { *result = FALSE; return TRUE; } *result = cbox_execute_on(fb, NULL, "/class_name", "s", error, obj->class_ptr->name); return TRUE; } return FALSE; }