case LuaScriptInfo::Snippet:
_sl_snippet->push_back(lsi);
break;
- case LuaScriptInfo::SessionSetup:
+ case LuaScriptInfo::SessionInit:
_sl_setup->push_back(lsi);
break;
- case LuaScriptInfo::TrackSetup:
- _sl_tracks->push_back(lsi);
- break;
default:
break;
}
if (key == "description") { lsi->description = val; }
if (key == "category") { lsi->category = val; }
}
+
+
+ if (type == LuaScriptInfo::EditorAction) {
+
+ luabridge::LuaRef lua_rs = luabridge::getGlobal (L, "route_setup");
+ if (lua_rs.isFunction ()) {
+ lsi->subtype |= LuaScriptInfo::RouteSetup;
+ }
+
+ luabridge::LuaRef lua_ss = luabridge::getGlobal (L, "session_setup");
+ if (lua_ss.isFunction ()) {
+ try {
+ if (lua_ss () == true) {
+ lsi->subtype |= LuaScriptInfo::SessionSetup;
+ }
+ } catch (...) { }
+ }
+
+ }
+
return lsi;
}
case LuaScriptInfo::Snippet:
return *_sl_snippet;
break;
- case LuaScriptInfo::SessionSetup:
+ case LuaScriptInfo::SessionInit:
return *_sl_setup;
break;
- case LuaScriptInfo::TrackSetup:
- return *_sl_tracks;
- break;
default:
break;
}
case LuaScriptInfo::EditorHook: return "EditorHook";
case LuaScriptInfo::EditorAction: return "EditorAction";
case LuaScriptInfo::Snippet: return "Snippet";
- case LuaScriptInfo::SessionSetup: return "SessionSetup";
- case LuaScriptInfo::TrackSetup: return "TrackSetup";
+ case LuaScriptInfo::SessionInit: return "SessionInit";
default: return "Invalid";
}
}
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;}
- if (!strcasecmp (type, "TrackSetup")) {return LuaScriptInfo::TrackSetup;}
+ if (!strcasecmp (type, "SessionInit")) {return LuaScriptInfo::SessionInit;}
return LuaScriptInfo::Invalid;
}
} else {
lua.do_command (s);
}
- } catch (luabridge::LuaException const& e) {
+ } catch (...) {
return rv;
}
cerr << e.what() << "\n";
#endif
lua_print (e.what());
- }
+ } catch (...) { }
return false;
}
if (lua_factory.isFunction()) {
return (lua_dump(lua_factory)).cast<std::string> ();
}
- } catch (luabridge::LuaException const& e) { }
+ } catch (...) { }
return "";
}