Skip to content

Instantly share code, notes, and snippets.

@TakaakiIchijo
Last active July 30, 2019 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakaakiIchijo/bde623ce973c64b5ed11da3160f3c370 to your computer and use it in GitHub Desktop.
Save TakaakiIchijo/bde623ce973c64b5ed11da3160f3c370 to your computer and use it in GitHub Desktop.
CRI ADX2のシーケンスコールバックをいい感じの構造体に包んで返してくれるやつ
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