Esempio n. 1
0
// selected
// called when the page is selected
// assign rendering buffers and UI handlers 
void select_ins(void) { 
  // assign global scroll region pointer
  // also marks dirty
  render_set_scroll(&centerScroll);
  // other regions are static in top-level render, with global handles
  region_fill(headRegion, 0x0);
  font_string_region_clip(headRegion, "INPUTS", 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 ;

}
Esempio n. 2
0
// init
void init_page_outs(void) {
    u8 i, n;
    print_dbg("\r\n alloc OUTS page");
    // allocate regions
    region_alloc(&scrollRegion);
    // init scroll
    scroll_init(&centerScroll, &scrollRegion);
    // fill regions
    region_fill(&scrollRegion, 0x0);
    // fill the scroll with actual line values...
    n = 3;
    i = 0;
    //// need to actually set the scroll region at least temporarily
    render_set_scroll(&centerScroll);
    while(i<5) {
        render_line(i, 0xa);
        render_to_scroll_line(n, i == 0 ? 1 : 0);
        ++n;
        ++i;
    }
}
Esempio n. 3
0
// redraw all lines, based on current selection
void redraw_outs(void) {
    u8 i=0;
    u8 n = *pageSelect - 3;

    // set scroll region
    // FIXME: should be separate function i guess
    render_set_scroll(&centerScroll);

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

    while(i<8) {
        /* print_dbg("\r\n redraw_outs, line: "); */
        /* print_dbg_ulong(i); */
        /* print_dbg("index: "); */
        /* print_dbg_ulong(n); */

        render_line( n, 0xa );
        render_to_scroll_line(i, n == *pageSelect ? 1 : 0);
        ++i;
        ++n;
    }
}
Esempio n. 4
0
// redraw all lines, force selection
void redraw_ins(void) {
  u8 i=0;
  s32 n = *pageSelect - 3;
  // num_ins() includes param count!
  const s32 max = net_num_ins() - 1;

  // set scroll region
  // FIXME: should be separate function i guess
  render_set_scroll(&centerScroll);

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

  while(i<8) {
    print_dbg("\r\n input page redraw, n: ");
    print_dbg_ulong(n);

    if(n == -1) {
      // draw a blank line
      region_fill(lineRegion, 0);
    } else if(n == (max+1)) {
      // draw a blank line
      region_fill(lineRegion, 0);
    } else {
      if(n < -1) {
	n += (max + 2);
      }
      if( n > max ) {
	n -= (max + 2);
      }
      print_dbg(" ,  after wrap: ");
      print_dbg_ulong(n);

      render_line( n, 0xa );
    }
    render_to_scroll_line(i, n == *pageSelect ? 1 : 0);
    ++i;
    ++n;
  }
}
Esempio n. 5
0
//----------------------
// ---- extern 
// init
void init_page_dsp(void) {
  u8 i, n;
  u16 max = files_get_dsp_count() - 1;
  print_dbg("\r\n alloc DSP page");
  // allocate regions
  region_alloc(&scrollRegion);
  // init scroll
  scroll_init(&centerScroll, &scrollRegion);
  // fill regions
  region_fill(&scrollRegion, 0x0);
  // fill the scroll with actual line values...
  n = 3;
  i = 0;
  //// need to actually set the scroll region at least temporarily
  render_set_scroll(&centerScroll);
  // also, reset scroller!
  while(i<5) {
    render_line(i, max);
    render_to_scroll_line(n, i == 0 ? 1 : 0);
    ++n;
    ++i;
  }
}
Esempio n. 6
0
// 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(&centerScroll);
  //  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 ; 

}
Esempio n. 7
0
//=================================
//==== extern definitions
// init
void init_page_ops(void) {
  u8 i, n;
  print_dbg("\r\n alloc OPS page");
  // allocate regions
  region_alloc(&scrollRegion);
  // init scroll
  scroll_init(&centerScroll, &scrollRegion);
  // fill regions
  region_fill(&scrollRegion, 0x0);
  // fill the scroll with actual line values...
  n = 3;
  i = 0;
  //// need to actually set the scroll region at least temporarily
  render_set_scroll(&centerScroll);
  while(i<5) {
    /* print_dbg("\r\n init ops page, line "); */
    /* print_dbg_ulong(i); */
    render_line(i);
    render_to_scroll_line(n, i == 0 ? 1 : 0);
    ++n;
    ++i;
  }
  print_dbg("\r\n done.");
}