Anyone interested in juce bindings with minimal effort ?
from juce_bindings import juce, START_JUCE_APPLICATION
class MainComponent(juce.Component):
def paint(self, g):
g.fillAll(juce.Colours.black)
random = juce.Random.getSystemRandom()
rect = juce.Rectangle[int](0, 0, 20, 20)
for _ in range(100):
g.setColour(juce.Colour(
random.nextInt(256),
random.nextInt(256),
random.nextInt(256)))
rect.setCentre(random.nextInt(self.getWidth()), random.nextInt(self.getHeight()))
g.drawRect(rect)
class MainWindow(juce.DocumentWindow):
def __init__(self):
super().__init__(
juce.JUCEApplication.getInstance().getApplicationName(),
juce.Colours.red,
juce.DocumentWindow.allButtons,
True)
self.component = MainComponent()
self.setResizable(True, True)
self.setContentNonOwned(self.component, True)
self.centreWithSize(400, 300)
self.setVisible(True)
def __del__(self):
del self.component
def closeButtonPressed(self):
juce.JUCEApplication.getInstance().systemRequestedQuit()
class Application(juce.JUCEApplication):
def getApplicationName(self):
return "Super JUCE-o-matic"
def getApplicationVersion(self):
return "1.0"
def initialise(self, commandLine):
self.window = MainWindow()
def shutdown(self):
if hasattr(self, "window") and self.window:
self.window.setVisible(False)
del self.window
if __name__ == "__main__":
START_JUCE_APPLICATION(Application)