feat(schedule): rework the schedule page controls and timeline
- Mixer in two areas: what the listeners hear (music, microphone) and what you hear; the master volume is gone. - One start button starts the created plan and goes live when laut.fm is on; while on air it ends the broadcast. - The start field takes Jetzt (default), a full hour or a typed time. A Jetzt plan moves to the moment it starts. - Timeline rows can be dragged to a new place; HinzufĂĽgen inserts a song, news, an ad or moderator talk as the item after next. - All page texts are translated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c8740774d
commit
ef388d82f4
8 files changed
+563
-245
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System.IO;
|
||||
using NAudio.Wave;
|
||||
using Radiosender.Services.Localization;
|
||||
|
||||
namespace Radiosender.Services.Audio;
|
||||
|
||||
@@ -12,7 +13,6 @@ public sealed class MusicPlayer : IAudioPlayer
|
||||
private readonly Lock _lock = new();
|
||||
private AudioFileReader? _reader;
|
||||
private ISampleProvider? _input;
|
||||
private float _volume = 1f;
|
||||
|
||||
private MusicPlayer()
|
||||
{
|
||||
@@ -36,21 +36,6 @@ public sealed class MusicPlayer : IAudioPlayer
|
||||
get { lock (_lock) return _reader?.TotalTime ?? TimeSpan.Zero; }
|
||||
}
|
||||
|
||||
public float Volume
|
||||
{
|
||||
get { lock (_lock) return _volume; }
|
||||
set
|
||||
{
|
||||
ArgumentOutOfRangeException.ThrowIfLessThan(value, 0f);
|
||||
ArgumentOutOfRangeException.ThrowIfGreaterThan(value, 1f);
|
||||
lock (_lock)
|
||||
{
|
||||
_volume = value;
|
||||
_reader?.Volume = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Play(string filePath)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(filePath);
|
||||
@@ -60,17 +45,17 @@ public sealed class MusicPlayer : IAudioPlayer
|
||||
Release();
|
||||
|
||||
if (!File.Exists(filePath))
|
||||
throw new FileNotFoundException($"Audiodatei nicht gefunden: {filePath}", filePath);
|
||||
throw new FileNotFoundException(Loc.F("Audio_FileNotFound", filePath), filePath);
|
||||
|
||||
try
|
||||
{
|
||||
_reader = new AudioFileReader(filePath) { Volume = _volume };
|
||||
_reader = new AudioFileReader(filePath);
|
||||
_input = _output.Add(_reader, AudioSource.Music);
|
||||
}
|
||||
catch (Exception ex) when (ex is not (OutOfMemoryException or NAudio.MmException))
|
||||
{
|
||||
Release();
|
||||
throw new InvalidDataException($"Audiodatei kann nicht gelesen werden: {filePath}", ex);
|
||||
throw new InvalidDataException(Loc.F("Audio_FileUnreadable", filePath), ex);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user