reflexion 0.3.8.1 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,93 @@
1
+ require_relative 'helper'
2
+
3
+
4
+ class TestMIDIEvent < Test::Unit::TestCase
5
+
6
+ def event(*args)
7
+ Reflex::MIDIEvent.new(nil, *args)
8
+ end
9
+
10
+ def test_initialize()
11
+ e = event 0x91, 2, 3, 4
12
+ assert_equal :note_on, e.action
13
+ assert_equal 1, e.channel
14
+ assert_equal 2, e.data1
15
+ assert_equal 3, e.data2
16
+ assert_equal 4, e.time
17
+ assert_false e.captured?
18
+
19
+ assert_raise {event 0x90, 256, 0, 0}
20
+ assert_raise {event 0x90, -1, 0, 0}
21
+ assert_raise {event 0x90, 0, 256, 0}
22
+ assert_raise {event 0x90, 0, -1, 0}
23
+ end
24
+
25
+ def test_dup()
26
+ e1 = event 0x91, 2, 3, 4
27
+ e2 = e1.dup
28
+ e1.block
29
+ e3 = e1.dup
30
+ assert_true e1.blocked?
31
+ assert_false e2.blocked?
32
+ assert_true e3.blocked?
33
+ end
34
+
35
+ def test_note_on_off()
36
+ assert_true event(0x90, 1, 2, 3).note_on?
37
+ assert_false event(0x90, 1, 2, 3).note_off?
38
+ assert_false event(0x80, 1, 2, 3).note_on?
39
+ assert_true event(0x80, 1, 2, 3).note_off?
40
+ end
41
+
42
+ def test_action()
43
+ assert_equal :note_on, event(0x90, 1, 2, 3).action
44
+ assert_equal :note_off, event(0x80, 1, 2, 3).action
45
+ assert_equal :key_pressure, event(0xA0, 1, 2, 3).action
46
+ assert_equal :control_change, event(0xB0, 1, 2, 3).action
47
+ assert_equal :program_change, event(0xC0, 1, 2, 3).action
48
+ assert_equal :channel_pressure, event(0xD0, 1, 2, 3).action
49
+ assert_equal :pitch_bend_change, event(0xE0, 1, 2, 3).action
50
+ assert_equal :system, event(0xF0, 1, 2, 3).action
51
+ end
52
+
53
+ def test_action?()
54
+ assert_true event(0x90, 1, 2, 3).note_on?
55
+ assert_false event(0x90, 1, 2, 3).note_off?
56
+
57
+ assert_true event(0x80, 1, 2, 3).note_off?
58
+ assert_false event(0x80, 1, 2, 3).note_on?
59
+
60
+ assert_true event(0xA0, 1, 2, 3).key_pressure?
61
+ assert_false event(0xA0, 1, 2, 3).channel_pressure?
62
+
63
+ assert_true event(0xB0, 1, 2, 3).control_change?
64
+ assert_true event(0xB0, 1, 2, 3).cc?
65
+ assert_false event(0xB0, 1, 2, 3).program_change?
66
+
67
+ assert_true event(0xC0, 1, 2, 3).program_change?
68
+ assert_true event(0xC0, 1, 2, 3).pc?
69
+ assert_false event(0xC0, 1, 2, 3).control_change?
70
+
71
+ assert_true event(0xD0, 1, 2, 3).channel_pressure?
72
+ assert_false event(0xD0, 1, 2, 3).key_pressure?
73
+
74
+ assert_true event(0xE0, 1, 2, 3).pitch_bend_change?
75
+ assert_false event(0xE0, 1, 2, 3).system?
76
+
77
+ assert_true event(0xF0, 1, 2, 3).system?
78
+ assert_false event(0xF0, 1, 2, 3).pitch_bend_change?
79
+ end
80
+
81
+ def test_channel()
82
+ assert_equal 1, event(0x91, 1, 2, 3).channel
83
+ assert_equal 2, event(0x82, 1, 2, 3).channel
84
+ assert_equal 3, event(0xA3, 1, 2, 3).channel
85
+ assert_equal 4, event(0xB4, 1, 2, 3).channel
86
+ assert_equal 5, event(0xC5, 1, 2, 3).channel
87
+ assert_equal 6, event(0xD6, 1, 2, 3).channel
88
+ assert_equal 7, event(0xE7, 1, 2, 3).channel
89
+ assert_equal -1, event(0xF8, 1, 2, 3).channel
90
+ assert_equal -1, event(0x00, 1, 2, 3).channel
91
+ end
92
+
93
+ end# TestMIDIEvent
data/test/test_view.rb CHANGED
@@ -380,18 +380,18 @@ class TestView < Test::Unit::TestCase
380
380
 
