
JUNE is a Nim binding of the JUCE framework, allowing fast prototyping JUCE applications in your favourite compiled programming language.
Build the JUCE shared library.
nimble juce_debug
# nimble juce_releaseThen build the nim test (tweak nim.cfg if needed).
nimble app_debug
# nimble app_releaseA simple example application (subject to changes):
import june
{.emit: """/*INCLUDESECTION*/#include <june.h>""".}
defineCppClassTestApplicationofJUCEApplication:
window: ptrDocumentWindowprocconstructTestApplication*(): TestApplication=result=TestApplication()
proccreateApplication(): ptrJUCEApplication=var application: ptrTestApplication=cnewconstructTestApplication()
application.window =nil
application[].onGetApplicationName =bindClosure(proc(): String="JUNE App")
application[].onGetApplicationVersion =bindClosure(proc(): String="0.1")
application[].onInitialise =bindClosure(proc(commandLine: String) =var windowName = application[].getApplicationName()
application[].window =newDocumentWindow(windowName, makeColour(50'u8, 62'u8, 68'u8, 255'u8), DocumentWindow_allButtons, true)
application[].window[].onCloseButtonPressed =bindClosure(proc() =JUCEApplication.getInstance().systemRequestedQuit())
application[].window[].setResizable(true, true)
application[].window[].centreWithSize(640, 480)
application[].window[].setVisible(true)
)
application[].onShutdown =bindClosure(proc() =cdelete(application[].window)
application[].window =nil
)
application[].onSystemRequestedQuit =bindClosure(proc() = application[].quit())
result= application
whenisMainModule:
START_JUCE_APPLICATION(createApplication)Will look like this:
