![]() |
OMIDIV
|
Stores information about the currently loaded midi and its playback status. More...
Static Public Member Functions | |
static decimal | TicksPerSecond (uint tempoMicros) |
The current number of midi ticks per second, dependent on tempo. | |
static decimal | TimePerTick (uint tempoMicros) |
The duration of one midi tick. | |
static decimal | MicrosToTicks (decimal start, decimal micros) |
Converts a number of microseconds into a number of ticks. This is dependent on tempo and tempo changes, so the start time is needed. | |
Protected Member Functions | |
override void | OnEnable () |
override void | OnDisable () |
override void | Restart () |
override void | LoadMidi () |
Currently just reads the midi from the file into Midi | |
override void | DrawGUI () |
Override this. Use ImGui to draw most UI elements here. | |
void | DrawMainMenuItems (string menuName) |
![]() | |
virtual void | Awake () |
virtual void | OnDestroy () |
virtual void | ReadConfig () |
Override this. Read from Config here. Don't forget to include ConfigTag in your config keys. | |
virtual void | WriteConfig () |
Override this. Write to Config here. Don't forget to include ConfigTag in your config keys. | |
virtual void | OnPlayStart () |
Override this. Called when the visualization starts playing. May be starting from the beginning or resuming. | |
virtual void | OnPlayStop () |
Override this. Called when the visualization stops playing. | |
virtual void | Reset_ () |
Override this. Called when SceneController.OnReset is fired. LoadAudio and LoadMidi will also be called afterwards, so don't do any of that here, but do reload any other resources your component needs. | |
virtual void | LoadVisuals () |
Override this. Called when the visuals need to be recreated (like when something in the MIDI Controls window is changed). | |
virtual void | LoadAudio () |
Override this. Called when the audio needs to be loaded from the file. | |
Properties | |
static FileInfo | MidiPath [get] |
The path to the currently loaded midi file. | |
static RawMidi | rawMidi [get] |
The raw midi data of the currently loaded midi. | |
static CookedMidi | Midi = new CookedMidi() [get] |
The currently loaded midi. | |
static int | MidiDelay [get, set] |
static decimal | CurrentTick [get, set] |
The current midi tick the visualization is on. May be negative with a midi delay. | |
static decimal | CurrentTime [get, set] |
The current midi time in microseconds. May be negative with a midi delay. | |
static uint | CurrentTempoMicros = 500000 [get, set] |
The current tempo in microseconds per quarter note (as per the midi file format). | |
static double | CurrentTempoBPM [get, set] |
The current tempo in Beats Per Minute. | |
static decimal | TicksPerFrame [get] |
The frame delta time converted to ticks, accounting for tempo changes. Will be 0 if not playing. | |
![]() | |
static bool | IsPlaying [get] |
Is the visualization currently playing. | |
static double | FrameDeltaTime [get] |
Time.deltaTime when not recording, 1/recording framerate when recording. In most cases, use this instead of Time.deltaTime so that recordings work properly. | |
Events | |
static Action< long, decimal > | OnMidiDelayChanged |
< long diffMicros, decimal tickDelta > Called before CurrentTime and CurrentTick have been updated. | |
Additional Inherited Members | |
![]() | |
string | ConfigTag = "def" |
Use this to give different instances in difference scenes different saved config. | |
Stores information about the currently loaded midi and its playback status.
|
protectedvirtual |
Override this. Use ImGui to draw most UI elements here.
Subscribe to ImGuiManager.DrawMainMenuItems to add to main menu bar menus instead of here.
Reimplemented from OmidivComponent.
|
protected |
Please call base.DrawMainMenuItems()
if overriding this.
|
protectedvirtual |
Currently just reads the midi from the file into Midi
Please call base.LoadMidi()
if overriding this.
Reimplemented from OmidivComponent.
|
static |
Converts a number of microseconds into a number of ticks.
This is dependent on tempo and tempo changes, so the start time is needed.
start | The microsecond of playback to start at. May be negative. |
micros | The number of microseconds to convert |
Known very small issue: If there is a tempo change at, say 1000 microseconds, start is 1000.xxx, and micros is negative, 0.xxx micros will be converted at the previous tempo. Keep in mind this is nanoseconds of error.
|
protectedvirtual |
Please call base.OnDisable()
if overriding this, unless you really know what you're doing.
Reimplemented from OmidivComponent.
|
protectedvirtual |
Please call base.OnEnable()
if overriding this, unless you really know what you're doing.
Reimplemented from OmidivComponent.
|
protectedvirtual |
Please call base.LoadMidi()
if overriding this.
Reimplemented from OmidivComponent.