Ported from the Android tabs by parallel agents (each screen with its own SizzleSession category); slot editors use the card editor with a preset library; songs load/save in the Android project format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
2.4 KiB
Objective-C
48 lines
2.4 KiB
Objective-C
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#import "SizzleSession.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
/// API the Mix and Toolbox screens need beyond SizzleSession.h.
|
|
@interface SizzleSession (Mix)
|
|
|
|
#pragma mark - Slot samples (Sampler pads "padN", the SF2/XI loader's "sfSample")
|
|
/// Frames / sample rate of the sample a slot key refers to (0 when none is loaded).
|
|
- (NSInteger)sampleFramesOfSlot:(NSInteger)slot key:(NSString *)key;
|
|
- (NSInteger)sampleRateOfSlot:(NSInteger)slot key:(NSString *)key;
|
|
/// The sample as [buckets] (min, max) float pairs for drawing (Android's computePeaks),
|
|
/// or nil when none is loaded.
|
|
- (nullable NSData *)samplePeaksOfSlot:(NSInteger)slot key:(NSString *)key buckets:(NSInteger)buckets;
|
|
/// SamplerEditor's CLIP: replace the pad's sample with its slice; markers reset. NO if nothing to trim.
|
|
- (BOOL)trimPad:(NSInteger)pad ofSlot:(NSInteger)slot;
|
|
/// NORMALIZE: peak-normalise the pad's sample to full scale. NO if empty, silent or already full.
|
|
- (BOOL)normalizePad:(NSInteger)pad ofSlot:(NSInteger)slot;
|
|
/// CLEAR: forget the pad's sample and slice markers.
|
|
- (void)clearPad:(NSInteger)pad ofSlot:(NSInteger)slot;
|
|
|
|
#pragma mark - MIDI LFO
|
|
/// Point LFO [slot] at [target]'s parameter [key] ("slot:key"), capturing that
|
|
/// parameter's current value as the modulation centre; target < 0 clears it.
|
|
- (void)setLfoTargetOfSlot:(NSInteger)slot target:(NSInteger)target key:(NSString *)key;
|
|
|
|
#pragma mark - Preset library (Documents/presets/<TYPE>/<name>.szp, PresetIo text)
|
|
/// Saved presets for a device type, alphabetically. The type's factory presets are
|
|
/// written into the library the first time (Android's seedFactoryPresets), so a
|
|
/// deleted one stays deleted.
|
|
- (NSArray<NSString *> *)libraryPresetsForType:(NSString *)type;
|
|
/// Save [slot] under [name] (the slot takes that name).
|
|
- (BOOL)savePresetOfSlot:(NSInteger)slot name:(NSString *)name;
|
|
/// Load a saved preset into [slot] (renamed to the preset).
|
|
- (BOOL)loadPreset:(NSString *)name intoSlot:(NSInteger)slot;
|
|
- (BOOL)deletePreset:(NSString *)name type:(NSString *)type;
|
|
/// Import preset text into [slot] (it takes the preset's device type) and save it to the library.
|
|
- (BOOL)importPresetText:(NSString *)text intoSlot:(NSInteger)slot;
|
|
/// The preset's file, for sharing (nil when missing).
|
|
- (nullable NSURL *)presetFileForType:(NSString *)type name:(NSString *)name;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|