feat: stream live to laut.fm and import from its library

The Settings page gets a laut.fm card: a switch, the live access data
from Radioadmin (server, port, mountpoint, user, password) and the
station id and Radioadmin token for the library. Password and token
are written to settings.json encrypted with DPAPI for the Windows user.

While laut.fm is on, the Schedule page shows a Live button next to
"Jetzt starten". It logs in at the Icecast server with PUT and sends a
copy of the broadcast mix as MP3 at 128 kbit/s, encoded by Windows
Media Foundation. ProgramOutput hands that copy out through a live
feed. Each item that starts sets the stream title; ad items send
START_AD_BREAK at most once every 15 minutes.

LautFmProvider searches the station's tracks through the Radioadmin
API and the Import page lists it while laut.fm is on, so laut.fm tracks
are imported into the same library as local songs. Providers can now
hide themselves with IsAvailable.

Nothing was tested against a real laut.fm account; the tests use a
local fake server and fake HTTP answers.

Refs #15

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
fraujulianandClaude Opus 5.5 committed 2026-11-25 08:36:39 +01:00
1 parent 5d261717fe
commit a94fb862d2
16 files changed
+999 -16

No files matched your search

@@ -154,6 +154,74 @@
</Grid>
</Border>
<!-- laut.fm: live streaming and the station's library -->
<Border Style="{StaticResource Card}">
<StackPanel>
<ui:ToggleSwitch x:Name="LautFmSwitch" Content="laut.fm"
Checked="OnLautFmChanged" Unchecked="OnLautFmChanged" />
<ui:TextBlock Margin="0,8,0,0" TextWrapping="Wrap"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="Sendet live auf deine laut.fm-Station und bietet ihre Musik beim Import an. Im Plan erscheint dann der Button „Live“." />
<Grid x:Name="LautFmFields" Margin="0,4,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ui:TextBlock Margin="0,12,0,0" Grid.ColumnSpan="2" FontTypography="BodyStrong" Text="Live senden" />
<Label Grid.Row="1" Margin="0,8,0,0" VerticalAlignment="Center"
Content="Server" Target="{Binding ElementName=LautFmHostBox}" />
<ui:TextBox x:Name="LautFmHostBox" Grid.Row="1" Grid.Column="1" Margin="0,8,0,0"
AutomationProperties.Name="laut.fm-Server" />
<Label Grid.Row="2" Margin="0,8,0,0" VerticalAlignment="Center"
Content="Port" Target="{Binding ElementName=LautFmPortBox}" />
<ui:NumberBox x:Name="LautFmPortBox" Grid.Row="2" Grid.Column="1" Margin="0,8,0,0"
Width="130" HorizontalAlignment="Left" Minimum="1" Maximum="65535"
MaxDecimalPlaces="0" SmallChange="1" ClearButtonEnabled="False"
AutomationProperties.Name="laut.fm-Port" />
<Label Grid.Row="3" Margin="0,8,0,0" VerticalAlignment="Center"
Content="Mountpoint" Target="{Binding ElementName=LautFmMountBox}" />
<ui:TextBox x:Name="LautFmMountBox" Grid.Row="3" Grid.Column="1" Margin="0,8,0,0"
AutomationProperties.Name="laut.fm-Mountpoint" />
<Label Grid.Row="4" Margin="0,8,0,0" VerticalAlignment="Center"
Content="Benutzer" Target="{Binding ElementName=LautFmUserBox}" />
<ui:TextBox x:Name="LautFmUserBox" Grid.Row="4" Grid.Column="1" Margin="0,8,0,0"
AutomationProperties.Name="laut.fm-Benutzer" />
<Label Grid.Row="5" Margin="0,8,0,0" VerticalAlignment="Center"
Content="Passwort" Target="{Binding ElementName=LautFmPasswordBox}" />
<ui:PasswordBox x:Name="LautFmPasswordBox" Grid.Row="5" Grid.Column="1" Margin="0,8,0,0"
AutomationProperties.Name="laut.fm-Passwort" />
<ui:TextBlock Grid.Row="6" Grid.ColumnSpan="2" Margin="0,8,0,0" TextWrapping="Wrap"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="Diese Werte stehen in Radioadmin unter „Live senden“." />
<ui:TextBlock Grid.Row="7" Margin="0,16,0,0" Grid.ColumnSpan="2" FontTypography="BodyStrong" Text="Bibliothek" />
<Label Grid.Row="8" Margin="0,8,0,0" VerticalAlignment="Center"
Content="Stations-ID" Target="{Binding ElementName=LautFmStationBox}" />
<ui:TextBox x:Name="LautFmStationBox" Grid.Row="8" Grid.Column="1" Margin="0,8,0,0"
AutomationProperties.Name="laut.fm-Stations-ID" />
<Label Grid.Row="9" Margin="0,8,0,0" VerticalAlignment="Center"
Content="Radioadmin-Token" Target="{Binding ElementName=LautFmTokenBox}" />
<ui:PasswordBox x:Name="LautFmTokenBox" Grid.Row="9" Grid.Column="1" Margin="0,8,0,0"
AutomationProperties.Name="Radioadmin-Token"
ToolTip="Nach dem Login in Radioadmin in den Entwicklertools des Browsers: Lokaler Speicher, SchlĂĽssel laut.fm.api.token." />
</Grid>
<ui:TextBlock x:Name="LautFmHint" Margin="0,12,0,0" TextWrapping="Wrap"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="Passwort und Token werden verschlĂĽsselt fĂĽr deinen Windows-Benutzer gespeichert. Die Bibliothek nutzt eine nicht offizielle laut.fm-Schnittstelle und kann ohne Vorwarnung ausfallen." />
</StackPanel>
</Border>
<StackPanel Margin="0,4,0,0" Orientation="Horizontal">
<ui:Button Appearance="Primary" MinWidth="110" Content="Speichern" Icon="{ui:SymbolIcon Save24}" Click="OnSave" />
<ui:Button Margin="8,0,0,0" MinWidth="110" Content="ZurĂĽcksetzen" Icon="{ui:SymbolIcon ArrowReset24}"