hindbaer 0.0.4 → 0.0.5
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.
- data/README.markdown +25 -23
- data/lib/hindbaer/audio_pool.rb +26 -9
- data/lib/hindbaer/clip.rb +15 -17
- data/lib/hindbaer/fade.rb +15 -9
- data/lib/hindbaer/file.rb +22 -24
- data/lib/hindbaer/group.rb +28 -13
- data/lib/hindbaer/info.rb +27 -74
- data/lib/hindbaer/marker.rb +20 -9
- data/lib/hindbaer/plugin.rb +5 -5
- data/lib/hindbaer/plugin/base.rb +21 -11
- data/lib/hindbaer/plugin/compressor.rb +11 -9
- data/lib/hindbaer/plugin/equalizer.rb +27 -53
- data/lib/hindbaer/plugin/voice_profiler.rb +31 -55
- data/lib/hindbaer/region.rb +28 -52
- data/lib/hindbaer/session.rb +47 -72
- data/lib/hindbaer/track.rb +41 -16
- data/lib/hindbaer/version.rb +1 -1
- data/spec/audio_pool_spec.rb +4 -2
- data/spec/clip_spec.rb +6 -8
- data/spec/fade_spec.rb +7 -5
- data/spec/file_spec.rb +8 -6
- data/spec/fixtures/{project.nhsx → session.nhsx} +0 -0
- data/spec/group_spec.rb +5 -7
- data/spec/info_spec.rb +6 -4
- data/spec/marker_spec.rb +5 -3
- data/spec/{plugin_base_spec.rb → plugin/base_spec.rb} +6 -4
- data/spec/region_spec.rb +10 -12
- data/spec/session_spec.rb +6 -7
- data/spec/track_spec.rb +5 -6
- metadata +20 -20
data/lib/hindbaer/track.rb
CHANGED
@@ -1,27 +1,52 @@
|
|
1
1
|
module Hindbaer
|
2
2
|
class Track
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
def name
|
12
|
-
@doc['Name']
|
13
|
-
end
|
4
|
+
ATTRIBUTES = %w{
|
5
|
+
name pan
|
6
|
+
}
|
7
|
+
|
8
|
+
attr_accessor *ATTRIBUTES
|
9
|
+
attr_accessor :regions, :plugins
|
14
10
|
|
15
|
-
def
|
16
|
-
|
11
|
+
def self.parse(doc)
|
12
|
+
new do
|
13
|
+
ATTRIBUTES.each do |attribute|
|
14
|
+
self.send("#{attribute.to_sym}=", doc[attribute.capitalize])
|
15
|
+
end
|
16
|
+
|
17
|
+
self.regions = doc.css('Region').map do |r|
|
18
|
+
Hindbaer::Region.parse(r)
|
19
|
+
end
|
20
|
+
self.plugins = doc.css('Plugin').map do |p|
|
21
|
+
Hindbaer::Plugin.parse(p)
|
22
|
+
end
|
23
|
+
end
|
17
24
|
end
|
18
25
|
|
19
|
-
def
|
20
|
-
|
26
|
+
def initialize(&block)
|
27
|
+
self.regions = []
|
28
|
+
self.plugins = []
|
29
|
+
|
30
|
+
block.arity > 0 ? block.call(self) : instance_eval(&block)
|
21
31
|
end
|
22
32
|
|
23
|
-
def
|
24
|
-
|
33
|
+
def to_xml(xml)
|
34
|
+
xml.Track Name: name, Pan: pan do
|
35
|
+
regions.each do |region|
|
36
|
+
xml.Region Ref: region.ref, Name: region.name, Start: region.start, Length: region.length, Offset: region.offset, FadeIn: region.fade_in, FadeOut: region.fade_out, Gain: region.gain, Leq: region.leq do
|
37
|
+
region.fades.each do |fade|
|
38
|
+
fade.to_xml(xml)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
unless plugins.empty?
|
43
|
+
xml.Plugins do
|
44
|
+
plugins.each do |plugin|
|
45
|
+
plugin.to_xml(xml)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
25
50
|
end
|
26
51
|
end
|
27
52
|
end
|
data/lib/hindbaer/version.rb
CHANGED
data/spec/audio_pool_spec.rb
CHANGED
@@ -3,8 +3,10 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::AudioPool do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
@pool = session.audio_pool
|
9
|
+
end
|
8
10
|
end
|
9
11
|
|
10
12
|
it 'must return path to audio files' do
|
data/spec/clip_spec.rb
CHANGED
@@ -3,14 +3,15 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Clip do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
group = session.clipboard_groups.first
|
9
|
+
@clip = group.clips.first
|
10
|
+
end
|
9
11
|
end
|
10
12
|
|
11
13
|
it 'must return file reference' do
|
12
|
-
@clip.
|
13
|
-
@clip.reference.id.must_equal 2
|
14
|
+
@clip.ref.must_equal '2'
|
14
15
|
end
|
15
16
|
|
16
17
|
it 'must return name' do
|
@@ -25,7 +26,4 @@ describe Hindbaer::Clip do
|
|
25
26
|
@clip.leq.must_equal '-'
|
26
27
|
end
|
27
28
|
|
28
|
-
it 'must return parent group' do
|
29
|
-
@clip.group.must_equal @group
|
30
|
-
end
|
31
29
|
end
|
data/spec/fade_spec.rb
CHANGED
@@ -3,14 +3,16 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Fade do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
track = session.tracks[2]
|
9
|
+
region = track.regions.first
|
10
|
+
@fade = region.fades.first
|
11
|
+
end
|
10
12
|
end
|
11
13
|
|
12
14
|
it 'must return start time' do
|
13
|
-
@fade.
|
15
|
+
@fade.start.must_equal '06.426'
|
14
16
|
end
|
15
17
|
|
16
18
|
it 'must return length' do
|
data/spec/file_spec.rb
CHANGED
@@ -3,12 +3,14 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::File do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
@file = session.audio_pool.files.first
|
9
|
+
end
|
8
10
|
end
|
9
11
|
|
10
12
|
it 'must return id' do
|
11
|
-
@file.id.must_equal 1
|
13
|
+
@file.id.must_equal '1'
|
12
14
|
end
|
13
15
|
|
14
16
|
it 'must return name' do
|
@@ -20,15 +22,15 @@ describe Hindbaer::File do
|
|
20
22
|
end
|
21
23
|
|
22
24
|
it 'must return the number of channels' do
|
23
|
-
@file.
|
25
|
+
@file.channels.must_equal '2'
|
24
26
|
end
|
25
27
|
|
26
28
|
it 'must return leq' do
|
27
|
-
@file.leq.must_equal -10.4
|
29
|
+
@file.leq.must_equal '-10.4'
|
28
30
|
end
|
29
31
|
|
30
32
|
it 'must return dynamics' do
|
31
|
-
@file.
|
33
|
+
@file.dyn.must_equal nil
|
32
34
|
end
|
33
35
|
|
34
36
|
it 'must return the original file path' do
|
File without changes
|
data/spec/group_spec.rb
CHANGED
@@ -3,8 +3,10 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Group do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
@group = session.clipboard_groups.first
|
9
|
+
end
|
8
10
|
end
|
9
11
|
|
10
12
|
it 'must return caption' do
|
@@ -12,7 +14,7 @@ describe Hindbaer::Group do
|
|
12
14
|
end
|
13
15
|
|
14
16
|
it 'must return number of clips used' do
|
15
|
-
@group.
|
17
|
+
@group.used.must_equal '2'
|
16
18
|
end
|
17
19
|
|
18
20
|
it 'must return all clips' do
|
@@ -20,8 +22,4 @@ describe Hindbaer::Group do
|
|
20
22
|
@group.clips.size.must_equal 2
|
21
23
|
end
|
22
24
|
|
23
|
-
it 'must return session' do
|
24
|
-
@group.session.must_equal @session
|
25
|
-
end
|
26
|
-
|
27
25
|
end
|
data/spec/info_spec.rb
CHANGED
@@ -3,8 +3,10 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Info do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
@info = session.info
|
9
|
+
end
|
8
10
|
end
|
9
11
|
|
10
12
|
it 'must return title' do
|
@@ -36,7 +38,7 @@ describe Hindbaer::Info do
|
|
36
38
|
end
|
37
39
|
|
38
40
|
it 'must return album track' do
|
39
|
-
@info.
|
41
|
+
@info.track.must_equal '1'
|
40
42
|
end
|
41
43
|
|
42
44
|
it 'must return artist' do
|
@@ -60,7 +62,7 @@ describe Hindbaer::Info do
|
|
60
62
|
end
|
61
63
|
|
62
64
|
it 'must return whether explicit' do
|
63
|
-
@info.explicit
|
65
|
+
@info.explicit.must_equal 'Yes'
|
64
66
|
end
|
65
67
|
|
66
68
|
it 'must return identifier' do
|
data/spec/marker_spec.rb
CHANGED
@@ -3,12 +3,14 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Marker do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
@marker = session.markers.first
|
9
|
+
end
|
8
10
|
end
|
9
11
|
|
10
12
|
it 'must return id' do
|
11
|
-
@marker.id.must_equal 1
|
13
|
+
@marker.id.must_equal '1'
|
12
14
|
end
|
13
15
|
|
14
16
|
it 'must return name' do
|
@@ -3,13 +3,15 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Plugin::Base do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
track = session.tracks.first
|
9
|
+
@plugin = track.plugins.first
|
10
|
+
end
|
9
11
|
end
|
10
12
|
|
11
13
|
it 'must return id' do
|
12
|
-
@plugin.id.must_equal 0
|
14
|
+
@plugin.id.must_equal '0'
|
13
15
|
end
|
14
16
|
|
15
17
|
it 'must return name' do
|
data/spec/region_spec.rb
CHANGED
@@ -3,14 +3,15 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Region do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
track = session.tracks.first
|
9
|
+
@region = track.regions.first
|
10
|
+
end
|
9
11
|
end
|
10
12
|
|
11
13
|
it 'must return audio reference' do
|
12
|
-
@region.
|
13
|
-
@region.reference.id.must_equal 1
|
14
|
+
@region.ref.must_equal '1'
|
14
15
|
end
|
15
16
|
|
16
17
|
it 'must return name' do
|
@@ -18,7 +19,7 @@ describe Hindbaer::Region do
|
|
18
19
|
end
|
19
20
|
|
20
21
|
it 'must return start time' do
|
21
|
-
@region.
|
22
|
+
@region.start.must_equal '00.0'
|
22
23
|
end
|
23
24
|
|
24
25
|
it 'must return length' do
|
@@ -38,19 +39,16 @@ describe Hindbaer::Region do
|
|
38
39
|
end
|
39
40
|
|
40
41
|
it 'must return gain' do
|
41
|
-
@region.gain.must_equal -3.3
|
42
|
+
@region.gain.must_equal '-3.3'
|
42
43
|
end
|
43
44
|
|
44
45
|
it 'must return long-term equivalent level' do
|
45
|
-
@region.leq.must_equal -16.4
|
46
|
+
@region.leq.must_equal '-16.4'
|
46
47
|
end
|
47
48
|
|
48
49
|
it 'must return all fades' do
|
49
50
|
@region.fades.first.must_be_kind_of Hindbaer::Fade
|
50
51
|
@region.fades.size.must_equal 1
|
51
52
|
end
|
52
|
-
|
53
|
-
it 'must return parent track' do
|
54
|
-
@region.track.must_equal @track
|
55
|
-
end
|
53
|
+
|
56
54
|
end
|
data/spec/session_spec.rb
CHANGED
@@ -3,15 +3,17 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Session do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
@session = Hindbaer::Session.parse(f)
|
8
|
+
end
|
7
9
|
end
|
8
10
|
|
9
11
|
it 'must return software version' do
|
10
|
-
@session.
|
12
|
+
@session.version.must_equal 'Hindenburg Journalist Pro 1.10.1742'
|
11
13
|
end
|
12
14
|
|
13
15
|
it 'must return sample rate' do
|
14
|
-
@session.
|
16
|
+
@session.samplerate.must_equal '44100'
|
15
17
|
end
|
16
18
|
|
17
19
|
it 'must return session info' do
|
@@ -42,10 +44,7 @@ describe Hindbaer::Session do
|
|
42
44
|
end
|
43
45
|
|
44
46
|
it 'must render itself as xml' do
|
45
|
-
|
46
|
-
file << @session.to_xml
|
47
|
-
end
|
48
|
-
@session.to_xml.must_equal File.open('spec/fixtures/project.nhsx').read
|
47
|
+
puts @session.to_xml
|
49
48
|
end
|
50
49
|
|
51
50
|
end
|
data/spec/track_spec.rb
CHANGED
@@ -3,8 +3,10 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Track do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
|
6
|
+
File.open('spec/fixtures/session.nhsx') do |f|
|
7
|
+
session = Hindbaer::Session.parse(f)
|
8
|
+
@track = session.tracks.first
|
9
|
+
end
|
8
10
|
end
|
9
11
|
|
10
12
|
it 'must return name' do
|
@@ -24,8 +26,5 @@ describe Hindbaer::Track do
|
|
24
26
|
@track.plugins.first.must_be_kind_of Hindbaer::Plugin::Base
|
25
27
|
@track.plugins.size.must_equal 4
|
26
28
|
end
|
27
|
-
|
28
|
-
it 'must return parent session' do
|
29
|
-
@track.session.must_equal @session
|
30
|
-
end
|
29
|
+
|
31
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hindbaer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-08-
|
12
|
+
date: 2011-08-29 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &70332400753160 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70332400753160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: guard
|
27
|
-
requirement: &
|
27
|
+
requirement: &70332400752540 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70332400752540
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: guard-minitest
|
38
|
-
requirement: &
|
38
|
+
requirement: &70332400752120 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70332400752120
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rb-fsevent
|
49
|
-
requirement: &
|
49
|
+
requirement: &70332400751440 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70332400751440
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: growl_notify
|
60
|
-
requirement: &
|
60
|
+
requirement: &70332400750740 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70332400750740
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mocha
|
71
|
-
requirement: &
|
71
|
+
requirement: &70332400749980 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70332400749980
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: nokogiri
|
82
|
-
requirement: &
|
82
|
+
requirement: &70332400749220 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70332400749220
|
91
91
|
description: A Hindenburg Journalist parser
|
92
92
|
email:
|
93
93
|
- jamiehodge@me.com
|
@@ -122,11 +122,11 @@ files:
|
|
122
122
|
- spec/clip_spec.rb
|
123
123
|
- spec/fade_spec.rb
|
124
124
|
- spec/file_spec.rb
|
125
|
-
- spec/fixtures/
|
125
|
+
- spec/fixtures/session.nhsx
|
126
126
|
- spec/group_spec.rb
|
127
127
|
- spec/info_spec.rb
|
128
128
|
- spec/marker_spec.rb
|
129
|
-
- spec/
|
129
|
+
- spec/plugin/base_spec.rb
|
130
130
|
- spec/region_spec.rb
|
131
131
|
- spec/session_spec.rb
|
132
132
|
- spec/spec_helper.rb
|
@@ -160,11 +160,11 @@ test_files:
|
|
160
160
|
- spec/clip_spec.rb
|
161
161
|
- spec/fade_spec.rb
|
162
162
|
- spec/file_spec.rb
|
163
|
-
- spec/fixtures/
|
163
|
+
- spec/fixtures/session.nhsx
|
164
164
|
- spec/group_spec.rb
|
165
165
|
- spec/info_spec.rb
|
166
166
|
- spec/marker_spec.rb
|
167
|
-
- spec/
|
167
|
+
- spec/plugin/base_spec.rb
|
168
168
|
- spec/region_spec.rb
|
169
169
|
- spec/session_spec.rb
|
170
170
|
- spec/spec_helper.rb
|