]> git.sesse.net Git - nageru/blobdiff - theme.h
Comment LiveInputWrapper slightly better.
[nageru] / theme.h
diff --git a/theme.h b/theme.h
index 48039734a840f58f90924b514eeaaf27f1f61657..ad963d6cdb0cb8bec9f59d7ccb73b167e0f06b7e 100644 (file)
--- a/theme.h
+++ b/theme.h
@@ -1,27 +1,23 @@
 #ifndef _THEME_H
 #define _THEME_H 1
 
-#include <epoxy/gl.h>
-#include <lauxlib.h>
-#include <lua.h>
-#include <movit/effect_chain.h>
-#include <movit/deinterlace_effect.h>
+#include <lua.hpp>
 #include <movit/ycbcr_input.h>
 #include <stdbool.h>
-#include <stdio.h>
 #include <functional>
+#include <map>
 #include <mutex>
-#include <set>
 #include <string>
-#include <utility>
 #include <vector>
 
-#include "defs.h"
-#include "input_state.h"
 #include "ref_counted_frame.h"
 
+struct InputState;
+
 namespace movit {
 class ResourcePool;
+class Effect;
+class EffectChain;
 struct ImageFormat;
 struct YCbCrFormat;
 }  // namespace movit
@@ -39,7 +35,7 @@ public:
 
 class Theme {
 public:
-       Theme(const char *filename, movit::ResourcePool *resource_pool, unsigned num_cards);
+       Theme(const std::string &filename, const std::vector<std::string> &search_dirs, movit::ResourcePool *resource_pool, unsigned num_cards);
        ~Theme();
 
        struct Chain {
@@ -54,9 +50,12 @@ public:
 
        int get_num_channels() const { return num_channels; }
        int map_signal(int signal_num);
+       void set_signal_mapping(int signal_num, int card_num);
        std::string get_channel_name(unsigned channel);
+       int get_channel_signal(unsigned channel);
        bool get_supports_set_wb(unsigned channel);
        void set_wb(unsigned channel, double r, double g, double b);
+       std::string get_channel_color(unsigned channel);
 
        std::vector<std::string> get_transition_names(float t);
 
@@ -75,11 +74,18 @@ private:
        movit::ResourcePool *resource_pool;
        int num_channels;
        unsigned num_cards;
-       std::set<int> signals_warned_about;
+
+       std::mutex map_m;
+       std::map<int, int> signal_to_card_mapping;  // Protected by <map_m>.
 
        friend class LiveInputWrapper;
 };
 
+// LiveInputWrapper is a facade on top of an YCbCrInput, exposed to
+// the Lua code. It contains a function (connect_signal()) intended
+// to be called during chain setup, that picks out the current frame
+// (in the form of a set of textures) from the input state given by
+// the mixer, and communicates that state over to the actual YCbCrInput.
 class LiveInputWrapper {
 public:
        LiveInputWrapper(Theme *theme, movit::EffectChain *chain, bool override_bounce, bool deinterlace);