]> git.sesse.net Git - casparcg/commitdiff
Made the server more portable
authorHelge Norberg <helge.norberg@svt.se>
Thu, 26 Mar 2015 12:55:54 +0000 (13:55 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Thu, 26 Mar 2015 12:55:54 +0000 (13:55 +0100)
100 files changed:
CMakeLists.txt
accelerator/CMakeLists.txt
accelerator/StdAfx.cpp
accelerator/accelerator.cpp
accelerator/cpu/image/image_mixer.cpp
accelerator/cpu/util/xmm.h
accelerator/ogl/image/image_kernel.cpp
accelerator/ogl/image/image_kernel.h
accelerator/ogl/image/image_mixer.cpp
accelerator/ogl/image/image_shader.cpp
accelerator/ogl/util/buffer.cpp
accelerator/ogl/util/device.cpp
accelerator/ogl/util/shader.cpp
accelerator/ogl/util/texture.cpp
common/CMakeLists.txt
common/array.h
common/endian.h
common/gl/gl_check.h
common/lock.h
common/memshfl.h
common/os/linux/scheduling.cpp [new file with mode: 0644]
common/os/scheduling.h [new file with mode: 0644]
common/os/windows/scheduling.cpp [new file with mode: 0644]
common/param.h
common/reactive.h
common/stdafx.h
common/tweener.cpp
common/tweener.h
core/StdAfx.cpp
core/consumer/frame_consumer.cpp
core/consumer/output.cpp
core/diagnostics/osd_graph.cpp
core/diagnostics/subject_diagnostics.cpp
core/frame/draw_frame.cpp
core/frame/frame.cpp
core/frame/frame_transform.cpp
core/frame/frame_transform.h
core/frame/geometry.cpp
core/mixer/audio/audio_mixer.cpp
core/mixer/mixer.cpp
core/producer/binding.h
core/producer/color/color_producer.cpp
core/producer/draw/freehand_producer.cpp
core/producer/frame_producer.cpp
core/producer/layer.cpp
core/producer/scene/const_producer.cpp
core/producer/scene/expression_parser.cpp
core/producer/scene/hotswap_producer.cpp
core/producer/scene/scene_producer.cpp
core/producer/scene/scene_producer.h
core/producer/scene/xml_scene_producer.cpp
core/producer/separated/separated_producer.cpp
core/producer/stage.cpp
core/producer/text/text_producer.cpp
core/producer/text/utils/text_info.h
core/producer/text/utils/texture_font.cpp
core/producer/transition/transition_producer.cpp
core/producer/transition/transition_producer.h
core/thumbnail_generator.cpp
core/video_channel.cpp
core/video_format.cpp
core/video_format.h
dependencies64/ffmpeg/include-win32/inttypes.h [moved from dependencies64/ffmpeg/include/inttypes.h with 100% similarity]
modules/CMakeLists.txt
modules/ffmpeg/StdAfx.cpp
modules/ffmpeg/StdAfx.h
modules/ffmpeg/consumer/ffmpeg_consumer.cpp
modules/ffmpeg/producer/audio/audio_decoder.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/filter/filter.cpp
modules/ffmpeg/producer/input/input.cpp
modules/ffmpeg/producer/tbb_avcodec.cpp
modules/ffmpeg/producer/util/flv.cpp
modules/ffmpeg/producer/util/util.cpp
modules/ffmpeg/producer/util/util.h
modules/ffmpeg/producer/video/video_decoder.cpp
protocol/CMakeLists.txt
protocol/StdAfx.cpp
protocol/StdAfx.h
protocol/amcp/AMCPCommand.h
protocol/amcp/AMCPCommandQueue.cpp
protocol/amcp/AMCPCommandQueue.h
protocol/amcp/AMCPCommandsImpl.cpp
protocol/amcp/AMCPProtocolStrategy.cpp
protocol/amcp/AMCPProtocolStrategy.h
protocol/cii/CIICommand.h
protocol/cii/CIICommandsImpl.cpp
protocol/cii/CIICommandsImpl.h
protocol/cii/CIIProtocolStrategy.cpp
protocol/cii/CIIProtocolStrategy.h
protocol/clk/CLKProtocolStrategy.cpp
protocol/clk/clk_command_processor.cpp
protocol/clk/clk_commands.cpp
protocol/osc/client.cpp
protocol/util/AsyncEventServer.cpp
protocol/util/lock_container.cpp
protocol/util/strategy_adapters.cpp
protocol/util/strategy_adapters.h
shell/main.cpp
shell/server.cpp

index 6fef136d11e94f9e1c5012c0216cafab952c6340..5a1d576b6f0f9d1e5cdb4c68c2d48081240cc73f 100644 (file)
@@ -21,7 +21,13 @@ set(TBB_INCLUDE_PATH                 "${DEPENDENCIES_FOLDER}/tbb/include")
 set(GLEW_INCLUDE_PATH                  "${DEPENDENCIES_FOLDER}/glew/include")
 set(SFML_INCLUDE_PATH                  "${DEPENDENCIES_FOLDER}/sfml/include")
 set(FREETYPE_INCLUDE_PATH              "${DEPENDENCIES_FOLDER}/freetype/include")
-set(FFMPEG_INCLUDE_PATH                        "${DEPENDENCIES_FOLDER}/ffmpeg/include")
+
+if (MSVC)
+       set(FFMPEG_INCLUDE_PATH         "${DEPENDENCIES_FOLDER}/ffmpeg/include" "${DEPENDENCIES_FOLDER}/ffmpeg/include-win32")
+else ()
+       set(FFMPEG_INCLUDE_PATH         "${DEPENDENCIES_FOLDER}/ffmpeg/include")
+endif ()
+
 set(ASMLIB_INCLUDE_PATH                        "${DEPENDENCIES_FOLDER}/asmlib")
 set(FREEIMAGE_INCLUDE_PATH             "${DEPENDENCIES_FOLDER}/freeimage/include")
 set(OPENAL_INCLUDE_PATH                        "${DEPENDENCIES_FOLDER}/openal/include")
@@ -55,16 +61,19 @@ add_definitions( -DTBB_USE_CAPTURED_EXCEPTION=0 )
 add_definitions( -DUNICODE )
 add_definitions( -D_UNICODE )
 
-if (${MSVC})
+if (MSVC)
        set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS}                     /EHa /Zi /W4 /WX /MP /fp:fast /FIcommon/compiler/vs/disable_silly_warnings.h")
        set(CMAKE_CXX_FLAGS_DEBUG       "${CMAKE_CXX_FLAGS_DEBUG}       /D TBB_USE_ASSERT=1 /D TBB_USE_DEBUG /bigobj")
        set(CMAKE_CXX_FLAGS_RELEASE     "${CMAKE_CXX_FLAGS_RELEASE}     /Oi /Ot /Gy")
 
 elseif (CMAKE_COMPILER_IS_GNUCXX)
        add_compile_options( -std=c++11 )
+       add_compile_options( -msse3 )
+       add_compile_options( -mssse3 )
+       add_compile_options( -msse4.1 )
 endif ()
 
-#cmake_policy(SET CMP0045 OLD)
+cmake_policy(SET CMP0045 OLD)
 include(CMake/PrecompiledHeader.cmake)
 
 add_subdirectory(accelerator)
@@ -73,3 +82,4 @@ add_subdirectory(core)
 add_subdirectory(modules)
 add_subdirectory(protocol)
 add_subdirectory(shell)
+
index 2e79ea862888bf94eb31a482835307f072b33382..8edfbece8a087868203c036c9b3dae68d723c124 100644 (file)
@@ -1,8 +1,16 @@
 cmake_minimum_required (VERSION 2.6)
 project (accelerator)
 
+if (MSVC)
+       set(OS_SPECIFIC_SOURCES
+                       cpu/image/image_mixer.cpp
+                       cpu/image/image_mixer.h
+       
+                       cpu/util/xmm.h
+       )
+elseif (CMAKE_COMPILER_IS_GNUCXX)
+endif ()
 set(SOURCES
-               cpu/image/image_mixer.cpp
 
                ogl/image/image_kernel.cpp
                ogl/image/image_mixer.cpp
@@ -17,10 +25,6 @@ set(SOURCES
                StdAfx.cpp
 )
 set(HEADERS
-               cpu/image/image_mixer.h
-
-               cpu/util/xmm.h
-
                ogl/image/blending_glsl.h
                ogl/image/image_kernel.h
                ogl/image/image_mixer.h
@@ -35,7 +39,7 @@ set(HEADERS
                StdAfx.h
 )
 
-add_library(accelerator ${SOURCES} ${HEADERS})
+add_library(accelerator ${SOURCES} ${HEADERS} ${OS_SPECIFIC_SOURCES})
 add_precompiled_header(accelerator StdAfx.h FORCEINCLUDE)
 
 include_directories(..)
index 218fe591a7ddb4d67eced93069b6420d8f13e368..954ab00ec34be225e81f2644fb52cd2c28dd8fc8 100644 (file)
@@ -19,4 +19,4 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "stdafx.h"
\ No newline at end of file
+#include "StdAfx.h"
index 1a7865738cfb182a5c3d4c767c59e31e57399bac..d9747c38f661870ad2cdda90b41e437b9e9c7dee 100644 (file)
@@ -1,8 +1,10 @@
-#include "stdafx.h"
+#include "StdAfx.h"
 
 #include "accelerator.h"
 
+#ifdef _MSC_VER
 #include "cpu/image/image_mixer.h"
+#endif
 #include "ogl/image/image_mixer.h"
 
 #include "ogl/util/device.h"
@@ -43,8 +45,11 @@ struct accelerator::impl
                        if(path_ == L"gpu" || path_ == L"ogl")
                                CASPAR_LOG_CURRENT_EXCEPTION();
                }
-
+#ifdef _MSC_VER
                return std::unique_ptr<core::image_mixer>(new cpu::image_mixer());
+#else
+               CASPAR_THROW_EXCEPTION(not_supported());
+#endif
        }
 };
 
@@ -62,4 +67,4 @@ std::unique_ptr<core::image_mixer> accelerator::create_image_mixer()
        return impl_->create_image_mixer();
 }
 
-}}
\ No newline at end of file
+}}
index 093e266c4d98dcb5dd253ea34606aef4ba83b017..9f8371ccc2bc1fbf13bee3e9255d3b62ccf87da4 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "image_mixer.h"
 
@@ -39,7 +39,7 @@
 
 #include <asmlib.h>
 
-#include <gl/glew.h>
+#include <GL/glew.h>
 
 #include <tbb/parallel_for.h>
 #include <tbb/parallel_for_each.h>
@@ -52,6 +52,7 @@
 #include <cstdint>
 #include <vector>
 #include <set>
+#include <array>
 
 #if defined(_MSC_VER)
 #pragma warning (push)
@@ -140,7 +141,7 @@ static void kernel(uint8_t* dest, const uint8_t* source, size_t count)
 {                      
        using namespace xmm;
 
-       if(reinterpret_cast<int>(dest) % 16 != 0 || reinterpret_cast<int>(source) % 16 != 0)
+       if(reinterpret_cast<long>(dest) % 16 != 0 || reinterpret_cast<long>(source) % 16 != 0)
                kernel<temporal_tag, unaligned_tag>(dest, source, count);
        else
                kernel<temporal_tag, aligned_tag>(dest, source, count);
@@ -284,7 +285,7 @@ private:
                        {
                                if(source_items[n].data == data)
                                {
-                                       dest_items[n].data.assign(0);
+                                       dest_items[n].data.fill(0);
                                        dest_items[n].data[0]                   = dest_frame->data();
                                        dest_items[n].pix_desc                  = core::pixel_format_desc(core::pixel_format::bgra);
                                        dest_items[n].pix_desc.planes   = { core::pixel_format_desc::plane(width, height, 4) };
@@ -355,7 +356,7 @@ public:
                return renderer_(std::move(items_), format_desc);
        }
        
-       virtual core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc)
+       core::mutable_frame create_frame(const void* tag, const core::pixel_format_desc& desc)
        {
                std::vector<array<std::uint8_t>> buffers;
                for (auto& plane : desc.planes)
@@ -377,4 +378,4 @@ void image_mixer::begin_layer(core::blend_mode blend_mode){impl_->begin_layer(bl
 void image_mixer::end_layer(){impl_->end_layer();}
 core::mutable_frame image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->create_frame(tag, desc);}
 
-}}}
\ No newline at end of file
+}}}
index 84fb4d8324f6b13e5361eab1bcf7dd2b9de8326a..7b1e19ceb26fab29ca5928fec8bdc9a46750bdcd 100644 (file)
@@ -1,6 +1,11 @@
 #pragma once
 
+#ifdef WIN32
 #include <intrin.h>
+#else
+#include <smmintrin.h>
+#endif
+
 #include <type_traits>
 
 namespace caspar { namespace accelerator { namespace cpu { namespace xmm {
@@ -663,4 +668,4 @@ u8_x u8_x::blend(const u8_x& lhs, const u8_x& rhs, const u8_x& mask)
 //     return xmm_cast_impl<T>()(other);
 //}
 
-}}}}
\ No newline at end of file
+}}}}
index a259e13da3bf70eb8ecb73cccc587b21e896e6fa..57507e00738ae34b081271728fbe541428e5c31d 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "image_kernel.h"
 
@@ -277,4 +277,4 @@ image_kernel::~image_kernel(){}
 void image_kernel::draw(const draw_params& params){impl_->draw(params);}
 bool image_kernel::has_blend_modes() const{return impl_->blend_modes_;}
 
-}}}
\ No newline at end of file
+}}}
index c0ed0ee838cfa60304b99ded56c3819a3e60706d..2b7c1d06d4bd2e06f02502f61c35c28a8f96b2de 100644 (file)
@@ -44,7 +44,7 @@ struct draw_params final
        core::image_transform                                           transform;
        core::frame_geometry                                            geometry;
        core::blend_mode                                                        blend_mode      = core::blend_mode::normal;
-       keyer                                                                           keyer           = keyer::linear;
+       ogl::keyer                                                                      keyer           = ogl::keyer::linear;
        std::shared_ptr<class texture>                          background;
        std::shared_ptr<class texture>                          local_key;
        std::shared_ptr<class texture>                          layer_key;
@@ -75,4 +75,4 @@ private:
        spl::unique_ptr<impl> impl_;
 };
 
-}}}
\ No newline at end of file
+}}}
index 8ead24bfb107799a54d14475906e867846a681f2..24cb8cd32c8d265c71388d2713948c7464d8e93b 100644 (file)
@@ -18,7 +18,7 @@
 *
 * Author: Robert Nagy, ronag89@gmail.com
 */
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "image_mixer.h"
 
@@ -41,7 +41,7 @@
 
 #include <asmlib.h>
 
-#include <gl/glew.h>
+#include <GL/glew.h>
 
 #include <boost/range/algorithm_ext/erase.hpp>
 #include <boost/thread/future.hpp>
@@ -80,8 +80,9 @@ struct layer
 
 std::size_t get_max_video_format_size()
 {
+       auto format_size = [](core::video_format format) { return core::video_format_desc(format).size; };
        return cpplinq::from(enum_constants<core::video_format>())
-               .select([](core::video_format format) { return core::video_format_desc(format).size; })
+               .select(std::ref(format_size))
                .max();
 }
 
@@ -366,4 +367,4 @@ void image_mixer::begin_layer(core::blend_mode blend_mode){impl_->begin_layer(bl
 void image_mixer::end_layer(){impl_->end_layer();}
 core::mutable_frame image_mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->create_frame(tag, desc);}
 
-}}}
\ No newline at end of file
+}}}
index e2a2e177e302d622efb55c9d481f7e8f4bbdb09b..df2be866f963a87ec2f9fad4c15cd0133545b072 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "image_shader.h"
 
index 5700ac13162c9a58f2095a263745f51105e796e4..6b20ad034fe062736377314de3fd1ac98a87fe5d 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "buffer.h"
 
@@ -29,7 +29,7 @@
 #include <common/except.h>
 #include <common/gl/gl_check.h>
 
-#include <gl/glew.h>
+#include <GL/glew.h>
 
 #include <tbb/atomic.h>
 
@@ -58,8 +58,11 @@ public:
                GL(glGenBuffers(1, &pbo_));
                bind(); 
                GL(glBufferData(target_, size_, NULL, usage_));         
-               if(usage_ == GL_STREAM_DRAW)    
-                       data_ = (uint8_t*)GL2(glMapBuffer(target_, usage_ == GL_STREAM_DRAW ? GL_WRITE_ONLY : GL_READ_ONLY));  
+               if(usage_ == GL_STREAM_DRAW)
+               {
+                       auto result = GL2(glMapBuffer(target_, usage_ == GL_STREAM_DRAW ? GL_WRITE_ONLY : GL_READ_ONLY));
+                       data_ = reinterpret_cast<uint8_t*>(result);
+               }
                unbind();
 
                if(!pbo_)
@@ -87,7 +90,8 @@ public:
                if(usage_ == GL_STREAM_DRAW)                    
                        GL(glBufferData(target_, size_, NULL, usage_)); // Notify OpenGL that we don't care about previous data.
                
-               data_ = (uint8_t*)GL2(glMapBuffer(target_, usage_ == GL_STREAM_DRAW ? GL_WRITE_ONLY : GL_READ_ONLY));  
+               auto result = GL2(glMapBuffer(target_, usage_ == GL_STREAM_DRAW ? GL_WRITE_ONLY : GL_READ_ONLY));
+               data_ = (uint8_t*) result;
 
                if(timer.elapsed() > 0.02)
                        CASPAR_LOG(debug) << L"[buffer] Performance warning. Buffer mapping blocked: " << timer.elapsed();
@@ -135,4 +139,4 @@ void buffer::unbind() const{impl_->unbind();}
 std::size_t buffer::size() const { return impl_->size_; }
 int buffer::id() const {return impl_->pbo_;}
 
-}}}
\ No newline at end of file
+}}}
index ccd1cf74fd6f9585bf8d60a14cbaf9ad2c717ab6..6e09628935be35e3410dd6b102bf7bc5bb8c6549 100644 (file)
@@ -21,7 +21,7 @@
 
 // TODO: Smart GC
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "device.h"
 
 #include <common/except.h>
 #include <common/future.h>
 #include <common/array.h>
+#include <common/memory.h>
 #include <common/gl/gl_check.h>
-#include <common/os/windows/windows.h>
+//#include <common/os/windows/windows.h>
 
-#include <gl/glew.h>
+#include <GL/glew.h>
 
 #include <SFML/Window/Context.hpp>
 
