midilib 2.0.4 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +2 -1
- data/Credits +44 -2
- data/README.rdoc +13 -9
- data/Rakefile +36 -53
- data/TODO.rdoc +13 -2
- data/examples/from_scratch.rb +4 -6
- data/examples/measures_mbt.rb +11 -11
- data/examples/print_program_changes.rb +11 -11
- data/examples/reader2text.rb +191 -191
- data/examples/seq2text.rb +18 -18
- data/examples/split.rb +21 -20
- data/examples/strings.rb +15 -15
- data/examples/transpose.rb +41 -42
- data/html/MIDI/ActiveSense.html +89 -213
- data/html/MIDI/ChannelEvent.html +95 -224
- data/html/MIDI/ChannelPressure.html +103 -241
- data/html/MIDI/Clock.html +89 -213
- data/html/MIDI/Continue.html +89 -213
- data/html/MIDI/Controller.html +105 -246
- data/html/MIDI/Event.html +134 -358
- data/html/MIDI/IO/MIDIFile.html +544 -1148
- data/html/MIDI/IO/SeqReader.html +273 -577
- data/html/MIDI/IO/SeqWriter.html +233 -439
- data/html/MIDI/IO.html +48 -164
- data/html/MIDI/KeySig.html +148 -291
- data/html/MIDI/Marker.html +73 -192
- data/html/MIDI/Measure.html +104 -267
- data/html/MIDI/Measures.html +106 -259
- data/html/MIDI/MetaEvent.html +171 -352
- data/html/MIDI/NoteEvent.html +114 -276
- data/html/MIDI/NoteOff.html +95 -223
- data/html/MIDI/NoteOn.html +95 -223
- data/html/MIDI/PitchBend.html +104 -242
- data/html/MIDI/PolyPressure.html +102 -246
- data/html/MIDI/ProgramChange.html +103 -241
- data/html/MIDI/Realtime.html +96 -230
- data/html/MIDI/Sequence.html +256 -576
- data/html/MIDI/SongPointer.html +104 -242
- data/html/MIDI/SongSelect.html +103 -241
- data/html/MIDI/Start.html +89 -213
- data/html/MIDI/Stop.html +89 -213
- data/html/MIDI/SystemCommon.html +73 -192
- data/html/MIDI/SystemExclusive.html +106 -244
- data/html/MIDI/SystemReset.html +89 -213
- data/html/MIDI/Tempo.html +127 -309
- data/html/MIDI/TimeSig.html +119 -300
- data/html/MIDI/Track.html +214 -494
- data/html/MIDI/TuneRequest.html +96 -230
- data/html/MIDI/Utils.html +91 -233
- data/html/MIDI.html +142 -526
- data/html/Object.html +197 -0
- data/html/README_rdoc.html +280 -486
- data/html/TODO_rdoc.html +68 -145
- data/html/created.rid +15 -14
- data/html/css/fonts.css +167 -0
- data/html/css/rdoc.css +639 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/index.html +230 -446
- data/html/js/darkfish.js +22 -91
- data/html/js/navigation.js +4 -41
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +41 -25
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +9 -8
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +1111 -505
- data/install.rb +53 -34
- data/lib/midilib/consts.rb +406 -408
- data/lib/midilib/event.rb +335 -306
- data/lib/midilib/info.rb +5 -7
- data/lib/midilib/io/midifile.rb +424 -452
- data/lib/midilib/io/seqreader.rb +200 -192
- data/lib/midilib/io/seqwriter.rb +151 -147
- data/lib/midilib/measure.rb +78 -80
- data/lib/midilib/mergesort.rb +39 -0
- data/lib/midilib/sequence.rb +93 -87
- data/lib/midilib/track.rb +71 -118
- data/lib/midilib/utils.rb +17 -20
- data/lib/midilib.rb +5 -5
- data/test/event_equality.rb +50 -52
- data/test/test_event.rb +120 -124
- data/test/test_io.rb +118 -38
- data/test/test_mergesort.rb +37 -0
- data/test/test_midifile.rb +6 -19
- data/test/test_sequence.rb +62 -61
- data/test/test_track.rb +126 -155
- data/test/test_varlen.rb +23 -27
- metadata +67 -62
- data/html/IO.html +0 -259
- data/html/MIDI/MIDI/MIDI/Array.html +0 -353
- data/html/MIDI/MIDI/MIDI.html +0 -204
- data/html/MIDI/MIDI.html +0 -204
- data/html/js/jquery.js +0 -18
- data/html/rdoc.css +0 -543
data/install.rb
CHANGED
@@ -5,53 +5,72 @@
|
|
5
5
|
# This script installs midilib into the Ruby site-local library directory.
|
6
6
|
#
|
7
7
|
# Author:: Jim Menard (mailto:jim@jimmenard.com)
|
8
|
-
# Copyright:: Copyright (c) 2003-
|
8
|
+
# Copyright:: Copyright (c) 2003-2013 by Jim Menard
|
9
9
|
# License:: Distributed under the same license as Ruby.
|
10
10
|
#
|
11
11
|
|
12
12
|
require 'getoptlong'
|
13
|
-
require 'ftools'
|
14
13
|
require 'find'
|
14
|
+
begin
|
15
|
+
require 'ftools'
|
16
|
+
def mkdirs(dir)
|
17
|
+
File.makedirs(dir)
|
18
|
+
end
|
19
|
+
|
20
|
+
def install(*args)
|
21
|
+
File.install(*args)
|
22
|
+
end
|
23
|
+
rescue LoadError
|
24
|
+
require 'fileutils'
|
25
|
+
def mkdirs(dir)
|
26
|
+
FileUtils.mkdir_p(dir)
|
27
|
+
end
|
28
|
+
|
29
|
+
def install(*args)
|
30
|
+
args[2] = { mode: args[2], verbose: args[3] }
|
31
|
+
args.pop
|
32
|
+
FileUtils.install(*args)
|
33
|
+
end
|
34
|
+
end
|
15
35
|
|
16
36
|
SOURCE_DIR = 'lib'
|
17
37
|
LIB_DIR = 'midilib'
|
18
38
|
IO_DIR = File.join(LIB_DIR, 'io')
|
19
39
|
|
20
40
|
def instdir
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
28
|
-
}
|
29
|
-
|
30
|
-
begin
|
31
|
-
require 'rbconfig'
|
32
|
-
libdir = Config::CONFIG['sitedir'] + "/" +
|
33
|
-
Config::CONFIG['MAJOR'] + "." +
|
34
|
-
Config::CONFIG['MINOR']
|
35
|
-
rescue ScriptError
|
36
|
-
$LOAD_PATH.each do |l|
|
37
|
-
if l =~ /site_ruby/ && l =~ /\d$/ && l !~ /#{PLATFORM}/
|
38
|
-
libdir = l
|
39
|
-
break
|
40
|
-
end
|
41
|
-
end
|
42
|
-
STDERR.puts "Can't find required file `rbconfig.rb'."
|
43
|
-
STDERR.puts "The `midilib' files need to be installed manually in" +
|
44
|
-
" #{libdir}"
|
41
|
+
g = GetoptLong.new(['--install-dir', '-i', GetoptLong::REQUIRED_ARGUMENT])
|
42
|
+
g.each do |name, arg|
|
43
|
+
if name == '--install-dir'
|
44
|
+
return arg
|
45
|
+
else
|
46
|
+
warn 'usage: $0 [--install-dir dir]'
|
45
47
|
end
|
46
|
-
|
48
|
+
end
|
49
|
+
|
50
|
+
begin
|
51
|
+
require 'rbconfig'
|
52
|
+
libdir = Config::CONFIG['sitedir'] + '/' +
|
53
|
+
Config::CONFIG['MAJOR'] + '.' +
|
54
|
+
Config::CONFIG['MINOR']
|
55
|
+
rescue ScriptError
|
56
|
+
$LOAD_PATH.each do |l|
|
57
|
+
if l =~ /site_ruby/ && l =~ /\d$/ && l !~ /#{PLATFORM}/
|
58
|
+
libdir = l
|
59
|
+
break
|
60
|
+
end
|
61
|
+
end
|
62
|
+
warn "Can't find required file `rbconfig.rb'."
|
63
|
+
warn "The `midilib' files need to be installed manually in #{libdir}"
|
64
|
+
end
|
65
|
+
libdir
|
47
66
|
end
|
48
67
|
|
49
|
-
INSTALL_DIR = instdir
|
68
|
+
INSTALL_DIR = instdir
|
50
69
|
files = Dir.chdir('lib') { Dir['**/*.rb'] }
|
51
70
|
|
52
|
-
files.each
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
71
|
+
files.each do |f|
|
72
|
+
dir = File.dirname(f)
|
73
|
+
target_dir = File.join(INSTALL_DIR, dir)
|
74
|
+
mkdirs(target_dir) unless File.exist?(target_dir)
|
75
|
+
install(File.join('lib', f), File.join(INSTALL_DIR, f), 0o644, true)
|
76
|
+
end
|