hindbaer 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +44 -15
- data/lib/hindbaer.rb +20 -2
- data/lib/hindbaer/audio_pool.rb +21 -0
- data/lib/hindbaer/clip.rb +28 -0
- data/lib/hindbaer/fade.rb +2 -2
- data/lib/hindbaer/{audio.rb → file.rb} +1 -1
- data/lib/hindbaer/group.rb +24 -0
- data/lib/hindbaer/info.rb +77 -0
- data/lib/hindbaer/plugin.rb +20 -0
- data/lib/hindbaer/region.rb +3 -3
- data/lib/hindbaer/session.rb +10 -56
- data/lib/hindbaer/track.rb +6 -2
- data/lib/hindbaer/version.rb +1 -1
- data/spec/audio_pool_spec.rb +18 -0
- data/spec/clip_spec.rb +31 -0
- data/spec/{audio_spec.rb → file_spec.rb} +9 -9
- data/spec/fixtures/project.nhsx +6 -1
- data/spec/group_spec.rb +27 -0
- data/spec/info_spec.rb +74 -0
- data/spec/plugin_spec.rb +23 -0
- data/spec/region_spec.rb +8 -1
- data/spec/session_spec.rb +11 -36
- data/spec/track_spec.rb +12 -2
- metadata +33 -18
data/README.markdown
CHANGED
@@ -14,25 +14,37 @@ Usage
|
|
14
14
|
|
15
15
|
Parse a session file:
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
session = Hindbaer::Session.new('spec/fixtures/project.nhsx')
|
18
|
+
|
19
|
+
session.software_version
|
20
|
+
session.sample_rate
|
21
|
+
|
22
|
+
session.info.title
|
23
|
+
session.info.subtitle
|
24
|
+
session.info.description
|
25
|
+
session.info.author
|
26
|
+
session.info.album
|
27
|
+
session.ínfo.album_track
|
28
|
+
session.info.keywords
|
29
|
+
# etc.
|
30
|
+
|
31
|
+
session.length # in seconds
|
28
32
|
|
29
33
|
Retrieve all tracks:
|
30
34
|
|
31
|
-
tracks =
|
35
|
+
tracks = session.tracks
|
32
36
|
track = tracks.first
|
33
37
|
track.name
|
34
38
|
track.panning
|
35
39
|
|
40
|
+
Retrieve all track plugins:
|
41
|
+
|
42
|
+
plugins = track.plugins
|
43
|
+
plugin = plugins.first
|
44
|
+
plugin.id
|
45
|
+
plugin.name
|
46
|
+
plugin.uid
|
47
|
+
|
36
48
|
Retrieve all regions for a given track:
|
37
49
|
|
38
50
|
regions = tracks.first.regions
|
@@ -55,9 +67,23 @@ Retrieve all fades for a given region:
|
|
55
67
|
fade.length
|
56
68
|
fade.gain
|
57
69
|
|
70
|
+
Retrieve all clipboard groups and their clips:
|
71
|
+
|
72
|
+
groups = session.clipboard_groups
|
73
|
+
group = group.first
|
74
|
+
group.caption
|
75
|
+
group.num_clips_used
|
76
|
+
|
77
|
+
clips = group.clips
|
78
|
+
clip = clips.first
|
79
|
+
clip.reference
|
80
|
+
clip.name
|
81
|
+
clip.length
|
82
|
+
clip.leq # (long-term equivalent level)
|
83
|
+
|
58
84
|
Retrieve all markers:
|
59
85
|
|
60
|
-
markers =
|
86
|
+
markers = session.markers
|
61
87
|
marker = markers.first
|
62
88
|
marker.id
|
63
89
|
marker.name
|
@@ -65,8 +91,11 @@ Retrieve all markers:
|
|
65
91
|
|
66
92
|
Retrieve all audio file references:
|
67
93
|
|
68
|
-
audio_pool =
|
69
|
-
|
94
|
+
audio_pool = session.audio_pool
|
95
|
+
audio_pool.path
|
96
|
+
audio_pool.location
|
97
|
+
|
98
|
+
file = audio_pool.files.first
|
70
99
|
file.id
|
71
100
|
file.name
|
72
101
|
file.duration
|
data/lib/hindbaer.rb
CHANGED
@@ -4,8 +4,26 @@ require 'nokogiri'
|
|
4
4
|
|
5
5
|
require 'hindbaer/version'
|
6
6
|
require 'hindbaer/session'
|
7
|
-
require 'hindbaer/
|
7
|
+
require 'hindbaer/info'
|
8
|
+
require 'hindbaer/audio_pool'
|
9
|
+
require 'hindbaer/file'
|
8
10
|
require 'hindbaer/track'
|
9
11
|
require 'hindbaer/region'
|
10
12
|
require 'hindbaer/fade'
|
11
|
-
require 'hindbaer/
|
13
|
+
require 'hindbaer/plugin'
|
14
|
+
require 'hindbaer/group'
|
15
|
+
require 'hindbaer/clip'
|
16
|
+
require 'hindbaer/marker'
|
17
|
+
|
18
|
+
module Hindbaer
|
19
|
+
extend self
|
20
|
+
|
21
|
+
def tc_to_secs(timecode)
|
22
|
+
seconds, minutes, hours = timecode.split(':').reverse
|
23
|
+
total = seconds.to_f if seconds
|
24
|
+
total += minutes.to_f * 60 if minutes
|
25
|
+
total += hours.to_f * 60 * 60 if hours
|
26
|
+
total
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Hindbaer
|
2
|
+
class AudioPool
|
3
|
+
|
4
|
+
def initialize(fragment)
|
5
|
+
@doc = fragment
|
6
|
+
end
|
7
|
+
|
8
|
+
def path
|
9
|
+
@doc['Path']
|
10
|
+
end
|
11
|
+
|
12
|
+
def location
|
13
|
+
@doc['Location']
|
14
|
+
end
|
15
|
+
|
16
|
+
def files
|
17
|
+
@doc.css('File').map { |f| Hindbaer::File.new(f.dup.unlink) }
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Hindbaer
|
2
|
+
class Clip
|
3
|
+
|
4
|
+
def initialize(fragment, group)
|
5
|
+
@doc = fragment
|
6
|
+
@group = group
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :group
|
10
|
+
|
11
|
+
def reference
|
12
|
+
id = @doc['Ref'].to_i
|
13
|
+
self.group.session.audio_pool.files.find { |a| a.id == id }
|
14
|
+
end
|
15
|
+
|
16
|
+
def name
|
17
|
+
@doc['Name']
|
18
|
+
end
|
19
|
+
|
20
|
+
def length
|
21
|
+
@doc['Length']
|
22
|
+
end
|
23
|
+
|
24
|
+
def leq
|
25
|
+
@doc['Leq'].to_f
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/hindbaer/fade.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Hindbaer
|
2
|
+
class Group
|
3
|
+
|
4
|
+
def initialize(fragment, session)
|
5
|
+
@doc = fragment
|
6
|
+
@session = session
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :session
|
10
|
+
|
11
|
+
def caption
|
12
|
+
@doc['Caption']
|
13
|
+
end
|
14
|
+
|
15
|
+
def num_clips_used
|
16
|
+
@doc['Used'].to_i
|
17
|
+
end
|
18
|
+
|
19
|
+
def clips
|
20
|
+
@doc.css('Clip').map { |c| Hindbaer::Clip.new(c.dup.unlink, self) }
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module Hindbaer
|
2
|
+
class Info
|
3
|
+
|
4
|
+
def initialize(fragment)
|
5
|
+
@doc = fragment
|
6
|
+
end
|
7
|
+
|
8
|
+
def name
|
9
|
+
@doc['Name']
|
10
|
+
end
|
11
|
+
|
12
|
+
def title
|
13
|
+
@doc['Title']
|
14
|
+
end
|
15
|
+
|
16
|
+
def subtitle
|
17
|
+
@doc['Subtitle']
|
18
|
+
end
|
19
|
+
|
20
|
+
def author
|
21
|
+
@doc['Author']
|
22
|
+
end
|
23
|
+
|
24
|
+
def link
|
25
|
+
@doc['Link']
|
26
|
+
end
|
27
|
+
|
28
|
+
def email
|
29
|
+
@doc['Email']
|
30
|
+
end
|
31
|
+
|
32
|
+
def description
|
33
|
+
@doc['Description']
|
34
|
+
end
|
35
|
+
|
36
|
+
def album
|
37
|
+
@doc['Album']
|
38
|
+
end
|
39
|
+
|
40
|
+
def album_track
|
41
|
+
@doc['Track']
|
42
|
+
end
|
43
|
+
|
44
|
+
def artist
|
45
|
+
@doc['Artist']
|
46
|
+
end
|
47
|
+
|
48
|
+
def composer
|
49
|
+
@doc['Composer']
|
50
|
+
end
|
51
|
+
|
52
|
+
def date
|
53
|
+
@doc['Date']
|
54
|
+
end
|
55
|
+
|
56
|
+
def copyright
|
57
|
+
@doc['Copyright']
|
58
|
+
end
|
59
|
+
|
60
|
+
def explicit?
|
61
|
+
@doc['Explicit'] == 'Yes'
|
62
|
+
end
|
63
|
+
|
64
|
+
def keywords
|
65
|
+
@doc['Keywords'].split(',').map { |k| k.strip }
|
66
|
+
end
|
67
|
+
|
68
|
+
def identifier
|
69
|
+
@doc['Identifier']
|
70
|
+
end
|
71
|
+
|
72
|
+
def reference
|
73
|
+
@doc['Reference']
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
data/lib/hindbaer/region.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Hindbaer
|
2
2
|
class Region
|
3
|
-
def initialize(
|
4
|
-
@doc =
|
3
|
+
def initialize(fragment, track = nil)
|
4
|
+
@doc = fragment
|
5
5
|
@track = track
|
6
6
|
end
|
7
7
|
|
@@ -9,7 +9,7 @@ module Hindbaer
|
|
9
9
|
|
10
10
|
def reference
|
11
11
|
id = @doc['Ref'].to_i
|
12
|
-
self.track.session.audio_pool.find { |a| a.id == id }
|
12
|
+
self.track.session.audio_pool.files.find { |a| a.id == id }
|
13
13
|
end
|
14
14
|
|
15
15
|
def name
|
data/lib/hindbaer/session.rb
CHANGED
@@ -2,7 +2,7 @@ module Hindbaer
|
|
2
2
|
|
3
3
|
class Session
|
4
4
|
def initialize(file)
|
5
|
-
File.open(file, 'r') do |file|
|
5
|
+
::File.open(file, 'r') do |file|
|
6
6
|
@doc = Nokogiri::XML(file)
|
7
7
|
end
|
8
8
|
end
|
@@ -15,54 +15,22 @@ module Hindbaer
|
|
15
15
|
@doc.at_css('Session')['Samplerate']
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
def title
|
23
|
-
info['Title']
|
24
|
-
end
|
25
|
-
|
26
|
-
def subtitle
|
27
|
-
info['Subtitle']
|
28
|
-
end
|
29
|
-
|
30
|
-
def author
|
31
|
-
info['Author']
|
32
|
-
end
|
33
|
-
|
34
|
-
def description
|
35
|
-
info['Description']
|
36
|
-
end
|
37
|
-
|
38
|
-
def album
|
39
|
-
info['Album']
|
40
|
-
end
|
41
|
-
|
42
|
-
def album_track
|
43
|
-
info['Track']
|
44
|
-
end
|
45
|
-
|
46
|
-
def keywords
|
47
|
-
info['Keywords'].split(',').map { |k| k.strip }
|
18
|
+
def info
|
19
|
+
Hindbaer::Info.new(@doc.at_css('Info').dup.unlink)
|
48
20
|
end
|
49
21
|
|
50
22
|
def audio_pool
|
51
|
-
@doc.
|
52
|
-
end
|
53
|
-
|
54
|
-
def audio_pool_path
|
55
|
-
@doc.at_css('AudioPool')['Path']
|
56
|
-
end
|
57
|
-
|
58
|
-
def audio_pool_location
|
59
|
-
@doc.at_css('AudioPool')['Location']
|
23
|
+
Hindbaer::AudioPool.new(@doc.at_css('AudioPool').dup.unlink)
|
60
24
|
end
|
61
25
|
|
62
26
|
def tracks
|
63
27
|
@doc.css('Tracks Track').map { |t| Hindbaer::Track.new(t.dup.unlink, self) }
|
64
28
|
end
|
65
29
|
|
30
|
+
def clipboard_groups
|
31
|
+
@doc.css('Clipboard Group').map { |g| Hindbaer::Group.new(g.dup.unlink, self) }
|
32
|
+
end
|
33
|
+
|
66
34
|
def markers
|
67
35
|
@doc.css('Markers Marker').map { |m| Hindbaer::Marker.new(m.dup.unlink) }
|
68
36
|
end
|
@@ -73,24 +41,10 @@ module Hindbaer
|
|
73
41
|
end.compact
|
74
42
|
|
75
43
|
regions.map do |r|
|
76
|
-
tc_to_secs(r.start_time) +
|
77
|
-
tc_to_secs(r.length)
|
44
|
+
Hindbaer.tc_to_secs(r.start_time) +
|
45
|
+
Hindbaer.tc_to_secs(r.length)
|
78
46
|
end.max
|
79
47
|
end
|
80
|
-
|
81
|
-
private
|
82
|
-
|
83
|
-
def info
|
84
|
-
@doc.at_css('Info')
|
85
|
-
end
|
86
|
-
|
87
|
-
def tc_to_secs(timecode)
|
88
|
-
seconds, minutes, hours = timecode.split(':').reverse
|
89
|
-
total = seconds.to_f if seconds
|
90
|
-
total += minutes.to_f * 60 if minutes
|
91
|
-
total += hours.to_f * 60 * 60 if hours
|
92
|
-
total
|
93
|
-
end
|
94
48
|
|
95
49
|
end
|
96
50
|
end
|
data/lib/hindbaer/track.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Hindbaer
|
2
2
|
class Track
|
3
3
|
|
4
|
-
def initialize(
|
5
|
-
@doc =
|
4
|
+
def initialize(fragment, session = nil)
|
5
|
+
@doc = fragment
|
6
6
|
@session = session
|
7
7
|
end
|
8
8
|
|
@@ -19,5 +19,9 @@ module Hindbaer
|
|
19
19
|
def regions
|
20
20
|
@doc.css('Region').map { |r| Hindbaer::Region.new(r.dup.unlink, self) }
|
21
21
|
end
|
22
|
+
|
23
|
+
def plugins
|
24
|
+
@doc.css('Plugin').map { |p| Hindbaer::Plugin.new(p.dup.unlink) }
|
25
|
+
end
|
22
26
|
end
|
23
27
|
end
|
data/lib/hindbaer/version.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hindbaer::AudioPool do
|
4
|
+
|
5
|
+
before do
|
6
|
+
session = Hindbaer::Session.new('spec/fixtures/project.nhsx')
|
7
|
+
@pool = session.audio_pool
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'must return path to audio files' do
|
11
|
+
@pool.path.must_equal 'Example session Files'
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'must return location of audio file path' do
|
15
|
+
@pool.location.must_equal '/Users/jamiehodge/Desktop'
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/spec/clip_spec.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hindbaer::Clip do
|
4
|
+
|
5
|
+
before do
|
6
|
+
@session = Hindbaer::Session.new('spec/fixtures/project.nhsx')
|
7
|
+
@group = @session.clipboard_groups.first
|
8
|
+
@clip = @group.clips.first
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'must return file reference' do
|
12
|
+
@clip.reference.must_be_kind_of Hindbaer::File
|
13
|
+
@clip.reference.id.must_equal 2
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'must return name' do
|
17
|
+
@clip.name.must_equal 'Group 1 1'
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'must return length' do
|
21
|
+
@clip.length.must_equal '04:03.669'
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'must return long-term equivalent level' do
|
25
|
+
@clip.leq.must_equal 0
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'must return parent group' do
|
29
|
+
@clip.group.must_equal @group
|
30
|
+
end
|
31
|
+
end
|
@@ -1,38 +1,38 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Hindbaer::
|
3
|
+
describe Hindbaer::File do
|
4
4
|
|
5
5
|
before do
|
6
6
|
project = Hindbaer::Session.new('spec/fixtures/project.nhsx')
|
7
|
-
@
|
7
|
+
@file = project.audio_pool.files.first
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'must return id' do
|
11
|
-
@
|
11
|
+
@file.id.must_equal 1
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'must return name' do
|
15
|
-
@
|
15
|
+
@file.name.must_equal 'file1.wav'
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'must return duration' do
|
19
|
-
@
|
19
|
+
@file.duration.must_equal '2:51:09.025'
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'must return the number of channels' do
|
23
|
-
@
|
23
|
+
@file.num_channels.must_equal 2
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'must return leq' do
|
27
|
-
@
|
27
|
+
@file.leq.must_equal -10.4
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'must return dynamics' do
|
31
|
-
@
|
31
|
+
@file.dynamics.must_equal 0.0
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'must return the original file path' do
|
35
|
-
@
|
35
|
+
@file.original_path.must_equal '/path/to/file1.wav'
|
36
36
|
end
|
37
37
|
|
38
38
|
end
|
data/spec/fixtures/project.nhsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
2
2
|
<Session Version="Hindenburg Journalist Pro 1.12.1752" Samplerate="44100">
|
3
|
-
<Info Subtitle="
|
3
|
+
<Info Subtitle="Vestibulum Ante Ipsum Primis" Album="Nulla At Nulla" Composer="Quisque Eget Odio Ac" Track="1" Genre="Podcast" Author="Jamie Hodge" Link="http://" Email="user@example.com" Description="Etiam at risus et justo" Artist="Lorem Ipsum Dolor" Date="Today" Title="Suspendisse Dictum Feugiat Nisl Ut" Explicit="Yes" Copyright="2011" Identifier="Lorem Ipsum Dolor Sit" Keywords="In, Condimentum, Facilisis" Reference="Vivamus Hendrerit Arcu" />
|
4
4
|
<AudioPool Path="Example session Files" Location="/Users/jamiehodge/Desktop">
|
5
5
|
<File Id="1" Name="file1.wav" Duration="2:51:09.025" Channels="2" Leq="-10.4">
|
6
6
|
<MetaData OriginalPath="/path/to/file1.wav"/>
|
@@ -21,6 +21,11 @@
|
|
21
21
|
<Fade Start="00.200" Length="01.013" Gain="2.33123"/>
|
22
22
|
</Region>
|
23
23
|
<Region Ref="1" Name="Speak 2" Start="44.171" Length="08.808" Offset="01:11.521" FadeIn="00.036" FadeOut="00.245" Gain="-0.8" Leq="-16.4"/>
|
24
|
+
<Plugins>
|
25
|
+
<Plugin Id="0" Name="Equalizer" UID="nheq" Bypass="1" MF_Q="0.1" LF_Gain="0.5" HP_Freq="0.00454545" HP_Gain="0.2" HF_Q="0.1" MF_Gain="0.5" HF_Gain="0.5" HF_Freq="0.363636" HF_Type="0" MF_Freq="0.0454545" LF_Freq="0.00909091" LF_Q="0.1" LF_Type="0">
|
26
|
+
<![CDATA[]]>
|
27
|
+
</Plugin>
|
28
|
+
</Plugins>
|
24
29
|
</Track>
|
25
30
|
<Track Name="Interview" Pan="0.025">
|
26
31
|
<Region Ref="2" Name="Interview 1" Start="10.758" Length="33.553" FadeIn="00.085" Gain="1.2" Leq="-21.1"/>
|
data/spec/group_spec.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hindbaer::Group do
|
4
|
+
|
5
|
+
before do
|
6
|
+
@session = Hindbaer::Session.new('spec/fixtures/project.nhsx')
|
7
|
+
@group = @session.clipboard_groups.first
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'must return caption' do
|
11
|
+
@group.caption.must_equal 'Group 1'
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'must return number of clips used' do
|
15
|
+
@group.num_clips_used.must_equal 2
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'must return all clips' do
|
19
|
+
@group.clips.first.must_be_kind_of Hindbaer::Clip
|
20
|
+
@group.clips.size.must_equal 2
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'must return session' do
|
24
|
+
@group.session.must_equal @session
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
data/spec/info_spec.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hindbaer::Info do
|
4
|
+
|
5
|
+
before do
|
6
|
+
session = Hindbaer::Session.new('spec/fixtures/project.nhsx')
|
7
|
+
@info = session.info
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'must return title' do
|
11
|
+
@info.title.must_equal 'Suspendisse Dictum Feugiat Nisl Ut'
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'must return subtitle' do
|
15
|
+
@info.subtitle.must_equal 'Vestibulum Ante Ipsum Primis'
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'must return description' do
|
19
|
+
@info.description.must_equal 'Etiam at risus et justo'
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'must return author' do
|
23
|
+
@info.author.must_equal 'Jamie Hodge'
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'must return link' do
|
27
|
+
@info.link.must_equal 'http://'
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'must return email' do
|
31
|
+
@info.email.must_equal 'user@example.com'
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'must return album' do
|
35
|
+
@info.album.must_equal 'Nulla At Nulla'
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'must return album track' do
|
39
|
+
@info.album_track.must_equal '1'
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'must return artist' do
|
43
|
+
@info.artist.must_equal 'Lorem Ipsum Dolor'
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'must return composer' do
|
47
|
+
@info.composer.must_equal 'Quisque Eget Odio Ac'
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'must return date' do
|
51
|
+
@info.date.must_equal 'Today'
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'must return copyright' do
|
55
|
+
@info.copyright.must_equal '2011'
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'must return whether explicit' do
|
59
|
+
@info.explicit?.must_equal true
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'must return identifier' do
|
63
|
+
@info.identifier.must_equal 'Lorem Ipsum Dolor Sit'
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'must return reference' do
|
67
|
+
@info.reference.must_equal 'Vivamus Hendrerit Arcu'
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'must return keywords' do
|
71
|
+
@info.keywords.must_equal %w{In Condimentum Facilisis}
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
data/spec/plugin_spec.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hindbaer::Plugin do
|
4
|
+
|
5
|
+
before do
|
6
|
+
project = Hindbaer::Session.new('spec/fixtures/project.nhsx')
|
7
|
+
track = project.tracks.first
|
8
|
+
@plugin = track.plugins.first
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'must return id' do
|
12
|
+
@plugin.id.must_equal 0
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'must return name' do
|
16
|
+
@plugin.name.must_equal 'Equalizer'
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'must return uid (unique identifier)' do
|
20
|
+
@plugin.uid.must_equal 'nheq'
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/spec/region_spec.rb
CHANGED
@@ -4,10 +4,12 @@ describe Hindbaer::Region do
|
|
4
4
|
|
5
5
|
before do
|
6
6
|
session = Hindbaer::Session.new('spec/fixtures/project.nhsx')
|
7
|
-
@
|
7
|
+
@track = session.tracks.first
|
8
|
+
@region = @track.regions.first
|
8
9
|
end
|
9
10
|
|
10
11
|
it 'must return audio reference' do
|
12
|
+
@region.reference.must_be_kind_of Hindbaer::File
|
11
13
|
@region.reference.id.must_equal 1
|
12
14
|
end
|
13
15
|
|
@@ -44,6 +46,11 @@ describe Hindbaer::Region do
|
|
44
46
|
end
|
45
47
|
|
46
48
|
it 'must return all fades' do
|
49
|
+
@region.fades.first.must_be_kind_of Hindbaer::Fade
|
47
50
|
@region.fades.size.must_equal 1
|
48
51
|
end
|
52
|
+
|
53
|
+
it 'must return parent track' do
|
54
|
+
@region.track.must_equal @track
|
55
|
+
end
|
49
56
|
end
|
data/spec/session_spec.rb
CHANGED
@@ -14,51 +14,26 @@ describe Hindbaer::Session do
|
|
14
14
|
@session.sample_rate.must_equal '44100'
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'must return
|
18
|
-
@session.
|
17
|
+
it 'must return session info' do
|
18
|
+
@session.info.must_be_instance_of Hindbaer::Info
|
19
19
|
end
|
20
20
|
|
21
|
-
it 'must return
|
22
|
-
@session.
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'must return description' do
|
26
|
-
@session.description.must_equal 'An example description'
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'must return author' do
|
30
|
-
@session.author.must_equal 'Jamie Hodge'
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'must return album' do
|
34
|
-
@session.album.must_equal 'An example album'
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'must return album track' do
|
38
|
-
@session.album_track.must_equal 'An example track'
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'must return keywords' do
|
42
|
-
@session.keywords.must_equal ['example', 'test']
|
43
|
-
end
|
44
|
-
|
45
|
-
it 'must return all audio files' do
|
46
|
-
@session.audio_pool.size.must_equal 4
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'must return path to audio files' do
|
50
|
-
@session.audio_pool_path.must_equal 'Example session Files'
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'must return location of audio file path' do
|
54
|
-
@session.audio_pool_location.must_equal '/Users/jamiehodge/Desktop'
|
21
|
+
it 'must return audio pool' do
|
22
|
+
@session.audio_pool.must_be_instance_of Hindbaer::AudioPool
|
55
23
|
end
|
56
24
|
|
57
25
|
it 'must return all tracks' do
|
26
|
+
@session.tracks.first.must_be_kind_of Hindbaer::Track
|
58
27
|
@session.tracks.size.must_equal 5
|
59
28
|
end
|
60
29
|
|
30
|
+
it 'must return clipboard groups' do
|
31
|
+
@session.clipboard_groups.first.must_be_kind_of Hindbaer::Group
|
32
|
+
@session.clipboard_groups.size.must_equal 4
|
33
|
+
end
|
34
|
+
|
61
35
|
it 'must return all markers' do
|
36
|
+
@session.markers.first.must_be_kind_of Hindbaer::Marker
|
62
37
|
@session.markers.size.must_equal 2
|
63
38
|
end
|
64
39
|
|
data/spec/track_spec.rb
CHANGED
@@ -3,8 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe Hindbaer::Track do
|
4
4
|
|
5
5
|
before do
|
6
|
-
|
7
|
-
@track =
|
6
|
+
@session = Hindbaer::Session.new('spec/fixtures/project.nhsx')
|
7
|
+
@track = @session.tracks.first
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'must return name' do
|
@@ -16,6 +16,16 @@ describe Hindbaer::Track do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'must return all regions' do
|
19
|
+
@track.regions.first.must_be_kind_of Hindbaer::Region
|
19
20
|
@track.regions.size.must_equal 2
|
20
21
|
end
|
22
|
+
|
23
|
+
it 'must return all plugins' do
|
24
|
+
@track.plugins.first.must_be_kind_of Hindbaer::Plugin
|
25
|
+
@track.plugins.size.must_equal 1
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'must return parent session' do
|
29
|
+
@track.session.must_equal @session
|
30
|
+
end
|
21
31
|
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.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-08-24 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &70139580355740 !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: *70139580355740
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: guard
|
27
|
-
requirement: &
|
27
|
+
requirement: &70139580355160 !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: *70139580355160
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: guard-minitest
|
38
|
-
requirement: &
|
38
|
+
requirement: &70139580354440 !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: *70139580354440
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rb-fsevent
|
49
|
-
requirement: &
|
49
|
+
requirement: &70139580353860 !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: *70139580353860
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: growl_notify
|
60
|
-
requirement: &
|
60
|
+
requirement: &70139580353260 !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: *70139580353260
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mocha
|
71
|
-
requirement: &
|
71
|
+
requirement: &70139580352660 !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: *70139580352660
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: nokogiri
|
82
|
-
requirement: &
|
82
|
+
requirement: &70139580352240 !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: *70139580352240
|
91
91
|
description: A Hindenburg Journalist client
|
92
92
|
email:
|
93
93
|
- jamiehodge@me.com
|
@@ -102,17 +102,27 @@ files:
|
|
102
102
|
- Rakefile
|
103
103
|
- hindbaer.gemspec
|
104
104
|
- lib/hindbaer.rb
|
105
|
-
- lib/hindbaer/
|
105
|
+
- lib/hindbaer/audio_pool.rb
|
106
|
+
- lib/hindbaer/clip.rb
|
106
107
|
- lib/hindbaer/fade.rb
|
108
|
+
- lib/hindbaer/file.rb
|
109
|
+
- lib/hindbaer/group.rb
|
110
|
+
- lib/hindbaer/info.rb
|
107
111
|
- lib/hindbaer/marker.rb
|
112
|
+
- lib/hindbaer/plugin.rb
|
108
113
|
- lib/hindbaer/region.rb
|
109
114
|
- lib/hindbaer/session.rb
|
110
115
|
- lib/hindbaer/track.rb
|
111
116
|
- lib/hindbaer/version.rb
|
112
|
-
- spec/
|
117
|
+
- spec/audio_pool_spec.rb
|
118
|
+
- spec/clip_spec.rb
|
113
119
|
- spec/fade_spec.rb
|
120
|
+
- spec/file_spec.rb
|
114
121
|
- spec/fixtures/project.nhsx
|
122
|
+
- spec/group_spec.rb
|
123
|
+
- spec/info_spec.rb
|
115
124
|
- spec/marker_spec.rb
|
125
|
+
- spec/plugin_spec.rb
|
116
126
|
- spec/region_spec.rb
|
117
127
|
- spec/session_spec.rb
|
118
128
|
- spec/spec_helper.rb
|
@@ -142,10 +152,15 @@ signing_key:
|
|
142
152
|
specification_version: 3
|
143
153
|
summary: Parse, modify and generate Hindenburg Journalist audio session files
|
144
154
|
test_files:
|
145
|
-
- spec/
|
155
|
+
- spec/audio_pool_spec.rb
|
156
|
+
- spec/clip_spec.rb
|
146
157
|
- spec/fade_spec.rb
|
158
|
+
- spec/file_spec.rb
|
147
159
|
- spec/fixtures/project.nhsx
|
160
|
+
- spec/group_spec.rb
|
161
|
+
- spec/info_spec.rb
|
148
162
|
- spec/marker_spec.rb
|
163
|
+
- spec/plugin_spec.rb
|
149
164
|
- spec/region_spec.rb
|
150
165
|
- spec/session_spec.rb
|
151
166
|
- spec/spec_helper.rb
|