Skip to content

Commit

Permalink
- refactoring/implementation of stack feature
Browse files Browse the repository at this point in the history
- "selected_model" is now purely for display
- in models, "tokens" are no longer extracted from lua code
  • Loading branch information
bjorn-nesby committed Jun 14, 2017
1 parent 98f4842 commit b9bf827
Show file tree
Hide file tree
Showing 18 changed files with 1,632 additions and 1,072 deletions.
54 changes: 31 additions & 23 deletions Tools/com.renoise.xStream.xrnx/main.lua
Expand Up @@ -14,7 +14,8 @@ com.renoise.xStream.xrnx (main.lua)
rns = nil -- reference to renoise.song()
_trace_filters = nil -- don't show traces in console
--_trace_filters = {".*"}
--_trace_filters = {"^xOscClient"}
--_trace_filters = {"^xStreamBuffer*","^xStreamStack*","^xStreamProcess*"}
_trace_filters = {"^>>> xStreamBuffer:write_line*","^xStreamStackMember*"}

---------------------------------------------------------------------------------------------------
-- required files
Expand All @@ -32,6 +33,7 @@ require (_clibroot..'cObservable')
require (_clibroot..'cReflection')
require (_clibroot..'cParseXML')
require (_clibroot..'cSandbox')
require (_clibroot..'cTable')
require (_clibroot..'cColor')

require (_vlibroot..'vLib')
Expand Down Expand Up @@ -62,6 +64,7 @@ require (_xlibroot..'xPatternSequencer')
require (_xlibroot..'xPlayPos')
require (_xlibroot..'xScale')
require (_xlibroot..'xSongPos')
require (_xlibroot..'xSongSettings')
require (_xlibroot..'xStreamPos')
require (_xlibroot..'xStreamBuffer')
require (_xlibroot..'xTransport')
Expand All @@ -75,8 +78,11 @@ require ('source/xStreamFavorite')
require ('source/xStreamFavorites')
require ('source/xStreamModel')
require ('source/xStreamModels')
require ('source/xStreamProcess')
require ('source/xStreamPresets')
require ('source/xStreamModelPresets')
--require ('source/xStreamProcess')
require ('source/xStreamStack')
require ('source/xStreamStacks')
require ('source/xStreamStackMember')
require ('source/xStreamPrefs')
require ('source/xStreamUserData')
require ('source/xStreamUILuaEditor')
Expand All @@ -85,6 +91,7 @@ require ('source/xStreamUIModelCreate')
require ('source/xStreamUICallbackCreate')
require ('source/xStreamUIGlobalToolbar')
require ('source/xStreamUIModelToolbar')
require ('source/xStreamUIStackToolbar')
require ('source/xStreamUIOptions')
require ('source/xStreamUIFavorites')
require ('source/xStreamUIPresetPanel')
Expand Down Expand Up @@ -117,7 +124,7 @@ function show()
midi_prefix = MIDI_PREFIX,
tool_name = TOOL_NAME,
}
xstream.active_observable:add_notifier(function()
xstream.stack.active_observable:add_notifier(function()
TRACE("xStream main.lua - self.active_observable fired...")
register_tool_menu()
end)
Expand Down Expand Up @@ -159,7 +166,8 @@ end)

---------------------------------------------------------------------------------------------------
-- keyboard/midi mappings

--[[
local key_mapping, midi_mapping = nil,nil
--== "favorites" ==--
Expand Down Expand Up @@ -196,7 +204,7 @@ for i = 1,16 do
name = midi_mapping,
invoke = function()
if xstream then
xstream.process:set_selected_preset_index(i)
xstream.stack:set_selected_preset_index(i)
end
end
}
Expand All @@ -207,13 +215,12 @@ for i = 1,16 do
invoke = function(repeated)
if not repeated then
if xstream then
xstream.process:set_selected_preset_index(i)
xstream.stack:set_selected_preset_index(i)
end
end
end
}
--[[
]]
end
Expand All @@ -222,7 +229,7 @@ renoise.tool():add_midi_mapping{
name = midi_mapping,
invoke = function()
if xstream then
xstream.process:select_next_preset()
xstream.stack:select_next_preset()
end
end
}
Expand All @@ -232,7 +239,7 @@ renoise.tool():add_keybinding{
invoke = function(repeated)
if not repeated then
if xstream then
xstream.process:select_next_preset()
xstream.stack:select_next_preset()
end
end
end
Expand All @@ -243,7 +250,7 @@ renoise.tool():add_midi_mapping{
name = midi_mapping,
invoke = function()
if xstream then
xstream.process:select_previous_preset()
xstream.stack:select_previous_preset()
end
end
}
Expand All @@ -253,7 +260,7 @@ renoise.tool():add_keybinding{
invoke = function(repeated)
if not repeated then
if xstream then
xstream.process:select_previous_preset()
xstream.stack:select_previous_preset()
end
end
end
Expand All @@ -266,7 +273,7 @@ renoise.tool():add_midi_mapping{
name = midi_mapping,
invoke = function()
if xstream then
xstream.process:fill_track()
xstream.stack:fill_track()
end
end
}
Expand All @@ -276,7 +283,7 @@ renoise.tool():add_keybinding{
invoke = function(repeated)
if not repeated then
if xstream then
xstream.process:fill_track()
xstream.stack:fill_track()
end
end
end
Expand All @@ -287,7 +294,7 @@ renoise.tool():add_midi_mapping{
name = midi_mapping,
invoke = function()
if xstream then
xstream.process:fill_selection(true)
xstream.stack:fill_selection(true)
end
end
}
Expand All @@ -297,7 +304,7 @@ renoise.tool():add_keybinding{
invoke = function(repeated)
if not repeated then
if xstream then
xstream.process:fill_selection(true)
xstream.stack:fill_selection(true)
end
end
end
Expand All @@ -308,7 +315,7 @@ renoise.tool():add_midi_mapping{
name = midi_mapping,
invoke = function()
if xstream then
xstream.process:fill_selection()
xstream.stack:fill_selection()
end
end
}
Expand All @@ -318,7 +325,7 @@ renoise.tool():add_keybinding{
invoke = function(repeated)
if not repeated then
if xstream then
xstream.process:fill_selection()
xstream.stack:fill_selection()
end
end
end
Expand All @@ -329,7 +336,7 @@ renoise.tool():add_midi_mapping{
name = midi_mapping,
invoke = function()
if xstream then
xstream.process:fill_line(true)
xstream.stack:fill_line(true)
end
end
}
Expand All @@ -339,7 +346,7 @@ renoise.tool():add_keybinding{
invoke = function(repeated)
if not repeated then
if xstream then
xstream.process:fill_line(true)
xstream.stack:fill_line(true)
end
end
end
Expand All @@ -350,7 +357,7 @@ renoise.tool():add_midi_mapping{
name = midi_mapping,
invoke = function()
if xstream then
xstream.process:fill_line()
xstream.stack:fill_line()
end
end
}
Expand All @@ -360,8 +367,9 @@ renoise.tool():add_keybinding{
invoke = function(repeated)
if not repeated then
if xstream then
xstream.process:fill_line()
xstream.stack:fill_line()
end
end
end
}
]]

0 comments on commit b9bf827

Please sign in to comment.