Hello, Mixxx people!
I’ve been absent for a while, so first of all: to the development team, great work on the 2.1 release! I’m particularly happy to see the new Effect Unit design - I expect that now working with fx will be an enjoyable challenge - as it should be - instead of a nightmare.
And to whoever was trying to contact me a while back about the Denon MCX8000 mapping - sorry I didn’t respond. I’ve been going through some big life changes, and sometimes keeping myself together is the only project I have time for. And I guess I have a bit of seasonal depression on top of that
The good news is that I still love DJing, and I still love Mixxx and my MCX8000, and I’m eager to get them working together perfectly. So I’ve gotten back to that mapping, and I’ve been attempting to convert it to the components framework. For my own purposes, it would be fine to use the new EffectUnit component and leave the rest as is, but in case someone else wants to read my code, I suppose it is a good idea to consistently follow the recommended architecture. And there were a few things that needed to be overhauled anyway.
I’ve run into a few issues. It’s mostly random details that I don’t quite understand (and yes, I think the documentation could use some work - but that’s another discussion, and I may be able to help with that task). But there is one aspect of the library that I think I do understand, and which seems to me very poorly designed, and that is the shift/unshift behavior.
Maybe I just need to understand the rationale behind the design. If this issue has already been discussed, please feel free to point me to the record of that discussion (I’ve done a bit of searching in the forum archive, and didn’t come up with anything, though I did not dig back very far). But anyway, here’s what I’m having a hard time accepting:
In midicomponents-0.0.js, I find the following:
ComponentContainer.prototype = {
....
shift: function () {
this.forEachComponent(function(component) {
....
component.shift();
So … have I got this right? By default, every time you press or release the Shift button, [un]shift() is called recursively for the entire hierarchy of components, and every component has its state reset? When in all likelihood you are only going to operate one of those state-altered controls per shift press (unless people are using their controllers in ways I can’t imagine)? I find that rather horrifying … the more so since in many cases a controller will handle the shift internally - i.e., the control sends a different MIDI signal when Shift is active - and isn’t the point of doing that so that one’s device handling code doesn’t have to know about the state of the Shift button?
If you asked me to implement shift/unshift right now, I would write a default input function something like:
SomeComponent.prototype = {
....
this.input = function(bla bla bla ...) {
if (MyController.shifted) {
this.shiftAction();
} else {
this.defaultAction();
}
And of course, when you press or release Shift, it would simply set the Boolean property MyController.shifted.
I get that this is not quite as clean a design from an OO perspective, but I think it is vastly more efficient. Surely the one extra conditional wouldn’t cause a significant performance hit, would it? And if you have a controller like mine, where most controls send a different signal when shifted (and that’s pretty common, isn’t it?), then you don’t even need that - you can simply map those alternate signals to … either alternate methods of the same component, or the same method on alternate components. E.g., the standard Component might have input and shiftedInput methods.
IDK … am I missing something important here? Please help before I rewrite the whole Components library! Uhhh, just kidding - I’m not actually planning on doing that, but I kinda feel like it right now.