// function keys void handle_key_0(s32 val) { // load module if(val == 0) { return; } if(check_key(0)) { notify("loading..."); // don't do this! let it break? // net_clear_user_ops(); // disconnect parameters though net_disconnect_params(); files_load_dsp(*pageSelect); bfin_wait_ready(); scene_query_module(); net_report_params(); bfin_enable(); redraw_ins(); redraw_dsp(); notify("finished loading."); } show_foot(); }
// store void handle_key_0(s32 val) { if(val == 0) { return; } if(check_key(0)) { region_fill(headRegion, 0x0); font_string_region_clip(headRegion, "writing scene to card...", 0, 0, 0xa, 0); headRegion->dirty = 1; render_update(); region_fill(headRegion, 0x0); // files_store_scene_name(sceneData->desc.sceneName, 1); files_store_scene_name(sceneData->desc.sceneName); print_dbg("\r\n stored scene, back to handler"); font_string_region_clip(headRegion, "done writing.", 0, 0, 0xa, 0); headRegion->dirty = 1; render_update(); // refresh // redraw_lines(); redraw_scenes(); } show_foot(); }
// recall void handle_key_1(s32 val) { if(val == 1) { return; } if(check_key(1)) { preset_recall(*pageSelect); } show_foot(); }
// store void handle_key_0(s32 val) { if(val == 0) { return; } if(check_key(0)) { preset_store(*pageSelect); } show_foot(); }
void handle_key_1(s32 val) { if(val == 0) { return; } if(altMode) { if(check_key(1)) { // show / hide on play screen net_toggle_in_play(*pageSelect); // render to tmp buffer render_line(*pageSelect, 0xf); // copy to scroll with highlight render_to_scroll_line(SCROLL_CENTER_LINE, 1); } } else { if(check_key(1)) { // show preset name in head region draw_preset_name(); // include / exclude in preset net_toggle_in_preset(*pageSelect); // render to tmp buffer render_line(*pageSelect, 0xf); // copy to scroll with highlight render_to_scroll_line(SCROLL_CENTER_LINE, 1); } } show_foot(); }
void handle_key_2(s32 val) { if(val == 0) { return; } if(check_key(2)) { if(altMode) { // filter / all } else { if(zeroed) { /// set to max net_set_in_value(*pageSelect, OP_MAX_VAL); zeroed = 0; } else { /// set to 0 net_set_in_value(*pageSelect, 0); zeroed = 1; } // render to tmp buffer render_line(*pageSelect, 0xf); // copy to scroll with highlight render_to_scroll_line(SCROLL_CENTER_LINE, 1); } } show_foot(); }
// copy / clear / confirm void handle_key_2(s32 val) { if(val == 1) { return; } if(check_key(2)) { preset_clear(*pageSelect); } show_foot(); }
// function key handlers void handle_key_0(s32 val) { if(val == 0) { return; } if(altMode) { ///// follow // select target on ins page tmpTarget = net_get_target(*pageSelect); if(tmpTarget >= 0) { pages[ePageIns].select = tmpTarget; set_page(ePageIns); redraw_ins(); } } else { // store // show selected preset name draw_preset_name(); if(check_key(0)) { // store in preset net_set_out_preset(*pageSelect, 1); preset_store_out(preset_get_select(), *pageSelect); // redraw selected line render_line(*pageSelect, 0xa); render_scroll_apply_hl(SCROLL_CENTER_LINE, 1); // TODO: store directly in scene? } } show_foot(); }
void handle_key_1(s32 val) { s16 newOut; if(val == 0) { return; } if(check_key(1)) { if(altMode) { print_dbg("\r\n splitting output: "); print_dbg_ulong(*pageSelect); newOut = net_split_out(*pageSelect); *pageSelect = newOut; redraw_outs(); } else { // include / exclude in selected preset // show preset name in head region draw_preset_name(); // include / exclude in preset net_toggle_out_preset(*pageSelect); // re-draw selected line to update inclusion glyph // render to tmp buffer render_line(*pageSelect, 0xf); // copy to scroll with highlight render_to_scroll_line(SCROLL_CENTER_LINE, 1); } } show_foot(); }
// function keys void handle_key_0(s32 val) { // load module if(val == 0) { return; } if(check_key(0)) { region_fill(headRegion, 0x0); font_string_region_clip(headRegion, "loading DSP module...", 0, 0, 0xa, 0); headRegion->dirty = 1; render_update(); net_clear_user_ops(); files_load_dsp(*pageSelect); bfin_wait_ready(); net_report_params(); bfin_enable(); // render status to head region region_fill(headRegion, 0x0); font_string_region_clip(headRegion, "finished loading.", 0, 0, 0xa, 0); headRegion->dirty = 1; render_update(); } show_foot(); }
// alt void handle_key_3(s32 val) { if ( pages_set_alt(val)) { preset_name(*pageSelect)[cursor] = '\0'; redraw_presets(); render_selection(); } show_foot(); }
void handle_key_3(s32 val) { // alt mode if(val > 0) { altMode = 1; } else { altMode = 0; } show_foot(); }
// recall void handle_key_1(s32 val) { if(val == 1) { return; } if(check_key(1)) { notify("reading..."); files_load_scene(*pageSelect); redraw_ins(); redraw_outs(); redraw_ops(); redraw_scenes(); notify("done reading."); } show_foot(); }
void handle_key_1(s32 val) { #if BFIN_INTERNAL_FLASH if(val == 0) { return; } if(check_key(1)) { notify("writing..."); files_store_default_dsp(*pageSelect); notify("done writing."); } show_foot(); #endif }
// edit the current seleciton static void select_edit(s32 inc) { s16 tmptmp; // print_dbg("\r\n page_outs: select_edit"); // enter target-select mode if(targetSelect == 0) { // print_dbg(" , set targetSelect mode"); targetSelect = 1; /// only change tmp target selection if connected /// thus, unconnected outputs should default in editor to last connection made. tmptmp = net_get_target(*pageSelect); if(tmptmp > -1) { tmpTarget = tmptmp; } } /* print_dbg("\r\n tmpTarget: "); */ /* print_dbg_ulong(tmpTarget); */ // if(inc > 0) { /* print_dbg(" , inc tmpTarget"); */ /* print_dbg(" , value: "); */ /* print_dbg_ulong(tmpTarget); */ // increment tmpTarget tmpTarget += inc; if(tmpTarget >= net_num_ins() ) { tmpTarget -= (net_num_ins() + 1); } if(tmpTarget < -1) { tmpTarget += (net_num_ins() + 1); } /* ++tmpTarget; */ /* if(tmpTarget == net_num_ins()) { */ /* // print_dbg(" , tmpTarget at max"); */ /* // scroll past all inputs : disconnect and wrap */ /* tmpTarget = -1; */ /* } */ /* } else { */ /* --tmpTarget; */ /* if (tmpTarget == -2) { */ /* // print_dbg(" , tmpTarget at min"); */ /* // scrolled down from disconnect: connect and wrap */ /* tmpTarget = net_num_ins() - 1; */ /* } */ /* } */ // render to tmp buffer render_line(*pageSelect, 0xf); // copy to scroll with highlight render_to_scroll_line(SCROLL_CENTER_LINE, 1); show_foot(); // } }
void handle_key_1(s32 val) { /// FIXME: #if 0 // don't store DSP in flash for now if(val == 0) { return; } if(check_key(1)) { // render status to head region // notify("writing..."); // write module as default // files_store_default_dsp(*pageSelect); // notify("done writing."); } show_foot(); #endif }
void handle_key_2(s32 val) { // clear if(val == 1) { return; } if(check_key(2)) { notify("clearing..."); net_clear_user_ops(); redraw_ins(); redraw_outs(); redraw_ops(); redraw_scenes(); notify("done clearing."); } show_foot(); }
// function keys void handle_key_0(s32 val) { if(val == 0) { return; } if(check_key(0)) { // select op's inputs on ins page pages[ePageIns].select = net_op_in_idx(*pageSelect, 0); print_dbg("\r\n got 1st input index for selected op ( "); print_dbg_ulong( *pageSelect ); print_dbg(", result : "); print_dbg_ulong( net_op_in_idx(*pageSelect, 0)); // go to inputs page set_page(ePageIns); redraw_ins(); } show_foot(); }
void handle_key_3(s32 val) { // alt mode altMode = (val > 0); if(altMode) { if(inPresetSelect) { // load selected preset print_dbg("\r\n recalling preset from ins page, idx:"); print_dbg_ulong(preset_get_select()); preset_recall(preset_get_select()); inPresetSelect = 0; redraw_outs(); } } show_foot(); }
void handle_key_2(s32 val) { if(val == 0) { return; } if(check_key(2)) { if(altMode) { // delete last created operator net_pop_op(); } else { // create new operator of selected type net_add_op(userOpTypes[newOpType]); // change selection to last op *pageSelect = net_num_ops() - 1; } redraw_ops(); } show_foot(); }
void handle_key_2(s32 val) { if(val == 0) { return; } if(check_key(2)) { if(targetSelect) { // we are selecting a target, so perform the connection net_connect(*pageSelect, tmpTarget); targetSelect = 0; } else { // not selecting, clear current connection net_disconnect(*pageSelect); // re-draw selected line render_line(*pageSelect, 0xf); // copy to scroll with hi,ghlight render_to_scroll_line(SCROLL_CENTER_LINE, 1); } } show_foot(); }
// select void select_dsp(void) { // assign global scroll region pointer // also marks dirty render_set_scroll(¢erScroll); // other regions are static in top-level render, with global handles region_fill(headRegion, 0x0); font_string_region_clip(headRegion, "MODULES", 0, 0, 0xf, 0x1); show_foot(); // assign handlers app_event_handlers[ kEventEncoder0 ] = &handle_enc_0 ; app_event_handlers[ kEventEncoder1 ] = &handle_enc_1 ; app_event_handlers[ kEventEncoder2 ] = &handle_enc_2 ; app_event_handlers[ kEventEncoder3 ] = &handle_enc_3 ; app_event_handlers[ kEventSwitch0 ] = &handle_key_0 ; app_event_handlers[ kEventSwitch1 ] = &handle_key_1 ; app_event_handlers[ kEventSwitch2 ] = &handle_key_2 ; app_event_handlers[ kEventSwitch3 ] = &handle_key_3 ; }
// function keys void handle_key_0(s32 val) { // load module if(val == 0) { return; } if(check_key(0)) { notify("loading..."); net_disconnect_params(); files_load_dsp(*pageSelect); bfin_wait_ready(); bfin_enable(); redraw_ins(); redraw_dsp(); notify("finished loading."); } show_foot(); }
void handle_key_1(s32 val) { if(val == 0) { return; } if(check_key(1)) { if(altMode) { // TODO: split } else { // include / exclude in selected preset // show preset name in head region draw_preset_name(); // include / exclude in preset net_toggle_out_preset(*pageSelect); // re-draw selected line to update inclusion glyph // render to tmp buffer render_line(*pageSelect, 0xf); // copy to scroll with highlight render_to_scroll_line(SCROLL_CENTER_LINE, 1); } } show_foot(); }
//------------------------ //-- handlers // function keys void handle_key_0(s32 val) { if(val == 0) { return; } if(altMode) { // gather /// TODO } else { // show selected preset name draw_preset_name(); if(check_key(0)) { // store in preset net_set_in_preset(*pageSelect, 1); preset_store_in(preset_get_select(), *pageSelect); // redraw selected line render_line(*pageSelect, 0xf); render_to_scroll_line(SCROLL_CENTER_LINE, 1); } } show_foot(); }
// select void select_scenes(void) { // print_dbg("\r\n select SCENES... "); // assign global scroll region pointer // also marks dirty // print_dbg("\r\n set scroll region..."); render_set_scroll(¢erScroll); // print_dbg("\r\n fill head region..."); // other regions are static in top-level render, with global handles region_fill(headRegion, 0x0); font_string_region_clip(headRegion, "SCENES", 0, 0, 0xf, 0x1); show_foot(); // assign handlers // print_dbg("\r\n assign page handlers....."); app_event_handlers[ kEventEncoder0 ] = &handle_enc_0 ; app_event_handlers[ kEventEncoder1 ] = &handle_enc_1 ; app_event_handlers[ kEventEncoder2 ] = &handle_enc_2 ; app_event_handlers[ kEventEncoder3 ] = &handle_enc_3 ; app_event_handlers[ kEventSwitch0 ] = &handle_key_0 ; app_event_handlers[ kEventSwitch1 ] = &handle_key_1 ; app_event_handlers[ kEventSwitch2 ] = &handle_key_2 ; app_event_handlers[ kEventSwitch3 ] = &handle_key_3 ; }
void handle_key_1(s32 val) { if(val == 0) { return; } if(check_key(1)) { print_dbg("\r\n got 1st output index for selected op ( "); print_dbg_ulong( *pageSelect ); print_dbg(", result : "); print_dbg_ulong( net_op_out_idx(*pageSelect, 0)); // select op's outputs on outs page pages[ePageOuts].select = net_op_out_idx(*pageSelect, 0); print_dbg("\r\n performed set-selection"); // go to outputs page set_page(ePageOuts); print_dbg("\r\n performed select-page"); // redraw_outs(); print_dbg("\r\n performed redraw"); } show_foot(); }
// edit the current seleciton static void select_edit(s32 inc) { // print_dbg("\r\n page_outs: select_edit"); // enter target-select mode if(targetSelect == 0) { // print_dbg(" , set targetSelect mode"); targetSelect = 1; tmpTarget = net_get_target(*pageSelect); } /* print_dbg("\r\n tmpTarget: "); */ /* print_dbg_ulong(tmpTarget); */ if(inc > 0) { /* print_dbg(" , inc tmpTarget"); */ /* print_dbg(" , value: "); */ /* print_dbg_ulong(tmpTarget); */ // increment tmpTarget ++tmpTarget; if(tmpTarget == net_num_ins()) { // print_dbg(" , tmpTarget at max"); // scroll past all inputs : disconnect and wrap tmpTarget = -1; } } else { --tmpTarget; if (tmpTarget == -2) { // print_dbg(" , tmpTarget at min"); // scrolled down from disconnect: connect and wrap tmpTarget = net_num_ins() - 1; } } // render to tmp buffer render_line(*pageSelect, 0xf); // copy to scroll with highlight render_to_scroll_line(SCROLL_CENTER_LINE, 1); show_foot(); // } }