Files
video-v1/vav2/platforms/windows/applications/vav2player/Vav2Player/App.xaml.cpp

68 lines
2.0 KiB
C++

#include "pch.h"
#include "App.xaml.h"
#include "MainWindow.xaml.h"
#include "VavCore/VavCore.h"
using namespace winrt;
using namespace winrt::Microsoft::UI::Xaml;
namespace winrt::Vav2Player::implementation
{
// Simple VavCore test function
void TestVavCoreIntegration()
{
// Test VavCore C API
VavCoreResult result = vavcore_initialize();
if (result == VAVCORE_SUCCESS)
{
const char* version = vavcore_get_version_string();
OutputDebugStringA("VavCore initialized successfully, version: ");
OutputDebugStringA(version);
OutputDebugStringA("\n");
// Test creating a player
VavCorePlayer* player = vavcore_create_player();
if (player)
{
OutputDebugStringA("VavCore player created successfully\n");
vavcore_destroy_player(player);
}
// C++ wrapper test disabled for now (only using C API)
// VavCore::VideoPlayer cppPlayer;
// OutputDebugStringA("VavCore C++ player created successfully\n");
vavcore_cleanup();
OutputDebugStringA("VavCore cleanup completed\n");
}
else
{
OutputDebugStringA("Failed to initialize VavCore\n");
}
}
App::App()
{
InitializeComponent();
// Test VavCore integration on startup
// TestVavCoreIntegration(); // Disabled for logging system test
#if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException([](IInspectable const&, UnhandledExceptionEventArgs const& e)
{
if (IsDebuggerPresent())
{
auto errorMessage = e.Message();
__debugbreak();
}
});
#endif
}
void App::OnLaunched(LaunchActivatedEventArgs const&)
{
window = winrt::make<implementation::MainWindow>();
window.Activate();
}
}