381
381
  v.capture = :key; assert_equal [:key], v.capture
382
382
  v.capture = :pointer; assert_equal [:pointer], v.capture
383
- v.capture = :note; assert_equal [:note], v.capture
384
- v.capture = :all; assert_equal [:key, :pointer, :note], v.capture
383
+ v.capture = :midi; assert_equal [:midi], v.capture
384
+ v.capture = :all; assert_equal [:key, :pointer, :midi], v.capture
385
385
 
386
- v.capture -= [:key]; assert_equal [:pointer, :note], v.capture
387
- v.capture += [:key]; assert_equal [:key, :pointer, :note], v.capture
386
+ v.capture -= [:key]; assert_equal [:pointer, :midi], v.capture
387
+ v.capture += [:key]; assert_equal [:key, :pointer, :midi], v.capture
388
388
 
389
389
  v.capture = []; assert_equal [], v.capture
390
- v.capture += [:key, :pointer, :note]; assert_equal [:key, :pointer, :note], v.capture
390
+ v.capture += [:key, :pointer, :midi]; assert_equal [:key, :pointer, :midi], v.capture
391
391
  v.capture = []; assert_equal [], v.capture
392
- v.capture += [:all]; assert_equal [:key, :pointer, :note], v.capture
392
+ v.capture += [:all]; assert_equal [:key, :pointer, :midi], v.capture
393
393
 
394
- v.capture -= []; assert_equal [:key, :pointer, :note], v.capture
394
+ v.capture -= []; assert_equal [:key, :pointer, :midi], v.capture
395
395
  v.capture = []; assert_equal [], v.capture
396
396
  v.capture += []; assert_equal [], v.capture
397
397
  end
@@ -404,35 +404,35 @@ class TestView < Test::Unit::TestCase
404
404
  assert_false v.capturing?
405
405
  assert_false v.capturing? :key
406
406
  assert_false v.capturing? :pointer
407
- assert_false v.capturing? :note
407
+ assert_false v.capturing? :midi
408
408
  assert_false v.capturing? :all
409
409
 
410
410
  v.capture = :key
411
411
  assert_true v.capturing?
412
412
  assert_true v.capturing? :key
413
413
  assert_false v.capturing? :pointer
414
- assert_false v.capturing? :note
414
+ assert_false v.capturing? :midi
415
415
  assert_false v.capturing? :all
416
416
 
417
417
  v.capture = :pointer
418
418
  assert_true v.capturing?
419
419
  assert_false v.capturing? :key
420
420
  assert_true v.capturing? :pointer
421
- assert_false v.capturing? :note
421
+ assert_false v.capturing? :midi
422
422
  assert_false v.capturing? :all
423
423
 
424
- v.capture = :note
424
+ v.capture = :midi
425
425
  assert_true v.capturing?
426
426
  assert_false v.capturing? :key
427
427
  assert_false v.capturing? :pointer
428
- assert_true v.capturing? :note
428
+ assert_true v.capturing? :midi
429
429
  assert_false v.capturing? :all
430
430
 
431
431
  v.capture = :all
432
432
  assert_true v.capturing?
433
433
  assert_true v.capturing? :key
434
434
  assert_true v.capturing? :pointer
435
- assert_true v.capturing? :note
435
+ assert_true v.capturing? :midi
436
436
  assert_true v.capturing? :all
437
437
  end
438
438
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reflexion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8.1
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-12 00:00:00.000000000 Z
11
+ date: 2025-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,60 +16,60 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.7
19
+ version: 0.3.8
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.3.7
22
+ version: 0.3.8
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 0.3.7
29
+ version: 0.3.8
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.3.7
32
+ version: 0.3.8
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rucy
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.3.7
39
+ version: 0.3.8
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 0.3.7
42
+ version: 0.3.8
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 0.3.7
49
+ version: 0.3.8
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 0.3.7
52
+ version: 0.3.8
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rays
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: 0.3.7
59
+ version: 0.3.8
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 0.3.7
62
+ version: 0.3.8
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 0.3.7
69
+ version: 0.3.8
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 0.3.7
72
+ version: 0.3.8
73
73
  description: This library helps you to develop interactive graphical user interface.
74
74
  email: xordog@gmail.com
75
75
  executables: []
@@ -79,6 +79,7 @@ extra_rdoc_files:
79
79
  - ".doc/ext/reflex/application.cpp"
80
80
  - ".doc/ext/reflex/capture_event.cpp"
81
81
  - ".doc/ext/reflex/contact_event.cpp"
82
+ - ".doc/ext/reflex/control_change_event.cpp"
82
83
  - ".doc/ext/reflex/device.cpp"
83
84
  - ".doc/ext/reflex/device_event.cpp"
84
85
  - ".doc/ext/reflex/draw_event.cpp"
@@ -92,6 +93,7 @@ extra_rdoc_files:
92
93
  - ".doc/ext/reflex/key_event.cpp"
93
94
  - ".doc/ext/reflex/line_shape.cpp"
94
95
  - ".doc/ext/reflex/midi.cpp"
96
+ - ".doc/ext/reflex/midi_event.cpp"
95
97
  - ".doc/ext/reflex/motion_event.cpp"
96
98
  - ".doc/ext/reflex/native.cpp"
97
99
  - ".doc/ext/reflex/note_event.cpp"
@@ -116,6 +118,7 @@ files:
116
118
  - ".doc/ext/reflex/application.cpp"
117
119
  - ".doc/ext/reflex/capture_event.cpp"
118
120
  - ".doc/ext/reflex/contact_event.cpp"
121
+ - ".doc/ext/reflex/control_change_event.cpp"
119
122
  - ".doc/ext/reflex/device.cpp"
120
123
  - ".doc/ext/reflex/device_event.cpp"
121
124
  - ".doc/ext/reflex/draw_event.cpp"
@@ -129,6 +132,7 @@ files:
129
132
  - ".doc/ext/reflex/key_event.cpp"
130
133
  - ".doc/ext/reflex/line_shape.cpp"
131
134
  - ".doc/ext/reflex/midi.cpp"
135
+ - ".doc/ext/reflex/midi_event.cpp"
132
136
  - ".doc/ext/reflex/motion_event.cpp"
133
137
  - ".doc/ext/reflex/native.cpp"
134
138
  - ".doc/ext/reflex/note_event.cpp"
@@ -165,6 +169,7 @@ files:
165
169
  - ext/reflex/application.cpp
166
170
  - ext/reflex/capture_event.cpp
167
171
  - ext/reflex/contact_event.cpp
172
+ - ext/reflex/control_change_event.cpp
168
173
  - ext/reflex/defs.h
169
174
  - ext/reflex/device.cpp
170
175
  - ext/reflex/device_event.cpp
@@ -180,6 +185,7 @@ files:
180
185
  - ext/reflex/key_event.cpp
181
186
  - ext/reflex/line_shape.cpp
182
187
  - ext/reflex/midi.cpp
188
+ - ext/reflex/midi_event.cpp
183
189
  - ext/reflex/motion_event.cpp
184
190
  - ext/reflex/native.cpp
185
191
  - ext/reflex/note_event.cpp
@@ -266,6 +272,7 @@ files:
266
272
  - lib/reflex/line_shape.rb
267
273
  - lib/reflex/list_view.rb
268
274
  - lib/reflex/matrix.rb
275
+ - lib/reflex/midi_event.rb
269
276
  - lib/reflex/model.rb
270
277
  - lib/reflex/model_owner.rb
271
278
  - lib/reflex/model_view.rb
@@ -429,6 +436,7 @@ files:
429
436
  - test/test_frame_event.rb
430
437
  - test/test_has_frame.rb
431
438
  - test/test_key_event.rb
439
+ - test/test_midi_event.rb
432
440
  - test/test_model.rb
433
441
  - test/test_model_owner.rb
434
442
  - test/test_note_event.rb
@@ -481,6 +489,7 @@ test_files:
481
489
  - test/test_frame_event.rb
482
490
  - test/test_has_frame.rb
483
491
  - test/test_key_event.rb
492
+ - test/test_midi_event.rb
484
493
  - test/test_model.rb
485
494
  - test/test_model_owner.rb
486
495
  - test/test_note_event.rb