iOS 0.4.0: Sizzle's Tracker, Mix, Toolbox and Setup tabs on the C++ engine
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>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
29650b88d7
commit
962cfd1e2b
@@ -439,7 +439,7 @@ bool isSampleKey(const char *key) {
|
||||
}
|
||||
- (void)applyFactoryPreset:(NSString *)name toSlot:(NSInteger)slot {
|
||||
std::string n = name.UTF8String;
|
||||
[self edit:^(model::Project &p, engine::Engine &) {
|
||||
[self edit:^(model::Project &p, engine::Engine &e) {
|
||||
if (slot < 0 || slot >= 16) return;
|
||||
model::ToolboxSlot &s = p.toolbox[(size_t)slot];
|
||||
for (int i = 0; i < gen::factoryPresetCount; ++i) {
|
||||
@@ -448,6 +448,7 @@ bool isSampleKey(const char *key) {
|
||||
for (int k = 0; kv[k] && kv[k + 1]; k += 2) s.set(kv[k], kv[k + 1]);
|
||||
s.name = n;
|
||||
}
|
||||
e.rebuildFxChains();
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -490,11 +491,15 @@ bool isSampleKey(const char *key) {
|
||||
|
||||
- (BOOL)loadSongNamed:(NSString *)name error:(NSError **)error {
|
||||
NSString *text = [NSString stringWithContentsOfURL:[self songURL:name] encoding:NSUTF8StringEncoding error:error];
|
||||
return text && [self loadProjectText:text error:error];
|
||||
if (!text || ![self loadProjectText:text error:error]) return NO;
|
||||
self.songName = name; // as Android's loadSong: the file's name wins
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)deleteSongNamed:(NSString *)name error:(NSError **)error {
|
||||
return [NSFileManager.defaultManager removeItemAtURL:[self songURL:name] error:error];
|
||||
BOOL ok = [NSFileManager.defaultManager removeItemAtURL:[self songURL:name] error:error];
|
||||
if (ok) [self changed];
|
||||
return ok;
|
||||
}
|
||||
|
||||
- (void)newSong {
|
||||
|
||||
Reference in New Issue
Block a user