@@ -189,7 +190,7 @@ struct device::impl : public std::enable_shared_from_this<impl>
        {
                std::shared_ptr<buffer> buf;
 
-               auto tmp = source.storage<spl::shared_ptr<buffer>>();
+               auto tmp = source.template storage<spl::shared_ptr<buffer>>();
                if(tmp)
                        buf = *tmp;
                else
index 3d211f78623a8b1cb4b595c227e181bebd84208b..98e3b8a5dbdca463216b94c97dbb960f70f2f799 100644 (file)
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "shader.h"
 
 #include <common/gl/gl_check.h>
 
-#include <gl/glew.h>
+#include <GL/glew.h>
 
 #include <unordered_map>
 
@@ -154,4 +154,4 @@ void shader::set(const std::string& name, double value){impl_->set(name, value);
 int shader::id() const{return impl_->program_;}
 void shader::use()const{impl_->use();}
 
-}}}
\ No newline at end of file
+}}}
index ee21c5f45e0c85c3b42d0ef4fa2c79f04146816f..9e308762326cfcef4ad9fbc67013a8c9b3d24263 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "texture.h"
 
@@ -28,7 +28,7 @@
 #include <common/except.h>
 #include <common/gl/gl_check.h>
 
-#include <gl/glew.h>
+#include <GL/glew.h>
 
 #include <tbb/atomic.h>
 
@@ -138,4 +138,4 @@ int texture::stride() const { return impl_->stride_; }
 std::size_t texture::size() const { return static_cast<std::size_t>(impl_->width_*impl_->height_*impl_->stride_); }
 int texture::id() const{ return impl_->id_;}
 
-}}}
\ No newline at end of file
+}}}
index 567ec2889d91e844a5eb4cf959625f9a10633dfe..5eb83b0a0709620e8b38a56159339e332e9fb339 100644 (file)
@@ -23,6 +23,7 @@ if (MSVC)
                        os/windows/current_version.h
                        os/windows/page_locked_allocator.cpp
                        os/windows/prec_timer.cpp
+                       os/windows/scheduling.cpp
                        os/windows/stack_trace.cpp
                        os/windows/system_info.cpp
                        os/windows/win32_exception.cpp
@@ -32,6 +33,7 @@ if (MSVC)
 elseif (CMAKE_COMPILER_IS_GNUCXX)
        set(OS_SPECIFIC_SOURCES
                        os/linux/signal_handlers.cpp
+                       os/linux/scheduling.cpp
                        os/linux/stack_trace.cpp
                        os/linux/system_info.cpp
        )
@@ -43,6 +45,7 @@ set(HEADERS
 
                os/general_protection_fault.h
                os/page_locked_allocator.h
+               os/scheduling.h
                os/stack_trace.h
                os/system_info.h
 
index 08c1e2e653b575eb824b3064e923c3676274d87b..2eceb6948651628f045300cb124dad5714c0813d 100644 (file)
@@ -25,12 +25,12 @@ public:
 
        // Constructors
        
-       template<typename T>
-       explicit array(std::uint8_t* ptr, std::size_t size, bool cacheable, T&& storage)
+       template<typename T2>
+       explicit array(std::uint8_t* ptr, std::size_t size, bool cacheable, T2&& storage)
                : ptr_(ptr)
                , size_(size)
                , cacheable_(cacheable)
-               , storage_(new boost::any(std::forward<T>(storage)))
+               , storage_(new boost::any(std::forward<T2>(storage)))
        {
        }
 
@@ -66,10 +66,10 @@ public:
        bool empty() const                      {return size() == 0;}
        bool cacheable() const          {return cacheable_;}
        
-       template<typename T>
-       T* storage() const
+       template<typename T2>
+       T2* storage() const
        {
-               return boost::any_cast<T>(storage_.get());
+               return boost::any_cast<T2>(storage_.get());
        }
 private:
        T*                      ptr_;
@@ -88,12 +88,12 @@ public:
        // Constructors
        array() = default; // Needed by std::future
 
-       template<typename T>
-       explicit array(const std::uint8_t* ptr, std::size_t size, bool cacheable, T&& storage)
+       template<typename T2>
+       explicit array(const std::uint8_t* ptr, std::size_t size, bool cacheable, T2&& storage)
                : ptr_(ptr)
                , size_(size)
                , cacheable_(cacheable)
-               , storage_(new boost::any(std::forward<T>(storage)))
+               , storage_(new boost::any(std::forward<T2>(storage)))
        {
        }
 
@@ -148,16 +148,16 @@ public:
        bool empty() const                      {return size() == 0;}
        bool cacheable() const          {return cacheable_;}
        
-       template<typename T>
-       T* storage() const
+       template<typename T2>
+       T2* storage() const
        {
-               return boost::any_cast<T>(storage_.get());
+               return boost::any_cast<T2>(storage_.get());
        }
 
 private:
-       const T*        ptr_;
-       std::size_t     size_;
-       bool            cacheable_;
+       const T*                                        ptr_            = nullptr;
+       std::size_t                                     size_           = 0;
+       bool                                            cacheable_      = false;
        std::shared_ptr<boost::any>     storage_;
 };
 
index 6d17d691802e709ab041f04e216b832a3da1847b..272dad8e98e4fa1eda0d6ee35ce5f46cac77ecbb 100644 (file)
 #pragma once
 
 #include <type_traits>
+#include <cstdint>
 
+#ifdef _MSC_VER
 #include <intrin.h>
+#endif
 
 namespace caspar {
 
 template<typename T>
-typename std::enable_if<sizeof(T) == sizeof(unsigned char), T>::type swap_byte_order(
+typename std::enable_if<sizeof(T) == sizeof(std::uint8_t), T>::type swap_byte_order(
                const T& value)
 {
        return value;
 }
 
-template<typename T>
-typename std::enable_if<sizeof(T) == sizeof(unsigned short), T>::type swap_byte_order(
+/*template<typename T>
+typename std::enable_if<sizeof(T) == sizeof(std::uint16_t), T>::type swap_byte_order(
                const T& value)
 {
+#ifdef _MSC_VER
        auto swapped = _byteswap_ushort(reinterpret_cast<const unsigned short&>(value));
+#elif __GNUC__
+       auto swapped = __builtin_bswap32(value);
+#endif
+
        return reinterpret_cast<const T&>(swapped);
-}
+}*/
 
 template<typename T>
-typename std::enable_if<sizeof(T) == sizeof(unsigned long), T>::type swap_byte_order(
+typename std::enable_if<sizeof(T) == sizeof(std::uint32_t), T>::type swap_byte_order(
                const T& value)
 {
+#ifdef _MSC_VER
        auto swapped = _byteswap_ulong(reinterpret_cast<const unsigned long&>(value));
-    return reinterpret_cast<const T&>(swapped);
+#elif __GNUC__
+       auto swapped = __builtin_bswap32(value);
+#endif
+
+       return reinterpret_cast<const T&>(swapped);
 }
 
 template<typename T>
-typename std::enable_if<sizeof(T) == sizeof(unsigned long long), T>::type swap_byte_order(
+typename std::enable_if<sizeof(T) == sizeof(std::uint64_t), T>::type swap_byte_order(
                const T& value)
 {
+#ifdef _MSC_VER
        auto swapped = _byteswap_uint64(reinterpret_cast<const unsigned long long&>(value));
-    return reinterpret_cast<const T&>(swapped);
+#elif __GNUC__
+       auto swapped = __builtin_bswap64(value);
+#endif
+
+       return reinterpret_cast<const T&>(swapped);
 }
 
 }
index 72f3d33d736a16f69b84fd9884ef62388629f1ea..2ba7fa0039f9f1d212f2203d1ddcf27c7f94a335 100644 (file)
@@ -50,15 +50,24 @@ void SMFL_GLCheckError(const std::string& expr, const std::string& File, unsigne
                caspar::gl::SMFL_GLCheckError(CASPAR_GL_EXPR_STR(expr), __FILE__, __LINE__);\
        }
 
+// TODO: decltype version does not play well with gcc
 #define GL2(expr) \
-       [&]() -> decltype(expr)\
+       [&]()\
        {\
-               auto ret = (expr); \
+               auto ret = (expr);\
                caspar::gl::SMFL_GLCheckError(CASPAR_GL_EXPR_STR(expr), __FILE__, __LINE__);\
                return ret;\
        }()
+/*#define GL2(expr) \
+       [&]() -> decltype(expr) \
+       { \
+               auto ret = (expr); \
+               caspar::gl::SMFL_GLCheckError(CASPAR_GL_EXPR_STR(expr), __FILE__, __LINE__); \
+               return ret; \
+       }()*/
+//#define GL2(expr) [&]() -> decltype(expr) { auto ret = (expr); caspar::gl::SMFL_GLCheckError(CASPAR_GL_EXPR_STR(expr), __FILE__, __LINE__); return ret; }()
 //#else
 //#define GL(expr) expr
 //#endif
 
-}}
\ No newline at end of file
+}}
index f0ae64b6c338a07f21893e4e850a9550987b714a..5efd3097711b8db756bfa8a4f4dec49021350b4a 100644 (file)
@@ -5,8 +5,8 @@ namespace caspar {
 template<typename T, typename F>
 auto lock(T& mutex, F&& func) -> decltype(func())
 {
-       T::scoped_lock lock(mutex);
+       typename T::scoped_lock lock(mutex);
        return func();
 }
 
-}
\ No newline at end of file
+}
index 090a54d8a7fd1c7eaf4d010a5ee5b02957e1deed..de5c439a2aca3ccbcad4380b653fc2bf836c5974 100644 (file)
 
 #pragma once
 
+#ifdef _MSC_VER
 #include <intrin.h>
+#else
+#include <tmmintrin.h>
+#endif
 
 namespace caspar {
        
@@ -51,4 +55,4 @@ static void* aligned_memshfl(void* dest, const void* source, size_t count, int m
 }
 
 
-}
\ No newline at end of file
+}
diff --git a/common/os/linux/scheduling.cpp b/common/os/linux/scheduling.cpp
new file mode 100644 (file)
index 0000000..b0fed5b
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Robert Nagy, ronag89@gmail.com
+*/
+
+#include "../../stdafx.h"
+
+#include "../scheduling.h"
+
+namespace caspar {
+       
+void set_priority_of_current_thread(thread_priority priority)
+{
+       // TODO: implement
+}
+
+}
diff --git a/common/os/scheduling.h b/common/os/scheduling.h
new file mode 100644 (file)
index 0000000..c5f61e8
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Robert Nagy, ronag89@gmail.com
+*/
+
+#pragma once
+
+namespace caspar {
+
+enum class thread_priority
+{
+       LOW
+};
+
+void set_priority_of_current_thread(thread_priority priority);
+
+}
diff --git a/common/os/windows/scheduling.cpp b/common/os/windows/scheduling.cpp
new file mode 100644 (file)
index 0000000..9a76fc1
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Robert Nagy, ronag89@gmail.com
+*/
+
+#include "../../stdafx.h"
+
+#include "../scheduling.h"
+
+#include "windows.h"
+
+namespace caspar {
+       
+void set_priority_of_current_thread(thread_priority priority)
+{
+       if (priority == thread_priority::LOW)
+               SetThreadPriority(GetCurrentThread(), BELOW_NORMAL_PRIORITY_CLASS);
+}
+
+}
index ae38d35b164bedc9c01f2b8ec9cb858cd49e3db5..62cfeb2d1a5748f1b31dcf56c9583496f9050daf 100644 (file)
@@ -35,7 +35,7 @@ typename std::enable_if<!std::is_convertible<T, std::wstring>::value, typename s
                if(++it == params.end())
                        throw std::out_of_range("");
 
-               return boost::lexical_cast<std::decay<T>::type>(*it);
+               return boost::lexical_cast<typename std::decay<T>::type>(*it);
        }
        catch(...)
        {               
@@ -63,4 +63,4 @@ std::wstring get_param(const std::wstring& name, C&& params, const std::wstring&
        }
 }
 
-}
\ No newline at end of file
+}
index 1e99526c081a93f7b876477eaa324d7c1cbad59f..4e91b5444bbd6cd69cb47b85f0ef746916354564 100644 (file)
@@ -86,9 +86,9 @@ public:
 
        // Static Members
 
-       typedef T                                               value_type;
-       typedef observer<T>                             observer;
-       typedef std::weak_ptr<observer> observer_ptr;
+       typedef T                                                                               value_type;
+       typedef reactive::observer<T>                                   observer;
+       typedef std::weak_ptr<reactive::observer<T>>    observer_ptr;
        
        // Constructors
 
@@ -167,7 +167,6 @@ public:
        void swap(observer_function& other)
        {
                std::swap(func_, other.func_);
-               std::swap(filter_, other.filter_);
        }
                
        void on_next(const T& e) override
@@ -353,7 +352,7 @@ template<typename F>
 spl::shared_ptr<observer_function<typename std::decay<typename detail::function_traits<F>::arg1_type>::type, F>> 
 make_observer(F func)
 {
-       return spl::make_shared<observer_function<std::decay<typename detail::function_traits<F>::arg1_type>::type, F>>(std::move(func));
+       return spl::make_shared<observer_function<typename std::decay<typename detail::function_traits<F>::arg1_type>::type, F>>(std::move(func));
 }
 
 template<typename T>
@@ -363,4 +362,4 @@ basic_subject<T>& operator<<(basic_subject<T>& s, const T& val)
        return s;
 }
 
-}}
\ No newline at end of file
+}}
index 460d4e6a280cf6abfbec251c339533854a8ac244..0b0445d1051aaf61fdaf21ec0e67511842cc380b 100644 (file)
@@ -21,4 +21,6 @@
 
 #pragma once
 
-//#include "os/windows/windows.h"
+#ifdef WIN32
+#include "os/windows/windows.h"
+#endif
index 49411187259bd03744199922e9f406eeb686eb18..bb2fc72a7b005e192671266b5beb217bae573d46 100644 (file)
@@ -55,7 +55,7 @@
 #include <algorithm>
 #include <vector>
 
-namespace caspar { namespace core {
+namespace caspar {
 
 typedef std::function<double(double, double, double, double)> tweener_t;
                        
@@ -453,10 +453,8 @@ tweener_t get_tweener(std::wstring name)
                        params.push_back(boost::lexical_cast<double>(what["V1"].str()));
        }
                
-       auto tweens = get_tweens();
-
-       auto it = tweens.find(name);
-       if(it == tweens.end())
+       auto it = get_tweens().find(name);
+       if(it == get_tweens().end())
                CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info("Could not find tween.") << arg_value_info(name));
        
        auto tween = it->second;
@@ -481,13 +479,24 @@ double tweener::operator()(double t, double b , double c, double d) const
        return func_(t, b, c, d);
 }
 
-const std::vector<const std::wstring>& tweener::names()
+const std::vector<std::wstring>& tweener::names()
 {
-       static const auto names = cpplinq::from(get_tweens())
+       /*static const auto names = cpplinq::from(get_tweens())
                .select(keys())
-               .to_vector();
+               .to_vector();*/
+
+       static const auto result = []
+       {
+               std::vector<std::wstring> result;
 
-       return names;
+               for (auto& tween : get_tweens())
+                       result.push_back(tween.first);
+
+               return result;
+       }();
+       //static const std::vector<std::wstring> result;
+
+       return result;
 }
 
-}}
+}
index 3747cfce719aae0ef8398672e9854575b645d720..3a842a36b3401f671b819895f7072b2b8462f0ab 100644 (file)
@@ -24,7 +24,7 @@
 #include <functional>
 #include <vector>
 
