Skip to content

[pull] master from MusicPlayerDaemon:master #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 24, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented May 24, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

Enable double-typed configuration parameters and integrate a new vgmstream decoder plugin with corresponding build option and registration

New Features:

  • Add support for parsing and retrieving double configuration values
  • Introduce vgmstream decoder plugin for playback and metadata with new meson feature option

Build:

  • Detect and link against the vgmstream library in meson and include its plugin sources

Documentation:

  • Update plugin documentation to include vgmstream

@pull pull bot added the ⤵️ pull label May 24, 2025
@pull pull bot merged commit cf7b9e0 into CartoonFan:master May 24, 2025
1 check was pending
Copy link

sourcery-ai bot commented May 24, 2025

Reviewer's Guide

This PR extends the configuration subsystem to support double-precision values, integrates the vgmstream library into the build system, and introduces a new Vgmstream decoder plugin with full implementation and registration.

Sequence Diagram for Decoding a VGMStream File

sequenceDiagram
    actor User
    participant DecoderClient
    participant MPD_Core
    participant VgmstreamDecoderPlugin
    participant libvgmstream

    User->>MPD_Core: Play VGM file (path_fs)
    MPD_Core->>VgmstreamDecoderPlugin: VgmstreamFileDecode(client, path_fs)
    activate VgmstreamDecoderPlugin
    VgmstreamDecoderPlugin->>VgmstreamDecoderPlugin: path, subsong = ParseContainerPath(path_fs)
    VgmstreamDecoderPlugin->>libvgmstream: libstreamfile_open_from_stdio(path)
    activate libvgmstream
    libvgmstream-->>VgmstreamDecoderPlugin: file_handle
    deactivate libvgmstream
    VgmstreamDecoderPlugin->>libvgmstream: libvgmstream_create(file_handle, subsong, config)
    activate libvgmstream
    libvgmstream-->>VgmstreamDecoderPlugin: lib_handle
    deactivate libvgmstream

    VgmstreamDecoderPlugin->>VgmstreamDecoderPlugin: audio_format = VgmstreamGetFormat(lib_handle)
    VgmstreamDecoderPlugin->>DecoderClient: Ready(audio_format, true, song_time)

    VgmstreamDecoderPlugin->>VgmstreamDecoderPlugin: VgmstreamScanTags(path, lib_handle, tag_handler, rgi)
    VgmstreamDecoderPlugin->>DecoderClient: SubmitReplayGain(rgi)
    VgmstreamDecoderPlugin->>DecoderClient: SubmitTag(tag)

    loop Decode Loop
        VgmstreamDecoderPlugin->>libvgmstream: libvgmstream_render(lib_handle)
        activate libvgmstream
        libvgmstream-->>VgmstreamDecoderPlugin: rendered_data (or error/done)
        deactivate libvgmstream
        opt if error or done
            VgmstreamDecoderPlugin-->> MPD_Core: break loop
        end
        alt PCM24 format
            VgmstreamDecoderPlugin->>VgmstreamDecoderPlugin: pcm_unpack_24(data)
            VgmstreamDecoderPlugin->>DecoderClient: SubmitAudio(unpacked_data)
        else Other formats
            VgmstreamDecoderPlugin->>DecoderClient: SubmitAudio(rendered_data)
        end

        alt Seek Requested by Client
            DecoderClient->>VgmstreamDecoderPlugin: GetSeekFrame() (checks for command)
            VgmstreamDecoderPlugin-->>DecoderClient: seek_frame
            VgmstreamDecoderPlugin->>libvgmstream: libvgmstream_seek(lib_handle, seek_frame)
            VgmstreamDecoderPlugin->>DecoderClient: CommandFinished()
            VgmstreamDecoderPlugin->>DecoderClient: SubmitTimestamp(new_song_time)
        end
    end

    VgmstreamDecoderPlugin->>libvgmstream: libvgmstream_free(lib_handle)
    VgmstreamDecoderPlugin->>libvgmstream: libstreamfile_close(file_handle)
    deactivate VgmstreamDecoderPlugin
Loading

Sequence Diagram for Retrieving a Double Configuration Value

sequenceDiagram
    participant Component
    participant ConfigBlock
    participant BlockParam
    participant Parser

    Component->>ConfigBlock: GetBlockValue("setting_name", 1.0)
    activate ConfigBlock
    ConfigBlock->>ConfigBlock: bp = GetBlockParam("setting_name")
    alt BlockParam found (bp != nullptr)
        ConfigBlock->>BlockParam: GetDoubleValue()
        activate BlockParam
        BlockParam->>Parser: ParseDouble(value_string_from_bp)
        activate Parser
        Parser-->>BlockParam: parsed_double_value
        deactivate Parser
        BlockParam-->>ConfigBlock: parsed_double_value
        deactivate BlockParam
        ConfigBlock-->>Component: parsed_double_value
    else BlockParam not found (bp == nullptr)
        ConfigBlock-->>Component: default_value (1.0)
    end
    deactivate ConfigBlock
Loading

Class Diagram for Configuration System Updates

classDiagram
    class BlockParam {
        +GetBoolValue() bool
        +GetDoubleValue() double
        +GetDuration() duration
        +GetStringValue() string
        +GetPathValue() Path
        +GetPositiveValue() unsigned
        +GetUnsignedValue() unsigned
    }

    class ConfigBlock {
        +GetBlockValue(name, default_value) bool
        +GetBlockValue(name, default_value) double
        +GetBlockValue(name, default_value) string
        +GetBlockValue(name, default_value) Path
        +GetBlockValue(name, default_value) unsigned
        +GetDuration(name, min_value, default_value) duration
    }

    class Parser {
        <<Utility>>
        +ParseBool(s) bool
        +ParseDouble(s) double
        +ParseDuration(s, min_value) duration
        +ParsePath(s) Path
        +ParsePositive(s) unsigned
        +ParseUnsigned(s) unsigned
    }

    ConfigBlock ..> BlockParam : uses
    BlockParam ..> Parser : uses for parsing value
Loading

File-Level Changes

Change Details Files
Added support for parsing and retrieving double values in configuration blocks
  • Implemented BlockParam::GetDoubleValue() and ConfigBlock::GetBlockValue overload
  • Declared ParseDouble in Parser.hxx and Block.hxx
  • Added ParseDouble definition in Parser.cxx with error checking
src/config/Block.cxx
src/config/Block.hxx
src/config/Parser.cxx
src/config/Parser.hxx
Integrated vgmstream dependency into Meson build configuration
  • Added 'vgmstream' option in meson_options.txt
  • Detected vgmstream library and set ENABLE_VGMSTREAM feature flag
  • Appended VgmstreamDecoderPlugin.cxx to decoder_plugins_sources and dependency list
src/decoder/plugins/meson.build
meson_options.txt
Introduced VgmstreamDecoderPlugin implementation and registration
  • Added VgmstreamDecoderPlugin.cxx with full decoding, tag scanning, and container support
  • Created corresponding header VgmstreamDecoderPlugin.hxx
  • Registered plugin in DecoderList.cxx under ENABLE_VGMSTREAM
src/decoder/plugins/VgmstreamDecoderPlugin.cxx
src/decoder/plugins/VgmstreamDecoderPlugin.hxx
src/decoder/DecoderList.cxx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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

Successfully merging this pull request may close these issues.

2 participants