Пример #1
0
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();
}
Пример #2
0
// 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();
}
Пример #3
0
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();
}
Пример #4
0
//------------------------
//-- 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();
}
Пример #5
0
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();
}
Пример #6
0
// redraw based on provisional preset seleciton
void redraw_outs_preset (void) {
    //  s32 max = net_num_outs() - 1;

    /*
    u8 i=0;
    u8 idx = *pageSelect - 3;
    u8 fg;
    u8 enabled;
    s16 target;
    s16 targetOpIdx = -1;
    s16 srcOpIdx;
    */

    //  s32 preSel = preset_get_select();

    print_dbg("\r\n redraw_outs_preset()");

    //ppfffaaaggh
    /*
    while(i<8) {
      region_fill(lineRegion, 0x0);
      if(idx >= net_num_outs() ) { return; }

      //    enabled = preset_out_enabled(preSel, idx);
      //??
      enabled = preset_get_selected()->outs[idx].enabled;

      if(enabled) {
        // if it's enabled, show the preset's target (including if no target/disconnection)
        target = preset_get_selected()->outs[idx].target;
        srcOpIdx = net_out_op_idx(idx);
        targetOpIdx = net_in_op_idx(target);
        if(target >= 0) {
    //// output has target
    // the network doesn't actually execute connections from an op to itself.
    // reflect this in UI by dimming this line
    if(targetOpIdx == srcOpIdx) { fg = 0x5; }
    // render output
    clearln();
    appendln_idx_lj(srcOpIdx);
    appendln_char('.');
    appendln( net_op_name(srcOpIdx));
    appendln_char('/');
    appendln( net_out_name(idx) );
    endln();
    font_string_region_clip(lineRegion, lineBuf, 2, 0, fg, 0);
    // render target
    targetOpIdx = net_in_op_idx(target);
    clearln();
    appendln("-> ");
    if(targetOpIdx >= 0) {
      // target is operator input
      appendln_idx_lj(net_in_op_idx(target));
      appendln_char('.');
      appendln( net_op_name(net_in_op_idx(target)) );
      appendln_char('/');
      appendln( net_in_name(target) );
    } else {
      // target is parameter input
      appendln_idx_lj( (int)net_param_idx(target));
      appendln_char('.');
      appendln( net_in_name(target));
    }
    endln();
    font_string_region_clip(lineRegion, lineBuf, 60, 0, fg, 0);
    clearln();
        } else {
    //// no target
    // render output
    clearln();
    appendln_idx_lj(net_out_op_idx(idx));
    appendln_char('.');
    appendln( net_op_name(net_out_op_idx(idx)));
    appendln_char('/');
    appendln( net_out_name(idx) );
    endln();
    font_string_region_clip(lineRegion, lineBuf, 2, 0, fg, 0);
        }
        // draw something to indicate preset inclusion
        if(net_get_out_preset(idx)) {
    font_string_region_clip(lineRegion, ".", 126, 0, fg, 0);
        }

      } else {
        // not enabled, draw as normal with dim coloring
        render_line(idx, 0x5);
      }

      render_to_scroll_line(i, 0);
      ++i;
      ++idx;
    }
    */
    draw_preset_name();
}
Пример #7
0
// redraw based on provisional preset seleciton
void redraw_ins_preset ( void ) {
  s32 max = net_num_ins() - 1;
  u8 i=0;
  u8 n = *pageSelect - 3;
  u8 enabled;
  io_t opVal;
  s32 paramVal;
  s16 opIdx;


  print_dbg("\r\n redraw_ins_preset() ");


  while(i<8) {
    region_fill(lineRegion, 0x0);

    opIdx = net_in_op_idx(n);  

    if(n <= max) {
      enabled = net_get_in_preset(n);
      if(opIdx < 0 ) {
	// parameter...
	clearln();
	appendln_idx_lj( (int)net_param_idx(n)); 
	appendln_char('.');
	appendln( net_in_name(n)) ; 
	endln();
	font_string_region_clip(lineRegion, lineBuf, 4, 0, 0xf, 0);
	clearln();

	if(enabled) {
	  paramVal = preset_get_selected()->ins[n].value;
	  net_get_param_value_string_conversion(lineBuf, net_param_idx(n), paramVal);
	} else {
	  net_get_param_value_string(lineBuf, n);
	}
	font_string_region_clip(lineRegion, lineBuf, LINE_VAL_POS_LONG, 0, 0xf, 0);
      } else {
	// op input
	clearln();
	appendln_idx_lj(opIdx);
	appendln_char('.');
	appendln( net_op_name(opIdx) );
	appendln_char('/');
	appendln( net_in_name(n) );
	endln();

	font_string_region_clip(lineRegion, lineBuf, 4, 0, 0xf, 0);

	if(enabled) {
	  opVal = preset_get_selected()->ins[n].value;
	} else {
	  opVal = net_get_in_value(n);
	}
	op_print(lineBuf, opVal);

	font_string_region_clip(lineRegion, lineBuf, LINE_VAL_POS_SHORT, 0, 0xf, 0);
      }
      // draw something to indicate preset inclusion
      if(enabled) {
	font_string_region_clip(lineRegion, ".", 126, 0, 0xf, 0);
      }
    }
    render_to_scroll_line(i, 0);
    ++i;
    ++n;
  }
  //  print_dbg("\r\n\r\n");
  draw_preset_name();
}