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

116 lines
3.8 KiB
C++

#include "pch.h"
#include "LayeredVideoPage.xaml.h"
#if __has_include("LayeredVideoPage.g.cpp")
#include "LayeredVideoPage.g.cpp"
#endif
using namespace winrt;
using namespace winrt::Microsoft::UI::Xaml;
namespace winrt::Vav2Player::implementation
{
LayeredVideoPage::LayeredVideoPage()
{
InitializeComponent();
UpdateActiveLayerCount();
UpdateStatus(L"Layered Video - Ready");
}
// File load handlers
void LayeredVideoPage::LoadBackground_Click(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&)
{
LoadVideoFileForLayer(1);
}
void LayeredVideoPage::LoadOverlay_Click(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&)
{
LoadVideoFileForLayer(2);
}
void LayeredVideoPage::LoadPiP_Click(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&)
{
LoadVideoFileForLayer(3);
}
// Opacity control handlers
void LayeredVideoPage::Layer1Opacity_Changed(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const& e)
{
Layer1().Opacity(e.NewValue());
}
void LayeredVideoPage::Layer2Opacity_Changed(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const& e)
{
Layer2().Opacity(e.NewValue());
}
void LayeredVideoPage::Layer3Opacity_Changed(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs const& e)
{
Layer3().Opacity(e.NewValue());
}
// Playback control handlers
void LayeredVideoPage::PlayAllLayers_Click(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&)
{
VideoLayer1().Play();
VideoLayer2().Play();
VideoLayer3().Play();
UpdateStatus(L"Playing all layers");
}
void LayeredVideoPage::PauseAllLayers_Click(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&)
{
VideoLayer1().Pause();
VideoLayer2().Pause();
VideoLayer3().Pause();
UpdateStatus(L"Paused all layers");
}
void LayeredVideoPage::StopAllLayers_Click(winrt::Windows::Foundation::IInspectable const&, winrt::Microsoft::UI::Xaml::RoutedEventArgs const&)
{
VideoLayer1().Stop();
VideoLayer2().Stop();
VideoLayer3().Stop();
UpdateStatus(L"Stopped all layers");
}
// Helper methods
void LayeredVideoPage::UpdateActiveLayerCount()
{
// TODO: Implement proper layer counting
ActiveLayerCount().Text(L"0/3");
}
winrt::Windows::Foundation::IAsyncAction LayeredVideoPage::LoadVideoFileForLayer(int layerIndex)
{
// TODO: Implement file loading for specific layer
co_await resume_background();
// Update status based on layer
switch (layerIndex) {
case 1:
UpdateStatus(L"Loading background video - Coming soon");
break;
case 2:
UpdateStatus(L"Loading overlay video - Coming soon");
break;
case 3:
UpdateStatus(L"Loading PiP video - Coming soon");
break;
default:
UpdateStatus(L"Invalid layer index");
break;
}
}
void LayeredVideoPage::UpdateStatus(winrt::hstring const& message)
{
try {
if (LayeredVideoStatusText()) {
LayeredVideoStatusText().Text(message);
}
} catch (...) {
// Ignore if UI not ready yet
}
OutputDebugStringA((winrt::to_string(message) + "\n").c_str());
}
}