]> git.sesse.net Git - casparcg/blobdiff - common/diagnostics/graph.cpp
2.0.1: ffmpeg: Replaced TBB implementation with better Concurrency Runtime based...
[casparcg] / common / diagnostics / graph.cpp
index 73fab59156e0c95909469780eb034fdfa4f1555c..213610aed37dee5a00ceda169927a2e08cdcacf4 100644 (file)
@@ -168,7 +168,7 @@ class line : public drawable
        boost::optional<diagnostics::guide> guide_;\r
        boost::circular_buffer<std::pair<double, bool>> line_data_;\r
 \r
-       std::vector<float>              tick_data_;\r
+       std::vector<double>             tick_data_;\r
        bool                                    tick_tag_;\r
        color c_;\r
 public:\r
@@ -232,7 +232,7 @@ public:
                        target.Draw(*guide_);\r
                \r
                glBegin(GL_LINE_STRIP);\r
-               glColor4f(c_.red, c_.green, c_.blue, 0.7f);             \r
+               glColor4f(c_.red, c_.green, c_.blue, 0.8f);             \r
                for(size_t n = 0; n < line_data_.size(); ++n)           \r
                        if(line_data_[n].first > -0.5)\r
                                glVertex3d(x+n*dx, std::max(0.05, std::min(0.95, (1.0f-line_data_[n].first)*0.8 + 0.1f)), 0.0);         \r
@@ -269,7 +269,7 @@ struct graph::implementation : public drawable
 \r
        implementation(const printer& parent_printer) \r
                : parent_printer_(parent_printer)\r
-               , name_(parent_printer_ ? narrow(parent_printer_()) : "")\r
+               , name_("")\r
                , counter_(0){}\r
 \r
        void update(const std::string& name, double value)\r
@@ -356,14 +356,20 @@ private:
        implementation& operator=(implementation&);\r
 };\r
        \r
-graph::graph(const std::string& name) : impl_(env::properties().get("configuration.diagnostics.graphs", true) ? new implementation(name) : nullptr)\r
+graph::graph(const std::string& name, bool start) : impl_(env::properties().get("configuration.diagnostics.graphs", true) ? new implementation(name) : nullptr)\r
 {\r
-       if(impl_)\r
-               context::register_drawable(impl_);\r
+       if(start)\r
+               graph::start();\r
 }\r
 \r
-graph::graph(const printer& parent_printer) : impl_(env::properties().get("configuration.diagnostics.graphs", true) ? new implementation(parent_printer) : nullptr)\r
+graph::graph(const printer& parent_printer, bool start) : impl_(env::properties().get("configuration.diagnostics.graphs", true) ? new implementation(parent_printer) : nullptr)\r
 {\r
+       if(start)\r
+               graph::start();\r
+}\r
+\r
+void graph::start()\r
+{      \r
        if(impl_)\r
                context::register_drawable(impl_);\r
 }\r
@@ -424,13 +430,13 @@ void graph::add_guide(const std::string& name, double value)
        }\r
 }\r
 \r
-safe_ptr<graph> create_graph(const std::string& name)\r
+safe_ptr<graph> create_graph(const std::string& name, bool start)\r
 {\r
-       return safe_ptr<graph>(new graph(name));\r
+       return safe_ptr<graph>(new graph(name, start));\r
 }\r
-safe_ptr<graph> create_graph(const printer& parent_printer)\r
+safe_ptr<graph> create_graph(const printer& parent_printer, bool start)\r
 {\r
-       return safe_ptr<graph>(new graph(parent_printer));\r
+       return safe_ptr<graph>(new graph(parent_printer, start));\r
 }\r
 \r
 \r