Add StreamType for multi-client support and improved UPnP control

- Introduce `Streamtype` enum (Continuous vs Finite) to distinguish radio streams from finite tracks
- Enrich `TrackBoundary` sync marker with stream type for proper pause behavior per mode (silence vs backpressure)
- Update all sources and sinks to pass `StreamType` when creating track boundaries
  - Radio Paradise, HTTP source → Continuous (infinite)
- Improve UPnP control architecture: pause sends silence for radio, blocks pipeline via backpressure for tracks
- Prepare groundwork for multi-client DSP architecture with shared source and per-DSP pipelines
This commit is contained in:
2026-04-04 14:37:11 +02:00
parent 33b279ff1e
commit 8924552696
16 changed files with 204 additions and 21 deletions

View File

@@ -13,7 +13,7 @@ use pmoaudio::{
nodes::{AudioError, TypedAudioNode, DEFAULT_CHUNK_DURATION_MS},
pipeline::{send_to_children, send_to_children_with_timing, Node, NodeLogic},
type_constraints::TypeRequirement,
AudioPipelineNode, AudioSegment, SyncMarker, I24,
AudioPipelineNode, AudioSegment, SyncMarker, I24, StreamType,
};
use pmoflac::decode_audio_stream;
use pmometadata::{MemoryTrackMetadata, TrackMetadata};
@@ -243,6 +243,7 @@ impl RadioParadiseStreamSourceLogic {
let track_boundary = AudioSegment::new_track_boundary(
*order, 0.0, // timestamp = 0 au début du stream
metadata,
StreamType::Continuous,
);
self.send_to_children(output, track_boundary).await?;
song_index = 1;
@@ -336,7 +337,7 @@ impl RadioParadiseStreamSourceLogic {
let metadata = song_to_metadata(song, block).await;
let timestamp_sec = total_samples as f64 / sample_rate as f64;
let track_boundary =
AudioSegment::new_track_boundary(*order, timestamp_sec, metadata);
AudioSegment::new_track_boundary(*order, timestamp_sec, metadata, StreamType::Continuous);
self.send_to_children(output, track_boundary).await?;
// Passer à la song suivante