-namespace caspar { namespace core {
+namespace caspar {
 
 /**
  * A tweener can be used for creating any kind of (image position, image fade
@@ -53,7 +53,7 @@ public:
         * @return The possible tween function names. Some of them may also support
         *                 additional parameters appended to the name.
         */
-       static const std::vector<const std::wstring>& names();
+       static const std::vector<std::wstring>& names();
 
        /**
         * Calculate a tweened value given a timepoint within the total duration
@@ -77,4 +77,4 @@ private:
        std::function<double(double, double, double, double)> func_;
 };
 
-}}
\ No newline at end of file
+}
index 218fe591a7ddb4d67eced93069b6420d8f13e368..954ab00ec34be225e81f2644fb52cd2c28dd8fc8 100644 (file)
@@ -19,4 +19,4 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "stdafx.h"
\ No newline at end of file
+#include "StdAfx.h"
index 1524b813a9d576179877376ca4c5531dbb8e3d1a..3cc4e768ba5910812a833b9ddd36e648e348da0e 100644 (file)
@@ -35,7 +35,7 @@
 
 namespace caspar { namespace core {
                
-std::vector<const consumer_factory_t> g_factories;
+std::vector<consumer_factory_t> g_factories;
 
 void register_consumer_factory(const consumer_factory_t& factory)
 {
@@ -122,7 +122,7 @@ public:
 class recover_consumer_proxy : public frame_consumer
 {      
        std::shared_ptr<frame_consumer> consumer_;
-       int                                                             channel_index_;
+       int                                                             channel_index_  = -1;
        video_format_desc                               format_desc_;
 public:
        recover_consumer_proxy(spl::shared_ptr<frame_consumer>&& consumer) 
@@ -273,4 +273,4 @@ const spl::shared_ptr<frame_consumer>& frame_consumer::empty()
        return consumer;
 }
 
-}}
\ No newline at end of file
+}}
index e313f69319520b5ed0dac6fe41ae13195f5259d6..048b6274c2d86e6390362fa1a389bc27661b6b45 100644 (file)
@@ -104,7 +104,7 @@ public:
                remove(consumer->index());
        }
        
-       void video_format_desc(const core::video_format_desc& format_desc)
+       void set_video_format_desc(const core::video_format_desc& format_desc)
        {
                executor_.invoke([&]
                {
@@ -154,7 +154,7 @@ public:
        {
                boost::timer frame_timer;
 
-               video_format_desc(format_desc);         
+               set_video_format_desc(format_desc);
 
                executor_.invoke([=]
                {                       
@@ -253,4 +253,4 @@ void output::remove(const spl::shared_ptr<frame_consumer>& consumer){impl_->remo
 std::future<boost::property_tree::wptree> output::info() const{return impl_->info();}
 void output::operator()(const_frame frame, const video_format_desc& format_desc){(*impl_)(std::move(frame), format_desc);}
 monitor::subject& output::monitor_output() {return *impl_->monitor_subject_;}
-}}
\ No newline at end of file
+}}
index 13f774f9a81574354f1094d4138c5244c730a556..7847f76bfeb529ac1452b0df61a159ee19ac3c9f 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../stdafx.h"
+#include "../StdAfx.h"
 
 #include "osd_graph.h"
 
@@ -31,6 +31,7 @@
 #include <common/lock.h>
 #include <common/env.h>
 #include <common/prec_timer.h>
+#include <common/os/scheduling.h>
 
 #include <SFML/Graphics.hpp>
 
@@ -48,8 +49,6 @@
 #include <tuple>
 #include <memory>
 
-#include <Windows.h>
-
 namespace caspar { namespace core { namespace diagnostics { namespace osd {
 
 static const int PREFERRED_VERTICAL_GRAPHS = 8;
@@ -100,12 +99,12 @@ class context : public drawable
        std::list<std::weak_ptr<drawable>>      drawables_;
        int64_t                                                         refresh_rate_millis_            = 16;
        boost::timer                                            display_time_;
-       bool                                                            calculate_view_;
+       bool                                                            calculate_view_                         = true;
        int                                                                     scroll_position_                        = 0;
        bool                                                            dragging_                                       = false;
-       int                                                                     last_mouse_y_;
+       int                                                                     last_mouse_y_                           = 0;
 
-       executor                                                        executor_                                       = L"diagnostics";
+       executor                                                        executor_                                       { L"diagnostics" };
 public:                                        
 
        static void register_drawable(const std::shared_ptr<drawable>& drawable)
@@ -135,8 +134,8 @@ private:
        context()
        {
                executor_.begin_invoke([=]
-               {                       
-                       SetThreadPriority(GetCurrentThread(), BELOW_NORMAL_PRIORITY_CLASS);
+               {
+                       set_priority_of_current_thread(thread_priority::LOW);
                });
        }
 
index 5eb40ce16b450509eee343c8b711ddc90ddc8531..e5981380c576170ea3bbe8905e854dd8a0f07dd9 100644 (file)
@@ -38,7 +38,7 @@ namespace {
 
 int64_t create_id()
 {
-       static std::atomic<int64_t> counter = 0;
+       static std::atomic<int64_t> counter { 0 };
 
        return ++counter;
 }
index a986f7c54173649a3fe1a46cb4cbbbc0ba609ed2..4d3a0bd4d972ef2e39949cc8ee21b330a36be6ff 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../stdafx.h"
+#include "../StdAfx.h"
 
 #include "draw_frame.h"
 
@@ -190,4 +190,4 @@ const draw_frame& draw_frame::late()
 }
        
 
-}}
\ No newline at end of file
+}}
index d52658350c9cb6612229ab971fa4774fb0c28bc3..8d77a76f32b822bfe1a16fdf8edd52a7969b0643 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../stdafx.h"
+#include "../StdAfx.h"
 
 #include "frame.h"
 
@@ -31,6 +31,9 @@
 #include <core/frame/pixel_format.h>
 #include <core/frame/geometry.h>
 
+#include <cstdint>
+#include <vector>
+
 #include <boost/lexical_cast.hpp>
 #include <boost/thread/future.hpp>
 
@@ -88,7 +91,6 @@ const const_frame& const_frame::empty()
 struct const_frame::impl : boost::noncopyable
 {                      
        mutable std::vector<std::shared_future<array<const std::uint8_t>>>      future_buffers_;
-       int                                                                                     id_;
        core::audio_buffer                                                      audio_data_;
        const core::pixel_format_desc                           desc_;
        const void*                                                                     tag_;
@@ -97,7 +99,6 @@ struct const_frame::impl : boost::noncopyable
        impl(const void* tag)
                : desc_(core::pixel_format::invalid)
                , tag_(tag)     
-               , id_(0)
                , geometry_(frame_geometry::get_default())
        {
        }
@@ -106,7 +107,6 @@ struct const_frame::impl : boost::noncopyable
                : audio_data_(std::move(audio_buffer))
                , desc_(desc)
                , tag_(tag)
-               , id_(reinterpret_cast<int>(this))
                , geometry_(frame_geometry::get_default())
        {
                if(desc.format != core::pixel_format::bgra)
@@ -119,7 +119,6 @@ struct const_frame::impl : boost::noncopyable
                : audio_data_(other.audio_data())
                , desc_(other.pixel_format_desc())
                , tag_(other.stream_tag())
-               , id_(reinterpret_cast<int>(this))
                , geometry_(other.geometry())
        {
                for(std::size_t n = 0; n < desc_.planes.size(); ++n)
@@ -181,4 +180,4 @@ const void* const_frame::data_tag()const{return impl_.get();}
 const frame_geometry& const_frame::geometry() const { return impl_->geometry_; }
 void const_frame::set_geometry(const frame_geometry& g) { impl_->geometry_ = g; }
 
-}}
\ No newline at end of file
+}}
index 47f8afa2f2f59dfe96cb670d305373b633fe3bc7..7db7b4df229cfffa9863aa272d7ada619b90e612 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../stdafx.h"
+#include "../StdAfx.h"
 
 #include "frame_transform.h"
 
@@ -199,4 +199,4 @@ bool operator!=(const frame_transform& lhs, const frame_transform& rhs)
        return !(lhs == rhs);
 }
 
-}}
\ No newline at end of file
+}}
index a1ec57179fdeea75a63a79b15477b138c1b7b8a8..fdb467eec5ef0589a02c5974f10a4cc648d9f42b 100644 (file)
@@ -51,9 +51,9 @@ struct image_transform final
        boost::array<double, 2> fill_scale                      = boost::array<double, 2> { { 1.0, 1.0 } };
        boost::array<double, 2> clip_translation        = boost::array<double, 2> { { 0.0, 0.0 } };
        boost::array<double, 2> clip_scale                      = boost::array<double, 2> { { 1.0, 1.0 } };
-       levels                                  levels;
+       core::levels                    levels;
 
-       field_mode                              field_mode                      = field_mode::progressive;
+       core::field_mode                field_mode                      = core::field_mode::progressive;
        bool                                    is_key                          = false;
        bool                                    is_mix                          = false;
        bool                                    is_still                        = false;
@@ -87,8 +87,8 @@ struct frame_transform final
 public:
        frame_transform();
        
-       image_transform image_transform;
-       audio_transform audio_transform;
+       core::image_transform image_transform;
+       core::audio_transform audio_transform;
 
        //char padding[(sizeof(core::image_transform) + sizeof(core::audio_transform)) % 16];
        
@@ -136,4 +136,4 @@ public:
        }
 };
 
-}}
\ No newline at end of file
+}}
index dda0c136d9ad8f3a33ebecf0ae175ac43e57703e..e25f612b6e1af7d4d3d8feb4f5797f1aa5691f84 100644 (file)
@@ -20,7 +20,7 @@
 */
 
 
-#include "..\StdAfx.h"
+#include "../StdAfx.h"
 
 #include "geometry.h"
 
@@ -54,4 +54,4 @@ const frame_geometry& frame_geometry::get_default()
        return g;
 }
 
-}}
\ No newline at end of file
+}}
index 4636d8466e22531789666638f3589a826a9b2e56..a1c233863bb763bc1bbbf0212af2b7e0ad9e5845 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "audio_mixer.h"
 
@@ -39,7 +39,7 @@ namespace caspar { namespace core {
 
 struct audio_item
 {
-       const void*                     tag;
+       const void*                     tag                     = nullptr;
        audio_transform         transform;
        audio_buffer            audio_data;
 
@@ -220,4 +220,4 @@ void audio_mixer::pop(){impl_->pop();}
 void audio_mixer::set_master_volume(float volume) { impl_->set_master_volume(volume); }
 audio_buffer audio_mixer::operator()(const video_format_desc& format_desc){return impl_->mix(format_desc);}
 
-}}
\ No newline at end of file
+}}
index aac96024301ba83a9e11332d1281bef9ace1a522..49c1f4ad0f2e5368f5add930a32f666c061f71c5 100644 (file)
@@ -32,7 +32,6 @@
 #include <common/executor.h>
 #include <common/diagnostics/graph.h>
 #include <common/except.h>
-#include <common/gl/gl_check.h>
 #include <common/future.h>
 
 #include <core/frame/draw_frame.h>
@@ -60,7 +59,7 @@ struct mixer::impl : boost::noncopyable
        
        std::unordered_map<int, blend_mode>     blend_modes_;
                        
-       executor executor_                                                                      = L"mixer";
+       executor executor_                                                                      { L"mixer" };
 
 public:
        impl(spl::shared_ptr<diagnostics::graph> graph, spl::shared_ptr<image_mixer> image_mixer) 
@@ -159,4 +158,4 @@ void mixer::set_master_volume(float volume) { impl_->set_master_volume(volume);
 std::future<boost::property_tree::wptree> mixer::info() const{return impl_->info();}
 const_frame mixer::operator()(std::map<int, draw_frame> frames, const struct video_format_desc& format_desc){return (*impl_)(std::move(frames), format_desc);}
 mutable_frame mixer::create_frame(const void* tag, const core::pixel_format_desc& desc) {return impl_->image_mixer_->create_frame(tag, desc);}
-}}
\ No newline at end of file
+}}
index d87576ece6098a2f5f621e0566214a76670a85fd..b136057663eab31c889a060b86454b00757162b2 100644 (file)
 #include <map>
 #include <algorithm>
 #include <type_traits>
+#include <stdexcept>
 
 #include <boost/lexical_cast.hpp>
 
+#include <common/tweener.h>
+
 namespace caspar { namespace core {
 
 namespace detail {
@@ -53,7 +56,7 @@ struct impl_base : std::enable_shared_from_this<impl_base>
                auto self = shared_from_this();
 
                if (dependency->depends_on(self))
-                       throw std::exception("Can't have circular dependencies between bindings");
+                       throw std::runtime_error("Can't have circular dependencies between bindings");
 
                dependency->on_change(self, [=] { evaluate(); });
                dependencies_.push_back(dependency);
@@ -123,7 +126,7 @@ private:
                {
                        if (bound())
                        {
-                               throw std::exception("Bound value cannot be set");
+                               throw std::runtime_error("Bound value cannot be set");
                        }
 
                        if (value == value_)
@@ -574,7 +577,7 @@ public:
        }
 };
 
-template<typename T, typename T2>
+/*template<typename T, typename T2>
 binding<T> add_tween(
                const binding<T>& to_tween,
                const binding<T2>& counter,
@@ -595,7 +598,7 @@ binding<T> add_tween(
                        return tween(t - start_time, start_val, destination_val, dur);
                }).as<T>())
                .otherwise(destination_value);
-}
+}*/
 
 template<typename T, typename T2>
 binding<T> delay(
index 67161ef3fa3f7bdc35f7a3c9dc9e8c439890ee90..281b9619fde549e7fecbc8ba01869475a3e95dea 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "color_producer.h"
 
@@ -193,4 +193,4 @@ draw_frame create_color_frame(void* tag, const spl::shared_ptr<frame_factory>& f
        return create_color_frame(tag, frame_factory, value);
 }
 
-}}
\ No newline at end of file
+}}
index d06640b6d90c412786ce26c5f03116b3a2160240..cdc6639bc024a53219d22ddfe8a877129f3594bf 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "freehand_producer.h"
 
index 80c181f75c6d1bdf377f6f5f95b7d8e63556e353..036dc1a4da306c2f36dca1724defedd3526cbba7 100644 (file)
@@ -41,8 +41,8 @@
 
 namespace caspar { namespace core {
        
-std::vector<const producer_factory_t> g_factories;
-std::vector<const producer_factory_t> g_thumbnail_factories;
+std::vector<producer_factory_t> g_factories;
+std::vector<producer_factory_t> g_thumbnail_factories;
 
 void register_producer_factory(const producer_factory_t& factory)
 {
@@ -260,7 +260,7 @@ spl::shared_ptr<core::frame_producer> create_destroy_proxy(spl::shared_ptr<core:
        return spl::make_shared<destroy_producer_proxy>(std::move(producer));
 }
 
-spl::shared_ptr<core::frame_producer> do_create_producer(const spl::shared_ptr<frame_factory>& my_frame_factory, const video_format_desc& format_desc, const std::vector<std::wstring>& params, const std::vector<const producer_factory_t>& factories, bool throw_on_fail = false)
+spl::shared_ptr<core::frame_producer> do_create_producer(const spl::shared_ptr<frame_factory>& my_frame_factory, const video_format_desc& format_desc, const std::vector<std::wstring>& params, const std::vector<producer_factory_t>& factories, bool throw_on_fail = false)
 {
        if(params.empty())
                CASPAR_THROW_EXCEPTION(invalid_argument() << arg_name_info("params") << arg_value_info(""));
@@ -369,4 +369,4 @@ spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<fram
        return create_producer(factory, format_desc, tokens);
 }
 
-}}
\ No newline at end of file
+}}
index b158510dbb7709bfdb1b6c35d51614f8c67da0d1..1e7d31a63657bef92809f0730328f28acdbbacd0 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../stdafx.h"
+#include "../StdAfx.h"
 
 #include "layer.h"
 
@@ -195,4 +195,4 @@ boost::property_tree::wptree layer::info() const{return impl_->info();}
 monitor::subject& layer::monitor_output() {return *impl_->monitor_subject_;}
 void layer::on_interaction(const interaction_event::ptr& event) { impl_->on_interaction(event); }
 bool layer::collides(double x, double y) const { return impl_->collides(x, y); }
-}}
\ No newline at end of file
+}}
index 2e46367c279a93233658e1bb9eabc7bdb98f71b5..8d51c594e190a635bc7be362c4d4c66784196d27 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "const_producer.h"
 
index 5202bcef1dddb30a273c8d2f61f207d3376c979e..40585db76b54a9b3ff1a4805fc529f276d5fe4d5 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "expression_parser.h"
 
@@ -430,7 +430,7 @@ boost::any negative(const boost::any& to_create_negative_of)
        return -require<double>(to_create_negative_of);
 }
 
-boost::any not(const boost::any& to_create_not_of)
+boost::any not_(const boost::any& to_create_not_of)
 {
        return !require<bool>(to_create_not_of);
 }
@@ -526,12 +526,12 @@ boost::any equal(const boost::any& lhs, boost::any& rhs)
                return require<bool>(l) == require<bool>(r);
 }
 
-boost::any and(const boost::any& lhs, boost::any& rhs)
+boost::any and_(const boost::any& lhs, boost::any& rhs)
 {
        return require<bool>(lhs) && require<bool>(rhs);
 }
 
-boost::any or(const boost::any& lhs, boost::any& rhs)
+boost::any or_(const boost::any& lhs, boost::any& rhs)
 {
        return require<bool>(lhs) || require<bool>(rhs);
 }
@@ -594,7 +594,7 @@ void resolve_operators(int precedence, std::vector<boost::any>& tokens)
                        }
                        else if (op_token.characters == L"!")
                        {
-                               tokens.at(i) = not(token_after);
+                               tokens.at(i) = not_(token_after);
                        }
 
                        tokens.erase(tokens.begin() + index_after);
@@ -625,11 +625,11 @@ void resolve_operators(int precedence, std::vector<boost::any>& tokens)
                                else if (op_token.characters == L"==")
                                        token_before = equal(token_before, token_after);
                                else if (op_token.characters == L"!=")
-                                       token_before = not(equal(token_before, token_after));
+                                       token_before = not_(equal(token_before, token_after));
                                else if (op_token.characters == L"&&")
-                                       token_before = and(token_before, token_after);
+                                       token_before = and_(token_before, token_after);
                                else if (op_token.characters == L"||")
-                                       token_before = or(token_before, token_after);
+                                       token_before = or_(token_before, token_after);
                        }
 
                        tokens.erase(tokens.begin() + i, tokens.begin() + i + 2);
index e5dcb42b67366fa926d8ae60abd3dc781e7f1afc..3afc93a61f6fb2a632eb42bcb8392e2a95aeeffd 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "hotswap_producer.h"
 
index 178b2c7271866aac0102c2cb57d28c00ed9fe5f7..4a0f65e3d6dd035622034f52105255c15a08630f 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include <common/future.h>
 #include <boost/algorithm/string/split.hpp>
@@ -237,7 +237,7 @@ struct scene_producer::impl
                                && translated.second <= 1.0
                                && layer.producer.get()->collides(translated.first, translated.second))
                        {
-                               return std::make_pair(transform, layer.producer.get().get());
+                               return std::make_pair(transform, static_cast<interaction_sink*>(layer.producer.get().get()));
                        }
                }
 
index 7e9ba810b5af1e03b01caffa9890332cd668b46f..34e47ef65d94d5221bd2a305871b63329b356725 100644 (file)
@@ -42,9 +42,9 @@ struct coord
 
 struct rect
 {
-       coord upper_left;
-       binding<double> width;
-       binding<double> height;
+       coord                   upper_left;
+       binding<double> width;
+       binding<double> height;
 };
 
 struct adjustments
