Skip to content

pptx: read media volume, mute, loop, hide and full screen from the timing tree (refs #1368) - #1465

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
Harrison-Booth:dc-sassisasah-2
Oct 30, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
Harrison-Booth:dc-sassisasah-2

Conversation

@Harrison-Booth

@Harrison-Booth Harrison-Booth commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Reads the media settings PowerPoint keeps in the slide's timing tree (part of #1368).

PowerPoint stores a video's or sound's volume, mute, Loop until Stopped, Hide While Not Playing and Play Full Screen on p:video/p:audio > p:cMediaNode (vol, mute, showWhenStopped, p:cTn repeatCount) and fullScrn, not on the picture, so MediaClip::volume stayed 1 and loop_play, hide_while_not_playing and full_screen stayed false after opening a file.

timing::media_settings now copies them onto the target's MediaClip (also inside groups). Absent attributes leave the existing defaults; mute gives volume 0.

Not in this PR: handing a decoded video frame to the renderer (the RenderOpts::video_frames half of the issue), and writing these settings back on save (the writer does not emit cMediaNode yet).

What ran: cargo test -p deckcraft-pptx on Linux (all pass), including two new tests that splice a timing tree into an exported deck and read it back (crates/pptx/tests/it/media_timing.rs). I did not open the files in PowerPoint; the attribute meanings are taken from the issue and the schema.

Refs #1368

Summary by CodeRabbit

  • New Features
    • Imported presentations now retain audio and video playback settings, including volume and mute state, looping, full-screen playback, and whether media is hidden when stopped.
    • Media clips without applicable timing settings continue to use their existing default behavior.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 88c2cef and 964f475.

Files selected for processing: 4
  • crates/pptx/src/read.rs
  • crates/pptx/src/read/timing.rs
  • crates/pptx/tests/it/main.rs
  • crates/pptx/tests/it/media_timing.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

Slide import now reads video and audio timing settings and applies them to matching media shapes. Supported settings include volume, mute, hide-while-stopped, looping, and full-screen playback.

Changes: Media Timing Import

Layer / File(s) Summary
Parse media timing settings
crates/pptx/src/read/timing.rs
media_settings resolves video and audio timing targets and applies supported settings to matching media shapes.
Wire slide import and test media settings
crates/pptx/src/read.rs, crates/pptx/tests/it/main.rs, crates/pptx/tests/it/media_timing.rs
read_slide calls media_settings when a slide has timing. Integration tests check imported media settings and defaults when settings are absent.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant read_slide
  participant media_settings
  participant IdCtx
  participant Shapes
  read_slide->>media_settings: timing element, shape context, mutable shapes
  media_settings->>IdCtx: resolve cMediaNode target
  IdCtx-->>media_settings: matching shape reference
  media_settings->>Shapes: update media settings
Loading

Suggested reviewers: marcoarnulfo, aiongg

Merge Risk: Minimal · up to 964f4

No actionable issue is established for this change. The timing import can merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: reading media volume, mute, loop, hide, and full-screen settings from the PowerPoint timing tree.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 4 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 42b0e1d into storytold:main Oct 30, 2026
1 check passed
@echelon

echelon commented Oct 30, 2026

Copy link
Copy Markdown
Member

Landed on main, thank you @Harrison-Booth for the contribution! If you haven't already, come join us on Discord: https://discord.gg/artcraft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants