User Tools

Site Tools


midi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
midi [2008/12/13 09:43]
pegasus Fixed sed command
midi [2008/12/17 16:13]
pegasus
Line 162: Line 162:
  
 Steps to loading: Steps to loading:
-  - read file '​midi-mappings-scripts.js'​ into a QString (refered to from here on as //​scriptFile//​) +  - <del>read file '​midi-mappings-scripts.js'​ into a QString (refered to from here on as //​scriptFile//​)</​del>​ 
-  - parse all lines matching mappable function signatures into a QStringList (refered to from here on as //​functionsMap//​). ​ Pure regex equivalent of this: <code shell>​grep '​function'​ midi-mappings-scripts.js|grep -i '​(msg)'​|sed -e '​s/​function \(.*\)(msg).*/​\1/​i'​ -e 's/[= ]//​g'</​code>​ should just about do it. +  - <del>parse all lines matching mappable function signatures into a QStringList (refered to from here on as //​functionsMap//​).</​del> ​ Pure regex equivalent of this: <code shell>​grep '​function'​ midi-mappings-scripts.js|grep -i '​(msg)'​|sed -e '​s/​function \(.*\)(msg).*/​\1/​i'​ -e 's/[= ]//​g'</​code>​ should just about do it. 
-  - Load mapping file, verify that all //<​script-binding/>//​ references are present in //​functionsMap//,​ else pop-up an error message indicating unmapped option. (don't assert, otherwise app dies and it will be impossible to correct inside the learning prefs screen). +  - <del>Load mapping file, verify that all //<​script-binding/>//​ references are present in //​functionsMap//,​ else pop-up an error message indicating unmapped option.</​del> ​(don't assert, otherwise app dies and it will be impossible to correct inside the learning prefs screen). 
-  - QtScriptEngine works by accepting a string argument. ​  Pass //​scriptFile//,​ check //​canEvaluate//​ -> false throw a pop-up indicating a scripting error...  +  - QtScriptEngine works by accepting a string argument. ​  <del>Pass //​scriptFile//,​ check //​canEvaluate//​ -> false throw a pop-up indicating a scripting error...</​del>​ Using a qDebug() for now
-  - Whenever a mapping with a //<​script-binding/>//​ option is triggered, evaluate that method in the QtScript, passing in the msg (w/ with channel data and data from raw midi event that triggered it).+  - <del>Whenever a mapping with a //<​script-binding/>//​ option is triggered, evaluate that method in the QtScript, passing in the msg (w/ with channel data and data from raw midi event that triggered it).</​del>​ Channel # and MIDI device name need to be in the MidiObject for script access in the future. (The init() and shutdown() functions depend on it.)
  
 Phase 2: a //<​script>//​ block will be added to the XML to hold controller specific QtScript functions. ​ There are considerations such as function name collisions and remapping to consider, global functions generic to all controllers will still be loaded from the //​mid-mapping-script.js//​ file as well. Phase 2: a //<​script>//​ block will be added to the XML to hold controller specific QtScript functions. ​ There are considerations such as function name collisions and remapping to consider, global functions generic to all controllers will still be loaded from the //​mid-mapping-script.js//​ file as well.
- 
  
midi.txt · Last modified: 2008/12/17 16:16 by pegasus