From: Rib R. <ri...@gm...> - 2005-03-18 00:37:49
|
On Thu, 17 Mar 2005 14:51:45 -0800, Joe Emenaker <jo...@em...> wrote: > Rib Rdb wrote: > > >You could do the same type of thing in Java. Then it would look like this: > >/* when the driver is created */ > >// create params in order so addresses are inferred > >decoder.addBooleanParam("Midi Pitch Bend"); > > > >/* Then in the editor */ > >addWidget(leftPane, > > new CheckBoxWidget(patch, decoder.getParam("Midi Pitch Bend")), > > , 0, 10, 1, 1, -3); > > > > > Hey.... that's pretty neat! > > It looks like your "decoder" is what I'm calling a "data-model", no? Yep > Based on that, all we'd have to do is teach addWidget to figure out what > kind of param it's getting and select the right widget automatically. > > Is it possible to explicitly define the addresses of the params? You can add whatever methods you want to your parameters and/or data model. This is supported by the XML driver as well. If your Decoder returns parameters that have the method setAddress(String), then all of the parameters accept <address>0xf00</address> This could either be required or optional (you only have to use it when the value that would be inferred is wrong) |