// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown // SPDX-License-Identifier: GPL-3.0-or-later // For SizzleSession categories only (Objective-C++): run code on the song under // the song lock. Each screen adds the API it needs in its own category file // (SizzleSession+Tracker / +Mix / +Setup) instead of growing SizzleSession.mm. #import "SizzleSession.h" #include "sizzle/Engine.hpp" #include "sizzle/Model.hpp" #include "sampler/SampleStore.hpp" @interface SizzleSession () /// Change the song: [body] runs under the lock, then SizzleSessionDidChange is posted. - (void)edit:(void (^)(sizzle::model::Project &p, sizzle::engine::Engine &e))body; /// Read the song consistently: [body] runs under the lock, nothing is posted. - (void)read:(void (^)(const sizzle::model::Project &p, const sizzle::engine::Engine &e))body; /// Put back into the store every sample the song refers to (Documents/samples). - (void)rehydrateSamples; /// The sample store (thread-safe on its own). - (sizzle::sampler::SampleStore &)sampleStore; // For the MIDI threads (SizzleMidi): no lock taken. /// Queue a note for the audio thread. Callers must not push concurrently (the /// sound module's lock serialises them). - (void)midiNoteOn:(int)note velocity:(int)velocity channel:(int)channel; - (void)midiNoteOff:(int)note channel:(int)channel; /// The engine and song, for lock-free reads (isPlaying, pollMidiOut, the tempo) /// and the engine's atomic setters. Both live as long as the session. - (sizzle::engine::Engine *)enginePointer; - (const sizzle::model::Project *)projectPointer; @end