Example #1
0
// store everything enabled in given preset
void preset_store(u32 preIdx) {
  u16 i;
  // ins
  for(i=0; i<net_num_ins(); ++i) {
    if( net_get_in_preset(i) ) {
      presets[preIdx].ins[i].value = net_get_in_value(i);
      presets[preIdx].ins[i].enabled = 1;
    }
  }
  // outs
  for(i=0; i<net_num_outs(); ++i) {
    if(net_get_out_preset(i)) {
      presets[preIdx].outs[i].target = net_get_target(i);
      presets[preIdx].outs[i].enabled = 1;
    }
  }
  // params
  /* for(i=0; i<net_num_params(); ++i) { */
  /*   if(get_param_preset(i)) { */
  /*     presets[preIdx].params[i].value =  get_param_value( i ); */
  /*     presets[preIdx].params[i].enabled = 1; */
  /*   } */
  /* } */
  select = preIdx;
}
Example #2
0
// fill tmp region with new content
// given input index and foreground color
static void render_line(s16 idx, u8 fg) {
  const s16 opIdx = net_in_op_idx(idx);  
  region_fill(lineRegion, 0x0);
  if(opIdx >= 0) {
    // operator input
    // build descriptor string
    clearln();
    appendln_idx_lj(opIdx);
    appendln_char('.');
    appendln( net_op_name(opIdx) );
    appendln_char('/');
    appendln( net_in_name(idx) );
    endln();

    font_string_region_clip(lineRegion, lineBuf, 4, 0, fg, 0);
    clearln();
 
    op_print(lineBuf, net_get_in_value(idx));

    font_string_region_clip(lineRegion, lineBuf, LINE_VAL_POS_SHORT, 0, fg, 0);
  } else {
    // parameter input    
    clearln();
    appendln_idx_lj( (int)net_param_idx(idx)); 
    appendln_char('.');
    appendln( net_in_name(idx)); 
    endln();
    font_string_region_clip(lineRegion, lineBuf, 4, 0, 0xa, 0);
    clearln();

    //    op_print(lineBuf, net_get_in_value(idx));
    /// FIXME: this is pretty dumb, 
    // params and inputs should just be on separate pages i guess
    net_get_param_value_string(lineBuf, idx);

    font_string_region_clip(lineRegion, lineBuf, LINE_VAL_POS_LONG, 0, fg, 0);
  }
  // draw something to indicate play mode visibility
  if(net_get_in_play(idx)) {
    font_string_region_clip(lineRegion, ".", 0, 0, fg, 0);
  }
  // draw something to indicate preset inclusion
  if(net_get_in_preset(idx)) {
    font_string_region_clip(lineRegion, ".", 126, 0, fg, 0);
  }

}
Example #3
0
static void show_foot1(void) {
  u8 fill = 0;
  if(keyPressed == 1) {
    fill = 0x5;
  }
  region_fill(footRegion[1], fill);
  if(altMode) {
    if(net_get_in_play(*pageSelect)) {
      font_string_region_clip(footRegion[1], "HIDE", 0, 0, 0xf, fill);
    } else {
      font_string_region_clip(footRegion[1], "SHOW", 0, 0, 0xf, fill);
    }
  } else {
    if(net_get_in_preset(*pageSelect)) {
      font_string_region_clip(footRegion[1], "EXC", 0, 0, 0xf, fill);
    } else {
      font_string_region_clip(footRegion[1], "INC", 0, 0, 0xf, fill);
    }
  }
}
Example #4
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();
}