Creating classes that can reference GUI items
Posted: Sun Feb 17, 2019 9:58 am
Maybe my lack of detailed understanding of Java coding, or the lack of detailed development documentation, but now I have a way to calculate the BPM from a gate reasonably accurately/reliably (although far from perfect), I was thinking about making it into a class that I can generalise and use across my modules.
In doing so, I have tried to work out how to reference the input jack that I want to be able the class to reference, which will then be called in initialisation (setting the jack to be monitoring), on a named timer (which looks at the signal on the jack), when the jack is connected or disconnected and when the value that is a running calculation is needed. I have tried a couple of things by looking through the code, but can't seem to setup a variable that I can use to reference the jack, check it is an AudioInput jack and use the GetValue and IsConnected methods on.
Any help/pointers on this would be really useful.
In doing so, I have tried to work out how to reference the input jack that I want to be able the class to reference, which will then be called in initialisation (setting the jack to be monitoring), on a named timer (which looks at the signal on the jack), when the jack is connected or disconnected and when the value that is a running calculation is needed. I have tried a couple of things by looking through the code, but can't seem to setup a variable that I can use to reference the jack, check it is an AudioInput jack and use the GetValue and IsConnected methods on.
Any help/pointers on this would be really useful.