Skip to content

renamed sequence player to engine player. Step 6#33045

Merged
RomanPudashkin merged 2 commits intomusescore:masterfrom
igorkorsukov:w/audio/remove_seq_6
Apr 17, 2026
Merged

renamed sequence player to engine player. Step 6#33045
RomanPudashkin merged 2 commits intomusescore:masterfrom
igorkorsukov:w/audio/remove_seq_6

Conversation

@igorkorsukov
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 277f3387-0c84-4e46-a3a5-8d24efb7ce8d

📥 Commits

Reviewing files that changed from the base of the PR and between 27803f2 and 6915efc.

📒 Files selected for processing (7)
  • src/framework/audio/common/audiotypes.h
  • src/framework/audio/engine/internal/engineplayback.h
  • src/framework/audio/engine/internal/enginerpccontroller.cpp
  • src/framework/audio/engine/internal/enginerpccontroller.h
  • src/framework/audio/main/internal/playback.cpp
  • src/framework/audio/main/internal/playback.h
  • src/framework/audio/main/iplayback.h
💤 Files with no reviewable changes (1)
  • src/framework/audio/common/audiotypes.h

📝 Walkthrough

Walkthrough

Sequence-related public types and interfaces were removed or renamed. TrackSequenceId, TrackSequenceIdList, and DUMMY_SEQUENCE_ID were deleted from audio public types. The ITrackSequence interface was removed. ISequencePlayer and SequencePlayer were renamed to IEnginePlayer and EnginePlayer (with corresponding pointer/type aliases) and CMake targets updated. Save-sound-track progress RPC stream payloads and playback logic were changed to drop sequence identifiers. Inline comments were adjusted to use more general track/playback terminology.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request has no description provided by the author, despite the template requiring sections for issue resolution, change motivation, and verification checklist completion. Add a description explaining the refactoring purpose, issue it resolves, and confirm completed checklist items from the template.
Docstring Coverage ⚠️ Warning Docstring coverage is 5.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: renaming SequencePlayer to EnginePlayer and removing TrackSequence-related types as part of a larger refactoring series.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/framework/audio/main/internal/playback.h (1)

22-23: 🧹 Nitpick | 🔵 Trivial

Nit: stale header guard name.

