void frontier_push(board_node *node) { list *item = init_item(node); get_head(); while(frontier->next != NULL) { board_node *l_node = frontier->node; if (l_node->cost < node->cost) { break; } frontier = frontier->next; } item->next = frontier; item->prev = frontier->prev; if (frontier->prev != NULL) { frontier->prev->next = item; } frontier->prev = item; frontier = item; list_rewind(frontier); }
//Update all the widgets void GHEffectViews_renderEffects(LinkedList* effectParams) { GHEffectParamView* param; list_rewind(effectParams); //List over all the parameters. while((param = list_next(effectParams))) { //Knobs need to be repainted every time. Otherwise the animated cursor would erase the position indicators. if (param->knob) { renderKnob(param); } //If the parameter value hasn't changed, we can carry on if (!param->invalidated) continue; //Display text-based widgets if they are defined if (param->nameShard) { GHTextShards_displaySingle(param->nameShard); } if (param->valueShard) { formatParamTextValue(param->valueShard->value, param->controller); GHTextShards_displaySingle(param->valueShard); } //Display button if it is defined if(param->button) { renderButton(param); } //invalidated is set to 1 when the value of a parameter changes. The update then needs to happen twice in a row in order to fill both buffers. if(param->invalidated==2) param->invalidated = 0; else param->invalidated = 2; } }
list *get_head() { list_rewind(frontier); return frontier; }