@@ -56,23 +56,23 @@ struct adjustments
 
 struct layer
 {
-       binding<std::wstring> name;
-       coord position;
-       rect clipping;
-       adjustments adjustments;
-       binding<spl::shared_ptr<frame_producer>> producer;
-       binding<bool> hidden;
-       binding<bool> is_key;
+       binding<std::wstring>                                           name;
+       scene::coord                                                            position;
+       scene::rect                                                                     clipping;
+       scene::adjustments                                                      adjustments;
+       binding<spl::shared_ptr<frame_producer>>        producer;
+       binding<bool>                                                           hidden;
+       binding<bool>                                                           is_key;
 
        explicit layer(const std::wstring& name, const spl::shared_ptr<frame_producer>& producer);
 };
 
 struct keyframe
 {
-       std::function<void ()> on_start_animate;
-       std::function<void (int64_t start_frame, int64_t current_frame)> on_animate_to;
-       std::function<void ()> on_destination_frame;
-       int64_t destination_frame;
+       std::function<void ()>                                                                                          on_start_animate;
+       std::function<void (int64_t start_frame, int64_t current_frame)>        on_animate_to;
+       std::function<void ()>                                                                                          on_destination_frame;
+       int64_t                                                                                                                         destination_frame;
 public:
        keyframe(int64_t destination_frame)
                : destination_frame(destination_frame)
index e0b2b3a2c3896294246f968ebb2a97cde8db2827..be37c6ef8b86d3545e813072955af0d8352eb5cd 100644 (file)
 * Author: Helge Norberg, helge.norberg@svt.se
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "xml_scene_producer.h"
 #include "expression_parser.h"
 
 #include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
 #include <boost/property_tree/ptree.hpp>
 #include <boost/property_tree/xml_parser.hpp>
 
@@ -73,7 +74,7 @@ spl::shared_ptr<core::frame_producer> create_xml_scene_producer(
                return core::frame_producer::empty();
 
        boost::property_tree::wptree root;
-       std::wifstream file(filename);
+       boost::filesystem::wifstream file(filename);
        boost::property_tree::read_xml(
                        file,
                        root,
index 4818f574a16f101c122bba8b0bb36b58d196b402..a8e2355f43f98730a6817fd0318eac0516815383 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "separated_producer.h"
 
index ae0b926518d8ff1c5620bae899f58c07c6ca554a..29790d0e73d40e5f50218331ef8786999e900aeb 100644 (file)
@@ -364,7 +364,7 @@ public:
                                && translated.second <= 1.0
                                && layer.second.collides(translated.first, translated.second))
                        {
-                               return std::make_pair(transform, &layer.second);
+                               return std::make_pair(transform, static_cast<interaction_sink*>(&layer.second));
                        }
                }
 
index 73f24135c810e729cb46a7ac90f9527454773bbd..94e654f4f376c36b0e124098df02a35f846065e3 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Niklas P Andersson, niklas.p.andersson@svt.se
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "text_producer.h"
 
@@ -52,8 +52,8 @@
 #include FT_FREETYPE_H
 #include FT_GLYPH_H
 
-#include "utils\texture_atlas.h"
-#include "utils\texture_font.h"
+#include "utils/texture_atlas.h"
+#include "utils/texture_font.h"
 
 class font_comparer {
        const std::wstring& lhs;
@@ -95,7 +95,7 @@ namespace caspar { namespace core {
                                        if(fontname != nullptr)
                                        {
                                                std::string fontname_str(fontname);
-                                               result.insert(std::pair<std::wstring, std::wstring>(std::wstring(fontname_str.begin(), fontname_str.end()), file.path().native()));
+                                               result.insert(std::make_pair(u16(fontname_str), u16(file.path().native())));
                                        }
 
                                        FT_Done_Face(face);
index aafb6948c7db28e608e9b4c4fd916335813c8ca4..02700cccf25d2c172990df9eaf086bdf1ac05518 100644 (file)
@@ -10,14 +10,14 @@ namespace caspar { namespace core { namespace text {
                std::wstring font;
                std::wstring font_file;
 
-               float size                                              = 0.0f;
-               color<float> color;
-               //int shadow_distance;
-               //int shadow_size;
-               //float shadow_spread;
-               //color<float> shadow_color;
-               int baseline_shift                              = 0;
-               int tracking                                    = 0;
+               float                                   size                            = 0.0f;
+               text::color<float>              color;
+               //int                                   shadow_distance;
+               //int                                   shadow_size;
+               //float                                 shadow_spread;
+               //text::color<float>    shadow_color;
+               int                                             baseline_shift          = 0;
+               int                                             tracking                        = 0;
        };
 
-}}}
\ No newline at end of file
+}}}
index 4e9cf83ffef48f6b77eb0d3a5fd5d8ab4acadc74..99db8f11942df934fbc427e1eb8117e9203b0ebd 100644 (file)
@@ -1,9 +1,10 @@
-#include "..\..\..\StdAfx.h"
+#include "../../../StdAfx.h"
 
 #include "texture_atlas.h"
 #include "texture_font.h"
 
 #include <map>
+#include <memory>
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #include FT_GLYPH_H
@@ -84,7 +85,7 @@ public:
                return range.last - range.first;
        }
 
-       void impl::load_glyphs(unicode_block block, const color<float>& col)
+       void load_glyphs(unicode_block block, const color<float>& col)
        {
                FT_Error err;
                int flags = FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT | FT_LOAD_TARGET_NORMAL;
@@ -514,4 +515,4 @@ unicode_range get_range(unicode_block block)
        return unicode_range(0,0);
 }
 
-}}}
\ No newline at end of file
+}}}
index 126326c8cd7fe911f0a83fdeac87576e8969e905..34a5ef1bc945ec28face70b4b04d5dab29b860ad 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "transition_producer.h"
 
index dc4ec0bb825ee086dc85e2faa096e24d8d3508e4..6eb400368bbb78cfd28e89fb5e290ddf061a5c34 100644 (file)
@@ -52,9 +52,9 @@ struct transition_info
        int                                             duration        = 0;
        transition_direction    direction       = transition_direction::from_left;
        transition_type                 type            = transition_type::cut;
-       tweener                                 tweener         = { L"linear" };
+       caspar::tweener                 tweener         { L"linear" };
 };
 
 spl::shared_ptr<class frame_producer> create_transition_producer(const field_mode& mode, const spl::shared_ptr<class frame_producer>& destination, const transition_info& info);
 
-}}
\ No newline at end of file
+}}
index f855a7006073c2d5f1d459d3f8fb4e352604568e..53758fdf2796151d2a55ab88eb54c551dd88f815 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se
 */
 
-#include "stdafx.h"
+#include "StdAfx.h"
 
 #include "thumbnail_generator.h"
 
@@ -86,7 +86,7 @@ struct thumbnail_output
                int current_sleep = sleep_millis;
 
                if (current_sleep > 0)
-                       boost::this_thread::sleep(boost::posix_time::milliseconds(current_sleep));
+                       boost::this_thread::sleep_for(boost::chrono::milliseconds(current_sleep));
 
                on_send(std::move(frame));
                on_send = nullptr;
@@ -375,4 +375,4 @@ void thumbnail_generator::generate_all()
        impl_->generate_all();
 }
 
-}}
\ No newline at end of file
+}}
index 086ad414236927a3991b14c9055614bb2dbbf62e..d99bb75b16a9efb0c4e17ece6b3cb454eee4655b 100644 (file)
@@ -69,7 +69,7 @@ struct video_channel::impl final
        caspar::core::mixer                                                                     mixer_;
        caspar::core::stage                                                                     stage_; 
 
-       executor                                                                                        executor_                       = L"video_channel";
+       executor                                                                                        executor_                       { L"video_channel" };
 public:
        impl(int index, const core::video_format_desc& format_desc, std::unique_ptr<image_mixer> image_mixer)  
                : monitor_subject_(spl::make_shared<monitor::subject>(
@@ -187,4 +187,4 @@ boost::property_tree::wptree video_channel::info() const{return impl_->info();}
 int video_channel::index() const { return impl_->index(); }
 monitor::subject& video_channel::monitor_output(){ return *impl_->monitor_subject_; }
 
-}}
\ No newline at end of file
+}}
index 64575d2171f6b1caee570a658bf0659d1a717d70..a0bb0647d195febe1b1243378403f52a9db59ab9 100644 (file)
@@ -81,7 +81,7 @@ video_format_desc::video_format_desc(
        , fps(static_cast<double>(time_scale) / static_cast<double>(duration))
        , time_scale(time_scale)
        , duration(duration)
-       , field_count(field_mode == field_mode::progressive ? 1 : 2)
+       , field_count(field_mode == core::field_mode::progressive ? 1 : 2)
        , size(width*height*4)
        , name(name)
        , audio_sample_rate(48000)
@@ -92,14 +92,14 @@ video_format_desc::video_format_desc(
 
 video_format_desc::video_format_desc(video_format format)
        : format(video_format::invalid)
-       , field_mode(field_mode::empty)
+       , field_mode(core::field_mode::empty)
 {
        *this = format_descs.at(static_cast<int>(format));
 }
 
 video_format_desc::video_format_desc(const std::wstring& name)
        : format(video_format::invalid)
-       , field_mode(field_mode::empty)
+       , field_mode(core::field_mode::empty)
 {      
        *this = video_format_desc(video_format::invalid);
        for(auto it = std::begin(format_descs); it != std::end(format_descs)-1; ++it)
index 9f2b52c79b524e043dfabf22493d29f85c87552e..cb260480a14b26ba38b860496bbf0ac56bc45740 100644 (file)
@@ -83,7 +83,7 @@ struct video_format_desc final
        int                                     height;         
        int                                     square_width;
        int                                     square_height;
-       field_mode                      field_mode;     // progressive, interlaced upper field first, interlaced lower field first
+       core::field_mode        field_mode;     // progressive, interlaced upper field first, interlaced lower field first
        double                          fps;            // actual framerate = duration/time_scale, e.g. i50 = 25 fps, p50 = 50 fps
        int                                     time_scale;
        int                                     duration;
@@ -115,4 +115,4 @@ bool operator!=(const video_format_desc& rhs, const video_format_desc& lhs);
 
 std::wostream& operator<<(std::wostream& out, const video_format_desc& format_desc);
 
-}}
\ No newline at end of file
+}}
index cd93e20b13156ff86af50bd8727aade24224895c..17216bbcf1d69f2132862bdc4a13fb9c668fbd65 100644 (file)
@@ -1,12 +1,19 @@
 cmake_minimum_required (VERSION 2.6)
 project ("modules")
 
-add_subdirectory(bluefish)
-add_subdirectory(decklink)
+if (MSVC)
+       add_subdirectory(bluefish)
+       add_subdirectory(decklink)
+endif ()
+
 add_subdirectory(ffmpeg)
-add_subdirectory(flash)
-add_subdirectory(image)
-add_subdirectory(oal)
-add_subdirectory(psd)
-add_subdirectory(reroute)
-add_subdirectory(screen)
+
+if (MSVC)
+       add_subdirectory(flash)
+       add_subdirectory(image)
+       add_subdirectory(oal)
+       add_subdirectory(psd)
+       add_subdirectory(reroute)
+       add_subdirectory(screen)
+endif ()
+
index b2f0eab5690e733a64cd8a6f2476d0518ae84a0c..954ab00ec34be225e81f2644fb52cd2c28dd8fc8 100644 (file)
@@ -19,4 +19,4 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "stdafx.h"
+#include "StdAfx.h"
index abf2ae996affb61003474be2bcf87210e6a9f31a..81976b5404a3f23684d55cb3604c253d8001437e 100644 (file)
@@ -51,7 +51,6 @@
 #include <boost/thread/once.hpp>
 #include <boost/thread/thread.hpp>
 #include <boost/timer.hpp>
-#include <crtdbg.h>
 #include <cstdint>
 #include <cstdio>
 #include <deque>
index c8d0defa56e52c57b1c0c553252a616cec9de3f8..0447ff94cb7bbee7b5d89a80732f053db2ad9ae6 100644 (file)
@@ -56,6 +56,7 @@
 #include <tbb/spin_mutex.h>
 
 #include <numeric>
+#include <cstring>
 
 #if defined(_MSC_VER)
 #pragma warning (push)
@@ -304,7 +305,7 @@ public:
 
                oc_->oformat = output_format_.format;
                                
-               strcpy_s(oc_->filename, filename_.c_str());
+               std::strcpy(oc_->filename, filename_.c_str());
                
                //  Add the audio and video streams using the default format codecs     and initialize the codecs.
                video_st_ = add_video_stream(options);
index 14059b2005ce5e851e277164108ca79526a3e085..acb0630f8c8ef6a79af180205589b9b01d6692de 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "audio_decoder.h"
 
@@ -182,4 +182,4 @@ std::shared_ptr<AVFrame> audio_decoder::operator()(){return impl_->poll();}
 uint32_t audio_decoder::nb_frames() const{return impl_->nb_frames();}
 std::wstring audio_decoder::print() const{return impl_->print();}
 core::monitor::subject& audio_decoder::monitor_output() { return impl_->monitor_subject_;}
-}}
\ No newline at end of file
+}}
index 2041beaef063307af5e0421b911d58578621f508..83ad7f19bf3d7615201ac085ff735fc4f0a5cf66 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../stdafx.h"
+#include "../StdAfx.h"
 
 #include "ffmpeg_producer.h"
 
@@ -412,4 +412,4 @@ spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<core
        return create_destroy_proxy(spl::make_shared_ptr(std::make_shared<ffmpeg_producer>(frame_factory, format_desc, filename, filter_str, loop, start, length)));
 }
 
-}}
\ No newline at end of file
+}}
index dac2eef3dfbe4438524af646176a3afa7fb50ab3..24f5d9712120b975ed980d871b9763396a7c1b49 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "filter.h"
 
@@ -274,4 +274,4 @@ std::vector<spl::shared_ptr<AVFrame>> filter::poll_all()
        return frames;
 }
 
-}}
\ No newline at end of file
+}}
index 8dbcf8dfb9b5c9f79eb0a69562c7ddbc7483aae4..823e10ac74685d570a85f63bc7858128366e3b98 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "input.h"
 
@@ -116,8 +116,8 @@ struct input::impl : boost::noncopyable
        double                                                                          fps_                                    = read_fps(*format_context_, 0.0);
        uint32_t                                                                        frame_number_                   = 0;
 
-       stream                                                                          video_stream_                   = av_find_best_stream(format_context_.get(), AVMEDIA_TYPE_VIDEO, -1, -1, 0, 0);
-       stream                                                                          audio_stream_                   = av_find_best_stream(format_context_.get(), AVMEDIA_TYPE_AUDIO, -1, -1, 0, 0);
+       stream                                                                          video_stream_                   { av_find_best_stream(format_context_.get(), AVMEDIA_TYPE_VIDEO, -1, -1, 0, 0) };
+       stream                                                                          audio_stream_                   { av_find_best_stream(format_context_.get(), AVMEDIA_TYPE_AUDIO, -1, -1, 0, 0) };
 
        boost::optional<uint32_t>                                       seek_target_;
 
@@ -291,7 +291,7 @@ private:
                {
                        try
                        {
-                               boost::this_thread::sleep(boost::posix_time::milliseconds(1));
+                               boost::this_thread::sleep_for(boost::chrono::milliseconds(1));
                                
                                {
                                        boost::unique_lock<boost::mutex> lock(mutex_);
index 1205446902412cd453985d09b141931ee1f4e2c4..a371c332dcce902b2849a6e8af4bbce24416510f 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../stdafx.h"
+#include "../StdAfx.h"
 
 #include "tbb_avcodec.h"
 
@@ -124,4 +124,4 @@ int tbb_avcodec_close(AVCodecContext* avctx)
        return avcodec_close(avctx); 
 }
 
-}
\ No newline at end of file
+}
index 72445136a6a2a63f61d32c5ef4c20cc569396da6..362af475defa65cfc5e16b7ae91ef5d74558846d 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "flv.h"
 
@@ -29,6 +29,7 @@
 #include <boost/filesystem.hpp>
 
 #include <iostream>
+#include <fstream>
 
 #include <unordered_map>
 
@@ -46,7 +47,7 @@ std::map<std::string, std::string> read_flv_meta_info(const std::string& filenam
                if(!boost::filesystem::exists(filename))
                        CASPAR_THROW_EXCEPTION(caspar_exception());
        
-               std::fstream fileStream = std::fstream(filename, std::fstream::in);
+               std::fstream fileStream(filename, std::fstream::in);
                
                std::vector<char> bytes2(256);
                fileStream.read(bytes2.data(), bytes2.size());
@@ -100,4 +101,4 @@ std::map<std::string, std::string> read_flv_meta_info(const std::string& filenam
     return values;
 }
 
-}}
\ No newline at end of file
+}}
index bc09717392efdadfe7aa750816413aedc5718620..b1c730aa0f31ca74ccb99662633449198c14b95e 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "util.h"
 
@@ -45,6 +45,8 @@
 #include <boost/filesystem.hpp>
 #include <boost/lexical_cast.hpp>
 
+#include <fstream>
+
 #include <asmlib.h>
 
 #if defined(_MSC_VER)
@@ -541,7 +543,7 @@ bool is_valid_file(const std::wstring& filename)
        if(av_probe_input_format2(&pb, false, &score) != nullptr)
                return true;
 
-       std::ifstream file(filename);
+       std::ifstream file(u8filename);
 
        std::vector<unsigned char> buf;
        for(auto file_it = std::istreambuf_iterator<char>(file); file_it != std::istreambuf_iterator<char>() && buf.size() < 1024; ++file_it)
@@ -585,4 +587,4 @@ std::wstring probe_stem(const std::wstring& stem)
 //     frame =
 //}
 
-}}
\ No newline at end of file
+}}
index 41f4d416110fb6a766a40bdc879d7af000adf244..d3c6880b8d6862b6552bcafcf2e96e75d9fdab6c 100644 (file)
@@ -30,7 +30,8 @@
 
 #include <array>
 
-enum PixelFormat;
+#include <libavutil/avutil.h>
+
 struct AVFrame;
 struct AVFormatContext;
 struct AVPacket;
@@ -56,7 +57,7 @@ core::pixel_format_desc                               pixel_format_desc(PixelFormat pix_fmt, int width, int
 spl::shared_ptr<AVPacket> create_packet();
 spl::shared_ptr<AVFrame>  create_frame();
 
-spl::shared_ptr<AVCodecContext> open_codec(AVFormatContext& context,  enum AVMediaType type, int& index);
+spl::shared_ptr<AVCodecContext> open_codec(AVFormatContext& context, AVMediaType type, int& index);
 spl::shared_ptr<AVFormatContext> open_input(const std::wstring& filename);
 
 bool is_sane_fps(AVRational time_base);
@@ -69,4 +70,4 @@ std::wstring print_mode(int width, int height, double fps, bool interlaced);
 std::wstring probe_stem(const std::wstring& stem);
 bool is_valid_file(const std::wstring& filename);
 
-}}
\ No newline at end of file
+}}
index db83a5633d7bfac7e9873dee0755b16aa674ef29..3492e9ab2369adcc0f74c236764c6bdc67282958 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "video_decoder.h"
 
@@ -173,4 +173,4 @@ uint32_t video_decoder::file_frame_number() const{return impl_->file_frame_numbe
 bool video_decoder::is_progressive() const{return impl_->is_progressive_;}
 std::wstring video_decoder::print() const{return impl_->print();}
 core::monitor::subject& video_decoder::monitor_output() { return impl_->monitor_subject_; }
-}}
\ No newline at end of file
+}}
index ebf9f16e22159b47fe492606679c328692595674..d257b484ef206e4d6a21cd127f5606658a79d6c5 100644 (file)
@@ -73,6 +73,7 @@ include_directories(..)
 include_directories(${BOOST_INCLUDE_PATH})
 include_directories(${RXCPP_INCLUDE_PATH})
 include_directories(${TBB_INCLUDE_PATH})
