feat(qbz-player): Phase 6.5 - export full Player module
Reorganize qbz-player to export the complete Player struct with all playback functionality. Changes: - Restructure: mod.rs -> player/mod.rs with submodules - Add rodio, serde, reqwest, qbz-qobuz dependencies - Export Player, SharedState, PlaybackState, PlaybackEvent - Export streaming types (BufferedMediaSource, etc.) The Player module is now fully available from qbz-player crate. Full workspace and src-tauri compile successfully.
This commit is contained in:
1 parent
0238b1c559
commit
71f8d09c41
5 files changed
+27
-20
No files matched your search
@@ -8,6 +8,10 @@ description = "Playback engine and queue management for QBZ"
|
||||
[dependencies]
|
||||
qbz-models = { path = "../qbz-models" }
|
||||
qbz-audio = { path = "../qbz-audio" }
|
||||
qbz-qobuz = { path = "../qbz-qobuz" }
|
||||
|
||||
# Serialization
|
||||
serde = { workspace = true }
|
||||
|
||||
# Async
|
||||
tokio = { workspace = true }
|
||||
@@ -27,6 +31,8 @@ rand = "0.8"
|
||||
# Audio decoding
|
||||
symphonia = { workspace = true }
|
||||
|
||||
# Vendored audio libraries (will be copied in Phase 3)
|
||||
# rodio = { path = "./vendor/rodio", features = ["symphonia-all"] }
|
||||
# cpal = { path = "./vendor/cpal" }
|
||||
# Vendored audio libraries (same as qbz-audio)
|
||||
rodio = { path = "../../src-tauri/vendor/rodio", features = ["symphonia-all"] }
|
||||
|
||||
# HTTP client for streaming
|
||||
reqwest = { workspace = true }
|
||||
@@ -2,8 +2,8 @@
|
||||
//!
|
||||
//! This crate provides:
|
||||
//! - QueueManager: Track queue management with shuffle/repeat
|
||||
//! - Player: Main playback control (TODO: Phase 3b)
|
||||
//! - StreamingSource: HTTP audio streaming (TODO: Phase 3b)
|
||||
//! - Player: Main playback engine
|
||||
//! - StreamingSource: HTTP audio streaming
|
||||
//!
|
||||
//! # Architecture
|
||||
//!
|
||||
@@ -23,26 +23,26 @@
|
||||
//!
|
||||
//! # Usage
|
||||
//!
|
||||
//! ```rust
|
||||
//! use qbz_player::QueueManager;
|
||||
//! use qbz_models::QueueTrack;
|
||||
//! ```rust,ignore
|
||||
//! use qbz_player::{Player, QueueManager};
|
||||
//! use qbz_audio::{AudioSettings, AudioDiagnostic};
|
||||
//!
|
||||
//! let player = Player::new(None, AudioSettings::default(), None, AudioDiagnostic::new());
|
||||
//! let queue = QueueManager::new();
|
||||
//! // queue.add_track(track);
|
||||
//! // queue.next();
|
||||
//! ```
|
||||
|
||||
pub mod queue;
|
||||
pub mod player;
|
||||
|
||||
// Re-export main types
|
||||
pub use queue::QueueManager;
|
||||
|
||||
// TODO: Phase 3b - Extract player module
|
||||
// The player module has complex dependencies on:
|
||||
// - QobuzClient (for streaming URLs)
|
||||
// - Audio backend (for playback)
|
||||
// - Config system (for audio settings)
|
||||
// - Visualizer
|
||||
//
|
||||
// These need to be abstracted via traits before extraction.
|
||||
// For now, the player remains in qbz-nix/src-tauri.
|
||||
pub use player::{
|
||||
Player,
|
||||
SharedState,
|
||||
PlaybackState,
|
||||
PlaybackEvent,
|
||||
BufferedMediaSource,
|
||||
BufferWriter,
|
||||
StreamingConfig,
|
||||
IncrementalStreamingSource,
|
||||
};
|
||||
@@ -37,6 +37,7 @@ use symphonia::core::probe::Hint;
|
||||
use symphonia::default::{get_codecs, get_probe};
|
||||
|
||||
use qbz_models::Quality;
|
||||
use qbz_qobuz::QobuzClient;
|
||||
use qbz_audio::{
|
||||
AudioBackendType, AudioDiagnostic, BackendConfig, BackendManager, DiagnosticSource,
|
||||
extract_replaygain, calculate_gain_factor, db_to_linear,
|
||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user