]> git.sesse.net Git - casparcg/blobdiff - protocol/cii/CIICommandsImpl.cpp
2.1.0: Reverted utf8. To complicated to fully fix for now.
[casparcg] / protocol / cii / CIICommandsImpl.cpp
index ea5b825ef5770bd71f30971071dd501d963af74f..306e6b60ad5852d3037557f9a1c4ea31531ef548 100644 (file)
@@ -1,22 +1,24 @@
 /*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
 *\r
-*  This file is part of CasparCG.\r
+* This file is part of CasparCG (www.casparcg.com).\r
 *\r
-*    CasparCG is free software: you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation, either version 3 of the License, or\r
-*    (at your option) any later version.\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
 *\r
-*    CasparCG is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
 *\r
+* Author: Nicklas P Andersson\r
 */\r
+\r
  \r
 #include "../StdAfx.h"\r
 \r
@@ -24,7 +26,7 @@
 #include "CIICommandsImpl.h"\r
 #include <sstream>\r
 #include <algorithm>\r
-#include <core/producer/flash/cg_producer.h>\r
+#include <modules/flash/producer/cg_producer.h>\r
 \r
 namespace caspar { namespace protocol { namespace cii {\r
 \r
@@ -98,6 +100,7 @@ void MiscellaneousCommand::Setup(const std::vector<std::wstring>& parameters)
        {\r
                filename_ = parameters[5];\r
                filename_ = filename_.substr(0, filename_.find_last_of(TEXT('.')));\r
+               filename_.append(L".ft");\r
                state_ = 0;\r
                return;\r
        }\r
@@ -140,7 +143,7 @@ void MiscellaneousCommand::Execute()
 \r
        //TODO: Need to be checked for validity\r
        else if(state_ == 1)\r
-               core::flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->add(layer_, filename_, false, TEXT(""), xmlData_);\r
+               flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->add(layer_, filename_, false, TEXT(""), xmlData_);\r
 }\r
 \r
 \r
@@ -154,11 +157,11 @@ void KeydataCommand::Execute()
 \r
        //TODO: Need to be checked for validity\r
        else if(state_ == 1)\r
-               core::flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->stop(layer_, 0);\r
+               flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->stop(layer_, 0);\r
        else if(state_ == 2)\r
-               core::flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->clear();\r
+               pCIIStrategy_->GetChannel()->stage()->clear(flash::cg_producer::DEFAULT_LAYER);\r
        else if(state_ == 3)\r
-               core::flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->play(layer_);\r
+               flash::get_default_cg_producer(pCIIStrategy_->GetChannel())->play(layer_);\r
 }\r
 \r
 void KeydataCommand::Setup(const std::vector<std::wstring>& parameters) {\r
@@ -183,10 +186,12 @@ void KeydataCommand::Setup(const std::vector<std::wstring>& parameters) {
 \r
        if(parameters[1].at(0) == 27)   //NEPTUNE:      Y\<27>\X                        Stop layer X.\r
                state_ = 1;\r
-       else if(static_cast<unsigned char>(parameters[1].at(0)) == 254) //NEPTUNE:      Y\<254>                 Clear Canvas. \r
+       else if(static_cast<unsigned char>(parameters[1].at(1)) == 190) //NEPTUNE:      Y\<254>                 Clear Canvas. \r
                state_ = 2;\r
-       else if(static_cast<unsigned char>(parameters[1].at(0)) == 213) //NEPTUNE:      Y\<213><243>\X  Play layer X. \r
-               state_ = 3;\r
+       else if(static_cast<unsigned char>(parameters[1].at(1)) == 149) //NEPTUNE:      Y\<213><243>\X  Play layer X. \r
+               state_ = 3;                                                                                                     //UPDATE 2011-05-09: These char-codes are aparently not valid after converting to wide-chars\r
+                                                                                                                                       //the correct sequence is <195><149><195><179> \r
+               \r
 }\r
 \r
 }}}
\ No newline at end of file