|
JubeatPlus 3.9.11
|
The chart-editor data model. More...
#include <EditSequence.h>


Instance Methods | |
| (nullable NSMutableArray< NSNumber * > *) | - getEventData |
| Re-encodes the working event array into an array of boxed packed note words. | |
| (BOOL) | - checkEventsLegality: |
| Validates that a decoded sequence blob has a recognised header and a consistent length. | |
| (void) | - createEvents:tempSlot: |
| Parses a decoded sequence blob into one template slot. | |
| (void) | - refreshEditMusicBar |
Rebuilds the per-segment note-density table editMusicBar from the working events. | |
| (void) | - refreshMusicBar |
Packs editMusicBar into the nibble-per-segment musicBar bitmap. | |
| (void) | - refreshConflictTable |
Packs editConflictTable into the nibble-per-segment conflictTable bitmap. | |
| (void) | - loadTemplate: |
| Loads a template slot into the working event array and clears the history. | |
| (void) | - createConflictTable |
Rebuilds editConflictTable by testing every note event for a conflict. | |
| (BOOL) | - checkConflictEvent:btn: |
| Returns whether the note event at an index is a note on a given button. | |
| (int) | - searchBtnNearSector:btn: |
| Returns the index of the note nearest a sector on a given button, or -1. | |
| (int) | - searchNearIndex: |
| Returns the event index nearest a sector. | |
| (int) | - checkConflictByIndex:btn:vec:area:sameCheck: |
| Searches by index in one direction for a conflicting note within an area. | |
| (int) | - checkConflictBySector:btn:vec:area:sameCheck: |
| Searches by sector in one direction for a conflicting note within an area. | |
| (BOOL) | - checkConflictBySector:btn:area:sameCheck: |
| Returns whether a sector conflicts with a note on a button, searching both directions. | |
| (BOOL) | - checkConflictByIndex:btn:area:sameCheck: |
| Returns whether an index conflicts with a note on a button, searching both directions. | |
| (BOOL) | - checkConflictArea:vector: |
| Returns whether the note at an index conflicts with another note in the given direction. | |
| (BOOL) | - checkConflict:vector: |
| Returns whether the note at the current index conflicts, on a button, in a direction. | |
| (BOOL) | - checkKeyConflict: |
| Returns whether adding a note on a button at the current sector would conflict. | |
| (BOOL) | - conflictKeyCheck:vector: |
| Returns whether a run of notes on a button starting at the current index conflicts. | |
| (void) | - addHistory: |
| Pushes an edit-part record onto the history, trimming and truncating as needed. | |
| (int) | - rollController: |
| Replays or reverses one history entry, rebuilding the music-bar and conflict tables. | |
| (int) | - undoHistory |
| Undoes the current history entry. | |
| (int) | - redoHistory |
| Redoes the next history entry. | |
| (void) | - addHistoryParts:index:sector:type:value: |
| Boxes one edit-part record (index, sector, type, value) and appends it to an array. | |
| (int) | - addNote:divide:isSwitch: |
| Adds or toggles a note on a button, snapping to the nearest beat subdivision. | |
| (int) | - addNote: |
| Adds a note at the current sector on a button, or deletes it when it already conflicts. | |
| (BOOL) | - deleteNote: |
| Deletes the note nearest the current position on a button. | |
| (float) | - getNearBeatRate: |
| Returns the beat-line rate nearest a fractional position, from the empty template. | |
| (int) | - getNearDiveBeatSector:divide: |
| Returns the sector nearest a sector on a subdivided beat grid. | |
| (float) | - getNearDivBeatRate:divide: |
| Returns the fractional position nearest a fractional position on a subdivided beat grid. | |
| (float) | - sector2rate: |
| Converts a sector to a fractional position over the chart. | |
| (unsigned int) | - rate2sector: |
| Converts a fractional position over the chart to a sector. | |
| (int) | - getFrontBeatSector: |
| Returns the index of the beat line at or before a sector, from the empty template. | |
| (int) | - getBackBeatSector: |
| Returns the sector of the first beat line after a sector, from the empty template. | |
| (void) | - eventArrayDecode: |
| Decodes an array of boxed packed note words into the working event array. | |
| (void) | - importSequenceData: |
| Loads a new chart into the working event array and rebuilds every derived table. | |
| (instancetype) | - initWithData:sequenceData: |
| Initialises the editor from a downloaded pack archive and an optional edit-note table. | |
| (void) | - reset |
| Resets the play state and clears every recorded judgement. | |
| (void) | - seekToTime: |
| Advances the play position to a time, updating the tempo, measure, beat, and clap state. | |
| (void) | - getMarkerState: |
| Fills a per-panel marker-animation state array for the current position. | |
| (const char *) | - getMusicBar |
| Returns the packed note-density music bar. | |
| (const char *) | - getConflictBar |
| Returns the packed conflict music bar. | |
| (const SequenceEvent *) | - getSequenceEventTable |
| Returns the working event array. | |
| (const SequenceEvent *) | - getSequencePasteTable |
| Returns the area copy/paste clipboard event array. | |
| (unsigned int) | - getEndSector |
| Returns the chart's end sector. | |
| (unsigned int) | - getConflictSector |
| Returns the fixed conflict-detection window, in sectors. | |
| (int) | - getRewindMeasureSector |
| Returns the sector of the measure two measures before the current position. | |
| (int) | - searchSectorIndex: |
| Returns the index of the first event at or after a sector, or -1 past a terminator. | |
| (BOOL) | - exeAreaCopy:endSec: |
| Copies the notes in a sector range into the clipboard. | |
| (void) | - exeAreaDelete:endSec: |
| Deletes the notes in a sector range, pushing the deletion onto the history. | |
| (int) | - exeAreaPaste: |
| Pastes the clipboard notes starting at a sector, skipping conflicts. | |
| (unsigned int) | - getTemplateNoteNum: |
| Returns the note count of a template slot. | |
| (unsigned int) | - getNoteNum |
| Returns the working note count. | |
| (unsigned int) | - getEventNum |
| Returns the working event count. | |
| (unsigned int) | - getFirstMarker |
| Returns the first-marker panel bitmask, computed from the leading same-sector notes. | |
| (unsigned int) | - getFirstSector |
| Returns the sector of the first note. | |
| (void) | - printInfoParts: |
| Prints debug information for an edit operation. | |
| (void) | - eventShift:destIndex: |
Moves a run of events from one index to another within events . | |
Class Methods | |
| (void) | + getMusicBarData:raw: |
| Copies a chart's raw music-bar bitmap out of an encoded sequence blob. | |
Protected Attributes | |
| SequenceEvent * | eventsTemplate [kEditSequenceTemplateSlotCount] |
| The four difficulty/structure templates, each a malloc'd 2000-entry event array. | |
| unsigned int | templateNumEvent [kEditSequenceTemplateSlotCount] |
| The event count of each template slot. | |
| unsigned int | templateEndSector [kEditSequenceTemplateSlotCount] |
| The end sector of each template slot. | |
| unsigned int | templateNotesNum [kEditSequenceTemplateSlotCount] |
| The note count of each template slot. | |
| char | templateMusicBar [kEditSequenceTemplateSlotCount][kEditSequenceTemplateMusicBarByteCount] |
| The raw per-segment note-density music bar of each template slot. | |
| SequenceEvent * | events |
| The malloc'd working event array (2000 entries). | |
| SequenceEvent * | copyEvents |
| The malloc'd area copy/paste clipboard (2000 entries). | |
| unsigned int | numEvent |
The number of events in events . | |
| unsigned int | numPlayEvent |
| The scoring-note count parsed from the chart header. | |
| unsigned int | endSector |
| The chart's final sector. | |
| unsigned int | notesNum |
The number of note events in events . | |
| unsigned int | numCopyEvent |
The number of events in copyEvents . | |
| unsigned int | judgedIndex |
The judgement cursor over events . | |
| unsigned int | currentTempo |
| The tempo in effect at the play position. | |
| unsigned int | oldTempo |
| The tempo in effect before the last change. | |
| unsigned int | lastHakuSector |
| The sector of the last beat (haku) line. | |
| unsigned int | nextHakuSector |
| The sector of the next beat (haku) line. | |
| unsigned int | lastMeasureSector |
| The sector of the last measure line. | |
| unsigned int | nextMeasureSector |
| The sector of the next measure line. | |
| char | musicBar [kEditSequenceMusicBarByteCount] |
| The packed note-density music bar. | |
| int | editMusicBar [kEditSequenceMusicBarSegmentCount] |
| Per-segment note-density counts. | |
| char | conflictTable [kEditSequenceMusicBarByteCount] |
| The packed conflict music bar. | |
| char | editConflictTable [kEditSequenceMusicBarSegmentCount] |
| Per-segment conflict flags. | |
| short | lastJudge [kEditSequencePanelCount] |
| The most recent grade shown per panel. | |
| unsigned int | lastJudgeSector [kEditSequencePanelCount] |
| The sector of that grade per panel. | |
| ScoreData | gameScore |
| The live score summary, mirrored from the play engine. | |
| NSMutableArray * | editHistory |
| The undo/redo history of boxed edit-part records. | |
| int | currentHistory |
The cursor into editHistory ; -1 when empty. | |
| int | clapIndex |
| The clap sound-effect scan cursor. | |
| int | backSector |
The play position of the previous -seekToTime: frame. | |
| BOOL | bClapSE |
| Whether a clap sound effect should fire this frame. | |
| BOOL | _enableUndo |
| Whether an undo is available. | |
| BOOL | _enableRedo |
| Whether a redo is available. | |
| unsigned short | _firstMarker |
| The panel bitmask of the first marker. | |
| unsigned int | _currentSector |
| The current play position, in sectors. | |
| unsigned int | _currentIndex |
The seek cursor over events . | |
| unsigned int | _firstMarkerSector |
| The sector of the first marker. | |
| double | _currentTime |
| The current play position, in seconds. | |
Properties | |
| BOOL | isClap |
| Whether a clap sound effect should fire on the current frame. | |
| float | hakuPhase |
| The normalised phase within the current beat (haku) interval, in [0, 1]. | |
| float | measurePhase |
| The normalised phase within the current measure interval, in [0, 1]. | |
| float | playPosition |
| The normalised play position over the whole chart, in [0, 1]. | |
| double | currentTime |
| The current play position, in seconds. | |
| unsigned int | currentSector |
| The current play position, in sectors. | |
| unsigned int | currentIndex |
| The seek cursor over the working events. | |
| unsigned short | firstMarker |
| The panel bitmask of the first marker. | |
| unsigned int | firstMarkerSector |
| The sector of the first marker. | |
| BOOL | enableUndo |
| Whether an undo is available. | |
| BOOL | enableRedo |
| Whether a redo is available. | |
The chart-editor data model.
| - (void) addHistory: | (nullable NSArray *) | parts |
Pushes an edit-part record onto the history, trimming and truncating as needed.
| parts | The array of boxed edit-part records for one undoable operation. |
| - (void) addHistoryParts: | (nullable NSMutableArray *) | parts | |
| index: | (int) | index | |
| sector: | (int) | sector | |
| type: | (int) | type | |
| value: | (int) | value |
Boxes one edit-part record (index, sector, type, value) and appends it to an array.
| parts | The destination array. |
| index | The event index. |
| sector | The event sector. |
| type | The part type (0 an add, 1 a delete). |
| value | The event value (panel index). |
| - (int) addNote: | (unsigned int) | btn |
Adds a note at the current sector on a button, or deletes it when it already conflicts.
| btn | The panel index. |
0 always. | - (int) addNote: | (unsigned int) | btn | |
| divide: | (int) | divide | |
| isSwitch: | (BOOL) | isSwitch |
Adds or toggles a note on a button, snapping to the nearest beat subdivision.
| btn | The panel index. |
| divide | The beat subdivision (15 disables snapping). |
| isSwitch | Whether a conflicting note is deleted instead of ignored. |
0 on success, 1 when the event or note limit is reached, 2 when past the end. | - (BOOL) checkConflict: | (unsigned int) | btn | |
| vector: | (int) | direction |
Returns whether the note at the current index conflicts, on a button, in a direction.
| btn | The panel index to match. |
| direction | The search direction. |
| - (BOOL) checkConflictArea: | (unsigned int) | index | |
| vector: | (int) | direction |
Returns whether the note at an index conflicts with another note in the given direction.
| index | The event index whose button and area are tested. |
| direction | The search direction. |
| - (BOOL) checkConflictByIndex: | (int) | index | |
| btn: | (unsigned int) | btn | |
| area: | (int) | area | |
| sameCheck: | (BOOL) | sameCheck |
Returns whether an index conflicts with a note on a button, searching both directions.
| index | The reference event index. |
| btn | The panel index to match. |
| area | The maximum sector distance that still counts as a conflict. |
| sameCheck | Whether the reference index itself is excluded. |
| - (int) checkConflictByIndex: | (int) | index | |
| btn: | (unsigned int) | btn | |
| vec: | (int) | direction | |
| area: | (int) | area | |
| sameCheck: | (BOOL) | sameCheck |
Searches by index in one direction for a conflicting note within an area.
| index | The starting event index. |
| btn | The panel index to match. |
| direction | The search direction (1 forwards, -1 backwards, 0 in place). |
| area | The maximum sector distance that still counts as a conflict. |
| sameCheck | Whether the reference index itself is excluded. |
| - (BOOL) checkConflictBySector: | (int) | sector | |
| btn: | (unsigned int) | btn | |
| area: | (int) | area | |
| sameCheck: | (BOOL) | sameCheck |
Returns whether a sector conflicts with a note on a button, searching both directions.
| sector | The reference sector. |
| btn | The panel index to match. |
| area | The maximum sector distance that still counts as a conflict. |
| sameCheck | Whether the reference sector's own note is excluded. |
| - (int) checkConflictBySector: | (int) | sector | |
| btn: | (unsigned int) | btn | |
| vec: | (int) | direction | |
| area: | (int) | area | |
| sameCheck: | (BOOL) | sameCheck |
Searches by sector in one direction for a conflicting note within an area.
| sector | The starting sector. |
| btn | The panel index to match. |
| direction | The search direction (1 forwards, -1 backwards, 0 in place). |
| area | The maximum sector distance that still counts as a conflict. |
| sameCheck | Whether the reference sector's own note is excluded. |
| - (BOOL) checkConflictEvent: | (int) | index | |
| btn: | (unsigned int) | btn |
Returns whether the note event at an index is a note on a given button.
| index | The event index. |
| btn | The panel index to match. |
| - (BOOL) checkEventsLegality: | (nullable NSData *) | data |
Validates that a decoded sequence blob has a recognised header and a consistent length.
| data | The decoded sequence blob. |
YES if the blob is a well-formed chart. | - (BOOL) checkKeyConflict: | (int) | btn |
Returns whether adding a note on a button at the current sector would conflict.
| btn | The panel index to test. |
| - (BOOL) conflictKeyCheck: | (unsigned int) | btn | |
| vector: | (int) | direction |
Returns whether a run of notes on a button starting at the current index conflicts.
| btn | The panel index to match. |
| direction | The scan direction. |
| - (void) createConflictTable |
Rebuilds editConflictTable by testing every note event for a conflict.
| - (void) createEvents: | (nullable NSData *) | data | |
| tempSlot: | (int) | slot |
Parses a decoded sequence blob into one template slot.
| data | The decoded sequence blob. |
| slot | The template slot (0 keeps only structural events; 1..3 are the difficulties). |
| - (BOOL) deleteNote: | (unsigned int) | btn |
Deletes the note nearest the current position on a button.
| btn | The panel index. |
YES if a note was deleted. | - (void) eventArrayDecode: | (nullable NSArray< NSNumber * > *) | table |
Decodes an array of boxed packed note words into the working event array.
| table | The array of NSNumber packed words. |
| - (void) eventShift: | (int) | srcIndex | |
| destIndex: | (int) | destIndex |
Moves a run of events from one index to another within events .
| srcIndex | The source index. |
| destIndex | The destination index. |
| - (BOOL) exeAreaCopy: | (int) | startSec | |
| endSec: | (int) | endSec |
Copies the notes in a sector range into the clipboard.
| startSec | The inclusive start sector. |
| endSec | The inclusive end sector. |
YES if any note was copied. | - (void) exeAreaDelete: | (int) | startSec | |
| endSec: | (int) | endSec |
Deletes the notes in a sector range, pushing the deletion onto the history.
| startSec | The inclusive start sector. |
| endSec | The inclusive end sector. |
| - (int) exeAreaPaste: | (int) | startSec |
Pastes the clipboard notes starting at a sector, skipping conflicts.
| startSec | The paste-target start sector. |
0 on success, 1 when a limit is reached, 2 when it would run past the end. | - (int) getBackBeatSector: | (int) | sector |
Returns the sector of the first beat line after a sector, from the empty template.
| sector | The reference sector. |
| - (const char *) getConflictBar |
Returns the packed conflict music bar.
| - (unsigned int) getConflictSector |
Returns the fixed conflict-detection window, in sectors.
| - (unsigned int) getEndSector |
Returns the chart's end sector.
| - (NSMutableArray< NSNumber * > *) getEventData |
Re-encodes the working event array into an array of boxed packed note words.
NSNumber packed words, always 2000 entries long. | - (unsigned int) getEventNum |
Returns the working event count.
| - (unsigned int) getFirstMarker |
Returns the first-marker panel bitmask, computed from the leading same-sector notes.
| - (unsigned int) getFirstSector |
Returns the sector of the first note.
| - (int) getFrontBeatSector: | (int) | sector |
Returns the index of the beat line at or before a sector, from the empty template.
| sector | The reference sector. |
| - (void) getMarkerState: | (int *) | state |
Fills a per-panel marker-animation state array for the current position.
| state | A 16-element destination array of packed marker states. |
| - (const char *) getMusicBar |
Returns the packed note-density music bar.
| + (void) getMusicBarData: | (char *) | raw | |
| raw: | (nullable NSData *) | data |
Copies a chart's raw music-bar bitmap out of an encoded sequence blob.
| raw | The 60-byte destination buffer. |
| data | The encoded sequence blob; ignored unless longer than 96 bytes. |
| - (float) getNearBeatRate: | (float) | rate |
Returns the beat-line rate nearest a fractional position, from the empty template.
| rate | The fractional position over the chart, in [0, 1]. |
| - (float) getNearDivBeatRate: | (float) | rate | |
| divide: | (int) | divide |
Returns the fractional position nearest a fractional position on a subdivided beat grid.
| rate | The fractional position over the chart, in [0, 1]. |
| divide | The beat subdivision. |
| - (int) getNearDiveBeatSector: | (int) | sector | |
| divide: | (int) | divide |
Returns the sector nearest a sector on a subdivided beat grid.
| sector | The reference sector. |
| divide | The beat subdivision (15 returns the sector unchanged). |
| - (unsigned int) getNoteNum |
Returns the working note count.
| - (int) getRewindMeasureSector |
Returns the sector of the measure two measures before the current position.
| - (const SequenceEvent *) getSequenceEventTable |
Returns the working event array.
| - (const SequenceEvent *) getSequencePasteTable |
Returns the area copy/paste clipboard event array.
| - (unsigned int) getTemplateNoteNum: | (int) | slot |
Returns the note count of a template slot.
| slot | The template slot. |
| - (void) importSequenceData: | (nullable NSArray< NSNumber * > *) | table |
Loads a new chart into the working event array and rebuilds every derived table.
| table | The array of boxed packed note words. |
| - (instancetype) initWithData: | (nullable KUnzip *) | data | |
| sequenceData: | (nullable NSArray< NSNumber * > *) | sequenceData |
Initialises the editor from a downloaded pack archive and an optional edit-note table.
| data | The KUnzip archive holding the three difficulty sequence entries. |
| sequenceData | The edit-note table to load, or nil to start from the empty template. |
nil if any difficulty entry is malformed. | - (void) loadTemplate: | (int) | slot |
Loads a template slot into the working event array and clears the history.
| slot | The template slot to load. |
| - (void) printInfoParts: | (nullable NSString *) | info |
Prints debug information for an edit operation.
The binary body is empty.
| info | The debug label. |
| - (unsigned int) rate2sector: | (float) | rate |
Converts a fractional position over the chart to a sector.
| rate | The fractional position, in [0, 1]. |
| - (int) redoHistory |
Redoes the next history entry.
| - (void) refreshConflictTable |
Packs editConflictTable into the nibble-per-segment conflictTable bitmap.
| - (void) refreshEditMusicBar |
Rebuilds the per-segment note-density table editMusicBar from the working events.
| - (void) refreshMusicBar |
Packs editMusicBar into the nibble-per-segment musicBar bitmap.
| - (void) reset |
Resets the play state and clears every recorded judgement.
| - (int) rollController: | (BOOL) | undo |
Replays or reverses one history entry, rebuilding the music-bar and conflict tables.
| undo | YES to undo the current entry, NO to redo the next entry. |
| - (int) searchBtnNearSector: | (int) | sector | |
| btn: | (int) | btn |
Returns the index of the note nearest a sector on a given button, or -1.
| sector | The reference sector. |
| btn | The panel index to match. |
| - (int) searchNearIndex: | (int) | sector |
Returns the event index nearest a sector.
| sector | The reference sector. |
| - (int) searchSectorIndex: | (int) | sector |
Returns the index of the first event at or after a sector, or -1 past a terminator.
| sector | The reference sector. |
| - (float) sector2rate: | (int) | sector |
Converts a sector to a fractional position over the chart.
| sector | The sector. |
| - (void) seekToTime: | (double) | time |
Advances the play position to a time, updating the tempo, measure, beat, and clap state.
| time | The new play time, in seconds. |
| - (int) undoHistory |
Undoes the current history entry.
|
readnonatomicassign |
The seek cursor over the working events.
|
readnonatomicassign |
The current play position, in sectors.
|
readnonatomicassign |
The current play position, in seconds.
|
readnonatomicassign |
Whether a redo is available.
|
readnonatomicassign |
Whether an undo is available.
|
readnonatomicassign |
The panel bitmask of the first marker.
|
readnonatomicassign |
The sector of the first marker.
|
readnonatomicassign |
The normalised phase within the current beat (haku) interval, in [0, 1].
|
readnonatomicassign |
Whether a clap sound effect should fire on the current frame.
|
readnonatomicassign |
The normalised phase within the current measure interval, in [0, 1].
|
readnonatomicassign |
The normalised play position over the whole chart, in [0, 1].