<?php

use App\Http\Controllers\AudioController;
use App\Http\Controllers\DataController;
use App\Http\Controllers\MusicCommandController;
use App\Http\Controllers\OnboardController;
use App\Http\Controllers\Overlays\DesktopController;
use App\Http\Controllers\Overlays\GameController;
use App\Http\Controllers\Overlays\GoodbyeController;
use App\Http\Controllers\Overlays\LandingController;
use App\Http\Controllers\Overlays\LoadingController;
use App\Http\Controllers\Overlays\MusicBoxController;
use App\Http\Controllers\Overlays\MusicDaemonController;
use Illuminate\Support\Facades\Route;

Route::view('/', 'index');

Route::get('/landing',      [LandingController::class,     'show']);
Route::get('/loading',      [LoadingController::class,     'show']);
Route::get('/game',         [GameController::class,        'show']);
Route::get('/desktop',      [DesktopController::class,     'show']);
Route::get('/goodbye',      [GoodbyeController::class,     'show']);
Route::get('/music-daemon', [MusicDaemonController::class, 'show']);

Route::prefix('music-box')->controller(MusicBoxController::class)->group(function () {
    Route::get('/',      'box');
    Route::get('widget', 'widget');
    Route::get('cover',  'cover');
    Route::get('nc',     'nc');
});

Route::get('/data/playlist.js', [DataController::class, 'playlist']);
Route::get('/cover.jpg',         [DataController::class, 'coverImage']);
Route::get('/track',             [AudioController::class, 'stream']);

Route::post('/cmd/{type}', [MusicCommandController::class, 'send'])
    ->whereIn('type', ['skip', 'prev', 'pause', 'resume']);

Route::get('/onboard',         [OnboardController::class, 'show']);
Route::get('/onboard/search',  [OnboardController::class, 'search']);
Route::post('/onboard',        [OnboardController::class, 'submit']);
