]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2: Fixed debug compilation.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 5 Apr 2011 09:15:39 +0000 (09:15 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 5 Apr 2011 09:15:39 +0000 (09:15 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@597 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

common/common.vcxproj
common/common.vcxproj.filters
common/compiler/vs/disable_silly_warnings.h
common/diagnostics/graph.cpp
common/printable.h [new file with mode: 0644]
core/producer/frame/image_transform.cpp

index 81f655871d9ace6fc2f1656668a6d7ce66dfb45d..5710dde859ebf033bd97a6dedc70b373a4041fb4 100644 (file)
     <ClInclude Include="memory\page_locked_allocator.h" />\r
     <ClInclude Include="memory\safe_ptr.h" />\r
     <ClInclude Include="env.h" />\r
+    <ClInclude Include="printable.h" />\r
     <ClInclude Include="stdafx.h" />\r
     <ClInclude Include="utility\assert.h" />\r
     <ClInclude Include="utility\printer.h" />\r
index 50380cfded7d05194d3419e37bba247c4d78839b..74df585ac905760e3a5140b49a3674ae89491dff 100644 (file)
@@ -87,5 +87,6 @@
     <ClInclude Include="utility\tweener.h">\r
       <Filter>utility</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="printable.h" />\r
   </ItemGroup>\r
 </Project>
\ No newline at end of file
index 1c090161defed17c7f0e57d1bda48942a8548430..41807dcb98d19539850bd33d47eb3d63338cfcee 100644 (file)
@@ -7,6 +7,7 @@
 #pragma warning (disable : 4482) // nonstandard extension used: enum 'enum' used in qualified name\r
 #pragma warning (disable : 4503) // decorated name length exceeded, name was truncated\r
 #pragma warning (disable : 4512) // assignment operator could not be generated\r
+#pragma warning (disable : 4702) //  unreachable code\r
 #pragma warning (disable : 4714) // marked as __forceinline not inlined\r
 #endif\r
 \r
index 63b5dd82d240beb1e036a14b5a7747a9177bb7d6..0c54451b79176b157768961887fd94c82c785b1f 100644 (file)
@@ -255,42 +255,27 @@ struct graph::implementation : public drawable
 \r
        void update(const std::string& name, float value)\r
        {\r
-               context::begin_invoke([=]\r
-               {\r
-                       lines_[name].update(value);\r
-               });\r
+               lines_[name].update(value);\r
        }\r
 \r
        void set(const std::string& name, float value)\r
        {\r
-               context::begin_invoke([=]\r
-               {\r
-                       lines_[name].set(value);\r
-               });\r
+               lines_[name].set(value);\r
        }\r
 \r
        void tag(const std::string& name)\r
        {\r
-               context::begin_invoke([=]\r
-               {\r
-                       lines_[name].tag();\r
-               });\r
+               lines_[name].tag();\r
        }\r
 \r
        void set_color(const std::string& name, color c)\r
        {\r
-               context::begin_invoke([=]\r
-               {\r
-                       lines_[name].set_color(c);\r
-               });\r
+               lines_[name].set_color(c);\r
        }\r
        \r
        void guide(const std::string& name, float value)\r
        {\r
-               context::begin_invoke([=]\r
-               {\r
-                       lines_[name].guide(diagnostics::guide(value));\r
-               });\r
+               lines_[name].guide(diagnostics::guide(value));  \r
        }\r
        \r
 private:\r
@@ -364,11 +349,61 @@ graph::graph(const printer& parent_printer) : impl_(env::properties().get("confi
                context::register_drawable(impl_);\r
 }\r
 \r
-void graph::update_value(const std::string& name, float value){if(impl_)impl_->update(name, value);}\r
-void graph::set_value(const std::string& name, float value){if(impl_)impl_->set(name, value);}\r
-void graph::set_color(const std::string& name, color c){if(impl_)impl_->set_color(name, c);}\r
-void graph::add_tag(const std::string& name){if(impl_)impl_->tag(name);}\r
-void graph::add_guide(const std::string& name, float value){if(impl_)impl_->guide(name, value);}\r
+void graph::update_value(const std::string& name, float value)\r
+{\r
+       if(impl_)\r
+       {       \r
+               auto p = impl_;\r
+               context::begin_invoke([=]\r
+               {       \r
+                       p->update(name, value);\r
+               });\r
+       }\r
+}\r
+void graph::set_value(const std::string& name, float value)\r
+{\r
+       if(impl_)\r
+       {               \r
+               auto p = impl_;\r
+               context::begin_invoke([=]\r
+               {       \r
+                       p->set(name, value);\r
+               });\r
+       }\r
+}\r
+void graph::set_color(const std::string& name, color c)\r
+{      \r
+       if(impl_)\r
+       {               \r
+               auto p = impl_;\r
+               context::begin_invoke([=]\r
+               {       \r
+                       p->set_color(name, c);\r
+               });\r
+       }\r
+}\r
+void graph::add_tag(const std::string& name)\r
+{      \r
+       if(impl_)\r
+       {               \r
+               auto p = impl_;\r
+               context::begin_invoke([=]\r
+               {       \r
+                       p->tag(name);\r
+               });\r
+       }\r
+}\r
+void graph::add_guide(const std::string& name, float value)\r
+{      \r
+       if(impl_)\r
+       {               \r
+               auto p = impl_;\r
+               context::begin_invoke([=]\r
+               {       \r
+                       p->guide(name, value);\r
+               });\r
+       }\r
+}\r
 \r
 safe_ptr<graph> create_graph(const std::string& name)\r
 {\r
diff --git a/common/printable.h b/common/printable.h
new file mode 100644 (file)
index 0000000..9e90864
--- /dev/null
@@ -0,0 +1,44 @@
+#pragma once\r
+\r
+#include <string>\r
+\r
+#include <tbb/spin_mutex.h>\r
+\r
+namespace caspar {\r
+\r
+class printable\r
+{\r
+       mutable tbb::spin_mutex mutex_;\r
+       const printable* parent_;\r
+public:\r
+       printable(const printable* parent = nullptr){set_parent(parent);}\r
+\r
+       std::wstring print() const\r
+       {\r
+               tbb::spin_mutex::scoped_lock lock(mutex_);\r
+               return (parent_ ? parent_->print() + L"/" : L"") + do_print();\r
+       }\r
+       \r
+       virtual void swap(object& other)\r
+       {\r
+               tbb::spin_mutex::scoped_lock lock(mutex_);\r
+               std::swap(parent_, other.parent_);\r
+       }\r
+       \r
+       const object* get_parent() const\r
+       {\r
+               tbb::spin_mutex::scoped_lock lock(mutex_);\r
+               return parent_;\r
+       }\r
+\r
+       void set_parent(const object* parent)\r
+       {\r
+               tbb::spin_mutex::scoped_lock lock(mutex_);\r
+               parent_ = parent != this ? parent : nullptr;\r
+       }\r
+\r
+private:\r
+       virtual std::wstring do_print() const = 0;\r
+};\r
+\r
+}
\ No newline at end of file
index eff38dc111a3527f0a736a61bac01e5a7c54ad48..c6bbb825540c2d39f804fd25548f68e7f79717c9 100644 (file)
@@ -120,7 +120,7 @@ image_transform tween(double time, const image_transform& source, const image_tr
                return tweener(time, source, dest-source, duration);\r
        };\r
 \r
-       CASPAR_ASSERT(lhs.get_mode() == rhs.get_mode() || lhs.get_mode() == video_mode::invalid || rhs.get_mode() == video_mode::invalid);\r
+       CASPAR_ASSERT(source.get_mode() == dest.get_mode() || source.get_mode() == video_mode::invalid || dest.get_mode() == video_mode::invalid);\r
 \r
        image_transform result; \r
        result.set_mode(dest.get_mode() != video_mode::invalid ? dest.get_mode() : source.get_mode());\r