<IncludePath>..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<LibraryPath>..\dependencies\BluefishSDK_V5_8_0_31\Lib\;..\dependencies\boost_1_44_0\stage\lib\;..\dependencies\ffmpeg 0.6\lib\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\lib\;..\dependencies\tbb30_20100406oss\lib\;$(LibraryPath)</LibraryPath>\r
<OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
- <IntDir>$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
</PropertyGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<IncludePath>..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<LibraryPath>..\dependencies\BluefishSDK_V5_8_0_31\Lib\;..\dependencies\boost_1_44_0\stage\lib\;..\dependencies\ffmpeg 0.6\lib\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\lib\;..\dependencies\tbb30_20100406oss\lib\;$(LibraryPath)</LibraryPath>\r
<OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
- <IntDir>$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
</PropertyGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">\r
<IncludePath>..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<LibraryPath>..\dependencies\BluefishSDK_V5_8_0_31\Lib\;..\dependencies\boost_1_44_0\stage\lib\;..\dependencies\ffmpeg 0.6\lib\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\lib\;..\dependencies\tbb30_20100406oss\lib\;$(LibraryPath)</LibraryPath>\r
<OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
- <IntDir>$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
</PropertyGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">\r
<IncludePath>..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<LibraryPath>..\dependencies\BluefishSDK_V5_8_0_31\Lib\;..\dependencies\boost_1_44_0\stage\lib\;..\dependencies\ffmpeg 0.6\lib\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\lib\;..\dependencies\tbb30_20100406oss\lib\;$(LibraryPath)</LibraryPath>\r
<OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
- <IntDir>$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
</PropertyGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
<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="object.h" />\r
<ClInclude Include="stdafx.h" />\r
<ClInclude Include="utility\assert.h" />\r
<ClInclude Include="utility\printer.h" />\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">Create</PrecompiledHeader>\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">Create</PrecompiledHeader>\r
</ClCompile>\r
+ <ClCompile Include="utility\string.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
</ItemGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets">\r
</ClCompile>\r
<ClCompile Include="env.cpp" />\r
<ClCompile Include="stdafx.cpp" />\r
+ <ClCompile Include="utility\string.cpp">\r
+ <Filter>utility</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="exception\exceptions.h">\r
<ClInclude Include="utility\tweener.h">\r
<Filter>utility</Filter>\r
</ClInclude>\r
- <ClInclude Include="printable.h" />\r
+ <ClInclude Include="object.h" />\r
</ItemGroup>\r
</Project>
\ No newline at end of file
#pragma warning (disable : 4100) // unreferenced formal parameter\r
#pragma warning (disable : 4127) // conditional expression is constant\r
#pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored\r
+#pragma warning (disable : 4355) // 'this' : used in base member initializer list\r
#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
media = widen(paths.get("media-path", initialPath + "\\media\\"));\r
log = widen(paths.get("log-path", initialPath + "\\log\\"));\r
ftemplate = widen(paths.get("template-path", initialPath + "\\template\\"));\r
- ftemplate_host = ftemplate + L"\\" + widen(paths.get("template-host", "cg.fth"));\r
+ ftemplate_host = widen(paths.get("template-host", "cg.fth"));\r
data = widen(paths.get("data-path", initialPath + "\\data\\"));\r
}\r
\r
--- /dev/null
+#pragma once\r
+\r
+#include <string>\r
+\r
+#include <tbb/spin_mutex.h>\r
+\r
+namespace caspar {\r
+\r
+//class object\r
+//{\r
+// mutable tbb::spin_mutex mutex_;\r
+// const object* parent_;\r
+//public:\r
+// object(const object* 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
+// 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
+//\r
+// virtual std::wstring do_print() const = 0;\r
+//};\r
+\r
+class object\r
+{\r
+ mutable tbb::spin_mutex mutex_;\r
+ const object* parent_;\r
+public:\r
+ object(const object* parent = nullptr){set_parent(parent);}\r
+\r
+ virtual std::wstring print() const\r
+ {\r
+ tbb::spin_mutex::scoped_lock lock(mutex_);\r
+ return (parent_ ? parent_->print() + L"/" : L"");\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
+\r
+}
\ No newline at end of file
--- /dev/null
+#include "../stdafx.h"\r
+\r
+namespace caspar {\r
+ \r
+std::wstring widen(const std::string& str)\r
+{\r
+ return std::wstring(str.begin(), str.end());\r
+}\r
+\r
+std::wstring widen(const std::wstring& str)\r
+{\r
+ return str;\r
+}\r
+ \r
+std::string narrow(const std::wstring& str)\r
+{\r
+ return std::string(str.begin(), str.end());\r
+}\r
+ \r
+std::string narrow(const std::string& str)\r
+{\r
+ return str ;\r
+}\r
+\r
+}
\ No newline at end of file
#pragma once\r
\r
-#include <locale>\r
-#include <iostream>\r
#include <string>\r
-#include <sstream>\r
#include <boost/lexical_cast.hpp>\r
\r
namespace caspar {\r
\r
-inline std::wstring widen(const std::string& str, const std::locale& locale = std::locale())\r
-{\r
- std::wstringstream wsstr ;\r
- wsstr.imbue(locale);\r
- const std::ctype<wchar_t>& ctfacet = std::use_facet<std::ctype<wchar_t>>(wsstr.getloc()) ;\r
- for(size_t i = 0 ;i < str.size(); ++i)\r
- wsstr << ctfacet.widen(str[i]) ;\r
- return wsstr.str() ;\r
-}\r
-\r
-inline std::wstring widen(const std::wstring& str, const std::locale&)\r
-{\r
- return str;\r
-}\r
-\r
-#if defined(_MSC_VER)\r
-#pragma warning(push)\r
-#pragma warning(disable : 4244)\r
-#endif\r
- \r
-inline std::string narrow(const std::wstring& str, const std::locale& locale = std::locale())\r
-{\r
- std::stringstream sstr;\r
- sstr.imbue(locale);\r
- const std::ctype<char>& ctfacet = std::use_facet<std::ctype<char>>(sstr.getloc());\r
- for(size_t i = 0; i < str.size(); ++i)\r
- sstr << ctfacet.narrow(str[i], 0) ;\r
- return sstr.str() ;\r
-}\r
- \r
-inline std::string narrow(const std::string& str, const std::locale&)\r
-{\r
- return str ;\r
-}\r
-\r
-#if defined(_MSC_VER)\r
-#pragma warning(pop)\r
-#endif\r
-//\r
-//inline std::string narrow_to_latin1(const std::wstring& wideString)\r
-//{\r
-// std::string destBuffer;\r
-// //28591 = ISO 8859-1 Latin I\r
-// int bytesWritten = 0;\r
-// int multibyteBufferCapacity = WideCharToMultiByte(28591, 0, wideString.c_str(), -1, 0, 0, \r
-// nullptr, nullptr);\r
-// if(multibyteBufferCapacity > 0) \r
-// {\r
-// destBuffer.resize(multibyteBufferCapacity);\r
-// bytesWritten = WideCharToMultiByte(28591, 0, wideString.c_str(), -1, &destBuffer[0], \r
-// destBuffer.size(), nullptr, nullptr);\r
-// }\r
-// destBuffer.resize(bytesWritten);\r
-// return destBuffer;\r
-//}\r
+std::wstring widen(const std::string& str);\r
+std::wstring widen(const std::wstring& str);\r
+std::string narrow(const std::wstring& str); \r
+std::string narrow(const std::string& str);\r
\r
template <typename T>\r
inline T lexical_cast_or_default(const std::wstring str, T fail_value = T())\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\;..\dependencies\boost_1_44_0\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\;..\dependencies\boost_1_44_0\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\;..\dependencies\boost_1_44_0\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
{\r
safe_ptr<basic_frame> frame_;\r
std::wstring color_str_;\r
- printer parent_printer_;\r
\r
public:\r
\r
BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << arg_value_info(narrow(color)) << msg_info("Invalid color code"));\r
}\r
\r
- virtual void initialize(const safe_ptr<frame_factory>& frame_factory)\r
+ virtual void set_frame_factory(const safe_ptr<frame_factory>& frame_factory)\r
{\r
auto frame = frame_factory->create_frame(1, 1, pixel_format::bgra);\r
auto& value = *reinterpret_cast<unsigned long*>(frame->image_data().begin());\r
str >> std::hex >> value; \r
frame_ = std::move(frame);\r
}\r
-\r
- virtual void set_parent_printer(const printer& parent_printer){parent_printer_ = parent_printer;}\r
- \r
+ \r
virtual safe_ptr<basic_frame> receive() { return frame_; }\r
\r
- virtual std::wstring print() const { return (parent_printer_ ? parent_printer_() + L"/" : L"") + L"color[" + color_str_ + L"]"; }\r
+ virtual std::wstring print() const { return frame_producer::print() + L"color[" + color_str_ + L"]"; }\r
};\r
\r
safe_ptr<frame_producer> create_color_producer(const std::vector<std::wstring>& params)\r
#pragma once\r
\r
#include <common/memory/safe_ptr.h>\r
-#include <common/utility/printer.h>\r
+#include <common/object.h>\r
\r
#include "../producer/frame/basic_frame.h"\r
#include "../producer/frame/frame_factory.h"\r
\r
#include <boost/noncopyable.hpp>\r
\r
-#include <string>\r
+#include <functional>\r
#include <ostream>\r
+#include <string>\r
\r
namespace caspar { namespace core {\r
\r
-class frame_producer : boost::noncopyable\r
+class frame_producer : public object, boost::noncopyable\r
{\r
public:\r
virtual ~frame_producer(){} \r
virtual void set_leading_producer(const safe_ptr<frame_producer>& /*producer*/) {} // nothrow\r
\r
////////////////////////////////////////////////////////////////////////////////////////////////////\r
- /// \fn virtual void :::initialize(const safe_ptr<frame_factory>& frame_factory) = 0;\r
+ /// \fn virtual void :::set_frame_factory(const safe_ptr<frame_factory>& frame_factory) = 0;\r
///\r
- /// \brief Provides the frame frame_factory used to create frames and initializes the producer. \r
+ /// \brief Sets the frame frame_factory used to create frames. \r
///\r
/// \param frame_factory The frame frame_factory. \r
////////////////////////////////////////////////////////////////////////////////////////////////////\r
- virtual void initialize(const safe_ptr<frame_factory>& frame_factory) = 0;\r
-\r
- virtual void set_parent_printer(const printer& parent_printer) = 0;\r
+ virtual void set_frame_factory(const safe_ptr<frame_factory>& frame_factory) = 0;\r
\r
+ virtual void param(const std::wstring&){}\r
+ \r
static const safe_ptr<frame_producer>& empty() // nothrow\r
{\r
struct empty_frame_producer : public frame_producer\r
{\r
virtual safe_ptr<basic_frame> receive(){return basic_frame::empty();}\r
- virtual void initialize(const safe_ptr<frame_factory>&){}\r
+ virtual void set_frame_factory(const safe_ptr<frame_factory>&){}\r
+ virtual void set_parent(const object* parent) {}\r
virtual std::wstring print() const { return L"empty";}\r
- virtual void set_parent_printer(const printer& parent_printer) {}\r
};\r
static safe_ptr<frame_producer> producer = make_safe<empty_frame_producer>();\r
return producer;\r
}\r
-\r
- virtual std::wstring print() const = 0; // nothrow\r
};\r
\r
inline std::wostream& operator<<(std::wostream& out, const frame_producer& producer)\r
\r
namespace caspar { namespace core {\r
\r
-struct frame_producer_device::implementation : boost::noncopyable\r
+struct frame_producer_device::implementation : public object, boost::noncopyable\r
{ \r
const printer parent_printer_;\r
\r
{\r
auto it = layers_.find(index);\r
if(it == layers_.end())\r
- it = layers_.insert(std::make_pair(index, layer(index, std::bind(&implementation::print, this)))).first;\r
+ it = layers_.insert(std::make_pair(index, layer(this, index))).first;\r
return it->second;\r
}\r
\r
\r
void load(int index, const safe_ptr<frame_producer>& producer, bool play_on_load, bool preview)\r
{\r
- producer->set_parent_printer(std::bind(&layer::print, &get_layer(index)));\r
- producer->initialize(factory_);\r
+ producer->set_frame_factory(factory_);\r
executor_.invoke([&]{get_layer(index).load(producer, play_on_load, preview);});\r
}\r
\r
\r
frame_producer_remover g_remover;\r
\r
-struct layer::implementation : boost::noncopyable\r
+struct layer::implementation : public object, boost::noncopyable\r
{ \r
mutable tbb::spin_mutex printer_mutex_;\r
printer parent_printer_;\r
safe_ptr<basic_frame> last_frame_;\r
bool is_paused_;\r
public:\r
- implementation(int index, const printer& parent_printer) \r
- : parent_printer_(parent_printer)\r
+ implementation(const object* parent, int index) \r
+ : object(parent)\r
, index_(index)\r
, foreground_(frame_producer::empty())\r
, background_(frame_producer::empty())\r
\r
void load(const safe_ptr<frame_producer>& frame_producer, bool play_on_load, bool preview)\r
{ \r
+ frame_producer->set_parent(this);\r
background_ = frame_producer;\r
is_paused_ = false;\r
\r
\r
auto following = foreground_->get_following_producer();\r
following->set_leading_producer(foreground_);\r
- following->set_parent_printer([=]{return print();});\r
+ following->set_parent(this);\r
g_remover.remove(std::move(foreground_));\r
foreground_ = following;\r
CASPAR_LOG(info) << foreground_->print() << L" Added.";\r
std::wstring print() const\r
{\r
tbb::spin_mutex::scoped_lock lock(printer_mutex_); // Child-producers may call print asynchronously to the producer thread.\r
- return (parent_printer_ ? parent_printer_() + L"/" : L"") + L"layer[" + boost::lexical_cast<std::wstring>(index_) + L"]";\r
+ return object::print() + L"layer[" + boost::lexical_cast<std::wstring>(index_) + L"]";\r
}\r
};\r
\r
-layer::layer(int index, const printer& parent_printer) : impl_(new implementation(index, parent_printer)){}\r
+layer::layer(const object* parent, int index) : impl_(new implementation(parent, index)){}\r
layer::layer(layer&& other) : impl_(std::move(other.impl_)){}\r
layer& layer::operator=(layer&& other)\r
{\r
#pragma once\r
\r
+#include <common/object.h>\r
#include <common/memory/safe_ptr.h>\r
#include <common/utility/printer.h>\r
\r
class layer : boost::noncopyable\r
{\r
public:\r
- layer(int index = std::numeric_limits<int>::min(), const printer& parent_printer = nullptr); // nothrow\r
+ explicit layer(const object* parent = nullptr, int index = std::numeric_limits<int>::min()); // nothrow\r
layer(layer&& other); // nothrow\r
layer& operator=(layer&& other); // nothrow\r
\r
\r
struct transition_producer::implementation : boost::noncopyable\r
{ \r
- printer parent_printer_;\r
+ const transition_producer* self_;\r
unsigned short current_frame_;\r
\r
const transition_info info_;\r
safe_ptr<frame_producer> source_producer_;\r
\r
std::shared_ptr<frame_factory> frame_factory_;\r
- video_format_desc format_desc_;\r
\r
std::vector<safe_ptr<basic_frame>> frame_buffer_;\r
\r
- implementation(const safe_ptr<frame_producer>& dest, const transition_info& info) \r
- : current_frame_(0)\r
+ implementation(const transition_producer* self, const safe_ptr<frame_producer>& dest, const transition_info& info) \r
+ : self_(self)\r
+ , current_frame_(0)\r
, info_(info)\r
, dest_producer_(dest)\r
, source_producer_(frame_producer::empty())\r
{\r
- dest_producer_->set_parent_printer(std::bind(&implementation::dest_print, this));\r
+ dest_producer_->set_parent(self_);\r
frame_buffer_.push_back(basic_frame::empty());\r
}\r
\r
- void initialize(const safe_ptr<frame_factory>& frame_factory)\r
+ void set_frame_factory(const safe_ptr<frame_factory>& frame_factory)\r
{\r
- dest_producer_->initialize(frame_factory);\r
+ dest_producer_->set_frame_factory(frame_factory);\r
frame_factory_ = frame_factory;\r
- format_desc_ = frame_factory_->get_video_format_desc();\r
}\r
-\r
- virtual void set_parent_printer(const printer& parent_printer) \r
- {\r
- parent_printer_ = parent_printer;\r
- }\r
-\r
+ \r
safe_ptr<frame_producer> get_following_producer() const\r
{\r
return dest_producer_;\r
void set_leading_producer(const safe_ptr<frame_producer>& producer)\r
{\r
source_producer_ = producer;\r
- source_producer_->set_parent_printer(std::bind(&implementation::source_print, this));\r
+ source_producer_->set_parent(self_);\r
}\r
\r
safe_ptr<basic_frame> receive()\r
{\r
CASPAR_LOG_CURRENT_EXCEPTION();\r
producer = frame_producer::empty();\r
- CASPAR_LOG(warning) << print() << " Failed to receive frame. Removed producer from transition.";\r
+ CASPAR_LOG(warning) << self_->print() << " Failed to receive frame. Removed producer from transition.";\r
}\r
\r
if(frame == basic_frame::eof())\r
try\r
{\r
auto following = producer->get_following_producer();\r
- following->initialize(safe_ptr<frame_factory>(frame_factory_));\r
+ following->set_frame_factory(safe_ptr<frame_factory>(frame_factory_));\r
following->set_leading_producer(producer);\r
+ following->set_parent(self_);\r
producer = std::move(following);\r
}\r
catch(...)\r
{\r
CASPAR_LOG_CURRENT_EXCEPTION();\r
producer = frame_producer::empty();\r
- CASPAR_LOG(warning) << print() << " Failed to initialize following producer.";\r
+ CASPAR_LOG(warning) << self_->print() << " Failed to initialize following producer.";\r
}\r
\r
return render_sub_frame(producer);\r
d_frame2->get_image_transform().set_key_scale(delta2, 1.0); \r
}\r
\r
- auto s_frame = s_frame1->get_image_transform() == s_frame2->get_image_transform() ? s_frame2 : basic_frame::interlace(s_frame1, s_frame2, format_desc_.mode);\r
- auto d_frame = basic_frame::interlace(d_frame1, d_frame2, format_desc_.mode);\r
+ auto mode = frame_factory_->get_video_format_desc().mode;\r
+ auto s_frame = s_frame1->get_image_transform() == s_frame2->get_image_transform() ? s_frame2 : basic_frame::interlace(s_frame1, s_frame2, mode);\r
+ auto d_frame = basic_frame::interlace(d_frame1, d_frame2, mode);\r
\r
return basic_frame(s_frame, d_frame);\r
}\r
\r
- std::wstring print() const\r
+ virtual std::wstring print() const\r
{\r
- return (parent_printer_ ? parent_printer_() + L"/" : L"") + L"transition[" + info_.name() + L":" + boost::lexical_cast<std::wstring>(info_.duration) + L"]";\r
+ return L"transition[" + info_.name() + L":" + boost::lexical_cast<std::wstring>(info_.duration) + L"]";\r
}\r
\r
std::wstring source_print() const { return print() + L"/source";}\r
std::wstring dest_print() const { return print() + L"/dest";}\r
};\r
\r
+transition_producer::transition_producer(const safe_ptr<frame_producer>& dest, const transition_info& info) : impl_(new implementation(this, dest, info)){}\r
transition_producer::transition_producer(transition_producer&& other) : impl_(std::move(other.impl_)){}\r
-transition_producer::transition_producer(const safe_ptr<frame_producer>& dest, const transition_info& info) : impl_(new implementation(dest, info)){}\r
safe_ptr<basic_frame> transition_producer::receive(){return impl_->receive();}\r
safe_ptr<frame_producer> transition_producer::get_following_producer() const{return impl_->get_following_producer();}\r
void transition_producer::set_leading_producer(const safe_ptr<frame_producer>& producer) { impl_->set_leading_producer(producer); }\r
-void transition_producer::initialize(const safe_ptr<frame_factory>& frame_factory) { impl_->initialize(frame_factory);}\r
-void transition_producer::set_parent_printer(const printer& parent_printer) {impl_->set_parent_printer(parent_printer);}\r
-std::wstring transition_producer::print() const { return impl_->print();}\r
+void transition_producer::set_frame_factory(const safe_ptr<frame_factory>& frame_factory) { impl_->set_frame_factory(frame_factory);}\r
+std::wstring transition_producer::print() const { return frame_producer::print();}// + impl_->print();}\r
\r
}}\r
\r
virtual safe_ptr<basic_frame> receive();\r
\r
virtual safe_ptr<frame_producer> get_following_producer() const;\r
+\r
virtual void set_leading_producer(const safe_ptr<frame_producer>& producer);\r
- virtual void initialize(const safe_ptr<frame_factory>& frame_factory);\r
- virtual void set_parent_printer(const printer& parent_printer);\r
+ virtual void set_frame_factory(const safe_ptr<frame_factory>& frame_factory);\r
+\r
virtual std::wstring print() const;\r
private:\r
struct implementation;\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\;..\common;..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\;..\common;..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\;..\common;..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\;..\..\common;..\..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\;..\..\common;..\..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\..\;..\..\common;..\..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
~co_init(){CoUninitialize();}\r
} co_;\r
\r
- printer parent_printer_;\r
+ const object* parent_;\r
const core::video_format_desc format_desc_;\r
std::wstring model_name_;\r
const size_t device_index_;\r
safe_ptr<core::basic_frame> tail_;\r
\r
public:\r
- decklink_input(const core::video_format_desc& format_desc, size_t device_index, const std::shared_ptr<core::frame_factory>& frame_factory, const printer& parent_printer)\r
- : parent_printer_(parent_printer)\r
+ decklink_input(const object* parent, const core::video_format_desc& format_desc, size_t device_index, const std::shared_ptr<core::frame_factory>& frame_factory)\r
+ : parent_(parent)\r
, format_desc_(format_desc)\r
, device_index_(device_index)\r
- , model_name_(L"DECKLINK")\r
+ , model_name_(L"decklink")\r
, frame_factory_(frame_factory)\r
, tail_(core::basic_frame::empty())\r
{\r
\r
std::wstring print() const\r
{\r
- return (parent_printer_ ? parent_printer_() + L"/" : L"") + L" [" + model_name_ + L"device:" + boost::lexical_cast<std::wstring>(device_index_) + L"]";\r
+ return static_cast<const core::frame_producer*>(parent_)->print() + L" [" + model_name_ + L"device:" + boost::lexical_cast<std::wstring>(device_index_) + L"]";\r
}\r
};\r
\r
class decklink_producer : public core::frame_producer\r
{ \r
const size_t device_index_;\r
- printer parent_printer_;\r
\r
std::unique_ptr<decklink_input> input_;\r
\r
explicit decklink_producer(const core::video_format_desc& format_desc, size_t device_index)\r
: format_desc_(format_desc) \r
, device_index_(device_index)\r
- , executor_(print()){}\r
+ , executor_(L"decklink_producer"){}\r
\r
~decklink_producer()\r
{ \r
});\r
}\r
\r
- virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory)\r
+ virtual void set_frame_factory(const safe_ptr<core::frame_factory>& frame_factory)\r
{\r
executor_.start();\r
executor_.invoke([=]\r
{\r
- input_.reset(new decklink_input(format_desc_, device_index_, frame_factory, parent_printer_));\r
+ input_.reset(new decklink_input(this, format_desc_, device_index_, frame_factory));\r
});\r
}\r
-\r
- virtual void set_parent_printer(const printer& parent_printer) { parent_printer_ = parent_printer;}\r
- \r
+ \r
virtual safe_ptr<core::basic_frame> receive()\r
{\r
return input_->get_frame();\r
\r
std::wstring print() const\r
{\r
- return (parent_printer_ ? parent_printer_() + L"/" : L"") + (input_ ? input_->print() : L"Unknown Decklink [input-" + boost::lexical_cast<std::wstring>(device_index_) + L"]");\r
+ return (input_ ? input_->print() : L"Unknown Decklink [input-" + boost::lexical_cast<std::wstring>(device_index_) + L"]");\r
}\r
};\r
\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
{\r
const std::wstring filename_;\r
const bool loop_;\r
- printer parent_printer_;\r
\r
std::shared_ptr<diagnostics::graph> graph_;\r
timer perf_timer_;\r
graph_->set_color("frame-time", diagnostics::color(1.0f, 0.0f, 0.0f));\r
}\r
\r
- virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory)\r
+ virtual void set_frame_factory(const safe_ptr<core::frame_factory>& frame_factory)\r
{\r
frame_factory_ = frame_factory;\r
input_.reset(new input(safe_ptr<diagnostics::graph>(graph_), filename_, loop_, std::bind(&ffmpeg_producer::print, this)));\r
\r
}\r
\r
- virtual void set_parent_printer(const printer& parent_printer) \r
- {\r
- parent_printer_ = parent_printer;\r
- }\r
-\r
virtual safe_ptr<core::basic_frame> receive()\r
{\r
perf_timer_.reset();\r
\r
virtual std::wstring print() const\r
{\r
- return (parent_printer_ ? parent_printer_() + L"/" : L"") + L"ffmpeg[" + boost::filesystem::wpath(filename_).filename() + L"]";\r
+ return frame_producer::print() + L"ffmpeg[" + boost::filesystem::wpath(filename_).filename() + L"]";\r
}\r
};\r
\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
#include <boost/filesystem.hpp>\r
#include <boost/format.hpp>\r
\r
+#include <boost/assign.hpp>\r
+\r
using boost::format;\r
using boost::io::group;\r
\r
\r
struct cg_producer::implementation : boost::noncopyable\r
{\r
- printer parent_printer_;\r
- safe_ptr<flash_producer> flash_producer_;\r
+ const cg_producer* self_;\r
+ safe_ptr<core::frame_producer> flash_producer_;\r
std::shared_ptr<core::frame_factory> frame_factory_;\r
public:\r
- implementation() \r
- : flash_producer_(flash_producer(env::template_host())){}\r
+ implementation(const cg_producer* self) \r
+ : self_(self)\r
+ , flash_producer_(create_flash_producer(boost::assign::list_of(env::template_host())))\r
+ {\r
+ flash_producer_->set_parent(self_);\r
+ }\r
\r
void clear()\r
{\r
- flash_producer_ = flash_producer(env::template_host());\r
- flash_producer_->set_parent_printer(parent_printer_);\r
- flash_producer_->initialize(safe_ptr<core::frame_factory>(frame_factory_));\r
+ flash_producer_ = create_flash_producer(boost::assign::list_of(env::template_host()));\r
+ flash_producer_->set_parent(self_);\r
+ flash_producer_->set_frame_factory(safe_ptr<core::frame_factory>(frame_factory_));\r
}\r
\r
void add(int layer, const std::wstring& filename, bool play_on_load, const std::wstring& label, const std::wstring& data)\r
{\r
- CASPAR_LOG(info) << print() << " Invoking add-command";\r
+ CASPAR_LOG(info) << flash_producer_->print() << " Invoking add-command";\r
flash_producer_->param((boost::wformat(L"<invoke name=\"Add\" returntype=\"xml\"><arguments><number>%1%</number><string>%2%</string>%3%<string>%4%</string><string><![CDATA[%5%]]></string></arguments></invoke>") % layer % filename % (play_on_load?TEXT("<true/>"):TEXT("<false/>")) % label % data).str());\r
}\r
\r
void remove(int layer)\r
{\r
- CASPAR_LOG(info) << print() << " Invoking remove-command";\r
+ CASPAR_LOG(info) << flash_producer_->print() << " Invoking remove-command";\r
flash_producer_->param((boost::wformat(L"<invoke name=\"Delete\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str());\r
}\r
\r
void play(int layer)\r
{\r
- CASPAR_LOG(info) << print() << " Invoking play-command";\r
+ CASPAR_LOG(info) << flash_producer_->print() << " Invoking play-command";\r
flash_producer_->param((boost::wformat(L"<invoke name=\"Play\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str());\r
}\r
\r
void stop(int layer, unsigned int)\r
{\r
- CASPAR_LOG(info) << print() << " Invoking stop-command";\r
+ CASPAR_LOG(info) << flash_producer_->print() << " Invoking stop-command";\r
flash_producer_->param((boost::wformat(L"<invoke name=\"Stop\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><number>0</number></arguments></invoke>") % layer).str());\r
}\r
\r
void next(int layer)\r
{\r
- CASPAR_LOG(info) << print() << " Invoking next-command";\r
+ CASPAR_LOG(info) << flash_producer_->print() << " Invoking next-command";\r
flash_producer_->param((boost::wformat(L"<invoke name=\"Next\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str());\r
}\r
\r
void update(int layer, const std::wstring& data)\r
{\r
- CASPAR_LOG(info) << print() <<" Invoking update-command";\r
+ CASPAR_LOG(info) << flash_producer_->print() <<" Invoking update-command";\r
flash_producer_->param((boost::wformat(L"<invoke name=\"SetData\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><string><![CDATA[%2%]]></string></arguments></invoke>") % layer % data).str());\r
}\r
\r
void invoke(int layer, const std::wstring& label)\r
{\r
- CASPAR_LOG(info) << print() << " Invoking invoke-command";\r
+ CASPAR_LOG(info) << flash_producer_->print() << " Invoking invoke-command";\r
flash_producer_->param((boost::wformat(L"<invoke name=\"Invoke\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><string>%2%</string></arguments></invoke>") % layer % label).str());\r
}\r
\r
return flash_producer_->receive();\r
}\r
\r
- void initialize(const safe_ptr<core::frame_factory>& frame_factory)\r
+ void set_frame_factory(const safe_ptr<core::frame_factory>& frame_factory)\r
{\r
frame_factory_ = frame_factory;\r
- flash_producer_->set_parent_printer(parent_printer_);\r
- flash_producer_->initialize(frame_factory);\r
- }\r
-\r
- void set_parent_printer(const printer& parent_printer) \r
- {\r
- parent_printer_ = parent_printer;\r
+ flash_producer_->set_frame_factory(frame_factory);\r
}\r
-\r
+ \r
std::wstring print() const\r
{\r
- return flash_producer_->print();\r
+ return L"cg";\r
}\r
};\r
\r
return producer;\r
}\r
\r
-cg_producer::cg_producer() : impl_(new implementation()){}\r
+cg_producer::cg_producer() : impl_(new implementation(this)){}\r
cg_producer::cg_producer(cg_producer&& other) : impl_(std::move(other.impl_)){}\r
safe_ptr<core::basic_frame> cg_producer::receive(){return impl_->receive();}\r
void cg_producer::clear(){impl_->clear();}\r
void cg_producer::next(int layer){impl_->next(layer);}\r
void cg_producer::update(int layer, const std::wstring& data){impl_->update(layer, data);}\r
void cg_producer::invoke(int layer, const std::wstring& label){impl_->invoke(layer, label);}\r
-void cg_producer::initialize(const safe_ptr<core::frame_factory>& frame_factory){impl_->initialize(frame_factory);}\r
-void cg_producer::set_parent_printer(const printer& parent_printer) { impl_->set_parent_printer(parent_printer);}\r
-std::wstring cg_producer::print() const{return impl_->print();}\r
+void cg_producer::set_frame_factory(const safe_ptr<core::frame_factory>& frame_factory){impl_->set_frame_factory(frame_factory);}\r
+std::wstring cg_producer::print() const{return frame_producer::print() + impl_->print();}\r
\r
}
\ No newline at end of file
explicit cg_producer();\r
cg_producer(cg_producer&& other);\r
\r
- virtual safe_ptr<core::basic_frame> receive();\r
- virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory);\r
- virtual void set_parent_printer(const printer& parent_printer);\r
-\r
void clear();\r
void add(int layer, const std::wstring& template_name, bool play_on_load, const std::wstring& start_from_label = TEXT(""), const std::wstring& data = TEXT(""));\r
void remove(int layer);\r
void update(int layer, const std::wstring& data);\r
void invoke(int layer, const std::wstring& label);\r
\r
+ // frame_producer\r
+ virtual safe_ptr<core::basic_frame> receive();\r
+ virtual void set_frame_factory(const safe_ptr<core::frame_factory>& frame_factory);\r
virtual std::wstring print() const;\r
\r
private:\r
#include <core/producer/frame/basic_frame.h>\r
#include <core/producer/frame/write_frame.h>\r
\r
+#include <common/env.h>\r
#include <common/concurrency/executor.h>\r
#include <common/utility/timer.h>\r
#include <common/diagnostics/graph.h>\r
~co_init(){CoUninitialize();}\r
} co_;\r
\r
- printer parent_printer_;\r
+ const object* parent_;\r
const std::wstring filename_;\r
const core::video_format_desc format_desc_;\r
\r
safe_ptr<diagnostics::graph> graph_;\r
timer perf_timer_;\r
\r
- std::wstring print()\r
- {\r
- return parent_printer_();\r
- }\r
-\r
public:\r
- flash_renderer(const safe_ptr<diagnostics::graph>& graph, const std::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filename, const printer& parent_printer) \r
- : parent_printer_(parent_printer)\r
+ flash_renderer(const object* parent, const safe_ptr<diagnostics::graph>& graph, const std::shared_ptr<core::frame_factory>& frame_factory, const std::wstring& filename) \r
+ : parent_(parent)\r
, graph_(graph)\r
, filename_(filename)\r
, format_desc_(frame_factory->get_video_format_desc())\r
if(FAILED(CComObject<caspar::flash::FlashAxContainer>::CreateInstance(&ax_)))\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to create FlashAxContainer"));\r
\r
- ax_->set_print(parent_printer_);\r
+ ax_->set_print([this]{return L"";});\r
\r
if(FAILED(ax_->CreateAxControl()))\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Failed to Create FlashAxControl"));\r
\r
bmp_.reset(CreateDIBSection(static_cast<HDC>(hdc_.get()), &info, DIB_RGB_COLORS, reinterpret_cast<void**>(&bmp_data_), 0, 0), DeleteObject);\r
SelectObject(static_cast<HDC>(hdc_.get()), bmp_.get()); \r
- CASPAR_LOG(info) << parent_printer_() << L" Thread started.";\r
+ CASPAR_LOG(info) << print() << L" Thread started.";\r
}\r
\r
~flash_renderer()\r
CASPAR_LOG(warning) << print() << " Flash function call failed. Param: " << param << ".";\r
graph_->add_tag("param");\r
\r
- if(abs(ax_->GetFPS() / format_desc_.fps) > 0.001)\r
+ if(abs(ax_->GetFPS() - format_desc_.fps) > 0.001 && abs(ax_->GetFPS()/2.0 - format_desc_.fps) > 0.001)\r
CASPAR_LOG(warning) << print() << " Invalid frame-rate: " << ax_->GetFPS() << L". Should be either " << format_desc_.fps << L" or " << format_desc_.fps*2.0 << L".";\r
}\r
\r
return ax_->GetFPS(); \r
}\r
\r
+ std::wstring print()\r
+ {\r
+ return parent_->print();\r
+ }\r
+\r
private:\r
\r
safe_ptr<core::basic_frame> render_simple_frame(bool underflow)\r
}\r
};\r
\r
-struct flash_producer::implementation\r
+struct flash_producer : public core::frame_producer\r
{ \r
- printer parent_printer_;\r
const std::wstring filename_; \r
tbb::atomic<int> fps_;\r
\r
\r
executor executor_;\r
\r
- std::wstring print() const\r
- { \r
- return (parent_printer_ ? parent_printer_() + L"/" : L"") + L"flash[" + boost::filesystem::wpath(filename_).filename() + L", " + \r
- boost::lexical_cast<std::wstring>(fps_) + \r
- (interlaced(fps_, format_desc_) ? L"i" : L"p") + L"]"; \r
- } \r
- \r
public:\r
- implementation(const std::wstring& filename) \r
+ flash_producer(const std::wstring& filename) \r
: filename_(filename) \r
, tail_(core::basic_frame::empty()) \r
- , executor_(print())\r
+ , executor_(L"flash_producer")\r
{ \r
if(!boost::filesystem::exists(filename))\r
BOOST_THROW_EXCEPTION(file_not_found() << boost::errinfo_file_name(narrow(filename))); \r
\r
- graph_ = diagnostics::create_graph(boost::bind(&implementation::print, this));\r
fps_ = 0;\r
- graph_->set_color("output-buffer", diagnostics::color(0.0f, 1.0f, 0.0f)); \r
}\r
\r
- ~implementation()\r
+ ~flash_producer()\r
{\r
executor_.clear();\r
executor_.invoke([=]\r
});\r
}\r
\r
- virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory)\r
+ virtual void set_frame_factory(const safe_ptr<core::frame_factory>& frame_factory)\r
{\r
frame_factory_ = frame_factory;\r
format_desc_ = frame_factory->get_video_format_desc();\r
- frame_buffer_.set_capacity(static_cast<size_t>(format_desc_.fps/4.0));\r
+ frame_buffer_.set_capacity(4);\r
+ graph_ = diagnostics::create_graph([this]{return print();});\r
+ graph_->set_color("output-buffer", diagnostics::color(0.0f, 1.0f, 0.0f)); \r
executor_.start();\r
}\r
-\r
- virtual void set_parent_printer(const printer& parent_printer) \r
- {\r
- parent_printer_ = parent_printer;\r
- }\r
-\r
+ \r
virtual safe_ptr<core::basic_frame> receive()\r
{ \r
if(!renderer_)\r
return tail_;\r
}\r
\r
- void param(const std::wstring& param) \r
+ virtual void param(const std::wstring& param) \r
{ \r
executor_.begin_invoke([=]\r
{\r
if(!renderer_)\r
{\r
- renderer_.reset(new flash_renderer(safe_ptr<diagnostics::graph>(graph_), frame_factory_, filename_, [=]{return print();}));\r
+ renderer_.reset(new flash_renderer(this, safe_ptr<diagnostics::graph>(graph_), frame_factory_, filename_));\r
while(frame_buffer_.try_push(core::basic_frame::empty())){} \r
}\r
\r
}\r
});\r
}\r
+ \r
+ virtual std::wstring print() const\r
+ { \r
+ return frame_producer::print() + L"flash[" + boost::filesystem::wpath(filename_).filename() + L", " + \r
+ boost::lexical_cast<std::wstring>(fps_) + \r
+ (interlaced(fps_, format_desc_) ? L"i" : L"p") + L"]"; \r
+ } \r
};\r
\r
-flash_producer::flash_producer(flash_producer&& other) : impl_(std::move(other.impl_)){}\r
-flash_producer::flash_producer(const std::wstring& filename) : impl_(new implementation(filename)){}\r
-safe_ptr<core::basic_frame> flash_producer::receive(){return impl_->receive();}\r
-void flash_producer::param(const std::wstring& param){impl_->param(param);}\r
-void flash_producer::initialize(const safe_ptr<core::frame_factory>& frame_factory) { impl_->initialize(frame_factory);}\r
-void flash_producer::set_parent_printer(const printer& parent_printer){impl_->set_parent_printer(parent_printer);}\r
-std::wstring flash_producer::print() const {return impl_->print();}\r
+safe_ptr<core::frame_producer> create_flash_producer(const std::vector<std::wstring>& params)\r
+{\r
+ std::wstring filename = env::template_folder() + L"\\" + params[0];\r
+ \r
+ return make_safe<flash_producer>(filename);\r
+}\r
\r
-std::wstring flash_producer::find_template(const std::wstring& template_name)\r
+std::wstring find_flash_template(const std::wstring& template_name)\r
{\r
if(boost::filesystem::exists(template_name + L".ft")) \r
return template_name + L".ft";\r
\r
namespace caspar {\r
\r
-class flash_producer : public core::frame_producer\r
-{\r
-public:\r
- explicit flash_producer(const std::wstring& filename);\r
- flash_producer(flash_producer&& other);\r
+safe_ptr<core::frame_producer> create_flash_producer(const std::vector<std::wstring>& params);\r
\r
- virtual safe_ptr<core::basic_frame> receive();\r
- virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory);\r
- virtual void set_parent_printer(const printer& parent_printer);\r
- virtual std::wstring print() const;\r
-\r
- void param(const std::wstring& param);\r
- \r
- static std::wstring find_template(const std::wstring& templateName);\r
-private: \r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
+std::wstring find_flash_template(const std::wstring& templateName);\r
\r
}
\ No newline at end of file
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\FreeImage\Dist\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\FreeImage\Dist\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\FreeImage\Dist\;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
\r
struct image_producer : public core::frame_producer\r
{ \r
- printer parent_printer_;\r
std::shared_ptr<core::frame_factory> frame_factory_;\r
std::wstring filename_;\r
safe_ptr<core::basic_frame> frame_;\r
+ decltype(load_image(L"")) bitmap_;\r
\r
- image_producer(const std::wstring& filename) \r
- : filename_(filename), frame_(core::basic_frame::empty()) {}\r
+ explicit image_producer(const std::wstring& filename) \r
+ : filename_(filename)\r
+ , frame_(core::basic_frame::empty()) \r
+ , bitmap_(load_image(filename_))\r
+ {\r
+ FreeImage_FlipVertical(bitmap_.get());\r
+ }\r
\r
virtual safe_ptr<core::basic_frame> receive(){return frame_;}\r
\r
- virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory)\r
+ virtual void set_frame_factory(const safe_ptr<core::frame_factory>& frame_factory)\r
{\r
frame_factory_ = frame_factory;\r
- auto bitmap = load_image(filename_);\r
- FreeImage_FlipVertical(bitmap.get());\r
- auto frame = frame_factory->create_frame(FreeImage_GetWidth(bitmap.get()), FreeImage_GetHeight(bitmap.get()));\r
- std::copy_n(FreeImage_GetBits(bitmap.get()), frame->image_data().size(), frame->image_data().begin());\r
+ auto frame = frame_factory->create_frame(FreeImage_GetWidth(bitmap_.get()), FreeImage_GetHeight(bitmap_.get()));\r
+ std::copy_n(FreeImage_GetBits(bitmap_.get()), frame->image_data().size(), frame->image_data().begin());\r
+ bitmap_.reset();\r
frame_ = std::move(frame);\r
}\r
\r
- virtual void set_parent_printer(const printer& parent_printer) \r
- {\r
- parent_printer_ = parent_printer;\r
- }\r
-\r
virtual std::wstring print() const\r
{\r
- return (parent_printer_ ? parent_printer_() + L"/" : L"") + L"image_producer. filename: " + filename_;\r
+ return frame_producer::print() + L"image_producer[" + filename_ + L"]";\r
}\r
};\r
\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\SFML-1.6\include;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\SFML-1.6\include;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\SFML-1.6\include;..\..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\GLee5_4\;..\..\dependencies\tbb30_20100406oss\include\;..\..\dependencies\SFML-1.6\include;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\GLee5_4\;..\..\dependencies\tbb30_20100406oss\include\;..\..\dependencies\SFML-1.6\include;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\GLee5_4\;..\..\dependencies\tbb30_20100406oss\include\;..\..\dependencies\SFML-1.6\include;$(IncludePath)</IncludePath>\r
\r
struct silverlight_producer : public core::frame_producer\r
{ \r
- std::wstring print() const{ return L"silverlight[]"; } \r
-\r
std::unique_ptr<silverlight_renderer> renderer_;\r
\r
executor executor_;\r
-\r
public:\r
\r
- silverlight_producer() : executor_(print())\r
- {}\r
+ silverlight_producer() : executor_(L"silverlight"){}\r
\r
- virtual void initialize(const safe_ptr<core::frame_factory>& frame_factory)\r
+ virtual void set_frame_factory(const safe_ptr<core::frame_factory>& frame_factory)\r
{\r
executor_.start();\r
executor_.invoke([=]\r
renderer_.reset(new silverlight_renderer(frame_factory));\r
});\r
}\r
-\r
- void set_parent_printer(const printer& parent_printer)\r
- {\r
-\r
- }\r
-\r
+ \r
virtual safe_ptr<core::basic_frame> receive()\r
{\r
executor_.begin_invoke([=]\r
\r
return renderer_->get_frame();\r
}\r
+\r
+ std::wstring print() const{ return frame_producer::print() + L"silverlight"; } \r
};\r
\r
safe_ptr<core::frame_producer> create_silverlight_producer(const std::vector<std::wstring>& params)\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)bin\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;..\..\dependencies\SFML-1.6\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;..\..\dependencies\SFML-1.6\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\..\;..\..\dependencies\boost_1_44_0\;..\..\dependencies\ffmpeg 0.6\include\;..\..\dependencies\tbb30_20100406oss\include\;..\..\dependencies\SFML-1.6\include\;$(IncludePath)</IncludePath>\r
}\r
}\r
\r
- std::wstring fullFilename = flash_producer::find_template(env::template_folder() + _parameters[2]);\r
+ std::wstring fullFilename = find_flash_template(env::template_folder() + _parameters[2]);\r
if(!fullFilename.empty())\r
{\r
std::wstring extension = boost::filesystem::wpath(fullFilename).extension();\r
fullTemplateFilename += TEXT("\\");\r
}\r
fullTemplateFilename += templateName;\r
- fullTemplateFilename = flash_producer::find_template(fullTemplateFilename);\r
+ fullTemplateFilename = find_flash_template(fullTemplateFilename);\r
if(fullTemplateFilename.empty())\r
{\r
CASPAR_LOG(error) << "Failed to save instance of " << templateName << TEXT(" as ") << titleName << TEXT(", template ") << fullTemplateFilename << " not found";\r
return;\r
}\r
\r
- auto producer = flash_producer(env::template_folder()+TEXT("CG.fth"));\r
+ auto producer = create_flash_producer(boost::assign::list_of(env::template_folder()+TEXT("CG.fth")));\r
\r
std::wstringstream flashParam;\r
flashParam << TEXT("<invoke name=\"Add\" returntype=\"xml\"><arguments><number>1</number><string>") << currentProfile_ << '/' << templateName << TEXT("</string><number>0</number><true/><string> </string><string><![CDATA[ ") << xmlData << TEXT(" ]]></string></arguments></invoke>");\r
- producer.param(flashParam.str());\r
+ producer->param(flashParam.str());\r
\r
CASPAR_LOG(info) << "Saved an instance of " << templateName << TEXT(" as ") << titleName ;\r
\r
</ImportGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<IncludePath>../;..\dependencies/tbb30_20100406oss/include;..\dependencies\boost_1_44_0;$(IncludePath)</IncludePath>\r
- <OutDir>$(ProjectDir)\bin\$(Configuration)\</OutDir>\r
+ <OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
+ <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
</PropertyGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
<IncludePath>../;..\dependencies/tbb30_20100406oss/include;..\dependencies\boost_1_44_0;$(IncludePath)</IncludePath>\r
- <OutDir>$(ProjectDir)\bin\$(Configuration)\</OutDir>\r
- <IntDir>$(ProjectDir)\bin\$(Configuration)\</IntDir>\r
+ <OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
+ <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
</PropertyGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">\r
<IncludePath>../;..\dependencies/tbb30_20100406oss/include;..\dependencies\boost_1_44_0;$(IncludePath)</IncludePath>\r
- <OutDir>$(ProjectDir)\bin\$(Configuration)\</OutDir>\r
+ <OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
+ <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
</PropertyGroup>\r
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">\r
<IncludePath>../;..\dependencies/tbb30_20100406oss/include;..\dependencies\boost_1_44_0;$(IncludePath)</IncludePath>\r
- <OutDir>$(ProjectDir)\bin\$(Configuration)\</OutDir>\r
+ <OutDir>$(ProjectDir)bin\$(Configuration)\</OutDir>\r
+ <IntDir>$(ProjectDir)tmp\$(Configuration)\</IntDir>\r
</PropertyGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
}\r
\r
void print_version()\r
-{ \r
+{\r
CASPAR_LOG(info) << L"Copyright (c) 2010 Sveriges Television AB, www.casparcg.com, <info@casparcg.com>";\r
CASPAR_LOG(info) << L"Starting CasparCG Video and Graphics Playout Server " << env::version();\r
CASPAR_LOG(info) << L"Flash " << get_flash_version();\r
}\r
\r
int main(int argc, wchar_t* argv[])\r
-{ \r
+{ \r
#ifdef _DEBUG\r
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF );\r
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG );\r
<PropertyGroup Label="UserMacros" />\r
<PropertyGroup>\r
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(Configuration)\</IntDir>\r
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(SolutionDir)tmp\$(Configuration)\</IntDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(SolutionDir)tmp\$(Configuration)\</IntDir>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">..\dependencies\BluefishSDK_V5_8_0_31\Inc\;..\dependencies\boost_1_44_0\;..\dependencies\ffmpeg 0.6\include\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\include\;..\dependencies\tbb30_20100406oss\include\;$(IncludePath)</IncludePath>\r
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\Program\Microsoft DirectX SDK (June 2010)\Lib\x86;..\dependencies\BluefishSDK_V5_8_0_31\Lib\;..\dependencies\boost_1_44_0\stage\lib\;..\dependencies\ffmpeg 0.6\lib\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\lib\;..\dependencies\tbb30_20100406oss\lib\ia32\vc10\;$(LibraryPath)</LibraryPath>\r
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">C:\Program\Microsoft DirectX SDK (June 2010)\Lib\x86;..\dependencies\BluefishSDK_V5_8_0_31\Lib\;..\dependencies\boost_1_44_0\stage\lib\;..\dependencies\ffmpeg 0.6\lib\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\lib\;..\dependencies\tbb30_20100406oss\lib\ia32\vc10\;$(LibraryPath)</LibraryPath>\r
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">C:\Program\Microsoft DirectX SDK (June 2010)\Lib\x86;..\dependencies\BluefishSDK_V5_8_0_31\Lib\;..\dependencies\boost_1_44_0\stage\lib\;..\dependencies\ffmpeg 0.6\lib\;..\dependencies\FreeImage\Dist\;..\dependencies\GLee5_4\;..\dependencies\SFML-1.6\lib\;..\dependencies\tbb30_20100406oss\lib\ia32\vc10\;$(LibraryPath)</LibraryPath>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)\bin\$(Configuration)\</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)\bin\$(Configuration)\</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(SolutionDir)\bin\$(Configuration)\</OutDir>\r
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(SolutionDir)\bin\$(Configuration)\</OutDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">$(SolutionDir)bin\$(Configuration)\</OutDir>\r
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionName)</TargetName>\r
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionName)</TargetName>\r
<TargetName Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">$(SolutionName)</TargetName>\r