]> git.sesse.net Git - casparcg/blobdiff - shell/main.cpp
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / shell / main.cpp
index 5278dd7cfb0c2415d6fba29eb2acfad91f764960..01ddc0ee724a2399d10e4259c2af5c68e93d6ef1 100644 (file)
 \r
 #include <conio.h>\r
 \r
-#include <core/config.h>\r
-#include <core/server.h>\r
-#include <core/protocol/amcp/AMCPProtocolStrategy.h>\r
+#include "bootstrapper.h"\r
+\r
 #include <common/exception/win32_exception.h>\r
 #include <common/exception/exceptions.h>\r
 #include <common/log/log.h>\r
+#include <common/env.h>\r
+#include <common/utility/assert.h>\r
+#include <protocol/amcp/AMCPProtocolStrategy.h>\r
 \r
 using namespace caspar;\r
 using namespace caspar::core;\r
+using namespace caspar::protocol;\r
 \r
 class win32_handler_tbb_installer : public tbb::task_scheduler_observer\r
 {\r
@@ -54,11 +57,13 @@ public:
  \r
 int main(int argc, wchar_t* argv[])\r
 {\r
+       timeBeginPeriod(1);\r
+\r
        std::wstringstream str;\r
-       str << "CasparCG " << CASPAR_VERSION_STR << " " << CASPAR_VERSION_TAG;\r
+       str << "CasparCG " << env::version() << " " << env::version_tag();\r
        SetConsoleTitle(str.str().c_str());\r
 \r
-       CASPAR_LOG(info) << L"Starting CasparCG Video Playout Server Ver: " << CASPAR_VERSION_STR << " Tag: " << CASPAR_VERSION_TAG << std::endl;\r
+       CASPAR_LOG(info) << L"Starting CasparCG Video Playout Server Ver: " << env::version() << env::version_tag() << std::endl;\r
        CASPAR_LOG(info) << L"Copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\n\n" << std::endl;\r
 \r
        EnableMenuItem(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE , MF_GRAYED);\r
@@ -74,7 +79,7 @@ int main(int argc, wchar_t* argv[])
        MessageBox(nullptr, TEXT("Now is the time to connect for remote debugging..."), TEXT("Debug"), MB_OK | MB_TOPMOST);\r
 #endif\r
 \r
-       log::add_file_sink(server::log_folder());\r
+       log::add_file_sink(env::log_folder());\r
        \r
        CASPAR_LOG(debug) << "Started Main Thread";\r
 \r
@@ -83,7 +88,7 @@ int main(int argc, wchar_t* argv[])
                                \r
        try \r
        {\r
-               server caspar_device;\r
+               bootstrapper caspar_device;\r
                                \r
                auto dummy = std::make_shared<IO::DummyClientInfo>();\r
                amcp::AMCPProtocolStrategy amcp(caspar_device.get_channels());\r
@@ -109,6 +114,8 @@ int main(int argc, wchar_t* argv[])
                                wcmd = L"LOAD 1-1 720p2500";\r
                        else if(wcmd.substr(0, 1) == L"8")\r
                                wcmd = L"LOAD 1-1 #FFFFFFFF AUTOPLAY";\r
+                       else if(wcmd.substr(0, 1) == L"9")\r
+                               wcmd = L"LOADBG 1-2 " + wcmd.substr(1, wcmd.length()-1) + L" [1.0-2.0] LOOP AUTOPLAY";\r
 \r
                        wcmd += L"\r\n";\r
                        amcp.Parse(wcmd.c_str(), wcmd.length(), dummy);\r
@@ -123,5 +130,7 @@ int main(int argc, wchar_t* argv[])
        }       \r
        CASPAR_LOG(debug) << "Ended Main Thread";\r
 \r
+       timeEndPeriod(1);\r
+\r
        return 0;\r
 }
\ No newline at end of file