]> git.sesse.net Git - casparcg/commitdiff
2.0. mixer: Simplified interface.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 14 Jun 2011 08:29:26 +0000 (08:29 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Tue, 14 Jun 2011 08:29:26 +0000 (08:29 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@893 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

core/mixer/mixer.cpp
core/mixer/mixer.h
modules/decklink/interop/DeckLinkAPI_h.h
modules/decklink/interop/DeckLinkAPI_i.c
protocol/amcp/AMCPCommandsImpl.cpp

index 3e86515ba8e272768eab08498a19aa6b142afa1e..3adf51bd36dd7520252f5e73ddf722f56d4f4630 100644 (file)
@@ -183,29 +183,7 @@ public:
                        transforms[index] = tweened_transform<T>(src, dst, mix_duration, tween);\r
                });\r
        }\r
-\r
-       template<typename T>\r
-       void reset_transform(unsigned int mix_duration, const std::wstring& tween)\r
-       {\r
-               channel_.execution().invoke([&]\r
-               {\r
-                       auto& transforms = boost::fusion::at_key<T>(transforms_);\r
-\r
-                       BOOST_FOREACH(auto& t, transforms)                      \r
-                                t.second = tweened_transform<T>(t.second.fetch(), T(), mix_duration, tween);                   \r
-                       set_transform(T(), mix_duration, tween);\r
-               });\r
-       }\r
-\r
-       template<typename T>\r
-       void reset_transform(int index, unsigned int mix_duration, const std::wstring& tween)\r
-       {\r
-               channel_.execution().invoke([&]\r
-               {               \r
-                       set_transform(T(), mix_duration, tween);\r
-               });\r
-       }\r
-       \r
+               \r
        std::wstring print() const\r
        {\r
                return L"mixer";\r
@@ -286,8 +264,5 @@ void mixer::apply_image_transform(const std::function<core::image_transform(core
 void mixer::apply_image_transform(int index, const std::function<core::image_transform(core::image_transform)>& transform, unsigned int mix_duration, const std::wstring& tween){impl_->apply_transform<core::image_transform>(index, transform, mix_duration, tween);}\r
 void mixer::apply_audio_transform(const std::function<core::audio_transform(core::audio_transform)>& transform, unsigned int mix_duration, const std::wstring& tween){impl_->apply_transform<core::audio_transform>(transform, mix_duration, tween);}\r
 void mixer::apply_audio_transform(int index, const std::function<core::audio_transform(core::audio_transform)>& transform, unsigned int mix_duration, const std::wstring& tween){impl_->apply_transform<core::audio_transform>(index, transform, mix_duration, tween);}\r
-void mixer::reset_image_transform(unsigned int mix_duration, const std::wstring& tween){impl_->reset_transform<core::image_transform>(mix_duration, tween);}\r
-void mixer::reset_image_transform(int index, unsigned int mix_duration, const std::wstring& tween){impl_->reset_transform<core::image_transform>(index, mix_duration, tween);}\r
-void mixer::reset_audio_transform(unsigned int mix_duration, const std::wstring& tween){impl_->reset_transform<core::audio_transform>(mix_duration, tween);}\r
-void mixer::reset_audio_transform(int index, unsigned int mix_duration, const std::wstring& tween){impl_->reset_transform<core::audio_transform>(index, mix_duration, tween);}\r
+\r
 }}
\ No newline at end of file
index 0fd2e562b5f4fa1ef23d838f83ef8cfb96d21423..ce0670bdc3de5591028dc820c87a5962eb2f60b6 100644 (file)
@@ -63,11 +63,6 @@ public:
        void apply_audio_transform(const std::function<core::audio_transform(core::audio_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
        void apply_audio_transform(int index, const std::function<core::audio_transform(core::audio_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
 \r
-       void reset_image_transform(unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void reset_image_transform(int index, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void reset_audio_transform(unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void reset_audio_transform(int index, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-\r
 private:\r
        struct implementation;\r
        safe_ptr<implementation> impl_;\r
index 17850418161f6a784f9ea32252089c2000720994..95d4c333fc3e8ed0edbbb49bf62091c6cd1ccc4e 100644 (file)
@@ -4,7 +4,7 @@
 \r
 \r
  /* File created by MIDL compiler version 7.00.0555 */\r
-/* at Mon Jun 13 15:24:58 2011\r
+/* at Tue Jun 14 09:26:37 2011\r
  */\r
 /* Compiler settings for interop\DeckLinkAPI.idl:\r
     Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
index 2b274da4883f239877d63cb8bfe8db4346a2d6dd..f14b03cc431bf7fca4b8314d4940326dae21718f 100644 (file)
@@ -6,7 +6,7 @@
 \r
 \r
  /* File created by MIDL compiler version 7.00.0555 */\r
-/* at Mon Jun 13 15:24:58 2011\r
+/* at Tue Jun 14 09:26:37 2011\r
  */\r
 /* Compiler settings for interop\DeckLinkAPI.idl:\r
     Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
index f64c36066d6d06258a806219e53e14967d0aa2c7..04e431a206b5f842062ba061ee67de19fec9a6f5 100644 (file)
@@ -335,9 +335,9 @@ bool MixerCommand::DoExecute()
 \r
                                int layer = GetLayerIndex(std::numeric_limits<int>::min());\r
                                if(layer != std::numeric_limits<int>::min())\r
-                                       GetChannel()->mixer()->reset_image_transform(GetLayerIndex(), duration, tween);\r
+                                       GetChannel()->mixer()->set_image_transform(GetLayerIndex(), image_transform(), duration, tween);\r
                                else\r
-                                       GetChannel()->mixer()->reset_image_transform(duration, tween);\r
+                                       GetChannel()->mixer()->set_image_transform(image_transform(), duration, tween);\r
                        }\r
                }\r
                else if(_parameters[0] == L"AUDIO")\r
@@ -364,15 +364,19 @@ bool MixerCommand::DoExecute()
                        {\r
                                int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0;\r
                                std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear";\r
-                               GetChannel()->mixer()->reset_audio_transform(duration, tween);\r
+                               int layer = GetLayerIndex(std::numeric_limits<int>::min());\r
+                               if(layer != std::numeric_limits<int>::min())\r
+                                       GetChannel()->mixer()->set_audio_transform(GetLayerIndex(), audio_transform(), duration, tween);\r
+                               else                                               \r
+                                       GetChannel()->mixer()->set_audio_transform(audio_transform(), duration, tween);\r
                        }\r
                }\r
                else if(_parameters[0] == L"RESET")\r
                {\r
                        int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0;\r
                        std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear";\r
-                       GetChannel()->mixer()->reset_image_transform(duration, tween);\r
-                       GetChannel()->mixer()->reset_audio_transform(duration, tween);\r
+                       GetChannel()->mixer()->set_image_transform(image_transform(), duration, tween);\r
+                       GetChannel()->mixer()->set_audio_transform(audio_transform(), duration, tween);\r
                }\r
        \r
                SetReplyString(TEXT("202 MIXER OK\r\n"));\r