+include_directories(${FFMPEG_INCLUDE_PATH})
 
 source_group(sources\\amcp amcp/*)
 source_group(sources\\asio asio/*)
index 2af006d7123b6d10f8c2d9f530f8556cd2b1cbda..6ab19283f18692266260a2c4c3dd53b96054152e 100644 (file)
@@ -19,4 +19,4 @@
 * Author: Nicklas P Andersson
 */
 
-#include "stdafx.h"
\ No newline at end of file
+#include "StdAfx.h"
index e2c054ed5c78933e2e61d3174e2dc499474af6a7..df1582008b43e6ccb8789c80f084becdf57595e0 100644 (file)
@@ -38,8 +38,6 @@
 #endif
 
 #include <cstdint>
-#include <winsock2.h>
-#include <tchar.h>
 #include <sstream>
 #include <memory>
 #include <functional>
@@ -61,4 +59,4 @@
 #include "../common/log.h"
 #include "../common/except.h"
 
-#include <assert.h>
\ No newline at end of file
+#include <assert.h>
index 58a937da03687d9aa5e703ce5e1e0846e30bc165..e77da6fce494013ea861c4fd09e3b090d83d7bcb 100644 (file)
@@ -21,7 +21,7 @@
 
 #pragma once
 
-#include "../util/clientinfo.h"
+#include "../util/ClientInfo.h"
 #include "amcp_shared.h"
 #include <core/consumer/frame_consumer.h>
 
@@ -94,7 +94,7 @@ namespace amcp {
                spl::shared_ptr<IO::lock_container>& lock_container() { return ctx_.lock; }
 
                unsigned int channel_index(){return channel_index_;}
-               int layer_index(int default = 0) const{return layer_index_ != -1 ? layer_index_ : default; }
+               int layer_index(int default_ = 0) const{return layer_index_ != -1 ? layer_index_ : default_; }
 
        private:
                unsigned int channel_index_;
@@ -118,13 +118,13 @@ namespace amcp {
        class AMCPChannelCommandBase : public AMCPChannelCommand, public AMCPCommandBase<TMinParameters>
        {
        public:
-               AMCPChannelCommandBase(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommand(channel, channel_index, layer_index), AMCPCommandBase(client)
+               AMCPChannelCommandBase(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommand(channel, channel_index, layer_index), AMCPCommandBase<TMinParameters>(client)
                {}
        protected:
-               AMCPChannelCommandBase(const AMCPChannelCommandBase& rhs) : AMCPChannelCommand(rhs), AMCPCommandBase(rhs)
+               AMCPChannelCommandBase(const AMCPChannelCommandBase& rhs) : AMCPChannelCommand(rhs), AMCPCommandBase<TMinParameters>(rhs)
                {}
                template<int T>
-               AMCPChannelCommandBase(const AMCPChannelCommandBase<T>& rhs) : AMCPChannelCommand(rhs), AMCPCommandBase(rhs)
+               AMCPChannelCommandBase(const AMCPChannelCommandBase<T>& rhs) : AMCPChannelCommand(rhs), AMCPCommandBase<TMinParameters>(rhs)
                {}
        };
 }}}
index 8cccef89e67627999748c0301db7b6617b44bc69..053c9d6adfea1ded15812b7175f65aa9f895d1bc 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Nicklas P Andersson
 */
 
-#include "..\stdafx.h"
+#include "../StdAfx.h"
 
 #include "AMCPCommandQueue.h"
 
@@ -86,4 +86,4 @@ void AMCPCommandQueue::AddCommand(AMCPCommand::ptr_type pCurrentCommand)
        });
 }
 
-}}}
\ No newline at end of file
+}}}
index e4d0eaed7adc630411ad2acc1abb72e68de733a8..0e42dd5df5c8e5567ea0b565352229e11ad7efbc 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <common/executor.h>
 
-#include <tbb\mutex.h>
+#include <tbb/mutex.h>
 
 namespace caspar { namespace protocol { namespace amcp {
 
index f1e8e876840ac1d34e27638f14c60153b7c4abf1..ae34cb268954fb74fd2ef31f65d22457cad6cd17 100644 (file)
@@ -56,7 +56,6 @@
 #include <modules/flash/producer/flash_producer.h>
 #include <modules/flash/producer/cg_proxy.h>
 #include <modules/ffmpeg/producer/util/util.h>
-#include <modules/image/image.h>
 #include <modules/screen/screen.h>
 #include <modules/reroute/producer/reroute_producer.h>
 
@@ -65,7 +64,7 @@
 #include <fstream>
 #include <memory>
 #include <cctype>
-#include <io.h>
+//#include <io.h>
 #include <future>
 
 #include <boost/date_time/posix_time/posix_time.hpp>
@@ -201,17 +200,17 @@ std::wstring MediaInfo(const boost::filesystem::path& path)
 {
        if(boost::filesystem::is_regular_file(path))
        {
-               std::wstring clipttype = TEXT("N/A");
+               std::wstring clipttype = L"N/A";
                std::wstring extension = boost::to_upper_copy(path.extension().wstring());
-               if(extension == TEXT(".TGA") || extension == TEXT(".COL") || extension == L".PNG" || extension == L".JPEG" || extension == L".JPG" ||
+               if(extension == L".TGA" || extension == L".COL" || extension == L".PNG" || extension == L".JPEG" || extension == L".JPG" ||
                        extension == L"GIF" || extension == L"BMP")
-                       clipttype = TEXT("STILL");
-               else if(extension == TEXT(".WAV") || extension == TEXT(".MP3"))
-                       clipttype = TEXT("AUDIO");
-               else if(extension == TEXT("SWF") || extension == TEXT("CT") || extension == TEXT("DV") || extension == TEXT("MOV") || extension == TEXT("MPG") || extension == TEXT("AVI") || caspar::ffmpeg::is_valid_file(path.wstring()))
-                       clipttype = TEXT("MOVIE");
+                       clipttype = L"STILL";
+               else if(extension == L".WAV" || extension == L".MP3")
+                       clipttype = L"AUDIO";
+               else if(extension == L"SWF" || extension == L"CT" || extension == L"DV" || extension == L"MOV" || extension == L"MPG" || extension == L"AVI" || caspar::ffmpeg::is_valid_file(path.wstring()))
+                       clipttype = L"MOVIE";
 
-               if(clipttype != TEXT("N/A"))
+               if(clipttype != L"N/A")
                {               
                        auto is_not_digit = [](char c){ return std::isdigit(c) == 0; };
 
@@ -225,15 +224,15 @@ std::wstring MediaInfo(const boost::filesystem::path& path)
                        sizeStr.erase(std::remove_if(sizeStr.begin(), sizeStr.end(), is_not_digit), sizeStr.end());
                        auto sizeWStr = std::wstring(sizeStr.begin(), sizeStr.end());
                                
-                       auto str = relativePath.replace_extension(TEXT("")).native();
-                       while(str.size() > 0 && (str[0] == '\\' || str[0] == '/'))
+                       auto str = relativePath.replace_extension(L"").generic_wstring();
+                       while(str.size() > 0 && (str[0] == L'\\' || str[0] == L'/'))
                                str = std::wstring(str.begin() + 1, str.end());
 
-                       return std::wstring() + TEXT("\"") + str +
-                                       + TEXT("\" ") + clipttype +
-                                       + TEXT(" ") + sizeStr +
-                                       + TEXT(" ") + writeTimeWStr +
-                                       + TEXT("\r\n");         
+                       return std::wstring() + L"\"" + str +
+                                       + L"\" " + clipttype +
+                                       + L" " + sizeStr +
+                                       + L" " + writeTimeWStr +
+                                       + L"\r\n";
                }       
        }
        return L"";
@@ -267,17 +266,17 @@ std::wstring ListTemplates()
 
                        auto sizeWStr = std::wstring(sizeStr.begin(), sizeStr.end());
 
-                       std::wstring dir = relativePath.parent_path().native();
+                       std::wstring dir = relativePath.parent_path().generic_wstring();
                        std::wstring file = boost::to_upper_copy(relativePath.filename().wstring());
                        relativePath = boost::filesystem::wpath(dir + L"/" + file);
                                                
-                       auto str = relativePath.replace_extension(TEXT("")).native();
+                       auto str = relativePath.replace_extension(L"").generic_wstring();
                        boost::trim_if(str, boost::is_any_of("\\/"));
 
-                       replyString << TEXT("\"") << str
-                                               << TEXT("\" ") << sizeWStr
-                                               << TEXT(" ") << writeTimeWStr
-                                               << TEXT("\r\n");                
+                       replyString << L"\"" << str
+                                               << L"\" " << sizeWStr
+                                               << L" " << writeTimeWStr
+                                               << L"\r\n";
                }
        }
        return replyString.str();
@@ -299,14 +298,14 @@ bool DiagnosticsCommand::DoExecute()
        {
                core::diagnostics::osd::show_graphs(true);
 
-               SetReplyString(TEXT("202 DIAG OK\r\n"));
+               SetReplyString(L"202 DIAG OK\r\n");
 
                return true;
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("502 DIAG FAILED\r\n"));
+               SetReplyString(L"502 DIAG FAILED\r\n");
                return false;
        }
 }
@@ -381,9 +380,9 @@ bool CallCommand::DoExecute()
                                
                std::wstringstream replyString;
                if(result.get().empty())
-                       replyString << TEXT("202 CALL OK\r\n");
+                       replyString << L"202 CALL OK\r\n";
                else
-                       replyString << TEXT("201 CALL OK\r\n") << result.get() << L"\r\n";
+                       replyString << L"201 CALL OK\r\n" << result.get() << L"\r\n";
                
                SetReplyString(replyString.str());
 
@@ -392,7 +391,7 @@ bool CallCommand::DoExecute()
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("502 CALL FAILED\r\n"));
+               SetReplyString(L"502 CALL FAILED\r\n");
                return false;
        }
 }
@@ -588,7 +587,7 @@ bool MixerCommand::DoExecute()
                }
                else
                {
-                       SetReplyString(TEXT("404 MIXER ERROR\r\n"));
+                       SetReplyString(L"404 MIXER ERROR\r\n");
                        return false;
                }
 
@@ -600,20 +599,20 @@ bool MixerCommand::DoExecute()
                else
                        channel()->stage().apply_transforms(transforms);
        
-               SetReplyString(TEXT("202 MIXER OK\r\n"));
+               SetReplyString(L"202 MIXER OK\r\n");
 
                return true;
        }
        catch(file_not_found&)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("404 MIXER ERROR\r\n"));
+               SetReplyString(L"404 MIXER ERROR\r\n");
                return false;
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("502 MIXER FAILED\r\n"));
+               SetReplyString(L"502 MIXER FAILED\r\n");
                return false;
        }
 }
@@ -643,20 +642,20 @@ bool SwapCommand::DoExecute()
                        ch1->stage().swap_layers(ch2.channel->stage());
                }
                
-               SetReplyString(TEXT("202 SWAP OK\r\n"));
+               SetReplyString(L"202 SWAP OK\r\n");
 
                return true;
        }
        catch(file_not_found&)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("404 SWAP ERROR\r\n"));
+               SetReplyString(L"404 SWAP ERROR\r\n");
                return false;
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("502 SWAP FAILED\r\n"));
+               SetReplyString(L"502 SWAP FAILED\r\n");
                return false;
        }
 }
@@ -678,20 +677,20 @@ bool AddCommand::DoExecute()
                auto consumer = create_consumer(parameters());
                channel()->output().add(layer_index(consumer->index()), consumer);
        
-               SetReplyString(TEXT("202 ADD OK\r\n"));
+               SetReplyString(L"202 ADD OK\r\n");
 
                return true;
        }
        catch(file_not_found&)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("404 ADD ERROR\r\n"));
+               SetReplyString(L"404 ADD ERROR\r\n");
                return false;
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("502 ADD FAILED\r\n"));
+               SetReplyString(L"502 ADD FAILED\r\n");
                return false;
        }
 }
@@ -715,20 +714,20 @@ bool RemoveCommand::DoExecute()
 
                channel()->output().remove(index);
 
-               SetReplyString(TEXT("202 REMOVE OK\r\n"));
+               SetReplyString(L"202 REMOVE OK\r\n");
 
                return true;
        }
        catch(file_not_found&)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("404 REMOVE ERROR\r\n"));
+               SetReplyString(L"404 REMOVE ERROR\r\n");
                return false;
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("502 REMOVE FAILED\r\n"));
+               SetReplyString(L"502 REMOVE FAILED\r\n");
                return false;
        }
 }
@@ -744,20 +743,20 @@ bool LoadCommand::DoExecute()
                auto pFP = create_producer(channel()->frame_factory(), channel()->video_format_desc(), parameters());
                channel()->stage().load(layer_index(), pFP, true);
        
-               SetReplyString(TEXT("202 LOAD OK\r\n"));
+               SetReplyString(L"202 LOAD OK\r\n");
 
                return true;
        }
        catch(file_not_found&)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("404 LOAD ERROR\r\n"));
+               SetReplyString(L"404 LOAD ERROR\r\n");
                return false;
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("502 LOAD FAILED\r\n"));
+               SetReplyString(L"502 LOAD FAILED\r\n");
                return false;
        }
 }
@@ -820,24 +819,24 @@ bool LoadbgCommand::DoExecute()
                auto tween = what["TWEEN"].matched ? what["TWEEN"].str() : L"";
                transitionInfo.tweener = tween;         
 
-               if(transition == TEXT("CUT"))
+               if(transition == L"CUT")
                        transitionInfo.type = transition_type::cut;
-               else if(transition == TEXT("MIX"))
+               else if(transition == L"MIX")
                        transitionInfo.type = transition_type::mix;
-               else if(transition == TEXT("PUSH"))
+               else if(transition == L"PUSH")
                        transitionInfo.type = transition_type::push;
-               else if(transition == TEXT("SLIDE"))
+               else if(transition == L"SLIDE")
                        transitionInfo.type = transition_type::slide;
-               else if(transition == TEXT("WIPE"))
+               else if(transition == L"WIPE")
                        transitionInfo.type = transition_type::wipe;
                
-               if(direction == TEXT("FROMLEFT"))
+               if(direction == L"FROMLEFT")
                        transitionInfo.direction = transition_direction::from_left;
-               else if(direction == TEXT("FROMRIGHT"))
+               else if(direction == L"FROMRIGHT")
                        transitionInfo.direction = transition_direction::from_right;
-               else if(direction == TEXT("LEFT"))
+               else if(direction == L"LEFT")
                        transitionInfo.direction = transition_direction::from_right;
-               else if(direction == TEXT("RIGHT"))
+               else if(direction == L"RIGHT")
                        transitionInfo.direction = transition_direction::from_left;
        }
        
@@ -875,20 +874,20 @@ bool LoadbgCommand::DoExecute()
                        channel()->stage().load(layer_index(), pFP2, false); // TODO: LOOP
        
                
-               SetReplyString(TEXT("202 LOADBG OK\r\n"));
+               SetReplyString(L"202 LOADBG OK\r\n");
 
                return true;
        }
        catch(file_not_found&)
        {               
                CASPAR_LOG(error) << L"File not found. No match found for parameters. Check syntax.";
-               SetReplyString(TEXT("404 LOADBG ERROR\r\n"));
+               SetReplyString(L"404 LOADBG ERROR\r\n");
                return false;
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("502 LOADBG FAILED\r\n"));
+               SetReplyString(L"502 LOADBG FAILED\r\n");
                return false;
        }
 }
@@ -898,12 +897,12 @@ bool PauseCommand::DoExecute()
        try
        {
                channel()->stage().pause(layer_index());
-               SetReplyString(TEXT("202 PAUSE OK\r\n"));
+               SetReplyString(L"202 PAUSE OK\r\n");
                return true;
        }
        catch(...)
        {
-               SetReplyString(TEXT("501 PAUSE FAILED\r\n"));
+               SetReplyString(L"501 PAUSE FAILED\r\n");
        }
 
        return false;
@@ -923,12 +922,12 @@ bool PlayCommand::DoExecute()
 
                channel()->stage().play(layer_index());
                
-               SetReplyString(TEXT("202 PLAY OK\r\n"));
+               SetReplyString(L"202 PLAY OK\r\n");
                return true;
        }
        catch(...)
        {
-               SetReplyString(TEXT("501 PLAY FAILED\r\n"));
+               SetReplyString(L"501 PLAY FAILED\r\n");
        }
 
        return false;
@@ -939,12 +938,12 @@ bool StopCommand::DoExecute()
        try
        {
                channel()->stage().stop(layer_index());
-               SetReplyString(TEXT("202 STOP OK\r\n"));
+               SetReplyString(L"202 STOP OK\r\n");
                return true;
        }
        catch(...)
        {
-               SetReplyString(TEXT("501 STOP FAILED\r\n"));
+               SetReplyString(L"501 STOP FAILED\r\n");
        }
 
        return false;
@@ -958,7 +957,7 @@ bool ClearCommand::DoExecute()
        else
                channel()->stage().clear();
                
-       SetReplyString(TEXT("202 CLEAR OK\r\n"));
+       SetReplyString(L"202 CLEAR OK\r\n");
 
        return true;
 }
@@ -967,7 +966,7 @@ bool PrintCommand::DoExecute()
 {
        channel()->output().add(create_consumer({ L"IMAGE" }));
                
-       SetReplyString(TEXT("202 PRINT OK\r\n"));
+       SetReplyString(L"202 PRINT OK\r\n");
 
        return true;
 }
@@ -977,7 +976,7 @@ bool LogCommand::DoExecute()
        if(boost::iequals(parameters().at(0), L"LEVEL"))
                log::set_log_level(parameters().at(1));
 
-       SetReplyString(TEXT("202 LOG OK\r\n"));
+       SetReplyString(L"202 LOG OK\r\n");
 
        return true;
 }
@@ -987,23 +986,23 @@ bool CGCommand::DoExecute()
        try
        {
                std::wstring command = boost::to_upper_copy(parameters()[0]);
-               if(command == TEXT("ADD"))
+               if(command == L"ADD")
                        return DoExecuteAdd();
-               else if(command == TEXT("PLAY"))
+               else if(command == L"PLAY")
                        return DoExecutePlay();
-               else if(command == TEXT("STOP"))
+               else if(command == L"STOP")
                        return DoExecuteStop();
-               else if(command == TEXT("NEXT"))
+               else if(command == L"NEXT")
                        return DoExecuteNext();
-               else if(command == TEXT("REMOVE"))
+               else if(command == L"REMOVE")
                        return DoExecuteRemove();
-               else if(command == TEXT("CLEAR"))
+               else if(command == L"CLEAR")
                        return DoExecuteClear();
-               else if(command == TEXT("UPDATE"))
+               else if(command == L"UPDATE")
                        return DoExecuteUpdate();
-               else if(command == TEXT("INVOKE"))
+               else if(command == L"INVOKE")
                        return DoExecuteInvoke();
-               else if(command == TEXT("INFO"))
+               else if(command == L"INFO")
                        return DoExecuteInfo();
        }
        catch(...)
@@ -1011,14 +1010,14 @@ bool CGCommand::DoExecute()
                CASPAR_LOG_CURRENT_EXCEPTION();
        }
 
