mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 13:45:43 +01:00
Add a new script type for meta-templates: SessionSetup
This commit is contained in:
parent
a38cdb0ae3
commit
e3edbcb806
2 changed files with 17 additions and 1 deletions
|
|
@ -38,6 +38,7 @@ class LIBARDOUR_API LuaScriptInfo {
|
|||
EditorHook,
|
||||
EditorAction,
|
||||
Snippet,
|
||||
SessionSetup,
|
||||
};
|
||||
|
||||
static std::string type2str (const ScriptType t);
|
||||
|
|
@ -123,6 +124,7 @@ private:
|
|||
LuaScriptList *_sl_hook;
|
||||
LuaScriptList *_sl_action;
|
||||
LuaScriptList *_sl_snippet;
|
||||
LuaScriptList *_sl_setup;
|
||||
LuaScriptList _empty_script_info;
|
||||
|
||||
Glib::Threads::Mutex _lock;
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ LuaScripting::LuaScripting ()
|
|||
, _sl_hook (0)
|
||||
, _sl_action (0)
|
||||
, _sl_snippet (0)
|
||||
, _sl_setup (0)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
|
@ -69,6 +70,7 @@ LuaScripting::~LuaScripting ()
|
|||
delete _sl_hook;
|
||||
delete _sl_action;
|
||||
delete _sl_snippet;
|
||||
delete _sl_setup;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -83,12 +85,14 @@ LuaScripting::refresh (bool run_scan)
|
|||
delete _sl_hook;
|
||||
delete _sl_action;
|
||||
delete _sl_snippet;
|
||||
delete _sl_setup;
|
||||
|
||||
_sl_dsp = 0;
|
||||
_sl_session = 0;
|
||||
_sl_hook = 0;
|
||||
_sl_action = 0;
|
||||
_sl_snippet = 0;
|
||||
_sl_setup = 0;
|
||||
|
||||
if (run_scan) {
|
||||
lm.release ();
|
||||
|
|
@ -120,6 +124,7 @@ LuaScripting::scan ()
|
|||
CLEAR_OR_NEW (_sl_hook)
|
||||
CLEAR_OR_NEW (_sl_action)
|
||||
CLEAR_OR_NEW (_sl_snippet)
|
||||
CLEAR_OR_NEW (_sl_setup)
|
||||
|
||||
#undef CLEAR_OR_NEW
|
||||
|
||||
|
|
@ -148,6 +153,9 @@ LuaScripting::scan ()
|
|||
case LuaScriptInfo::Snippet:
|
||||
_sl_snippet->push_back(lsi);
|
||||
break;
|
||||
case LuaScriptInfo::SessionSetup:
|
||||
_sl_setup->push_back(lsi);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -158,6 +166,7 @@ LuaScripting::scan ()
|
|||
std::sort (_sl_hook->begin(), _sl_hook->end(), ScriptSorter());
|
||||
std::sort (_sl_action->begin(), _sl_action->end(), ScriptSorter());
|
||||
std::sort (_sl_snippet->begin(), _sl_snippet->end(), ScriptSorter());
|
||||
std::sort (_sl_setup->begin(), _sl_setup->end(), ScriptSorter());
|
||||
|
||||
scripts_changed (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
|
@ -274,7 +283,7 @@ LuaScripting::scan_script (const std::string &fn, const std::string &sc)
|
|||
LuaScriptList &
|
||||
LuaScripting::scripts (LuaScriptInfo::ScriptType type) {
|
||||
|
||||
if (!_sl_dsp || !_sl_session || !_sl_hook || !_sl_action || !_sl_snippet) {
|
||||
if (!_sl_dsp || !_sl_session || !_sl_hook || !_sl_action || !_sl_snippet || ! _sl_setup) {
|
||||
scan ();
|
||||
}
|
||||
|
||||
|
|
@ -294,6 +303,9 @@ LuaScripting::scripts (LuaScriptInfo::ScriptType type) {
|
|||
case LuaScriptInfo::Snippet:
|
||||
return *_sl_snippet;
|
||||
break;
|
||||
case LuaScriptInfo::SessionSetup:
|
||||
return *_sl_setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -309,6 +321,7 @@ LuaScriptInfo::type2str (const ScriptType t) {
|
|||
case LuaScriptInfo::EditorHook: return "EditorHook";
|
||||
case LuaScriptInfo::EditorAction: return "EditorAction";
|
||||
case LuaScriptInfo::Snippet: return "Snippet";
|
||||
case LuaScriptInfo::SessionSetup: return "SessionSetup";
|
||||
default: return "Invalid";
|
||||
}
|
||||
}
|
||||
|
|
@ -321,6 +334,7 @@ LuaScriptInfo::str2type (const std::string& str) {
|
|||
if (!strcasecmp (type, "EditorHook")) {return LuaScriptInfo::EditorHook;}
|
||||
if (!strcasecmp (type, "EditorAction")) {return LuaScriptInfo::EditorAction;}
|
||||
if (!strcasecmp (type, "Snippet")) {return LuaScriptInfo::Snippet;}
|
||||
if (!strcasecmp (type, "SessionSetup")) {return LuaScriptInfo::SessionSetup;}
|
||||
return LuaScriptInfo::Invalid;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue