@@ -96,3 +96,155 @@ void ActionMIDISetNoteTime::getRecoveryData(juce::MemoryOutputStream& stream) {
96
96
stream.writeDouble (this ->oldStartTime );
97
97
stream.writeDouble (this ->oldEndTime );
98
98
}
99
+
100
+ ActionMIDISetNoteChannel::ActionMIDISetNoteChannel (
101
+ uint64_t ref, int track, int index,
102
+ uint8_t channel)
103
+ : ref(ref), track(track), index(index), channel(channel) {}
104
+
105
+ bool ActionMIDISetNoteChannel::doAction () {
106
+ /* * Get Old Channel */
107
+ auto note = SourceManager::getInstance ()->getMIDINote (
108
+ this ->ref , this ->track , this ->index );
109
+ if (note.eventOffIndex < 0 ) { return false ; }
110
+ this ->oldChannel = note.channel ;
111
+
112
+ /* * Set Channel */
113
+ return SourceManager::getInstance ()->setNoteChannel (
114
+ this ->ref , this ->track , this ->index , this ->channel );
115
+ }
116
+
117
+ bool ActionMIDISetNoteChannel::undoAction () {
118
+ return SourceManager::getInstance ()->setNoteChannel (
119
+ this ->ref , this ->track , this ->index , this ->oldChannel );
120
+ }
121
+
122
+ const juce::String ActionMIDISetNoteChannel::getStatusStr () const {
123
+ return " Source: " + juce::String{ this ->ref } + " \n " +
124
+ " Track: " + juce::String{ this ->track } + " \n " +
125
+ " Index: " + juce::String{ this ->index } + " \n " +
126
+ " Old Channel: " + juce::String{ this ->oldChannel } + " \n " +
127
+ " Channel: " + juce::String{ this ->channel } + " \n " ;
128
+ }
129
+
130
+ void ActionMIDISetNoteChannel::getRecoveryData (juce::MemoryOutputStream& stream) {
131
+ stream.writeInt64 ((int64_t )this ->ref );
132
+ stream.writeInt (this ->track );
133
+ stream.writeInt (this ->index );
134
+ stream.writeByte ((char )this ->channel );
135
+ stream.writeByte ((char )this ->oldChannel );
136
+ }
137
+
138
+ ActionMIDISetNotePitch::ActionMIDISetNotePitch (
139
+ uint64_t ref, int track, int index,
140
+ uint8_t pitch)
141
+ : ref(ref), track(track), index(index), pitch(pitch) {}
142
+
143
+ bool ActionMIDISetNotePitch::doAction () {
144
+ /* * Get Old Pitch */
145
+ auto note = SourceManager::getInstance ()->getMIDINote (
146
+ this ->ref , this ->track , this ->index );
147
+ if (note.eventOffIndex < 0 ) { return false ; }
148
+ this ->oldPitch = note.pitch ;
149
+
150
+ /* * Set Pitch */
151
+ return SourceManager::getInstance ()->setNotePitch (
152
+ this ->ref , this ->track , this ->index , this ->pitch );
153
+ }
154
+
155
+ bool ActionMIDISetNotePitch::undoAction () {
156
+ return SourceManager::getInstance ()->setNotePitch (
157
+ this ->ref , this ->track , this ->index , this ->oldPitch );
158
+ }
159
+
160
+ const juce::String ActionMIDISetNotePitch::getStatusStr () const {
161
+ return " Source: " + juce::String{ this ->ref } + " \n " +
162
+ " Track: " + juce::String{ this ->track } + " \n " +
163
+ " Index: " + juce::String{ this ->index } + " \n " +
164
+ " Old Pitch: " + juce::String{ this ->oldPitch } + " \n " +
165
+ " Pitch: " + juce::String{ this ->pitch } + " \n " ;
166
+ }
167
+
168
+ void ActionMIDISetNotePitch::getRecoveryData (juce::MemoryOutputStream& stream) {
169
+ stream.writeInt64 ((int64_t )this ->ref );
170
+ stream.writeInt (this ->track );
171
+ stream.writeInt (this ->index );
172
+ stream.writeByte ((char )this ->pitch );
173
+ stream.writeByte ((char )this ->oldPitch );
174
+ }
175
+
176
+ ActionMIDISetNoteVelocity::ActionMIDISetNoteVelocity (
177
+ uint64_t ref, int track, int index,
178
+ uint8_t velocity)
179
+ : ref(ref), track(track), index(index), velocity(velocity) {}
180
+
181
+ bool ActionMIDISetNoteVelocity::doAction () {
182
+ /* * Get Old Velocity */
183
+ auto note = SourceManager::getInstance ()->getMIDINote (
184
+ this ->ref , this ->track , this ->index );
185
+ if (note.eventOffIndex < 0 ) { return false ; }
186
+ this ->oldVelocity = note.vel ;
187
+
188
+ /* * Set Velocity */
189
+ return SourceManager::getInstance ()->setNoteVelocity (
190
+ this ->ref , this ->track , this ->index , this ->velocity );
191
+ }
192
+
193
+ bool ActionMIDISetNoteVelocity::undoAction () {
194
+ return SourceManager::getInstance ()->setNoteVelocity (
195
+ this ->ref , this ->track , this ->index , this ->oldVelocity );
196
+ }
197
+
198
+ const juce::String ActionMIDISetNoteVelocity::getStatusStr () const {
199
+ return " Source: " + juce::String{ this ->ref } + " \n " +
200
+ " Track: " + juce::String{ this ->track } + " \n " +
201
+ " Index: " + juce::String{ this ->index } + " \n " +
202
+ " Old Velocity: " + juce::String{ this ->oldVelocity } + " \n " +
203
+ " Velocity: " + juce::String{ this ->velocity } + " \n " ;
204
+ }
205
+
206
+ void ActionMIDISetNoteVelocity::getRecoveryData (juce::MemoryOutputStream& stream) {
207
+ stream.writeInt64 ((int64_t )this ->ref );
208
+ stream.writeInt (this ->track );
209
+ stream.writeInt (this ->index );
210
+ stream.writeByte ((char )this ->velocity );
211
+ stream.writeByte ((char )this ->oldVelocity );
212
+ }
213
+
214
+ ActionMIDISetNoteLyrics::ActionMIDISetNoteLyrics (
215
+ uint64_t ref, int track, int index,
216
+ const juce::String& lyrics)
217
+ : ref(ref), track(track), index(index), lyrics(lyrics) {}
218
+
219
+ bool ActionMIDISetNoteLyrics::doAction () {
220
+ /* * Get Old Lyrics */
221
+ auto note = SourceManager::getInstance ()->getMIDINote (
222
+ this ->ref , this ->track , this ->index );
223
+ if (note.eventOffIndex < 0 ) { return false ; }
224
+ this ->oldLyrics = note.lyrics ;
225
+
226
+ /* * Set Lyrics */
227
+ return SourceManager::getInstance ()->setNoteLyrics (
228
+ this ->ref , this ->track , this ->index , this ->lyrics );
229
+ }
230
+
231
+ bool ActionMIDISetNoteLyrics::undoAction () {
232
+ return SourceManager::getInstance ()->setNoteLyrics (
233
+ this ->ref , this ->track , this ->index , this ->oldLyrics );
234
+ }
235
+
236
+ const juce::String ActionMIDISetNoteLyrics::getStatusStr () const {
237
+ return " Source: " + juce::String{ this ->ref } + " \n " +
238
+ " Track: " + juce::String{ this ->track } + " \n " +
239
+ " Index: " + juce::String{ this ->index } + " \n " +
240
+ " Old Lyrics: " + this ->oldLyrics + " \n " +
241
+ " Lyrics: " + this ->lyrics + " \n " ;
242
+ }
243
+
244
+ void ActionMIDISetNoteLyrics::getRecoveryData (juce::MemoryOutputStream& stream) {
245
+ stream.writeInt64 ((int64_t )this ->ref );
246
+ stream.writeInt (this ->track );
247
+ stream.writeInt (this ->index );
248
+ stream.writeString (this ->lyrics );
249
+ stream.writeString (this ->oldLyrics );
250
+ }
0 commit comments