@@ -120,32 +120,12 @@ void updateInputs() {
120120 }
121121}
122122
123-
124- /* *
125- * Draw vertical slider with a "thumb" position identifying value
126- * thumpos ranges 0.0-1.0
127- */
128- void draw_vertical_slider (int x, int y, float thumbpos, int w=5 , int h=63 , int thumbw=5 , int thumbh=10 ) {
129- int ypos = thumbpos * h;
130- display.drawRect ( x, y, w, h, WHITE ); // right side scroll bar
131- display.fillRect ( x, y + ypos, thumbw, thumbh, WHITE ); // FIXME
132- }
133- /* *
134- * Draw horizontal slider with a "thumb" position identifying value
135- * thumpos ranges 0.0-1.0
136- */
137- void draw_horizontal_slider (int x, int y, float thumbpos, int w=127 , int h=5 , int thumbw=10 , int thumbh=5 ) {
138- int xpos = thumbpos * (w-thumbw);
139- display.drawRect ( x, y-h, w, h, WHITE ); // right side scroll bar
140- display.fillRect ( x+xpos, y-h, thumbw, thumbh, WHITE ); // FIXME
141- }
142-
143123/* *
144124 *
145125 */
146126void updateDisplay () {
147127 // delay(50);
148- char buf [20 ];
128+ char buf1[ 20 ], buf2 [20 ];
149129 float xpos, ypos;
150130 int hp = hilite_param + param_offset;
151131
@@ -164,23 +144,19 @@ void updateDisplay() {
164144 display.setFont (&myfont);
165145 display.setTextColor (WHITE, 0 );
166146
167- draw_vertical_slider ( 122 , 0 , (float )param_offset / (num_params-num_disp_params+1 ));
147+ synthui. draw_vertical_slider ( 122 , 0 , (float )param_offset / (num_params-num_disp_params+1 ));
168148
169149 for (int i = 0 ; i < num_disp_params; i++) {
170- display.setFont ( i==hilite_param ? &myfontB : &myfont );
150+ // display.setFont( );
171151 int io = i + param_offset;
172152 int loff = line_offset + i * line_spacing;
173153 if (io < num_params) {
174- snprintf (buf, 20 , " %s" , params[io].name );
175- display.setCursor (5 , loff); // param name
176- display.print (buf);
177- display.setFont (&myfontSM);
178- snprintf (buf, 20 , params[io].fmt , params[io].val ); // param value
179- // display.setFont( i==hilite_param ? &myfontB : &myfont);
180- display.setCursor (45 , loff);
181- display.print (" : " );
182- display.print (buf);
183- draw_horizontal_slider ( 80 , loff, params[io].percent (), 30 , 5 );
154+ snprintf (buf1, 20 , " %s" , params[io].name );
155+ snprintf (buf2, 20 , params[io].fmt , params[io].val ); // param value
156+ synthui.print_text (5 , loff, buf1, i==hilite_param ? &myfontB : &myfont);
157+ synthui.print_text (45 , loff, " :" , &myfontSM);
158+ synthui.print_text (50 , loff, buf2);
159+ synthui.draw_horizontal_slider ( 80 , loff, params[io].percent (), 35 , 7 ,7 );
184160 }
185161 }
186162
0 commit comments