]> git.sesse.net Git - nageru/blobdiff - theme.cpp
Add red and green borders around channels to mark them as used for live and preview.
[nageru] / theme.cpp
index 35b777e76d79c6ea3afe309e57b0ae5333be9b2e..aefc081e97847d9349079fcc502d1e9161f1cd90 100644 (file)
--- a/theme.cpp
+++ b/theme.cpp
@@ -810,6 +810,22 @@ int Theme::get_channel_signal(unsigned channel)
        return ret;
 }
 
+std::string Theme::get_channel_color(unsigned channel)
+{
+       unique_lock<mutex> lock(m);
+       lua_getglobal(L, "channel_color");
+       lua_pushnumber(L, channel);
+       if (lua_pcall(L, 1, 1, 0) != 0) {
+               fprintf(stderr, "error running function `channel_color': %s\n", lua_tostring(L, -1));
+               exit(1);
+       }
+
+       std::string ret = checkstdstring(L, -1);
+       lua_pop(L, 1);
+       assert(lua_gettop(L) == 0);
+       return ret;
+}
+
 bool Theme::get_supports_set_wb(unsigned channel)
 {
        unique_lock<mutex> lock(m);