That would be awesome.  If you want to see code examples of how I abuse
mode settings, take a look at some of my mappings:

http://jwcxz.com/projects/mixxx/

The X-Session pro full mapping (third one) is the biggest offender, but
the TotalControl mapping isn't so beautiful either.  I've written them
in a way that hopefully reduces lag as much as possible.  But writing
code in such a flat manner is a pain in the neck, reading it is also
hard, too.

One way to approach the problem would be to be able to
provide a way to change the "namespace" or however you call it in
JavaScript.

That is, right now, we already have to write function names like:
MAudioXSessionPRO.play.  So why not build different modes into different
namespaces.  Then you could have:

    MAudioXSessionPRO.regular.play = function(...) {}
    MAudioXSessionPRO.alternate.play = function(...) {}

And a way to change between "regular" and "alternate" mode.

Joe

Philip Whelan @ Thu 11 Jul 13  17:00:01 -0700:
Date: Thu, 11 Jul 2013 17:00:01 -0700
From: Philip Whelan <pwhe...@mixxx.org>
To: petah <mi...@djpetah.com>
Cc: Mixxx-devel <mixxx-devel@lists.sourceforge.net>
Subject: Re: [Mixxx-devel] high-res MIDI interface with "pull" architecture?

I've actually thought of adding in a new command for MIDI Script to allow
on the fly rebinding. This way the latency penalty for using MIDIScript
when using mode switches would only affect the mode switch itself, not the
actual commands that are switched.

In case that is not clear at all an example (for M-Audio X-session PRO's
mode switch for backwards/forwards when paused and pseudocode):

   MAudioXSessionPRO.play = function(....) {
       if (paused) {
           engine.resetbinding(MIDI_CTRL_BACKWARD_1, '[Channel1]' ,'back');
           engine.resetbinding(MIDI_CTRL_FORWARD_1, '[Channel1]',
,'forward');
       }
       else {
           engine.resetbinding(MIDI_CTRL_BACKWARD_1,
'[Channel1],'rate_down');
           engine.resetbinding(MIDI_CTRL_FORWARD_1, '[Channel1],
'rate_up');
      }
   }

Now when you press backwards or forwards the engine will execute the
command directly instead of passing through the MIDIScript engine. Getting
this to work for more complex cases might take a bit of work.

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org


Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel


--
Joe Colosimo
http://jwcxz.com/
PGP: http://pgp.jwcxz.com/pgp.asc

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org


Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to