Add OBS scene switching controls with dynamic button states
Some checks failed
Lint and Build / build (pull_request) Failing after 1m25s

- Add setScene API endpoint for OBS scene switching (1-Screen, 2-Screen, 4-Screen)
- Add getCurrentScene API endpoint to fetch active OBS scene
- Implement scene switching buttons in main UI with dynamic state tracking
- Buttons change color and text based on current active scene
- Glass morphism styling with Solarized Dark gradients
- Real-time scene state synchronization with optimistic UI updates
- Toast notifications for user feedback

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Decobus 2025-07-22 18:52:49 -04:00
parent 6fadccef51
commit 260eb3f7b2
3 changed files with 196 additions and 26 deletions

View file

@ -0,0 +1,30 @@
import { NextResponse } from 'next/server';
import { getOBSClient } from '../../../lib/obsClient';
export async function GET() {
try {
const obsClient = await getOBSClient();
// Get the current program scene
const response = await obsClient.call('GetCurrentProgramScene');
const { currentProgramSceneName } = response;
console.log(`Current OBS scene: ${currentProgramSceneName}`);
return NextResponse.json({
success: true,
data: { sceneName: currentProgramSceneName },
message: 'Current scene retrieved successfully'
});
} catch (obsError) {
console.error('OBS WebSocket error:', obsError);
return NextResponse.json(
{
success: false,
error: 'Failed to get current scene from OBS',
details: obsError instanceof Error ? obsError.message : 'Unknown error'
},
{ status: 500 }
);
}
}