]> git.sesse.net Git - casparcg/blobdiff - common/diagnostics/graph.h
[channel_producer] #590 Added NO_AUTO_DEINTERLACE parameter to channel route AMCP...
[casparcg] / common / diagnostics / graph.h
index b23e2fff4ac2e7422f8f6352bbbf5aa363c73168..0b8888013609fd45a9ae806084125d14de46c309 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <string>
 #include <tuple>
+#include <functional>
 
 #include <boost/noncopyable.hpp>
 
@@ -33,6 +34,12 @@ namespace caspar { namespace diagnostics {
 int color(float r, float g, float b, float a = 1.0f);
 std::tuple<float, float, float, float> color(int code);
 
+enum class tag_severity
+{
+       WARNING,
+       INFO
+};
+
 class graph : boost::noncopyable
 {
        friend void register_graph(const spl::shared_ptr<graph>& graph);
@@ -41,7 +48,7 @@ public:
        void set_text(const std::wstring& value);
        void set_value(const std::string& name, double value);
        void set_color(const std::string& name, int color);
-       void set_tag(const std::string& name);
+       void set_tag(tag_severity severity, const std::string& name);
        void auto_reset();
 private:
        struct impl;
@@ -49,7 +56,24 @@ private:
 };
 
 void register_graph(const spl::shared_ptr<graph>& graph);
-void show_graphs(bool value);
-void shutdown();
+
+namespace spi {
+
+class graph_sink : boost::noncopyable
+{
+public:
+       virtual ~graph_sink() { }
+       virtual void activate() = 0;
+       virtual void set_text(const std::wstring& value) = 0;
+       virtual void set_value(const std::string& name, double value) = 0;
+       virtual void set_color(const std::string& name, int color) = 0;
+       virtual void set_tag(tag_severity severity, const std::string& name) = 0;
+       virtual void auto_reset() = 0;
+};
+
+typedef std::function<spl::shared_ptr<graph_sink>()> sink_factory_t;
+void register_sink_factory(sink_factory_t factory);
+
+}
 
 }}
\ No newline at end of file