@@ -307,26 +307,25 @@ class ControlPanel {
307307
308308class DataSourceBox {
309309 public int x, y, w, h, padding; // size and position
310- private int numItems ;
310+ private final int NUM_ITEMS = 5 ;
311311 private int boxHeight = 24 ;
312312 private int spacing = 43 ;
313313 private ControlP5 datasource_cp5;
314314 private MenuList sourceList;
315315 private boolean initialUpdate = false ;
316316
317317 DataSourceBox (int _x , int _y , int _w , int _h , int _padding ) {
318- numItems = 6 ;
319318 x = _x;
320319 y = _y;
321320 w = _w;
322- h = spacing + (numItems * boxHeight);
321+ h = spacing + (NUM_ITEMS * boxHeight);
323322 padding = _padding;
324323
325324 // Instantiate local cp5 for this box
326325 datasource_cp5 = new ControlP5 (ourApplet);
327326 datasource_cp5. setGraphics(ourApplet, 0 ,0 );
328327 datasource_cp5. setAutoDraw(false );
329- createDatasourceList(datasource_cp5, " DataSourceList" , x + padding, y + padding* 2 + 13 , w - padding* 2 , numItems * boxHeight, p3);
328+ createDatasourceList(datasource_cp5, " DataSourceList" , x + padding, y + padding* 2 + 13 , w - padding* 2 , NUM_ITEMS * boxHeight, p3);
330329 }
331330
332331 public void update () {
@@ -356,8 +355,6 @@ class DataSourceBox {
356355 private void createDatasourceList (ControlP5 _cp5 , String name , int _x , int _y , int _w , int _h , PFont font ) {
357356 sourceList = new MenuList (_cp5, name, _w, _h, font);
358357 sourceList. setPosition(_x, _y);
359- // sourceList.itemHeight = 28;
360- // sourceList.padding = 9;
361358 sourceList. addItem(" CYTON (live)" , DATASOURCE_CYTON );
362359 sourceList. addItem(" GANGLION (live)" , DATASOURCE_GANGLION );
363360 sourceList. addItem(" PLAYBACK (from file)" , DATASOURCE_PLAYBACKFILE );
0 commit comments