-       SetReplyString(TEXT("403 CG ERROR\r\n"));
+       SetReplyString(L"403 CG ERROR\r\n");
        return false;
 }
 
 bool CGCommand::ValidateLayer(const std::wstring& layerstring) {
        int length = layerstring.length();
        for(int i = 0; i < length; ++i) {
-               if(!_istdigit(layerstring[i])) {
+               if(!std::isdigit(layerstring[i])) {
                        return false;
                }
        }
@@ -1037,14 +1036,14 @@ bool CGCommand::DoExecuteAdd() {
 
        if(parameters().size() < 4) 
        {
-               SetReplyString(TEXT("402 CG ERROR\r\n"));
+               SetReplyString(L"402 CG ERROR\r\n");
                return false;
        }
        unsigned int dataIndex = 4;
 
        if(!ValidateLayer(parameters()[1])) 
        {
-               SetReplyString(TEXT("403 CG ERROR\r\n"));
+               SetReplyString(L"403 CG ERROR\r\n");
                return false;
        }
 
@@ -1056,36 +1055,36 @@ bool CGCommand::DoExecuteAdd() {
                ++dataIndex;
 
                if(parameters().size() > 4 && parameters()[4].length() > 0)     //read play-on-load-flag
-                       bDoStart = (parameters()[4][0]==TEXT('1')) ? true : false;
+                       bDoStart = (parameters()[4][0]==L'1') ? true : false;
                else 
                {
-                       SetReplyString(TEXT("402 CG ERROR\r\n"));
+                       SetReplyString(L"402 CG ERROR\r\n");
                        return false;
                }
        }
        else if(parameters()[3].length() > 0) { //read play-on-load-flag
-               bDoStart = (parameters()[3][0]==TEXT('1')) ? true : false;
+               bDoStart = (parameters()[3][0]==L'1') ? true : false;
        }
        else 
        {
-               SetReplyString(TEXT("403 CG ERROR\r\n"));
+               SetReplyString(L"403 CG ERROR\r\n");
                return false;
        }
 
-       const TCHAR* pDataString = 0;
+       const wchar_t* pDataString = 0;
        std::wstring dataFromFile;
        if(parameters().size() > dataIndex) 
        {       //read data
                const std::wstring& dataString = parameters()[dataIndex];
 
-               if(dataString[0] == TEXT('<')) //the data is an XML-string
+               if(dataString[0] == L'<') //the data is an XML-string
                        pDataString = dataString.c_str();
                else 
                {
                        //The data is not an XML-string, it must be a filename
                        std::wstring filename = env::data_folder();
                        filename.append(dataString);
-                       filename.append(TEXT(".ftd"));
+                       filename.append(L".ftd");
 
                        dataFromFile = read_file(boost::filesystem::wpath(filename));
                        pDataString = dataFromFile.c_str();
@@ -1099,13 +1098,13 @@ bool CGCommand::DoExecuteAdd() {
                std::wstring filename = parameters()[2];
                filename.append(extension);
 
-               flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(channel()), layer_index(flash::cg_proxy::DEFAULT_LAYER)).add(layer, filename, bDoStart, label, (pDataString!=0) ? pDataString : TEXT(""));
-               SetReplyString(TEXT("202 CG OK\r\n"));
+               flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(channel()), layer_index(flash::cg_proxy::DEFAULT_LAYER)).add(layer, filename, bDoStart, label, (pDataString!=0) ? pDataString : L"");
+               SetReplyString(L"202 CG OK\r\n");
        }
        else
        {
                CASPAR_LOG(warning) << "Could not find template " << parameters()[2];
-               SetReplyString(TEXT("404 CG ERROR\r\n"));
+               SetReplyString(L"404 CG ERROR\r\n");
        }
        return true;
 }
@@ -1116,7 +1115,7 @@ bool CGCommand::DoExecutePlay()
        {
                if(!ValidateLayer(parameters()[1])) 
                {
-                       SetReplyString(TEXT("403 CG ERROR\r\n"));
+                       SetReplyString(L"403 CG ERROR\r\n");
                        return false;
                }
                int layer = boost::lexical_cast<int>(parameters()[1]);
@@ -1124,11 +1123,11 @@ bool CGCommand::DoExecutePlay()
        }
        else
        {
-               SetReplyString(TEXT("402 CG ERROR\r\n"));
+               SetReplyString(L"402 CG ERROR\r\n");
                return true;
        }
 
-       SetReplyString(TEXT("202 CG OK\r\n"));
+       SetReplyString(L"202 CG OK\r\n");
        return true;
 }
 
@@ -1138,7 +1137,7 @@ bool CGCommand::DoExecuteStop()
        {
                if(!ValidateLayer(parameters()[1])) 
                {
-                       SetReplyString(TEXT("403 CG ERROR\r\n"));
+                       SetReplyString(L"403 CG ERROR\r\n");
                        return false;
                }
                int layer = boost::lexical_cast<int>(parameters()[1]);
@@ -1146,11 +1145,11 @@ bool CGCommand::DoExecuteStop()
        }
        else 
        {
-               SetReplyString(TEXT("402 CG ERROR\r\n"));
+               SetReplyString(L"402 CG ERROR\r\n");
                return true;
        }
 
-       SetReplyString(TEXT("202 CG OK\r\n"));
+       SetReplyString(L"202 CG OK\r\n");
        return true;
 }
 
@@ -1160,7 +1159,7 @@ bool CGCommand::DoExecuteNext()
        {
                if(!ValidateLayer(parameters()[1])) 
                {
-                       SetReplyString(TEXT("403 CG ERROR\r\n"));
+                       SetReplyString(L"403 CG ERROR\r\n");
                        return false;
                }
 
@@ -1169,11 +1168,11 @@ bool CGCommand::DoExecuteNext()
        }
        else 
        {
-               SetReplyString(TEXT("402 CG ERROR\r\n"));
+               SetReplyString(L"402 CG ERROR\r\n");
                return true;
        }
 
-       SetReplyString(TEXT("202 CG OK\r\n"));
+       SetReplyString(L"202 CG OK\r\n");
        return true;
 }
 
@@ -1183,7 +1182,7 @@ bool CGCommand::DoExecuteRemove()
        {
                if(!ValidateLayer(parameters()[1])) 
                {
-                       SetReplyString(TEXT("403 CG ERROR\r\n"));
+                       SetReplyString(L"403 CG ERROR\r\n");
                        return false;
                }
 
@@ -1192,18 +1191,18 @@ bool CGCommand::DoExecuteRemove()
        }
        else 
        {
-               SetReplyString(TEXT("402 CG ERROR\r\n"));
+               SetReplyString(L"402 CG ERROR\r\n");
                return true;
        }
 
-       SetReplyString(TEXT("202 CG OK\r\n"));
+       SetReplyString(L"202 CG OK\r\n");
        return true;
 }
 
 bool CGCommand::DoExecuteClear() 
 {
        channel()->stage().clear(layer_index(flash::cg_proxy::DEFAULT_LAYER));
-       SetReplyString(TEXT("202 CG OK\r\n"));
+       SetReplyString(L"202 CG OK\r\n");
        return true;
 }
 
@@ -1213,17 +1212,17 @@ bool CGCommand::DoExecuteUpdate()
        {
                if(!ValidateLayer(parameters().at(1)))
                {
-                       SetReplyString(TEXT("403 CG ERROR\r\n"));
+                       SetReplyString(L"403 CG ERROR\r\n");
                        return false;
                }
                                                
                std::wstring dataString = parameters().at(2);                           
-               if(dataString.at(0) != TEXT('<'))
+               if(dataString.at(0) != L'<')
                {
                        //The data is not an XML-string, it must be a filename
                        std::wstring filename = env::data_folder();
                        filename.append(dataString);
-                       filename.append(TEXT(".ftd"));
+                       filename.append(L".ftd");
 
                        dataString = read_file(boost::filesystem::wpath(filename));
                }               
@@ -1233,33 +1232,33 @@ bool CGCommand::DoExecuteUpdate()
        }
        catch(...)
        {
-               SetReplyString(TEXT("402 CG ERROR\r\n"));
+               SetReplyString(L"402 CG ERROR\r\n");
                return true;
        }
 
-       SetReplyString(TEXT("202 CG OK\r\n"));
+       SetReplyString(L"202 CG OK\r\n");
        return true;
 }
 
 bool CGCommand::DoExecuteInvoke() 
 {
        std::wstringstream replyString;
-       replyString << TEXT("201 CG OK\r\n");
+       replyString << L"201 CG OK\r\n";
 
        if(parameters().size() > 2)
        {
                if(!ValidateLayer(parameters()[1]))
                {
-                       SetReplyString(TEXT("403 CG ERROR\r\n"));
+                       SetReplyString(L"403 CG ERROR\r\n");
                        return false;
                }
                int layer = boost::lexical_cast<int>(parameters()[1]);
                auto result = flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(channel()), layer_index(flash::cg_proxy::DEFAULT_LAYER)).invoke(layer, parameters()[2]);
-               replyString << result << TEXT("\r\n"); 
+               replyString << result << L"\r\n";
        }
        else 
        {
-               SetReplyString(TEXT("402 CG ERROR\r\n"));
+               SetReplyString(L"402 CG ERROR\r\n");
                return true;
        }
        
@@ -1270,25 +1269,25 @@ bool CGCommand::DoExecuteInvoke()
 bool CGCommand::DoExecuteInfo() 
 {
        std::wstringstream replyString;
-       replyString << TEXT("201 CG OK\r\n");
+       replyString << L"201 CG OK\r\n";
 
        if(parameters().size() > 1)
        {
                if(!ValidateLayer(parameters()[1]))
                {
-                       SetReplyString(TEXT("403 CG ERROR\r\n"));
+                       SetReplyString(L"403 CG ERROR\r\n");
                        return false;
                }
 
                int layer = boost::lexical_cast<int>(parameters()[1]);
                auto desc = flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(channel()), layer_index(flash::cg_proxy::DEFAULT_LAYER)).description(layer);
                
-               replyString << desc << TEXT("\r\n"); 
+               replyString << desc << L"\r\n";
        }
        else 
        {
                auto info = flash::create_cg_proxy(spl::shared_ptr<core::video_channel>(channel()), layer_index(flash::cg_proxy::DEFAULT_LAYER)).template_host_info();
-               replyString << info << TEXT("\r\n"); 
+               replyString << info << L"\r\n";
        }       
 
        SetReplyString(replyString.str());
@@ -1298,16 +1297,16 @@ bool CGCommand::DoExecuteInfo()
 bool DataCommand::DoExecute()
 {
        std::wstring command = boost::to_upper_copy(parameters()[0]);
-       if(command == TEXT("STORE"))
+       if(command == L"STORE")
                return DoExecuteStore();
-       else if(command == TEXT("RETRIEVE"))
+       else if(command == L"RETRIEVE")
                return DoExecuteRetrieve();
-       else if(command == TEXT("REMOVE"))
+       else if(command == L"REMOVE")
                return DoExecuteRemove();
-       else if(command == TEXT("LIST"))
+       else if(command == L"LIST")
                return DoExecuteList();
 
-       SetReplyString(TEXT("403 DATA ERROR\r\n"));
+       SetReplyString(L"403 DATA ERROR\r\n");
        return false;
 }
 
@@ -1315,13 +1314,13 @@ bool DataCommand::DoExecuteStore()
 {
        if(parameters().size() < 3) 
        {
-               SetReplyString(TEXT("402 DATA STORE ERROR\r\n"));
+               SetReplyString(L"402 DATA STORE ERROR\r\n");
                return false;
        }
 
        std::wstring filename = env::data_folder();
        filename.append(parameters()[1]);
-       filename.append(TEXT(".ftd"));
+       filename.append(L".ftd");
 
        auto data_path = boost::filesystem::wpath(
                boost::filesystem::wpath(filename).parent_path());
@@ -1329,10 +1328,10 @@ bool DataCommand::DoExecuteStore()
        if(!boost::filesystem::exists(data_path))
                boost::filesystem::create_directories(data_path);
 
-       std::wofstream datafile(filename.c_str());
+       boost::filesystem::wofstream datafile(filename);
        if(!datafile) 
        {
-               SetReplyString(TEXT("501 DATA STORE FAILED\r\n"));
+               SetReplyString(L"501 DATA STORE FAILED\r\n");
                return false;
        }
 
@@ -1340,7 +1339,7 @@ bool DataCommand::DoExecuteStore()
        datafile << parameters()[2] << std::flush;
        datafile.close();
 
-       std::wstring replyString = TEXT("202 DATA STORE OK\r\n");
+       std::wstring replyString = L"202 DATA STORE OK\r\n";
        SetReplyString(replyString);
        return true;
 }
@@ -1349,23 +1348,23 @@ bool DataCommand::DoExecuteRetrieve()
 {
        if(parameters().size() < 2) 
        {
-               SetReplyString(TEXT("402 DATA RETRIEVE ERROR\r\n"));
+               SetReplyString(L"402 DATA RETRIEVE ERROR\r\n");
                return false;
        }
 
        std::wstring filename = env::data_folder();
        filename.append(parameters()[1]);
-       filename.append(TEXT(".ftd"));
+       filename.append(L".ftd");
 
        std::wstring file_contents = read_file(boost::filesystem::wpath(filename));
 
        if (file_contents.empty()) 
        {
-               SetReplyString(TEXT("404 DATA RETRIEVE ERROR\r\n"));
+               SetReplyString(L"404 DATA RETRIEVE ERROR\r\n");
                return false;
        }
 
-       std::wstringstream reply(TEXT("201 DATA RETRIEVE OK\r\n"));
+       std::wstringstream reply(L"201 DATA RETRIEVE OK\r\n");
 
        std::wstringstream file_contents_stream(file_contents);
        std::wstring line;
@@ -1390,27 +1389,27 @@ bool DataCommand::DoExecuteRemove()
 { 
        if (parameters().size() < 2)
        {
-               SetReplyString(TEXT("402 DATA REMOVE ERROR\r\n"));
+               SetReplyString(L"402 DATA REMOVE ERROR\r\n");
                return false;
        }
 
        std::wstring filename = env::data_folder();
        filename.append(parameters()[1]);
-       filename.append(TEXT(".ftd"));
+       filename.append(L".ftd");
 
        if (!boost::filesystem::exists(filename))
        {
-               SetReplyString(TEXT("404 DATA REMOVE ERROR\r\n"));
+               SetReplyString(L"404 DATA REMOVE ERROR\r\n");
                return false;
        }
 
        if (!boost::filesystem::remove(filename))
        {
-               SetReplyString(TEXT("403 DATA REMOVE ERROR\r\n"));
+               SetReplyString(L"403 DATA REMOVE ERROR\r\n");
                return false;
        }
 
-       SetReplyString(TEXT("201 DATA REMOVE OK\r\n"));
+       SetReplyString(L"201 DATA REMOVE OK\r\n");
 
        return true;
 }
@@ -1418,7 +1417,7 @@ bool DataCommand::DoExecuteRemove()
 bool DataCommand::DoExecuteList() 
 {
        std::wstringstream replyString;
-       replyString << TEXT("200 DATA LIST OK\r\n");
+       replyString << L"200 DATA LIST OK\r\n";
 
        for (boost::filesystem::recursive_directory_iterator itr(env::data_folder()), end; itr != end; ++itr)
        {                       
@@ -1429,15 +1428,15 @@ bool DataCommand::DoExecuteList()
                        
                        auto relativePath = boost::filesystem::wpath(itr->path().wstring().substr(env::data_folder().size()-1, itr->path().wstring().size()));
                        
-                       auto str = relativePath.replace_extension(TEXT("")).native();
-                       if(str[0] == '\\' || str[0] == '/')
+                       auto str = relativePath.replace_extension(L"").generic_wstring();
+                       if(str[0] == L'\\' || str[0] == L'/')
                                str = std::wstring(str.begin() + 1, str.end());
 
-                       replyString << str << TEXT("\r\n");     
+                       replyString << str << L"\r\n";
                }
        }
        
-       replyString << TEXT("\r\n");
+       replyString << L"\r\n";
 
        SetReplyString(boost::to_upper_copy(replyString.str()));
        return true;
@@ -1460,16 +1459,16 @@ bool CinfCommand::DoExecute()
 
                if(info.empty())
                {
-                       SetReplyString(TEXT("404 CINF ERROR\r\n"));
+                       SetReplyString(L"404 CINF ERROR\r\n");
                        return false;
                }
-               replyString << TEXT("200 CINF OK\r\n");
+               replyString << L"200 CINF OK\r\n";
                replyString << info << "\r\n";
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("404 CINF ERROR\r\n"));
+               SetReplyString(L"404 CINF ERROR\r\n");
                return false;
        }
        
@@ -1479,7 +1478,7 @@ bool CinfCommand::DoExecute()
 
 void GenerateChannelInfo(int index, const spl::shared_ptr<core::video_channel>& pChannel, std::wstringstream& replyString)
 {
-       replyString << index+1 << TEXT(" ") << pChannel->video_format_desc().name << TEXT(" PLAYING") << TEXT("\r\n");
+       replyString << index+1 << L" " << pChannel->video_format_desc().name << L" PLAYING\r\n";
 }
 
 bool InfoCommand::DoExecute()
@@ -1538,7 +1537,6 @@ bool InfoCommand::DoExecute()
                                info.add(L"system.bluefish.device", device);
                                
                        info.add(L"system.flash",                                       caspar::flash::version());
-                       //info.add(L"system.free-image",                                caspar::image::version());
                        info.add(L"system.ffmpeg.avcodec",                      caspar::ffmpeg::avcodec_version());
                        info.add(L"system.ffmpeg.avformat",                     caspar::ffmpeg::avformat_version());
                        info.add(L"system.ffmpeg.avfilter",                     caspar::ffmpeg::avfilter_version());
@@ -1564,7 +1562,7 @@ bool InfoCommand::DoExecute()
                {                       
                        if(parameters().size() >= 1)
                        {
-                               replyString << TEXT("201 INFO OK\r\n");
+                               replyString << L"201 INFO OK\r\n";
                                boost::property_tree::wptree info;
 
                                std::vector<std::wstring> split;
@@ -1601,7 +1599,7 @@ bool InfoCommand::DoExecute()
                        else
                        {
                                // This is needed for backwards compatibility with old clients
-                               replyString << TEXT("200 INFO OK\r\n");
+                               replyString << L"200 INFO OK\r\n";
                                for(size_t n = 0; n < channels().size(); ++n)
                                        GenerateChannelInfo(n, channels()[n].channel, replyString);
                        }
@@ -1611,11 +1609,11 @@ bool InfoCommand::DoExecute()
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("403 INFO ERROR\r\n"));
+               SetReplyString(L"403 INFO ERROR\r\n");
                return false;
        }
 
-       replyString << TEXT("\r\n");
+       replyString << L"\r\n";
        SetReplyString(replyString.str());
        return true;
 }
