From: Joe E. <jo...@em...> - 2005-05-14 21:07:51
|
Rib Rdb wrote: >On 5/14/05, Joe Emenaker <jo...@em...> wrote: > > >>I think I'm going to investigate implementing a "listener" system with >>the midi input queues.... where various parts of the program add >>themselves as "listeners" to be notified when a message comes in. Seems >>like a better way than to have SysexGetDialog running a timer to poll >>the inport. >> >> >That sounds good. Perhaps each listener should also have a regular >expression or something specifying which messages it wants to get. > > Well, I'm trying to do things the same way the JFC does things... and they usually do things like that with "filters". For example, go look at java.io.FileFilter. It's an interface with one method: boolean accepts(File f) and then you can make your own filters, or use one of a few pre-made generic ones. So, I was thinking of making a pre-made filter which let you turn on/off the various classes of messages: PC, CC, sysex, note on/off, panic, etc. However, there are two reasons I won't be doing that *quite* yet. First, my "QueueObserver" interface only notifies that a message was received and it lets you know which queu it came into. It doesn't give you the actual message. Second, it looks like the lowest-level sysex handlers in JSL immediate discard any non-sysex messages. This is why the MidiMonitor window never shows any CC's, PC's, etc. >>Also, what does everyone else think about JSL being able to receive a >>patch even when the SysexGetDialog isn't open? For example, if JSL is >>just sitting there, and you dump a patch from a synth, it could pop up a >>message saying "JSL just received a patch dump which looks like a Alesis >>DM5 Bank. Would you like to save it in your current library or discard >>it?". Then, all the SysexGetDialog class would need to do is arrange to >>send out dump requests (and notify the receiving mechanism that a >>certain type of patch is expected). >> >> >Would it even need to do the notification? We'd just need to make sure >the incoming messages were routed correctly, wouldn't we. > > Well, I think that, from a user-experience point of view, you wouldn't want various sysex dumps just accumulating in your libraries. If the SysexGetDialog were open, then it could automatically insert them... but I think that, if you didn't have the dialog open, then you're not really "expecting" anything coming in, so it's probably nice to have JSL ask the user. Of course, we could also make this an on/off option, where the user *could* decide to automatically accept incoming dumps. - Joe |