@@ -28,6 +28,7 @@ class TrackEvent {
28
28
final int deltaTime;
29
29
final MidiEvent midiEvent;
30
30
31
+ /// Constructor
31
32
TrackEvent (this .deltaTime, this .midiEvent);
32
33
33
34
@override
@@ -85,32 +86,40 @@ abstract class MidiEvent {
85
86
/// Meta command.
86
87
static const int cmdMetaEvent = 0xFF ;
87
88
89
+ /// Constructor
88
90
MidiEvent ();
89
91
92
+ /// Constructor with command
90
93
MidiEvent .withParam (this .command);
91
94
92
95
/// Compute command from an event type and a channel
93
96
static int commandChannel (int eventType, int channel) {
94
97
return ((eventType << 4 ) | (channel & 0xF ));
95
98
}
96
99
100
+ /// Get the event type
97
101
@Deprecated ('use commandGetEventType' )
98
102
static int commandGetCommand (int command) => commandGetEventType (command);
99
103
104
+ /// Get the event type
100
105
static int commandGetEventType (int command) {
101
106
return ((command & 0xF0 ) >> 4 );
102
107
}
103
108
109
+ /// Get the channel
104
110
static int commandGetChannel (int command) {
105
111
// (command & 0xF)
106
112
return (command & 0xF );
107
113
}
108
114
115
+ /// Get the event type
109
116
int get eventType => commandGetEventType (command);
110
117
118
+ /// Get the event type
111
119
@Deprecated ('user event type instead' )
112
120
int get codeCommand => eventType;
113
121
122
+ /// Base command
114
123
factory MidiEvent .base (int command) {
115
124
MidiEvent event;
116
125
@@ -174,19 +183,25 @@ abstract class MidiEvent {
174
183
175
184
/// Channel event.
176
185
abstract class ChannelEvent extends MidiEvent {
186
+ /// Channel
177
187
int get channel => MidiEvent .commandGetChannel (command);
178
188
189
+ /// Constructor
179
190
ChannelEvent ();
180
191
181
- ChannelEvent .withParam (int comand, int channel)
182
- : super .withParam (MidiEvent .commandChannel (comand, channel));
192
+ /// Constructor with command and channel
193
+ ChannelEvent .withParam (int command, int channel)
194
+ : super .withParam (MidiEvent .commandChannel (command, channel));
183
195
}
184
196
197
+ /// Param1ByteEvent
185
198
abstract class Param1ByteEvent extends ChannelEvent {
186
199
int ? _param1;
187
200
201
+ /// Constructor
188
202
Param1ByteEvent ();
189
203
204
+ /// Constructor with command, channel and param1
190
205
Param1ByteEvent .withParam (super .command, super .channel, this ._param1)
191
206
: super .withParam ();
192
207
0 commit comments