The new Schedule page lets the user choose 1 to 24 hours and create a plan that starts at the next full hour. The timeline lists start time, type, title and duration. Each type has a labelled chip: news, ads and moderator segments get their own border color, songs stay neutral because the accent color can be the same red as the news. A now-playing card shows the current item with progress, elapsed and planned time, Start and Stop buttons and a volume slider. The current row is selected and scrolled into view. Errors from the generator and skipped items appear in an InfoBar. ScheduleController creates the plan from the library and drives the PlaybackEngine. It lives on App for the whole app run, so a broadcast keeps playing while the user switches pages, and it stops on exit. Refs #10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
867 B
C#
28 lines
867 B
C#
using System.Windows;
|
|
using Radiosender.Controllers;
|
|
using Radiosender.Services;
|
|
|
|
namespace Radiosender;
|
|
|
|
public partial class App : Application
|
|
{
|
|
public static SongRepository Songs { get; private set; } = null!;
|
|
|
|
/// <summary>App-wide, so a running broadcast keeps going while the user switches pages.</summary>
|
|
public static ScheduleController Schedule { get; private set; } = null!;
|
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
{
|
|
// Creates the database file and table on first start.
|
|
Songs = new SongRepository(SongRepository.DefaultDatabasePath);
|
|
Schedule = new ScheduleController(Songs, new ScheduleGenerator(), new PlaybackEngine(), () => DateTime.Now);
|
|
base.OnStartup(e);
|
|
}
|
|
|
|
protected override void OnExit(ExitEventArgs e)
|
|
{
|
|
Schedule.Stop();
|
|
base.OnExit(e);
|
|
}
|
|
}
|