File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 1
1
# lib/gemwarrior/misc/music.rb
2
2
# Music cues using win32-sound
3
3
4
- require 'feep'
5
- require 'win32/sound'
6
-
7
- require_relative 'musical_notes'
8
-
9
4
module Gemwarrior
10
5
module Music
11
6
def self . cue ( sequence )
12
7
# if Windows, use superior win32-sound library
13
8
if OS . windows?
9
+ require 'win32/sound'
14
10
threads = [ ]
15
11
16
12
Thread . start {
@@ -25,10 +21,13 @@ def self.cue(sequence)
25
21
}
26
22
# otherwise, use inferior feep library
27
23
else
24
+ require 'feep'
25
+ require_relative 'musical_notes'
26
+
28
27
feep_defaults = {
29
- :frequencies => '440' ,
30
- :waveform => 'sine' ,
31
- :volume => 0.3 ,
28
+ :frequencies => '440' ,
29
+ :waveform => 'sine' ,
30
+ :volume => 0.3 ,
32
31
:duration => 500 ,
33
32
:notext => true
34
33
}
@@ -38,9 +37,9 @@ def self.cue(sequence)
38
37
seq = feep_defaults . merge ( seq )
39
38
40
39
Feep ::Base . new ( {
41
- :freq_or_note => seq [ :frequencies ] ,
42
- :waveform => seq [ :waveform ] ,
43
- :volume => seq [ :volume ] ,
40
+ :freq_or_note => seq [ :frequencies ] ,
41
+ :waveform => seq [ :waveform ] ,
42
+ :volume => seq [ :volume ] ,
44
43
:duration => seq [ :duration ] ,
45
44
:notext => seq [ :notext ]
46
45
} )
Original file line number Diff line number Diff line change 2
2
# Version of Gem Warrior
3
3
4
4
module Gemwarrior
5
- VERSION = '0.9.26 '
5
+ VERSION = '0.9.27 '
6
6
end
You can’t perform that action at this time.
0 commit comments