JubeatPlus 3.9.11
Loading...
Searching...
No Matches
EditDataManager.h
Go to the documentation of this file.
1
19
20#import <Foundation/Foundation.h>
21
22NS_ASSUME_NONNULL_BEGIN
23
27@interface EditDataManager : NSObject
28
34+ (instancetype)sharedManager;
35
41- (instancetype)init;
42
43#pragma mark - Custom sequence directory tree
44
50- (nullable NSArray<NSString *> *)getCustomSequenceDirectoryList;
51
57- (void)deleteCustomSequenceDirectory:(nullable NSNumber *)musicID;
58
66- (BOOL)addIgnoreBackUpAttribute:(nullable NSString *)path;
67
79- (nullable NSString *)getDirectoryPath:(int)musicID;
80
86- (nullable NSString *)createJCFName;
87
94- (BOOL)deleteJCF:(nullable NSString *)path;
95
102- (BOOL)loadJCF:(nullable NSString *)path;
103
110- (BOOL)saveJCF:(nullable NSString *)path;
111
112#pragma mark - Blowfish encode/decode
113
120- (BOOL)createEditDataWithNSData:(nullable NSData *)data;
121
128- (nullable NSMutableData *)exeSaveBFEnc:(nullable NSData *)data;
129
136- (nullable NSMutableData *)exeLoadBFDec:(nullable NSData *)data;
137
145- (nullable NSData *)exeBFEnc:(nullable NSData *)data;
146
154- (nullable NSData *)exeBFDec:(nullable NSData *)data;
155
156#pragma mark - Download tagging
157
165- (nullable NSString *)createDLString:(char *)buffer isDL:(BOOL)isDL;
166
173- (BOOL)checkDownLoad:(nullable const char *)buffer;
174
181- (BOOL)checkDownloadFile:(nullable NSData *)data;
182
191- (BOOL)localSaveDLFile:(nullable NSData *)data
192 serial:(nullable NSString *)serial
193 usrTag:(int)usrTag;
194
195#pragma mark - Packed binary format helpers
196
203- (nullable NSMutableDictionary *)pickUpEditorInfoFromData:(nullable NSData *)data;
204
212- (void)setCharArray:(char *)buffer setData:(unsigned int)data byte:(int)byte;
213
221- (unsigned int)getCharArrayValue:(const char *)buffer byte:(int)byte;
222
229- (BOOL)validateHash:(nullable NSData *)data;
230
231#pragma mark - Score data
232
237- (void)scoreDataReset;
238
245- (nullable NSMutableDictionary *)pickUpScoreData:(nullable const char *)buffer;
246
253- (nullable NSMutableDictionary *)pickUpEditorInfo:(nullable const char *)buffer;
254
261- (nullable NSMutableDictionary *)pickUpEditSimpleData:(nullable const char *)buffer;
262
269- (nullable NSMutableArray<NSNumber *> *)pickUpSequenceTable:(nullable const char *)buffer;
270
277- (BOOL)decodeBinary;
278
285- (BOOL)encodeBinary;
286
293- (nullable NSMutableArray<NSMutableDictionary *> *)getFileInfoList:(unsigned int)musicID;
294
295#pragma mark - Edit state
296
302- (BOOL)isEnableEdit;
303
308- (void)disableEdit;
309
315- (nullable NSMutableDictionary *)getScoreData;
316
322- (void)setScoreData:(nullable NSDictionary *)scoreData;
323
329- (nullable NSMutableDictionary *)getEditorInfo;
330
336- (void)setEditorInfo:(nullable NSDictionary *)editorInfo;
337
343- (nullable NSMutableDictionary *)getEditSimpleData;
344
350- (void)setEditSimpleData:(nullable NSDictionary *)editSimpleData;
351
356- (void)clearEditData;
357
362- (void)resetEditorInfo;
363
369- (nullable NSMutableArray<NSNumber *> *)getSequenceTable;
370
376- (void)setSequenceTable:(nullable NSMutableArray<NSNumber *> *)sequenceTable;
377
378#pragma mark - Last-edited file
379
386- (nullable NSString *)getLastEditFileName:(int)musicID;
387
394- (nullable NSString *)getLastEditFilePath:(int)musicID;
395
402- (void)setLastEditFileName:(int)musicID fileName:(nullable NSString *)fileName;
403
410- (BOOL)IsExistEditFile:(int)musicID;
411
412#pragma mark - Score hashing and update
413
420- (nullable NSString *)getScoreHash:(int)score;
421
427- (BOOL)checkScoreHash;
428
436- (void)scoreUpdate:(int)score fullCombo:(BOOL)fullCombo tuneID:(int)tuneID;
437
438#pragma mark - Music catalogue
439
445- (nullable NSMutableArray<NSString *> *)getMusicIDList;
446
452- (int)getMusicNum;
453
459- (int)getEditSlotLimit;
460
466- (nullable NSMutableData *)getCurrentCustomData;
467
468#pragma mark - Flags
469
474@property(nonatomic, readonly) BOOL bEnableCopy;
475
481@property(nonatomic, assign) BOOL bIsDownload;
482
483@end
484
485NS_ASSUME_NONNULL_END
486
487// code: language=Objective-C
488// kate: hl Objective-C;
489// vim: set ft=objc :
The shared chart-editor data model.
Definition EditDataManager.h:28
void disableEdit()
Disables editing by setting the copy-lock flag.
Definition EditDataManager.m:648
int getMusicNum()
Returns the count of built-in and purchased music.
Definition EditDataManager.m:828
nullable NSMutableArray< NSString * > * getMusicIDList()
Returns the identifiers of every built-in and purchased music, as strings.
Definition EditDataManager.m:812
nullable NSMutableDictionary * getEditSimpleData()
Returns the simple-data dictionary.
Definition EditDataManager.m:670
void resetEditorInfo()
Rebuilds the editor-info and score dictionaries from application defaults.
Definition EditDataManager.m:687
instancetype init()
Initialises an empty manager with copying enabled and no loaded data.
Definition EditDataManager.m:113
int getEditSlotLimit()
Returns the number of editable slots: four plus one per forty music.
Definition EditDataManager.m:838
nullable NSMutableArray< NSNumber * > * getSequenceTable()
Returns the sequence table.
Definition EditDataManager.m:713
BOOL encodeBinary()
Encodes the editor-info, score, simple-data, and sequence table models into a packed blob stored as t...
Definition EditDataManager.m:520
void scoreDataReset()
Resets the score dictionary to its default (no best score, no full combo, zero hashes).
Definition EditDataManager.m:366
nullable NSString * createJCFName()
Builds a fresh .jcf file name from the current date and time.
Definition EditDataManager.m:174
BOOL bIsDownload
Whether the current chart is a downloaded chart.
Definition EditDataManager.h:481
BOOL bEnableCopy
Whether copying the current chart is allowed.
Definition EditDataManager.h:474
BOOL isEnableEdit()
Whether editing is currently enabled (the copy-lock flag is clear).
Definition EditDataManager.m:644
nullable NSMutableDictionary * getScoreData()
Returns the score dictionary.
Definition EditDataManager.m:652
instancetype sharedManager()
Returns the process-wide shared manager, creating it once.
Definition EditDataManager.m:103
void clearEditData()
Clears every loaded model reference.
Definition EditDataManager.m:679
nullable NSArray< NSString * > * getCustomSequenceDirectoryList()
Returns the names of the per-music custom-sequence directories, or nil if none exist.
Definition EditDataManager.m:129
nullable NSMutableDictionary * getEditorInfo()
Returns the editor-info dictionary.
Definition EditDataManager.m:661
nullable NSMutableData * getCurrentCustomData()
Returns the current encoded custom-data buffer.
Definition EditDataManager.m:842
BOOL decodeBinary()
Decodes the current custom data into the editor-info, score, simple-data, and sequence table models.
Definition EditDataManager.m:481
BOOL checkScoreHash()
Returns whether the stored score hash matches the stored best score.
Definition EditDataManager.m:783