Files
video-v1/vav2/platforms/windows/applications/vav2player/Vav2Player/App.xaml.cpp
2025-10-03 19:00:15 +09:00

67 lines
1.9 KiB
C++

#include "pch.h"
#include "App.xaml.h"
#include "MainWindow.xaml.h"
#include "VavCore/VavCore.h"
#include "src/Logger/SimpleLogger.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();
LOGF_INFO("[App] VavCore initialized successfully, version: %s", version);
// Test creating a player
VavCorePlayer* player = vavcore_create_player();
if (player)
{
LOGF_INFO("[App] VavCore player created successfully");
vavcore_destroy_player(player);
}
// C++ wrapper test disabled for now (only using C API)
// VavCore::VideoPlayer cppPlayer;
// LOGF_INFO("[App] VavCore C++ player created successfully");
vavcore_cleanup();
LOGF_INFO("[App] VavCore cleanup completed");
}
else
{
LOGF_ERROR("[App] Failed to initialize VavCore");
}
}
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();
}
}