UNPKG

@holzchopf/flp-file

Version:

Reads and writes FL Studio project and state files.

48 lines (47 loc) 4.62 kB
import { FLPEventTypeName } from "./flp-event-type"; /** * Possible data types for event values. */ export type FLPDataType = 'int8' | 'int16' | 'int32' | 'uint8' | 'uint16' | 'uint32' | 'float32' | 'binary' | 'ascii' | 'utf-16le'; /** * Data types for event's values. Falls back to `uint8` for event ids < 64, `uint16` for event ids < 128, `uint32` for event ids < 192, `utf-16le` for event ids < 210, `binary` otherwise. * * This is *not* a `const` - you can add or overwrite types for events in your project. */ export declare let FLPEventValueDataType: Partial<Record<FLPEventTypeName, FLPDataType>>; /** * Class for events. */ export declare class FLPEvent { /** * Numeric [[FLPEventType]]. */ type: number; /** * Name of [[FLPEventType]]. Readonly. */ get typeName(): "ByteEnabled" | "ByteNoteOn" | "ByteVol" | "BytePan" | "ByteMidiChan" | "ByteMidiNote" | "ByteMidiPatch" | "ByteMidiBank" | "ByteLoopActive" | "ByteShowInfo" | "ByteShuffle" | "ByteMainVol" | "ByteStretch" | "BytePitchable" | "ByteZipped" | "ByteDelayFlags" | "ByteProjectTimeSigNumerator" | "ByteProjectTimeSigDenominator" | "ByteUseLoopPoints" | "ByteChannelLoopType" | "ByteChannelType" | "ByteTargetFXTrack" | "BytePanningLaw" | "ByteNStepsShown" | "ByteSSLength" | "ByteSSLoop" | "ByteEffectChannelMuted" | "ByteIsRegistered" | "ByteAPDC" | "BytePlayTruncatedNotes" | "ByteEEAutoMode" | "ByteTimeSigMarkerNumerator" | "ByteTimeSigMarkerDenominator" | "ByteProjectShouldUseTimeSignatures" | "ByteShouldCutNotesFast" | "BytePluginIgnoresTheme" | "ByteInsertIgnoresTheme" | "ByteTrackIgnoresTheme" | "BytePlaylistShouldUseAutoCrossfades" | "WordNewChan" | "WordNewPat" | "WordTempo" | "WordCurrentPatNum" | "WordPatData" | "WordFx" | "WordFadeStereo" | "WordCutOff" | "WordDotVol" | "WordDotPan" | "WordPreAmp" | "WordDecay" | "WordAttack" | "WordDotNote" | "WordDotPitch" | "WordDotMix" | "WordMainPitch" | "WordRandChan" | "WordMixChan" | "WordResonance" | "WordLoopBar" | "WordStDel" | "WordFx3" | "WordDotReso" | "WordDotCutOff" | "WordShiftDelay" | "WordLoopEndBar" | "WordDot" | "WordDotShift" | "WordTempoFine" | "WordLayerChans" | "WordInsertIcon" | "WordDotRel" | "WordSwingMix" | "WordCurrentSlotNum" | "WordNewArrangement" | "WordCurrentArrangementNum" | "DWordColor" | "DWordPlayListItem" | "DWordEcho" | "DWordFxSine" | "DWordCutCutBy" | "DWordWindowH" | "DWordMiddleNote" | "DWordReserved" | "DWordMainResoCutOff" | "DWordDelayReso" | "DWordReverb" | "DWordIntStretch" | "DWordSsNote" | "DWordFineTune" | "DWordChannelSampleFlags" | "DWordChannelLayerFlags" | "DWordChanFilterNum" | "DWordCurFilterNum" | "DWordInsertOutChanNum" | "DWordNewTimeMarker" | "DWordInsertColor" | "DWordPatternColor" | "DWordPatternAutoMode" | "DwordSongLoopPos" | "DWordAUSmpRate" | "DwordInsertInChanNum" | "DWordPluginIcon" | "DWordFineTempo" | "DWordVersionBuilNumber" | "TextChanName" | "TextPatName" | "TextTitle" | "TextComment" | "TextSampleFileName" | "TextUrl" | "TextCommentRtf" | "TextVersion" | "TextRegName" | "TextDefPluginName" | "TextProjectDataPath" | "TextPluginName" | "TextInsertName" | "TextTimeMarkerName" | "TextGenre" | "TextProjectAuthor" | "TextMidiControls" | "TextDelay" | "DataTs404Params" | "DataDelayLine" | "DataNewPlugin" | "DataPluginParams" | "DataChanParams" | "DataCtrlRecChan" | "DataPlaylistSelection" | "DataEnvLfoParams" | "DataBasicChanParams" | "DataOldFilterParams" | "DataChanPoly" | "DataNoteEvents" | "DataOldAutomationData" | "DataPatternNotes" | "DataInsertParams" | "DataMIDIInfo" | "DataAutomationChannels" | "DataChannelTracking" | "DataChanOfsLevels" | "DataRemoteCtrlFormula" | "DataChanGroupName" | "DataRegBlackList" | "DataPlayListItems" | "DataAutomationData" | "DataInsertRoutes" | "DataInsertFlags" | "DataSaveTimestamp" | "DataNewPlaylistTrack" | "DataPlaylistTrackName" | "DataArrangementName" | "unknown"; /** * Primitive representation of event data. Data type varies by event type. */ value: number | string | ArrayBuffer; /** * Returns the maximum allowed byte length depending on event type. */ get maxByteLength(): 1 | 2 | 4 | undefined; constructor(type: number); /** * Creates the binary data for this event and returns it. */ getBinary(): ArrayBuffer; /** * Sets this event's values from binary data. * @param buffer Binary data. */ setBinary(buffer: ArrayBuffer): void; /** * Returns the expected data type for a given event type. * @param type Event type. */ static getValueDataType(type: number | FLPEventTypeName): FLPDataType; }