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
@@ -4,7 +4,32 @@
|
||||
#import "SizzleSession+Setup.h"
|
||||
#import "SizzleSession+Internal.h"
|
||||
|
||||
#include "io/KotlinText.hpp"
|
||||
|
||||
using namespace sizzle;
|
||||
|
||||
static NSError *setupError(NSString *msg) {
|
||||
return [NSError errorWithDomain:@"Sizzle" code:1 userInfo:@{NSLocalizedDescriptionKey: msg}];
|
||||
}
|
||||
|
||||
@implementation SizzleSession (Setup)
|
||||
|
||||
+ (BOOL)looksLikeProjectText:(NSString *)text {
|
||||
std::string t = text.UTF8String ?: "";
|
||||
for (const std::string &raw : io::kt::lines(t)) {
|
||||
const std::string line = io::kt::trim(raw);
|
||||
if (line.empty()) continue;
|
||||
return line == "SIZZLETRACKER-SNG 1";
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)importProjectText:(NSString *)text error:(NSError **)error {
|
||||
if (![SizzleSession looksLikeProjectText:text]) {
|
||||
if (error) *error = setupError(@"This doesn't look like a Sizzle project (.szg).");
|
||||
return NO;
|
||||
}
|
||||
return [self loadProjectText:text error:error];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user