OpenBCI_GUI: Adding UI elements inside the Playground Class
Greetings all,
I'm trying to add some UI elements that will be constrained by and only show while the "Developer Playground" is expanded. If there's a better method please let me know.
I've taken some Minim audioplayer code from a player with oscilloscope that I already have in Processing. I've got the audio and oscilloscope working nicely and can have it stop/start audio after I pick which MP3 to load. I'm having some trouble identifying the best way to confine the controls and oscilloscope to the playground area and to only have it show while expanded.
Any tips would be greatly appreciated. My original code was something like this:
I'm trying to add some UI elements that will be constrained by and only show while the "Developer Playground" is expanded. If there's a better method please let me know.
I've taken some Minim audioplayer code from a player with oscilloscope that I already have in Processing. I've got the audio and oscilloscope working nicely and can have it stop/start audio after I pick which MP3 to load. I'm having some trouble identifying the best way to confine the controls and oscilloscope to the playground area and to only have it show while expanded.
Any tips would be greatly appreciated. My original code was something like this:
I've got the oscilloscope right below the text("Developer Playground", x + 10, y + 10); in the Playground class but that's definitely not right. What's the best bet for making sure everything stays within these variables?xCenter = width/2;yCenter = height/2;for(int i = 0; i < player.bufferSize() - 1; i++){//line(x1, y1, x2, y2)line(i, yCenter-200+player.left.get(i)*100, i+1, yCenter-200+player.left.get(i+1)*100);line(i, yCenter+200+player.right.get(i+1)*100, i+1, yCenter+200+player.right.get(i)*100);}
x = width;y = topMargin;w = 0;h = height - (topMargin+bottomMargin);
Will provide the code via Github once done.
Thanks so much,
Corey
Thanks so much,
Corey
Comments
I've done this for the oscilloscope:
-Corey
Thanks for the feedback.
Conor