From a6083400e48fbe34e8d1c65687ea79641e680f18 Mon Sep 17 00:00:00 2001 From: ronag Date: Tue, 14 Jun 2011 08:29:26 +0000 Subject: [PATCH] 2.0. mixer: Simplified interface. 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 | 29 ++---------------------- core/mixer/mixer.h | 5 ---- modules/decklink/interop/DeckLinkAPI_h.h | 2 +- modules/decklink/interop/DeckLinkAPI_i.c | 2 +- protocol/amcp/AMCPCommandsImpl.cpp | 14 ++++++++---- 5 files changed, 13 insertions(+), 39 deletions(-) diff --git a/core/mixer/mixer.cpp b/core/mixer/mixer.cpp index 3e86515ba..3adf51bd3 100644 --- a/core/mixer/mixer.cpp +++ b/core/mixer/mixer.cpp @@ -183,29 +183,7 @@ public: transforms[index] = tweened_transform(src, dst, mix_duration, tween); }); } - - template - void reset_transform(unsigned int mix_duration, const std::wstring& tween) - { - channel_.execution().invoke([&] - { - auto& transforms = boost::fusion::at_key(transforms_); - - BOOST_FOREACH(auto& t, transforms) - t.second = tweened_transform(t.second.fetch(), T(), mix_duration, tween); - set_transform(T(), mix_duration, tween); - }); - } - - template - void reset_transform(int index, unsigned int mix_duration, const std::wstring& tween) - { - channel_.execution().invoke([&] - { - set_transform(T(), mix_duration, tween); - }); - } - + std::wstring print() const { return L"mixer"; @@ -286,8 +264,5 @@ void mixer::apply_image_transform(const std::function& transform, unsigned int mix_duration, const std::wstring& tween){impl_->apply_transform(index, transform, mix_duration, tween);} void mixer::apply_audio_transform(const std::function& transform, unsigned int mix_duration, const std::wstring& tween){impl_->apply_transform(transform, mix_duration, tween);} void mixer::apply_audio_transform(int index, const std::function& transform, unsigned int mix_duration, const std::wstring& tween){impl_->apply_transform(index, transform, mix_duration, tween);} -void mixer::reset_image_transform(unsigned int mix_duration, const std::wstring& tween){impl_->reset_transform(mix_duration, tween);} -void mixer::reset_image_transform(int index, unsigned int mix_duration, const std::wstring& tween){impl_->reset_transform(index, mix_duration, tween);} -void mixer::reset_audio_transform(unsigned int mix_duration, const std::wstring& tween){impl_->reset_transform(mix_duration, tween);} -void mixer::reset_audio_transform(int index, unsigned int mix_duration, const std::wstring& tween){impl_->reset_transform(index, mix_duration, tween);} + }} \ No newline at end of file diff --git a/core/mixer/mixer.h b/core/mixer/mixer.h index 0fd2e562b..ce0670bdc 100644 --- a/core/mixer/mixer.h +++ b/core/mixer/mixer.h @@ -63,11 +63,6 @@ public: void apply_audio_transform(const std::function& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear"); void apply_audio_transform(int index, const std::function& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear"); - void reset_image_transform(unsigned int mix_duration = 0, const std::wstring& tween = L"linear"); - void reset_image_transform(int index, unsigned int mix_duration = 0, const std::wstring& tween = L"linear"); - void reset_audio_transform(unsigned int mix_duration = 0, const std::wstring& tween = L"linear"); - void reset_audio_transform(int index, unsigned int mix_duration = 0, const std::wstring& tween = L"linear"); - private: struct implementation; safe_ptr impl_; diff --git a/modules/decklink/interop/DeckLinkAPI_h.h b/modules/decklink/interop/DeckLinkAPI_h.h index 178504181..95d4c333f 100644 --- a/modules/decklink/interop/DeckLinkAPI_h.h +++ b/modules/decklink/interop/DeckLinkAPI_h.h @@ -4,7 +4,7 @@ /* File created by MIDL compiler version 7.00.0555 */ -/* at Mon Jun 13 15:24:58 2011 +/* at Tue Jun 14 09:26:37 2011 */ /* Compiler settings for interop\DeckLinkAPI.idl: Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 diff --git a/modules/decklink/interop/DeckLinkAPI_i.c b/modules/decklink/interop/DeckLinkAPI_i.c index 2b274da48..f14b03cc4 100644 --- a/modules/decklink/interop/DeckLinkAPI_i.c +++ b/modules/decklink/interop/DeckLinkAPI_i.c @@ -6,7 +6,7 @@ /* File created by MIDL compiler version 7.00.0555 */ -/* at Mon Jun 13 15:24:58 2011 +/* at Tue Jun 14 09:26:37 2011 */ /* Compiler settings for interop\DeckLinkAPI.idl: Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 diff --git a/protocol/amcp/AMCPCommandsImpl.cpp b/protocol/amcp/AMCPCommandsImpl.cpp index f64c36066..04e431a20 100644 --- a/protocol/amcp/AMCPCommandsImpl.cpp +++ b/protocol/amcp/AMCPCommandsImpl.cpp @@ -335,9 +335,9 @@ bool MixerCommand::DoExecute() int layer = GetLayerIndex(std::numeric_limits::min()); if(layer != std::numeric_limits::min()) - GetChannel()->mixer()->reset_image_transform(GetLayerIndex(), duration, tween); + GetChannel()->mixer()->set_image_transform(GetLayerIndex(), image_transform(), duration, tween); else - GetChannel()->mixer()->reset_image_transform(duration, tween); + GetChannel()->mixer()->set_image_transform(image_transform(), duration, tween); } } else if(_parameters[0] == L"AUDIO") @@ -364,15 +364,19 @@ bool MixerCommand::DoExecute() { int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0; std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear"; - GetChannel()->mixer()->reset_audio_transform(duration, tween); + int layer = GetLayerIndex(std::numeric_limits::min()); + if(layer != std::numeric_limits::min()) + GetChannel()->mixer()->set_audio_transform(GetLayerIndex(), audio_transform(), duration, tween); + else + GetChannel()->mixer()->set_audio_transform(audio_transform(), duration, tween); } } else if(_parameters[0] == L"RESET") { int duration = _parameters.size() > 2 ? lexical_cast_or_default(_parameters[2], 0) : 0; std::wstring tween = _parameters.size() > 3 ? _parameters[3] : L"linear"; - GetChannel()->mixer()->reset_image_transform(duration, tween); - GetChannel()->mixer()->reset_audio_transform(duration, tween); + GetChannel()->mixer()->set_image_transform(image_transform(), duration, tween); + GetChannel()->mixer()->set_audio_transform(audio_transform(), duration, tween); } SetReplyString(TEXT("202 MIXER OK\r\n")); -- 2.39.5