1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! TIMELINE-001: TimelinePlayer State Management
//! Sprint 77 - GREEN Phase
//!
//! TimelinePlayer manages recording playback state and provides navigation controls
//! for the Timeline UI. It wraps a Recording and tracks the current frame position,
//! playback state, and speed.
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │ TimelinePlayer │
//! │ │
//! │ ┌─────────────┐ ┌──────────────┐ │
//! │ │ Recording │────────▶│ Snapshots │ │
//! │ │ │ │ [0..N] │ │
//! │ └─────────────┘ └──────────────┘ │
//! │ ▲ │
//! │ │ │
//! │ ┌───────┴────────┐ │
//! │ │ current_frame │ │
//! │ │ (position) │ │
//! │ └────────────────┘ │
//! │ │
//! │ Navigation Methods: │
//! │ • next_frame() ──────▶ Advance forward │
//! │ • prev_frame() ──────▶ Move backward │
//! │ • jump_to(N) ──────▶ Random access │
//! │ │
//! │ Playback Control: │
//! │ • play() ──────▶ Enable auto-advance │
//! │ • pause() ──────▶ Disable auto-advance │
//! │ • set_speed() ──────▶ Adjust playback rate │
//! └─────────────────────────────────────────────────────────────┘
//! ```
//!
//! ## Usage
//!
//! ```rust,no_run
//! use pmat::services::dap::{Recording, TimelinePlayer};
//! use std::path::PathBuf;
//!
//! // Load recording from file
//! let recording = Recording::load_from_file(&PathBuf::from("session.pmat"))?;
//!
//! // Create player
//! let mut player = TimelinePlayer::new(recording);
//!
//! // Navigate through frames
//! player.next_frame(); // Advance to frame 1
//! player.prev_frame(); // Back to frame 0
//! player.jump_to(50)?; // Jump to frame 50
//!
//! // Playback control
//! player.play(); // Start auto-advance mode
//! player.set_speed(2.0); // 2x speed
//! player.pause(); // Stop auto-advance
//!
//! // Access current state
//! let snapshot = player.current_snapshot();
//! let position = player.current_frame();
//! let total = player.total_frames();
//! # Ok::<(), anyhow::Error>(())
//! ```
use ;
use Result;
/// TimelinePlayer manages recording playback state and navigation
///
/// Wraps a Recording and provides:
/// - Frame position tracking (current_frame)
/// - Navigation controls (next, prev, jump)
/// - Playback state (play, pause, speed)
/// - Current snapshot access for UI rendering
// Navigation and constructor methods (new, current_frame, total_frames, next_frame, prev_frame, jump_to, current_snapshot)
include!;
// Playback control methods (play, pause, is_playing, set_speed, playback_speed, recording)
include!;
// Unit tests
include!;