@@ -1633,15 +1631,15 @@ bool ClsCommand::DoExecute()
        try
        {
                std::wstringstream replyString;
-               replyString << TEXT("200 CLS OK\r\n");
+               replyString << L"200 CLS OK\r\n";
                replyString << ListMedia();
-               replyString << TEXT("\r\n");
+               replyString << L"\r\n";
                SetReplyString(boost::to_upper_copy(replyString.str()));
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("501 CLS FAILED\r\n"));
+               SetReplyString(L"501 CLS FAILED\r\n");
                return false;
        }
 
@@ -1653,17 +1651,17 @@ bool TlsCommand::DoExecute()
        try
        {
                std::wstringstream replyString;
-               replyString << TEXT("200 TLS OK\r\n");
+               replyString << L"200 TLS OK\r\n";
 
                replyString << ListTemplates();
-               replyString << TEXT("\r\n");
+               replyString << L"\r\n";
 
                SetReplyString(replyString.str());
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("501 TLS FAILED\r\n"));
+               SetReplyString(L"501 TLS FAILED\r\n");
                return false;
        }
        return true;
@@ -1671,16 +1669,16 @@ bool TlsCommand::DoExecute()
 
 bool VersionCommand::DoExecute()
 {
-       std::wstring replyString = TEXT("201 VERSION OK\r\n") + env::version() + TEXT("\r\n");
+       std::wstring replyString = L"201 VERSION OK\r\n" + env::version() + L"\r\n";
 
        if(parameters().size() > 0)
        {
                if(boost::iequals(parameters()[0], L"FLASH"))
-                       replyString = TEXT("201 VERSION OK\r\n") + flash::version() + TEXT("\r\n");
+                       replyString = L"201 VERSION OK\r\n" + flash::version() + L"\r\n";
                else if(boost::iequals(parameters()[0], L"TEMPLATEHOST"))
-                       replyString = TEXT("201 VERSION OK\r\n") + flash::cg_version() + TEXT("\r\n");
+                       replyString = L"201 VERSION OK\r\n" + flash::cg_version() + L"\r\n";
                else if(!boost::iequals(parameters()[0], L"SERVER"))
-                       replyString = TEXT("403 VERSION ERROR\r\n");
+                       replyString = L"403 VERSION ERROR\r\n";
        }
 
        SetReplyString(replyString);
@@ -1700,26 +1698,26 @@ bool SetCommand::DoExecute()
                std::wstring name = boost::to_upper_copy(parameters()[0]);
                std::wstring value = boost::to_upper_copy(parameters()[1]);
 
-               if(name == TEXT("MODE"))
+               if(name == L"MODE")
                {
                        auto format_desc = core::video_format_desc(value);
                        if(format_desc.format != core::video_format::invalid)
                        {
                                channel()->video_format_desc(format_desc);
-                               SetReplyString(TEXT("202 SET MODE OK\r\n"));
+                               SetReplyString(L"202 SET MODE OK\r\n");
                        }
                        else
-                               SetReplyString(TEXT("501 SET MODE FAILED\r\n"));
+                               SetReplyString(L"501 SET MODE FAILED\r\n");
                }
                else
                {
-                       this->SetReplyString(TEXT("403 SET ERROR\r\n"));
+                       this->SetReplyString(L"403 SET ERROR\r\n");
                }
        }
        catch(...)
        {
                CASPAR_LOG_CURRENT_EXCEPTION();
-               SetReplyString(TEXT("501 SET FAILED\r\n"));
+               SetReplyString(L"501 SET FAILED\r\n");
                return false;
        }
 
@@ -1856,16 +1854,16 @@ bool ThumbnailCommand::DoExecute()
 {
        std::wstring command = boost::to_upper_copy(parameters()[0]);
 
-       if (command == TEXT("RETRIEVE"))
+       if (command == L"RETRIEVE")
                return DoExecuteRetrieve();
-       else if (command == TEXT("LIST"))
+       else if (command == L"LIST")
                return DoExecuteList();
-       else if (command == TEXT("GENERATE"))
+       else if (command == L"GENERATE")
                return DoExecuteGenerate();
-       else if (command == TEXT("GENERATE_ALL"))
+       else if (command == L"GENERATE_ALL")
                return DoExecuteGenerateAll();
 
-       SetReplyString(TEXT("403 THUMBNAIL ERROR\r\n"));
+       SetReplyString(L"403 THUMBNAIL ERROR\r\n");
        return false;
 }
 
@@ -1873,19 +1871,19 @@ bool ThumbnailCommand::DoExecuteRetrieve()
 {
        if(parameters().size() < 2) 
        {
-               SetReplyString(TEXT("402 THUMBNAIL RETRIEVE ERROR\r\n"));
+               SetReplyString(L"402 THUMBNAIL RETRIEVE ERROR\r\n");
                return false;
        }
 
        std::wstring filename = env::thumbnails_folder();
        filename.append(parameters()[1]);
-       filename.append(TEXT(".png"));
+       filename.append(L".png");
 
        std::wstring file_contents = read_file_base64(boost::filesystem::wpath(filename));
 
        if (file_contents.empty())
        {
-               SetReplyString(TEXT("404 THUMBNAIL RETRIEVE ERROR\r\n"));
+               SetReplyString(L"404 THUMBNAIL RETRIEVE ERROR\r\n");
                return false;
        }
 
@@ -1901,7 +1899,7 @@ bool ThumbnailCommand::DoExecuteRetrieve()
 bool ThumbnailCommand::DoExecuteList()
 {
        std::wstringstream replyString;
-       replyString << TEXT("200 THUMBNAIL LIST OK\r\n");
+       replyString << L"200 THUMBNAIL LIST OK\r\n";
 
        for (boost::filesystem::recursive_directory_iterator itr(env::thumbnails_folder()), end; itr != end; ++itr)
        {      
@@ -1912,7 +1910,7 @@ bool ThumbnailCommand::DoExecuteList()
 
                        auto relativePath = boost::filesystem::wpath(itr->path().wstring().substr(env::thumbnails_folder().size()-1, itr->path().wstring().size()));
 
-                       auto str = relativePath.replace_extension(L"").native();
+                       auto str = relativePath.replace_extension(L"").generic_wstring();
                        if(str[0] == '\\' || str[0] == '/')
                                str = std::wstring(str.begin() + 1, str.end());
 
@@ -1924,7 +1922,7 @@ bool ThumbnailCommand::DoExecuteList()
                }
        }
 
-       replyString << TEXT("\r\n");
+       replyString << L"\r\n";
 
        SetReplyString(boost::to_upper_copy(replyString.str()));
        return true;
@@ -1969,14 +1967,14 @@ bool ThumbnailCommand::DoExecuteGenerateAll()
 bool KillCommand::DoExecute()
 {
        shutdown_server_now_->set_value(false); //false for not attempting to restart
-       SetReplyString(TEXT("202 KILL OK\r\n"));
+       SetReplyString(L"202 KILL OK\r\n");
        return true;
 }
 
 bool RestartCommand::DoExecute()
 {
        shutdown_server_now_->set_value(true);  //true for attempting to restart
-       SetReplyString(TEXT("202 RESTART OK\r\n"));
+       SetReplyString(L"202 RESTART OK\r\n");
        return true;
 }
 
index 1495402dd7a5fd1db2b2b7d698d8469b155b7e55..74f451df4a51bdac1767eecb0efe9badb1f2b661 100644 (file)
@@ -29,7 +29,7 @@
 #include "AMCPCommandQueue.h"
 
 #include <stdio.h>
-#include <crtdbg.h>
+//#include <crtdbg.h>
 #include <string.h>
 #include <algorithm>
 #include <cctype>
@@ -162,7 +162,7 @@ private:
                                switch(state)
                                {
                                case parser_state::New:
-                                       if((*it)[0] == TEXT('/'))
+                                       if((*it)[0] == L'/')
                                                state = parser_state::GetSwitch;
                                        else
                                                state = parser_state::GetCommand;
@@ -288,14 +288,14 @@ private:
                                //insert code-handling here
                                switch(message[charIndex])
                                {
-                               case TEXT('\\'):
-                                       currentToken += TEXT("\\");
+                               case L'\\':
+                                       currentToken += L"\\";
                                        break;
-                               case TEXT('\"'):
-                                       currentToken += TEXT("\"");
+                               case L'\"':
+                                       currentToken += L"\"";
                                        break;
-                               case TEXT('n'):
-                                       currentToken += TEXT("\n");
+                               case L'n':
+                                       currentToken += L"\n";
                                        break;
                                default:
                                        break;
@@ -304,13 +304,13 @@ private:
                                continue;
                        }
 
-                       if(message[charIndex]==TEXT('\\'))
+                       if(message[charIndex]==L'\\')
                        {
                                getSpecialCode = true;
                                continue;
                        }
 
-                       if(message[charIndex]==' ' && inQuote==false)
+                       if(message[charIndex]==L' ' && inQuote==false)
                        {
                                if(currentToken.size()>0)
                                {
@@ -320,7 +320,7 @@ private:
                                continue;
                        }
 
-                       if(message[charIndex]==TEXT('\"'))
+                       if(message[charIndex]==L'\"')
                        {
                                inQuote = !inQuote;
 
@@ -347,20 +347,20 @@ private:
        AMCPCommand::ptr_type create_command(const std::wstring& str, ClientInfoPtr client)
        {
                std::wstring s = boost::to_upper_copy(str);
-               if(s == TEXT("DIAG"))                           return std::make_shared<DiagnosticsCommand>(client);
-               else if(s == TEXT("CHANNEL_GRID"))      return std::make_shared<ChannelGridCommand>(client, channels_);
-               else if(s == TEXT("DATA"))                      return std::make_shared<DataCommand>(client);
-               else if(s == TEXT("CINF"))                      return std::make_shared<CinfCommand>(client);
-               else if(s == TEXT("INFO"))                      return std::make_shared<InfoCommand>(client, channels_);
-               else if(s == TEXT("CLS"))                       return std::make_shared<ClsCommand>(client);
-               else if(s == TEXT("TLS"))                       return std::make_shared<TlsCommand>(client);
-               else if(s == TEXT("VERSION"))           return std::make_shared<VersionCommand>(client);
-               else if(s == TEXT("BYE"))                       return std::make_shared<ByeCommand>(client);
-               else if(s == TEXT("LOCK"))                      return std::make_shared<LockCommand>(client, channels_);
-               else if(s == TEXT("LOG"))                       return std::make_shared<LogCommand>(client);
-               else if(s == TEXT("THUMBNAIL"))         return std::make_shared<ThumbnailCommand>(client, thumb_gen_);
-               else if(s == TEXT("KILL"))                      return std::make_shared<KillCommand>(client, shutdown_server_now_);
-               else if(s == TEXT("RESTART"))           return std::make_shared<RestartCommand>(client, shutdown_server_now_);
+               if(s == L"DIAG")                                return std::make_shared<DiagnosticsCommand>(client);
+               else if(s == L"CHANNEL_GRID")   return std::make_shared<ChannelGridCommand>(client, channels_);
+               else if(s == L"DATA")                   return std::make_shared<DataCommand>(client);
+               else if(s == L"CINF")                   return std::make_shared<CinfCommand>(client);
+               else if(s == L"INFO")                   return std::make_shared<InfoCommand>(client, channels_);
+               else if(s == L"CLS")                    return std::make_shared<ClsCommand>(client);
+               else if(s == L"TLS")                    return std::make_shared<TlsCommand>(client);
+               else if(s == L"VERSION")                return std::make_shared<VersionCommand>(client);
+               else if(s == L"BYE")                    return std::make_shared<ByeCommand>(client);
+               else if(s == L"LOCK")                   return std::make_shared<LockCommand>(client, channels_);
+               else if(s == L"LOG")                    return std::make_shared<LogCommand>(client);
+               else if(s == L"THUMBNAIL")              return std::make_shared<ThumbnailCommand>(client, thumb_gen_);
+               else if(s == L"KILL")                   return std::make_shared<KillCommand>(client, shutdown_server_now_);
+               else if(s == L"RESTART")                return std::make_shared<RestartCommand>(client, shutdown_server_now_);
 
                return nullptr;
        }
@@ -369,20 +369,20 @@ private:
        {
                std::wstring s = boost::to_upper_copy(str);
        
-               if         (s == TEXT("MIXER"))                 return std::make_shared<MixerCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("CALL"))                      return std::make_shared<CallCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("SWAP"))                      return std::make_shared<SwapCommand>(client, channel, channel_index, layer_index, channels_);
-               else if(s == TEXT("LOAD"))                      return std::make_shared<LoadCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("LOADBG"))            return std::make_shared<LoadbgCommand>(client, channel, channel_index, layer_index, channels_);
-               else if(s == TEXT("ADD"))                       return std::make_shared<AddCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("REMOVE"))            return std::make_shared<RemoveCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("PAUSE"))                     return std::make_shared<PauseCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("PLAY"))                      return std::make_shared<PlayCommand>(client, channel, channel_index, layer_index, channels_);
-               else if(s == TEXT("STOP"))                      return std::make_shared<StopCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("CLEAR"))                     return std::make_shared<ClearCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("PRINT"))                     return std::make_shared<PrintCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("CG"))                        return std::make_shared<CGCommand>(client, channel, channel_index, layer_index);
-               else if(s == TEXT("SET"))                       return std::make_shared<SetCommand>(client, channel, channel_index, layer_index);
+               if         (s == L"MIXER")                      return std::make_shared<MixerCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"CALL")                   return std::make_shared<CallCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"SWAP")                   return std::make_shared<SwapCommand>(client, channel, channel_index, layer_index, channels_);
+               else if(s == L"LOAD")                   return std::make_shared<LoadCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"LOADBG")                 return std::make_shared<LoadbgCommand>(client, channel, channel_index, layer_index, channels_);
+               else if(s == L"ADD")                    return std::make_shared<AddCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"REMOVE")                 return std::make_shared<RemoveCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"PAUSE")                  return std::make_shared<PauseCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"PLAY")                   return std::make_shared<PlayCommand>(client, channel, channel_index, layer_index, channels_);
+               else if(s == L"STOP")                   return std::make_shared<StopCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"CLEAR")                  return std::make_shared<ClearCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"PRINT")                  return std::make_shared<PrintCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"CG")                             return std::make_shared<CGCommand>(client, channel, channel_index, layer_index);
+               else if(s == L"SET")                    return std::make_shared<SetCommand>(client, channel, channel_index, layer_index);
 
                return nullptr;
        }
@@ -395,4 +395,4 @@ void AMCPProtocolStrategy::Parse(const std::wstring& msg, IO::ClientInfoPtr pCli
 
 
 }      //namespace amcp
-}}     //namespace caspar
\ No newline at end of file
+}}     //namespace caspar
index b474369c87ec7d4598a270eb7b0120f5bdfb14fb..fe6f0f91e2438acf12ca2159911f9e8d593a1901 100644 (file)
@@ -21,7 +21,7 @@
 
 #pragma once
 
-#include "../util/protocolstrategy.h"
+#include "../util/ProtocolStrategy.h"
 
 #include <core/video_channel.h>
 #include <core/thumbnail_generator.h>
index 5df1e2813c81744ad29f9c863b7f6a46ac61235f..9be946c75cf7a91fa46088901ded7bf588bc9a3a 100644 (file)
@@ -22,6 +22,8 @@
  
 #pragma once
 
+#include <memory>
+
 namespace caspar { namespace protocol {
 namespace cii {
 
@@ -34,7 +36,7 @@ public:
 
        virtual void Execute() = 0;
 };
-typedef std::tr1::shared_ptr<ICIICommand> CIICommandPtr;
+typedef std::shared_ptr<ICIICommand> CIICommandPtr;
 
 }      //namespace cii
-}}     //namespace caspar
\ No newline at end of file
+}}     //namespace caspar
index 2da5f50d26a46a8980f0eed4ad4930b7fa702c36..fa41bb06e385f23fd10dec8ed6fb1168346a615e 100644 (file)
@@ -62,13 +62,13 @@ void WriteCommand::Setup(const std::vector<std::wstring>& parameters)
 
                        std::wstringstream dataStream;
 
-                       dataStream << TEXT("<templateData>");
+                       dataStream << L"<templateData>";
 
                        std::vector<std::wstring>::size_type end = parameters.size();
                        for(std::vector<std::wstring>::size_type i = 3; i < end; ++i) 
-                               dataStream << TEXT("<componentData id=\"field") << i-2 << TEXT("\"><data id=\"text\" value=\"") << parameters[i] << TEXT("\" /></componentData>"); 
+                               dataStream << L"<componentData id=\"field" << i-2 << L"\"><data id=\"text\" value=\"" << parameters[i] << L"\" /></componentData>";
 
-                       dataStream << TEXT("</templateData>");
+                       dataStream << L"</templateData>";
                        xmlData_ = dataStream.str();
                }
        }
@@ -86,7 +86,7 @@ void WriteCommand::Execute()
 // ImagestoreCommand
 void ImagestoreCommand::Setup(const std::vector<std::wstring>& parameters) 
 {
-       if(parameters[1] == TEXT("7") && parameters.size() > 2) 
+       if(parameters[1] == L"7" && parameters.size() > 2)
                titleName_ = parameters[2].substr(0, 4);        
 }
 
