#include <common/exception/win32_exception.h>\r
#include <common/exception/exceptions.h>\r
#include <common/log/log.h>\r
+#include <common/gl/gl_check.h>\r
#include <common/os/windows/current_version.h>\r
#include <common/os/windows/system_info.h>\r
#include <common/utility/assert.h>\r
#include <tbb/task_scheduler_init.h>\r
\r
#include <boost/foreach.hpp>\r
+#include <boost/property_tree/detail/file_parser_error.hpp>\r
\r
// NOTE: This is needed in order to make CComObject work since this is not a real ATL project.\r
CComModule _AtlModule;\r
extern __declspec(selectany) CAtlModule* _pAtlModule = &_AtlModule;\r
\r
+void change_icon( const HICON hNewIcon )\r
+{\r
+ auto hMod = ::LoadLibrary(L"Kernel32.dll"); \r
+ typedef DWORD(__stdcall *SCI)(HICON);\r
+ auto pfnSetConsoleIcon = reinterpret_cast<SCI>(::GetProcAddress(hMod, "SetConsoleIcon")); \r
+ pfnSetConsoleIcon(hNewIcon); \r
+ ::FreeLibrary(hMod);\r
+}\r
+\r
void setup_console_window()\r
{ \r
auto hOut = GetStdHandle(STD_OUTPUT_HANDLE);\r
DisplayArea.Right = coord.X-1;\r
DisplayArea.Bottom = (coord.Y-1)/2;\r
SetConsoleWindowInfo(hOut, TRUE, &DisplayArea);\r
- \r
+ \r
+ change_icon(::LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(101)));\r
+\r
// Set console title.\r
std::wstringstream str;\r
str << "CasparCG Server " << caspar::env::version();\r
{ \r
static_assert(sizeof(void*) == 4, "64-bit code generation is not supported.");\r
\r
+ CASPAR_LOG(info) << L"Type \"q\" to close application";\r
+\r
CASPAR_LOG(info) << L"THIS IS AN ALPHA BUILD";\r
\r
// Set debug mode.\r
struct tbb_thread_installer : public tbb::task_scheduler_observer\r
{\r
tbb_thread_installer(){observe(true);}\r
- void on_scheduler_entry(bool is_worker){caspar::win32_exception::install_handler();}\r
+ void on_scheduler_entry(bool is_worker)\r
+ {\r
+ caspar::detail::SetThreadName(GetCurrentThreadId(), "tbb-worker-thread");\r
+ caspar::win32_exception::install_handler();\r
+ }\r
} tbb_thread_installer;\r
\r
try \r
else if(wcmd.substr(0, 1) == L"3")\r
wcmd = L"CG 1-2 ADD 1 BBTELEFONARE 1";\r
else if(wcmd.substr(0, 1) == L"4")\r
- wcmd = L"PLAY 1-1 DV SEEK 350 FILTER yadif=1:-1 LOOP";\r
+ wcmd = L"PLAY 1-1 DV FILTER yadif=1:-1 LOOP";\r
else if(wcmd.substr(0, 1) == L"X")\r
{\r
int num = 0;\r
amcp.Parse(wcmd.c_str(), wcmd.length(), dummy);\r
}\r
}\r
+ catch(boost::property_tree::file_parser_error&)\r
+ {\r
+ CASPAR_LOG_CURRENT_EXCEPTION();\r
+ CASPAR_LOG(fatal) << L"Unhandled configuration error in main thread. Please check the configuration file (casparcg.config) for errors.";\r
+ }\r
+ catch(caspar::gl::ogl_exception&)\r
+ {\r
+ CASPAR_LOG_CURRENT_EXCEPTION();\r
+ CASPAR_LOG(fatal) << L"Unhandled OpenGL Error in main thread. Please try to update graphics drivers in order to receive full OpenGL 3.1+ Support.";\r
+ }\r
catch(...)\r
{\r
- CASPAR_LOG(fatal) << "UNHANDLED EXCEPTION in main thread.";\r
CASPAR_LOG_CURRENT_EXCEPTION();\r
+ CASPAR_LOG(fatal) << L"Unhandled exception in main thread. Please report this error on the CasparCG forums (www.casparcg.com/forum).";\r
} \r
\r
CASPAR_LOG(info) << "Successfully shutdown CasparCG Server.";\r