The header guard MUSE_AUDIO_SEQUENCER_H is a leftover from the sequencer-era naming. Consider renaming to MUSE_AUDIO_PLAYBACK_H (or switching to #pragma once for consistency with other headers in this PR like iengineplayer.h) while you're cleaning up sequence terminology.

Also applies to: 123-123

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/framework/audio/main/internal/playback.h` around lines 22 - 23, Header
guard name MUSE_AUDIO_SEQUENCER_H is stale; change it to MUSE_AUDIO_PLAYBACK_H
(or replace with `#pragma` once for consistency with iengineplayer.h). Update the
opening macro (MUSE_AUDIO_SEQUENCER_H -> MUSE_AUDIO_PLAYBACK_H), the matching
`#endif` comment (if any), and any other occurrences in playback.h (including the
one noted around line 123) so the macro name is consistent throughout the file.
src/framework/audio/main/internal/playback.cpp (1)

601-625: ⚠️ Potential issue | 🔴 Critical

Critical: inited is never set to true — the GetSaveSoundTrackProgress RPC is re-sent on every call.

The guard at line 604 is ineffective because nothing ever flips inited. Each invocation of saveSoundTrackProgressChanged() will dispatch another Method::GetSaveSoundTrackProgress message to the engine; the in-callback m_saveSoundTrackProgressStreamId == 0 check only prevents duplicate stream registrations — it does not avoid the redundant RPC round-trips (and the assert(m_saveSoundTrackProgressStreamId == streamId) on line 620 assumes the engine returns the same id every time, which is an implementation coupling worth avoiding).

Additionally, note the lifecycle mismatch with deinitPlayback() (line 139): it resets m_saveSoundTrackProgressStream but leaves m_saveSoundTrackProgressStreamId stale. Once inited is properly flipped, a re-init cycle would never re-register the stream. Both pieces of state should be reset together.

🐛 Proposed fix
 SaveSoundTrackProgress Playback::saveSoundTrackProgressChanged() const
 {
-    static bool inited = false;
-    if (!inited) {
+    if (m_saveSoundTrackProgressStreamId == 0) {
         Msg msg = rpc::make_request(Method::GetSaveSoundTrackProgress);
         channel()->send(msg, [this](const Msg& res) {
             ONLY_AUDIO_MAIN_THREAD;
             StreamId streamId = 0;
             IF_ASSERT_FAILED(RpcPacker::unpack(res.data, streamId)) {
                 return;
             }
 
             if (m_saveSoundTrackProgressStreamId == 0) {
                 m_saveSoundTrackProgressStreamId = streamId;
                 channel()->addReceiveStream(StreamName::SaveSoundTrackProgressStream,
                                             m_saveSoundTrackProgressStreamId,
                                             m_saveSoundTrackProgressStream);
             }
 
             assert(m_saveSoundTrackProgressStreamId == streamId);
         });
     }
 
     return m_saveSoundTrackProgressStream;
 }

And in deinitPlayback():

 void Playback::deinitPlayback()
 {
     ONLY_AUDIO_MAIN_THREAD;
+    m_saveSoundTrackProgressStreamId = 0;
     m_saveSoundTrackProgressStream = SaveSoundTrackProgress();
 }

Using the m_saveSoundTrackProgressStreamId == 0 member as the guard (instead of a function-local static) also removes the cross-instance coupling that a function-local static introduces if more than one Playback is ever constructed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/framework/audio/main/internal/playback.cpp` around lines 601 - 625, The
function-local static "inited" is never flipped so the RPC in
saveSoundTrackProgressChanged() is re-sent every call; replace that static guard
with a member-based guard by checking m_saveSoundTrackProgressStreamId (send the
rpc only when m_saveSoundTrackProgressStreamId == 0), and keep the existing
callback logic to set m_saveSoundTrackProgressStreamId and register the stream
via channel()->addReceiveStream(StreamName::SaveSoundTrackProgressStream,
m_saveSoundTrackProgressStreamId, m_saveSoundTrackProgressStream); also update
deinitPlayback() to reset both m_saveSoundTrackProgressStream and
m_saveSoundTrackProgressStreamId back to 0 so re-initialization works correctly
and removes the cross-instance coupling introduced by the function-local static.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/framework/audio/main/internal/playback.cpp`:
- Around line 601-625: The function-local static "inited" is never flipped so
the RPC in saveSoundTrackProgressChanged() is re-sent every call; replace that
static guard with a member-based guard by checking
m_saveSoundTrackProgressStreamId (send the rpc only when
m_saveSoundTrackProgressStreamId == 0), and keep the existing callback logic to
set m_saveSoundTrackProgressStreamId and register the stream via
channel()->addReceiveStream(StreamName::SaveSoundTrackProgressStream,
m_saveSoundTrackProgressStreamId, m_saveSoundTrackProgressStream); also update
deinitPlayback() to reset both m_saveSoundTrackProgressStream and
m_saveSoundTrackProgressStreamId back to 0 so re-initialization works correctly
and removes the cross-instance coupling introduced by the function-local static.

In `@src/framework/audio/main/internal/playback.h`:
- Around line 22-23: Header guard name MUSE_AUDIO_SEQUENCER_H is stale; change
it to MUSE_AUDIO_PLAYBACK_H (or replace with `#pragma` once for consistency with
iengineplayer.h). Update the opening macro (MUSE_AUDIO_SEQUENCER_H ->
MUSE_AUDIO_PLAYBACK_H), the matching `#endif` comment (if any), and any other
occurrences in playback.h (including the one noted around line 123) so the macro
name is consistent throughout the file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 792f7d53-f59f-45da-a307-1a08bc80a5a2

📥 Commits

Reviewing files that changed from the base of the PR and between 564ee17 and 80a6295.

📒 Files selected for processing (13)
  • src/framework/audio/common/audiotypes.h
  • src/framework/audio/engine/CMakeLists.txt
  • src/framework/audio/engine/iengineplayer.h
  • src/framework/audio/engine/internal/engineplayback.cpp
  • src/framework/audio/engine/internal/engineplayback.h
  • src/framework/audio/engine/internal/engineplayer.cpp
  • src/framework/audio/engine/internal/engineplayer.h
  • src/framework/audio/engine/internal/enginerpccontroller.cpp
  • src/framework/audio/engine/internal/enginerpccontroller.h
  • src/framework/audio/engine/itracksequence.h
  • src/framework/audio/main/internal/playback.cpp
  • src/framework/audio/main/internal/playback.h
  • src/framework/audio/main/iplayback.h
💤 Files with no reviewable changes (2)
  • src/framework/audio/common/audiotypes.h
  • src/framework/audio/engine/itracksequence.h

@igorkorsukov igorkorsukov force-pushed the w/audio/remove_seq_6 branch from 80a6295 to 27803f2 Compare April 17, 2026 14:52
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/framework/audio/main/internal/playback.cpp (1)

601-627: ⚠️ Potential issue | 🟠 Major

static bool inited should be a per-instance member — breaks multi-context and re-init.

Playback is a context-scoped service (one instance per window, per the class comment in playback.h), but inited is a function-local static, so it is shared process-wide across all Playback instances. Only the first instance will send GetSaveSoundTrackProgress; every other instance will skip the request and return its own m_saveSoundTrackProgressStream that is never attached via addReceiveStream, so consumers in those contexts will silently receive no progress updates.

The same flag also persists across deinitPlayback() → re-init cycles. Since deinitPlayback() (Line 139) replaces m_saveSoundTrackProgressStream with a fresh SaveSoundTrackProgress() but leaves inited == true and m_saveSoundTrackProgressStreamId != 0, the next call to this method won't resubscribe and will hand out a disconnected channel. Note also that m_saveSoundTrackProgressStreamId is never reset in deinitPlayback(), which makes the if (m_saveSoundTrackProgressStreamId == 0) guard in the lambda incorrect on re-init.

🛠️ Suggested fix

In playback.h, add a member flag next to m_saveSoundTrackProgressStreamId:

mutable bool m_saveSoundTrackProgressInited = false;

In playback.cpp:

 void Playback::deinitPlayback()
 {
     ONLY_AUDIO_MAIN_THREAD;
     m_saveSoundTrackProgressStream = SaveSoundTrackProgress();
+    m_saveSoundTrackProgressStreamId = 0;
+    m_saveSoundTrackProgressInited = false;
 }
 SaveSoundTrackProgress Playback::saveSoundTrackProgressChanged() const
 {
-    static bool inited = false;
-    if (!inited) {
+    if (!m_saveSoundTrackProgressInited) {
         Msg msg = rpc::make_request(Method::GetSaveSoundTrackProgress);
         channel()->send(msg, [this](const Msg& res) {
             ...
         });

-        inited = true;
+        m_saveSoundTrackProgressInited = true;
     }

     return m_saveSoundTrackProgressStream;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/framework/audio/main/internal/playback.cpp` around lines 601 - 627,
Replace the function-local static inited with a per-instance mutable flag (e.g.
add mutable bool m_saveSoundTrackProgressInited = false next to
m_saveSoundTrackProgressStreamId in Playback) and use that member inside
saveSoundTrackProgressChanged() instead of the static; also ensure
deinitPlayback() resets m_saveSoundTrackProgressInited to false and resets
m_saveSoundTrackProgressStreamId to 0 so re-init will re-subscribe, and keep the
lambda logic that assigns m_saveSoundTrackProgressStreamId and calls
channel()->addReceiveStream when the id is 0 (or when changed) so each Playback
instance gets its own receive stream.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/framework/audio/main/internal/playback.cpp`:
- Around line 601-627: Replace the function-local static inited with a
per-instance mutable flag (e.g. add mutable bool m_saveSoundTrackProgressInited
= false next to m_saveSoundTrackProgressStreamId in Playback) and use that
member inside saveSoundTrackProgressChanged() instead of the static; also ensure
deinitPlayback() resets m_saveSoundTrackProgressInited to false and resets
m_saveSoundTrackProgressStreamId to 0 so re-init will re-subscribe, and keep the
lambda logic that assigns m_saveSoundTrackProgressStreamId and calls
channel()->addReceiveStream when the id is 0 (or when changed) so each Playback
instance gets its own receive stream.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 59a987ff-2fea-461e-99cc-0bcbb31838cb

📥 Commits

Reviewing files that changed from the base of the PR and between 80a6295 and 27803f2.

📒 Files selected for processing (7)
  • src/framework/audio/common/audiotypes.h
  • src/framework/audio/engine/internal/engineplayback.h
  • src/framework/audio/engine/internal/enginerpccontroller.cpp
  • src/framework/audio/engine/internal/enginerpccontroller.h
  • src/framework/audio/main/internal/playback.cpp
  • src/framework/audio/main/internal/playback.h
  • src/framework/audio/main/iplayback.h
💤 Files with no reviewable changes (1)
  • src/framework/audio/common/audiotypes.h

@igorkorsukov igorkorsukov force-pushed the w/audio/remove_seq_6 branch from 27803f2 to 6915efc Compare April 17, 2026 15:06
@RomanPudashkin RomanPudashkin merged commit b669ca8 into musescore:master Apr 17, 2026
13 checks passed
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.

2 participants