@@ -102,10 +102,10 @@ void MiscellaneousCommand::Setup(const std::vector<std::wstring>& parameters)
 {
        //HAWRYS:       V\5\3\1\1\namn.tga\1
        //                      Display still
-       if((parameters.size() > 5) && parameters[1] == TEXT("5") && parameters[2] == TEXT("3"))
+       if((parameters.size() > 5) && parameters[1] == L"5" && parameters[2] == L"3")
        {
                filename_ = parameters[5];
-               filename_ = filename_.substr(0, filename_.find_last_of(TEXT('.')));
+               filename_ = filename_.substr(0, filename_.find_last_of(L'.'));
                filename_.append(L".ft");
                state_ = 0;
                return;
@@ -113,9 +113,9 @@ void MiscellaneousCommand::Setup(const std::vector<std::wstring>& parameters)
        
        //NEPTUNE:      V\5\13\1\X\Template\0\TabField1\TabField2...
        //                      Add Template to layer X in the active templatehost
-       if((parameters.size() > 5) && parameters[1] == TEXT("5") && parameters[2] == TEXT("13"))
+       if((parameters.size() > 5) && parameters[1] == L"5" && parameters[2] == L"13")
        {
-               layer_ = _ttoi(parameters[4].c_str());
+               layer_ = boost::lexical_cast<int>(parameters[4]);
                filename_ = parameters[5];
                if(filename_.find(L"PK/") == std::wstring::npos && filename_.find(L"PK\\") == std::wstring::npos)
                        filename_ = L"PK/" + filename_;
@@ -124,19 +124,19 @@ void MiscellaneousCommand::Setup(const std::vector<std::wstring>& parameters)
                if(parameters.size() > 7) {
                        std::wstringstream dataStream;
 
-                       dataStream << TEXT("<templateData>");
+                       dataStream << L"<templateData>";
                        std::vector<std::wstring>::size_type end = parameters.size();
                        for(std::vector<std::wstring>::size_type i = 7; i < end; ++i) {
-                               dataStream << TEXT("<componentData id=\"f") << i-7 << TEXT("\"><data id=\"text\" value=\"") << parameters[i] << TEXT("\" /></componentData>"); 
+                               dataStream << L"<componentData id=\"f" << i-7 << L"\"><data id=\"text\" value=\"" << parameters[i] << L"\" /></componentData>";
                        }
-                       dataStream << TEXT("</templateData>");
+                       dataStream << L"</templateData>";
 
                        xmlData_ = dataStream.str();
                }
        }
 
        // VIDEO MODE V\5\14\MODE
-       if((parameters.size() > 3) && parameters[1] == TEXT("5") && parameters[2] == TEXT("14"))
+       if((parameters.size() > 3) && parameters[1] == L"5" && parameters[2] == L"14")
        {
                std::wstring value = parameters[3];
                std::transform(value.begin(), value.end(), value.begin(), toupper);
@@ -155,7 +155,7 @@ void MiscellaneousCommand::Execute()
        {
                // HACK fix. The data sent is UTF8, however the protocol is implemented for ISO-8859-1. Instead of doing risky changes we simply convert into proper encoding when leaving protocol code.
                auto xmlData2 = boost::locale::conv::utf_to_utf<wchar_t, char>(std::string(xmlData_.begin(), xmlData_.end()));
-               flash::create_cg_proxy(pCIIStrategy_->GetChannel()).add(layer_, filename_, false, TEXT(""), xmlData2);
+               flash::create_cg_proxy(pCIIStrategy_->GetChannel()).add(layer_, filename_, false, L"", xmlData2);
        }
 }
 
@@ -186,7 +186,7 @@ void KeydataCommand::Setup(const std::vector<std::wstring>& parameters) {
                for(int i=0;i<4;++i)
                {
                        if(parameters[1][i+3] < 176) {
-                               titleName_ = TEXT("");
+                               titleName_ = L"";
                                break;
                        }
                        titleName_[i] = parameters[1][i+3]-144;
@@ -228,4 +228,4 @@ void KeydataCommand::Setup(const std::vector<std::wstring>& parameters) {
                
 }
 
-}}}
\ No newline at end of file
+}}}
index 6d51a08e95a983dff4792bf3d4de0f3604472eff..880e46967558eb71473f9983d475256ef21e2186 100644 (file)
@@ -22,7 +22,7 @@
  
 #pragma once
 
-#include "ciicommand.h"
+#include "CIICommand.h"
 
 namespace caspar { namespace protocol {
 
@@ -134,4 +134,4 @@ private:
 };
 
 }      //namespace cii
-}}     //namespace caspar
\ No newline at end of file
+}}     //namespace caspar
index 83ade84c7b1935c01017a8cc2b3d4db93741be41..b134e3935391da17b5a0af64490448bec6a2b821 100644 (file)
@@ -26,7 +26,7 @@
 #include <sstream>
 #include <algorithm>
 #include "CIIProtocolStrategy.h"
-#include "CIICommandsimpl.h"
+#include "CIICommandsImpl.h"
 #include <modules/flash/producer/flash_producer.h>
 #include <core/producer/transition/transition_producer.h>
 #include <core/mixer/mixer.h>
@@ -86,16 +86,16 @@ int CIIProtocolStrategy::TokenizeMessage(const std::wstring& message, std::vecto
                if(message[charIndex] == TokenDelimiter) 
                {
                        pTokenVector->push_back(currentToken.str());
-                       currentToken.str(TEXT(""));
+                       currentToken.str(L"");
                        continue;
                }
 
-               if(message[charIndex] == TEXT('\"')) 
-                       currentToken << TEXT("&quot;");         
-               else if(message[charIndex] == TEXT('<')) 
-                       currentToken << TEXT("&lt;");           
-               else if(message[charIndex] == TEXT('>')) 
-                       currentToken << TEXT("&gt;");           
+               if(message[charIndex] == L'\"')
+                       currentToken << L"&quot;";
+               else if(message[charIndex] == L'<')
+                       currentToken << L"&lt;";
+               else if(message[charIndex] == L'>')
+                       currentToken << L"&gt;";
                else 
                        currentToken << message[charIndex];
        }
@@ -109,39 +109,39 @@ int CIIProtocolStrategy::TokenizeMessage(const std::wstring& message, std::vecto
 /************
 // Examples (<X> = ASCIICHAR X)
 
-I\25\3\VII\\                                                                   sätter outputtype till 'vii'
+I\25\3\VII\\                                                                   stter outputtype till 'vii'
 I\25\4\1\\                                                                             enablar framebuffer (ignore this)
 
-M\C/SVTNEWS\\                                                                  pekar ut vilken grafisk profil som skall användas
+M\C/SVTNEWS\\                                                                  pekar ut vilken grafisk profil som skall anvndas
 
-W\4009\4067\Jonas Björkman\\                                   Skriver "Jonas Björkman" till första textfältet i template 4067 och sparar den färdiga skylten som 4009
+W\4009\4067\Jonas Bj�rkman\\                                 Skriver "Jonas Bj�rkman" till f�rsta textf�ltet i template 4067 och sparar den f�rdiga skylten som 4009
 
-T\7\4009.VII\A\\                                                               lägger ut skylt 4009
+T\7\4009.VII\A\\                                                               lgger ut skylt 4009
 
-Y\<205><247><202><196><192><192><200><248>\\   lägger ut skylten 4008 (<205><247><202><196><192><192><200><248> = "=g:4008h" om man drar bort 144 från varje asciivärde)
+Y\<205><247><202><196><192><192><200><248>\\   l�gger ut skylten 4008 (<205><247><202><196><192><192><200><248> = "=g:4008h" om man drar bort 144 fr�n varje asciiv�rde)
 
-V\5\3\1\1\namn.tga\1\\                                                 lägger ut bilden namn.tga
-V\0\1\D\C\10\0\0\0\\                                                   gör någon inställning som har med föregående kommando att göra.
+V\5\3\1\1\namn.tga\1\\                                                 lgger ut bilden namn.tga
+V\0\1\D\C\10\0\0\0\\                                                   g�r n�gon inst�llning som har med f�reg�ende kommando att g�ra.
 
 *************/
 
 /**********************
 New Commands to support the Netupe automation system
-V\5\13\1\1\Template\0\TabField1\TabField2...\\         Build. Ettan före Template indikerar vilket lager den nya templaten skall laddas in i. OBS. Skall inte visas efter det här steget
-Y\<27>\\                                                                                       Stop. Här kommer ett lagerID också att skickas med (<27> = ESC)
-Y\<254>\\                                                                                      Clear Canvas. Här kommer ett lagerID också att skickas med, utan det skall allt tömmas
-Y\<213><243>\\                                                                         Play. Här kommer ett lagerID också att skickas med
+V\5\13\1\1\Template\0\TabField1\TabField2...\\         Build. Ettan f�re Template indikerar vilket lager den nya templaten skall laddas in i. OBS. Skall inte visas efter det h�r steget
+Y\<27>\\                                                                                       Stop. H�r kommer ett lagerID ocks� att skickas med (<27> = ESC)
+Y\<254>\\                                                                                      Clear Canvas. H�r kommer ett lagerID ocks� att skickas med, utan det skall allt t�mmas
+Y\<213><243>\\                                                                         Play. H�r kommer ett lagerID ocks� att skickas med
 
 **********************/
 CIICommandPtr CIIProtocolStrategy::Create(const std::wstring& name)
 {
        switch(name[0])
        {
-               case TEXT('M'): return std::make_shared<MediaCommand>(this);
-               case TEXT('W'): return std::make_shared<WriteCommand>(this);
-               case TEXT('T'): return std::make_shared<ImagestoreCommand>(this);
-               case TEXT('V'): return std::make_shared<MiscellaneousCommand>(this);
-               case TEXT('Y'): return std::make_shared<KeydataCommand>(this);
+               case L'M': return std::make_shared<MediaCommand>(this);
+               case L'W': return std::make_shared<WriteCommand>(this);
+               case L'T': return std::make_shared<ImagestoreCommand>(this);
+               case L'V': return std::make_shared<MiscellaneousCommand>(this);
+               case L'Y': return std::make_shared<KeydataCommand>(this);
                default:                return nullptr;
        }
 }
@@ -152,28 +152,28 @@ void CIIProtocolStrategy::WriteTemplateData(const std::wstring& templateName, co
        if(currentProfile_.size() > 0)
        {
                fullTemplateFilename += currentProfile_;
-               fullTemplateFilename += TEXT("\\");
+               fullTemplateFilename += L"\\";
        }
        fullTemplateFilename += templateName;
        fullTemplateFilename = flash::find_template(fullTemplateFilename);
        if(fullTemplateFilename.empty())
        {
-               CASPAR_LOG(error) << "Failed to save instance of " << templateName << TEXT(" as ") << titleName << TEXT(", template ") << fullTemplateFilename << " not found";
+               CASPAR_LOG(error) << "Failed to save instance of " << templateName << L" as " << titleName << L", template " << fullTemplateFilename << " not found";
                return;
        }
        core::diagnostics::scoped_call_context save;
        core::diagnostics::call_context::for_thread().video_channel = 1;
        core::diagnostics::call_context::for_thread().layer = 0;
 
-       auto producer = flash::create_producer(this->GetChannel()->frame_factory(), this->GetChannel()->video_format_desc(), { env::template_folder() + TEXT("CG.fth") });
+       auto producer = flash::create_producer(this->GetChannel()->frame_factory(), this->GetChannel()->video_format_desc(), { env::template_folder() + L"CG.fth" });
 
        std::wstringstream flashParam;
-       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>");
+       flashParam << L"<invoke name=\"Add\" returntype=\"xml\"><arguments><number>1</number><string>" << currentProfile_ << '/' <<  templateName << L"</string><number>0</number><true/><string> </string><string><![CDATA[ " << xmlData << L" ]]></string></arguments></invoke>";
        std::vector<std::wstring> params;
        params.push_back(flashParam.str());
        producer->call(std::move(params));
 
-       CASPAR_LOG(info) << "Saved an instance of " << templateName << TEXT(" as ") << titleName ;
+       CASPAR_LOG(info) << "Saved an instance of " << templateName << L" as " << titleName ;
 
        PutPreparedTemplate(titleName, spl::shared_ptr<core::frame_producer>(std::move(producer)));
        
@@ -238,7 +238,7 @@ spl::shared_ptr<core::frame_producer> CIIProtocolStrategy::GetPreparedTemplate(c
        return result;
 }
 
-void CIIProtocolStrategy::PutPreparedTemplate(const std::wstring& titleName, spl::shared_ptr<core::frame_producer>& pFP)
+void CIIProtocolStrategy::PutPreparedTemplate(const std::wstring& titleName, const spl::shared_ptr<core::frame_producer>& pFP)
 {
        CASPAR_LOG(debug) << L"Saved title with name " << titleName;
 
index 1afbefaf87dca08ff60ce2b80eda70bb945e07f4..079a9963c80560a0ac18f2153106e408d6ae6cc0 100644 (file)
@@ -78,7 +78,7 @@ private:
        typedef std::list<TitleHolder> TitleList;
        TitleList titles_;
        spl::shared_ptr<core::frame_producer> GetPreparedTemplate(const std::wstring& name);
-       void PutPreparedTemplate(const std::wstring& name, spl::shared_ptr<core::frame_producer>& pframe_producer);
+       void PutPreparedTemplate(const std::wstring& name, const spl::shared_ptr<core::frame_producer>& pframe_producer);
 
        static const wchar_t TokenDelimiter;
        static const std::wstring MessageDelimiter;
@@ -94,4 +94,4 @@ private:
        spl::shared_ptr<core::video_channel> pChannel_;
 };
 
-}}}
\ No newline at end of file
+}}}
index 37f050a0c2bd70ee613441d49f37b4b3e4dffb40..59739f8ae82f104760ca2938375b33ab01b4be3b 100644 (file)
@@ -20,7 +20,7 @@
 */
 
  
-#include "..\stdafx.h"
+#include "../StdAfx.h"
 
 #include "CLKProtocolStrategy.h"
 #include "clk_commands.h"
index d614a6ae10e4c3623336e61d7e153cdc3ae19c8c..f02e1081977b6d58f0c0913eb11c2a61d2abc1e2 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se\r
 */\r
 \r
-#include "../stdafx.h"\r
+#include "../StdAfx.h"\r
 \r
 #include "clk_command_processor.h"\r
 \r
index 75209288d9508c4eb787fdaf1aa3aac4d91c59d2..dc3b6bee3f7b34b0b5a8386e447b89a577ab1d43 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se\r
 */\r
 \r
-#include "../stdafx.h"\r
+#include "../StdAfx.h"\r
 \r
 #include <stdexcept>\r
 #include <sstream>\r
index 61e577f85723933f5b1a6ac97fb8426920d8ad23..67fe61372ff29ee3e8007317d7513d9f0b5591dc 100644 (file)
@@ -20,7 +20,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se
 */
 
-#include "../stdafx.h"
+#include "../StdAfx.h"
 
 #include "client.h"
 
index 762599f564627c8cd5d1b655123b00659a13485f..efca0e3f838585d0b98817e1152485d5c7ffbac9 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Robert Nagy, ronag89@gmail.com
 */
 
-#include "..\stdafx.h"
+#include "../StdAfx.h"
 
 #include "AsyncEventServer.h"
 
@@ -34,9 +34,9 @@
 #include <boost/thread.hpp>
 #include <boost/lexical_cast.hpp>
 
-#include <tbb\mutex.h>
-#include <tbb\concurrent_hash_map.h>
-#include <tbb\concurrent_queue.h>
+#include <tbb/mutex.h>
+#include <tbb/concurrent_hash_map.h>
+#include <tbb/concurrent_queue.h>
 
 using boost::asio::ip::tcp;
 
@@ -349,4 +349,4 @@ AsyncEventServer::AsyncEventServer(
 AsyncEventServer::~AsyncEventServer() {}
 void AsyncEventServer::add_client_lifecycle_object_factory(const lifecycle_factory_t& factory) { impl_->add_client_lifecycle_object_factory(factory); }
 
-}}
\ No newline at end of file
+}}
index 504b1c14b4db21494c2d8e692c832dd6ba2de080..c5b0c84bd5b7664ecc3eb4fe266e47d803a88e7b 100644 (file)
@@ -1,4 +1,4 @@
-#include "..\StdAfx.h"
+#include "../StdAfx.h"
 
 #include <tbb/spin_rw_mutex.h>
 #include "lock_container.h"
index 70b637f2e007db99c00be89fbac416af8247d90c..086d9a15508a859df8de05330b155d476050cb57 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se\r
 */\r
 \r
-#include "../stdafx.h"\r
+#include "../StdAfx.h"\r
 \r
 #include "strategy_adapters.h"\r
 \r
index 5483c8eda70a1ad6a03db7c7dfb650546561a1b7..22aad3d6f3405f006bffa750683e34d8a322761b 100644 (file)
@@ -61,11 +61,11 @@ class delimiter_based_chunking_strategy : public protocol_strategy<CharT>
 {\r
        std::basic_string<CharT> delimiter_;\r
        std::basic_string<CharT> input_;\r
-       protocol_strategy<CharT>::ptr strategy_;\r
+       typename protocol_strategy<CharT>::ptr strategy_;\r
 public:\r
        delimiter_based_chunking_strategy(\r
                        const std::basic_string<CharT>& delimiter, \r
-                       const protocol_strategy<CharT>::ptr& strategy)\r
+                       const typename protocol_strategy<CharT>::ptr& strategy)\r
                : delimiter_(delimiter)\r
                , strategy_(strategy)\r
        {\r
@@ -93,11 +93,11 @@ class delimiter_based_chunking_strategy_factory
        : public protocol_strategy_factory<CharT>\r
 {\r
        std::basic_string<CharT> delimiter_;\r
-       protocol_strategy_factory<CharT>::ptr strategy_factory_;\r
+       typename protocol_strategy_factory<CharT>::ptr strategy_factory_;\r
 public:\r
        delimiter_based_chunking_strategy_factory(\r
                        const std::basic_string<CharT>& delimiter, \r
-                       const protocol_strategy_factory<CharT>::ptr& strategy_factory)\r
+                       const typename protocol_strategy_factory<CharT>::ptr& strategy_factory)\r
                : delimiter_(delimiter)\r
                , strategy_factory_(strategy_factory)\r
        {\r
index 394a01078616e975de727681a462a30cfd9022ae..9a76452e2cc50a3c0ea1e5438ac1285aa8200ca3 100644 (file)
@@ -371,7 +371,7 @@ int main(int argc, wchar_t* argv[])
 
        #ifdef _DEBUG
                if(env::properties().get(L"configuration.debugging.remote", false))
-                       MessageBox(nullptr, TEXT("Now is the time to connect for remote debugging..."), TEXT("Debug"), MB_OK | MB_TOPMOST);
+                       MessageBox(nullptr, L"Now is the time to connect for remote debugging...", L"Debug", MB_OK | MB_TOPMOST);
        #endif   
 
                // Start logging to file.
index 6a96760ed4ef089507dab4404f367156038f40fd..cb55a52889192b073e0ec0d9342be467010169cd 100644 (file)
@@ -62,7 +62,7 @@
 #include <protocol/asio/io_service_manager.h>
 #include <protocol/amcp/AMCPProtocolStrategy.h>
 #include <protocol/cii/CIIProtocolStrategy.h>
-#include <protocol/CLK/CLKProtocolStrategy.h>
+#include <protocol/clk/CLKProtocolStrategy.h>
 #include <protocol/util/AsyncEventServer.h>
 #include <protocol/util/strategy_adapters.h>
 #include <protocol/osc/client.h>
@@ -328,4 +328,4 @@ const std::vector<spl::shared_ptr<video_channel>> server::channels() const
 std::shared_ptr<core::thumbnail_generator> server::get_thumbnail_generator() const {return impl_->thumbnail_generator_; }
 core::monitor::subject& server::monitor_output() { return *impl_->monitor_subject_; }
 
-}
\ No newline at end of file
+}