CRI ADX2のシーケンスコールバックをいい感じの構造体に包んで返してくれるやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace CriWareExtensions | |
{ | |
public static class CriAtomExSequencerExtension | |
{ | |
public delegate void EventCbFunc(CriSequenceParam param); | |
public static void SetEventCallback(EventCbFunc callback) | |
{ | |
CriAtomExSequencer.SetEventCallback((e) => | |
{ | |
string[] arr = e.Split('\t'); | |
callback( | |
new CriSequenceParam( | |
eventPosition: Convert.ToUInt64(arr[0]), | |
eventId: Convert.ToUInt32(arr[1]), | |
playId: Convert.ToUInt32(arr[2]), | |
eventType: arr[3], | |
eventTag: arr[4] | |
) | |
); | |
}); | |
} | |
public struct CriSequenceParam | |
{ | |
//1.イベント位置 | |
public ulong eventPosition { get; } | |
//2.イベントID | |
public uint eventId { get; } | |
//3.再生ID | |
public uint playId { get; } | |
//4.イベントタイプ(本来はenum) | |
public string eventType { get; } | |
//5.イベントタグ文字列 | |
public string eventTag { get; } | |
public CriSequenceParam(ulong eventPosition, uint eventId, uint playId, string eventType, string eventTag) | |
{ | |
this.eventPosition = eventPosition; | |
this.eventId = eventId; | |
this.playId = playId; | |
this.eventType = eventType; | |
this.eventTag = eventTag; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment