From: ronag Date: Fri, 4 Mar 2011 20:52:16 +0000 (+0000) Subject: 2.0.0.2: Fixed CLEAR command. X-Git-Tag: 2.0.1~700 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=394d6e5ee7418c982bebde6e60531caebfb42527;p=casparcg 2.0.0.2: Fixed CLEAR command. git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@527 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- diff --git a/casparcg.sln b/casparcg.sln index 060c3f5ba..753e0c989 100644 --- a/casparcg.sln +++ b/casparcg.sln @@ -5,8 +5,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common\common.vcx EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "core\core.vcxproj", "{79388C20-6499-4BF6-B8B9-D8C33D7D4DDD}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcxproj", "{8002D74D-4E89-4BD6-8CE8-0FE4DF14CA5D}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shell", "shell\shell.vcxproj", "{8C26C94F-8092-4769-8D84-DEA479721C5B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "protocol", "protocol\protocol.vcxproj", "{2040B361-1FB6-488E-84A5-38A580DA90DE}" @@ -46,12 +44,6 @@ Global {79388C20-6499-4BF6-B8B9-D8C33D7D4DDD}.Profile|Win32.Build.0 = Amplify|Win32 {79388C20-6499-4BF6-B8B9-D8C33D7D4DDD}.Release|Win32.ActiveCfg = Release|Win32 {79388C20-6499-4BF6-B8B9-D8C33D7D4DDD}.Release|Win32.Build.0 = Release|Win32 - {8002D74D-4E89-4BD6-8CE8-0FE4DF14CA5D}.Debug|Win32.ActiveCfg = Debug|Win32 - {8002D74D-4E89-4BD6-8CE8-0FE4DF14CA5D}.Debug|Win32.Build.0 = Debug|Win32 - {8002D74D-4E89-4BD6-8CE8-0FE4DF14CA5D}.Develop|Win32.ActiveCfg = Debug|Win32 - {8002D74D-4E89-4BD6-8CE8-0FE4DF14CA5D}.Profile|Win32.ActiveCfg = Release|Win32 - {8002D74D-4E89-4BD6-8CE8-0FE4DF14CA5D}.Release|Win32.ActiveCfg = Release|Win32 - {8002D74D-4E89-4BD6-8CE8-0FE4DF14CA5D}.Release|Win32.Build.0 = Release|Win32 {8C26C94F-8092-4769-8D84-DEA479721C5B}.Debug|Win32.ActiveCfg = Debug|Win32 {8C26C94F-8092-4769-8D84-DEA479721C5B}.Debug|Win32.Build.0 = Debug|Win32 {8C26C94F-8092-4769-8D84-DEA479721C5B}.Develop|Win32.ActiveCfg = Develop|Win32 diff --git a/core/producer/frame_producer_device.cpp b/core/producer/frame_producer_device.cpp index e6e31e194..5ad3d892b 100644 --- a/core/producer/frame_producer_device.cpp +++ b/core/producer/frame_producer_device.cpp @@ -103,16 +103,12 @@ public: void clear(int index) { - executor_.invoke([&]{get_layer(index).clear();}); + executor_.invoke([&]{layers_.erase(index);}); } void clear() { - executor_.invoke([&] - { - BOOST_FOREACH(auto& pair, layers_) - pair.second.clear(); - }); + executor_.invoke([&]{layers_.clear();}); } void swap_layer(int index, size_t other_index) diff --git a/core/producer/layer.cpp b/core/producer/layer.cpp index fa21c5b16..33e60ba15 100644 --- a/core/producer/layer.cpp +++ b/core/producer/layer.cpp @@ -105,15 +105,7 @@ public: last_frame_ = draw_frame::empty(); foreground_ = frame_producer::empty(); } - - void clear() - { - foreground_ = frame_producer::empty(); - background_ = frame_producer::empty(); - last_frame_ = draw_frame::empty(); - is_paused_ = false; - } - + safe_ptr receive() { if(is_paused_) @@ -175,7 +167,6 @@ void layer::load(const safe_ptr& frame_producer, bool play_on_lo void layer::play(){impl_->play();} void layer::pause(){impl_->pause();} void layer::stop(){impl_->stop();} -void layer::clear(){impl_->clear();} safe_ptr layer::receive() {return impl_->receive();} safe_ptr layer::foreground() const { return impl_->foreground_;} safe_ptr layer::background() const { return impl_->background_;} diff --git a/core/producer/layer.h b/core/producer/layer.h index dae8b399d..cf66e1ea3 100644 --- a/core/producer/layer.h +++ b/core/producer/layer.h @@ -27,7 +27,6 @@ public: void play(); // nothrow void pause(); // nothrow void stop(); // nothrow - void clear(); // nothrow safe_ptr foreground() const; // nothrow safe_ptr background() const; // nothrow diff --git a/protocol/amcp/AMCPCommandsImpl.cpp b/protocol/amcp/AMCPCommandsImpl.cpp index ad21aec4b..c2570bd19 100644 --- a/protocol/amcp/AMCPCommandsImpl.cpp +++ b/protocol/amcp/AMCPCommandsImpl.cpp @@ -584,7 +584,11 @@ bool StopCommand::DoExecute() bool ClearCommand::DoExecute() { - GetChannel()->producer().clear(GetLayerIndex()); + int index = GetLayerIndex(std::numeric_limits::min()); + if(index != std::numeric_limits::min()) + GetChannel()->producer().clear(index); + else + GetChannel()->producer().clear(); SetReplyString(TEXT("202 CLEAR OK\r\n"));