ASE: project.cc: activate new tracks on creation if Project is active - #70
ASE: project.cc: activate new tracks on creation if Project is active#70swesterfeld wants to merge 1 commit into
Conversation
Fixes tim-janik#69. Signed-off-by: Stefan Westerfeld <stefan@space.twc.de>
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR fixes a critical issue with CLAP plugin support by ensuring newly created tracks are properly activated when the project is already active. The change adds a simple conditional activation call (track->_activate()) immediately after creating a new track in ProjectImpl::create_track(). This addresses issue #69 where CLAP devices on newly created tracks would ignore MIDI events because they were never activated, making CLAP support appear unreliable.
The fix follows the existing activation pattern found in the project's _activate() method, which activates all tracks when the project becomes active. However, there was previously no corresponding logic to activate individual tracks created after the project was already active. This change ensures consistency in the activation lifecycle by mirroring the project-level activation behavior at the track creation level.
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
| ase/project.cc | 5/5 | Adds conditional track activation for new tracks when project is active |
Confidence score: 5/5
- This PR is extremely safe to merge with minimal risk of causing production issues
- Score reflects a simple, well-targeted fix that follows existing code patterns and directly addresses a specific bug without introducing complex logic changes
- No files require special attention as the change is minimal and follows established activation patterns in the codebase
Sequence Diagram
sequenceDiagram
participant User
participant ProjectImpl
participant TrackImpl
participant Engine
User->>ProjectImpl: "create_track()"
ProjectImpl->>TrackImpl: "TrackImpl::make_shared(*this, !havemaster)"
ProjectImpl->>ProjectImpl: "tracks_.insert(track)"
ProjectImpl->>ProjectImpl: "emit_event('track', 'insert')"
ProjectImpl->>TrackImpl: "_set_parent(this)"
alt Project is active
ProjectImpl->>ProjectImpl: "is_active()"
ProjectImpl->>TrackImpl: "_activate()"
end
ProjectImpl->>ProjectImpl: "emit_notify('all_tracks')"
ProjectImpl-->>User: "return track"
1 file reviewed, no comments
Fixes #69.
It turned out that the reason CLAP support is currently unreliable is not in the CLAP code itself, but caused by the fact that the CLAP device never gets activated, and thus ignores midi events if you follow the steps to reproduce the problem (described in #69).