1 #include "bcf_surface.h"
2 #include "surface_port.h"
3 #include "mackie_midi_builder.h"
7 using namespace Mackie;
9 void BcfSurface::display_bank_start( SurfacePort & port, MackieMidiBuilder & builder, uint32_t current_bank )
11 if ( current_bank == 0 )
13 // send Ar. to 2-char display on the master
14 port.write( builder.two_char_display( "Ar", ".." ) );
18 // write the current first remote_id to the 2-char display
19 port.write( builder.two_char_display( current_bank ) );
23 void BcfSurface::zero_all( SurfacePort & port, MackieMidiBuilder & builder )
25 // clear 2-char display
26 port.write( builder.two_char_display( "LC" ) );
28 // and the led ring for the master strip
29 blank_jog_ring( port, builder );
32 void BcfSurface::blank_jog_ring( SurfacePort & port, MackieMidiBuilder & builder )
34 Control & control = *controls_by_name["jog"];
35 port.write( builder.build_led_ring( dynamic_cast<Pot &>( control ), off ) );
38 float BcfSurface::scaled_delta( const ControlState & state, float current_speed )
40 return state.sign * ( std::pow( float(state.ticks + 1), 2 ) + current_speed ) / 100.0;