Class: Hindbaer::Clip

Inherits:
Object
  • Object
show all
Defined in:
lib/hindbaer/clip.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fragment, group) ⇒ Clip

Returns a new instance of Clip.



4
5
6
7
# File 'lib/hindbaer/clip.rb', line 4

def initialize(fragment, group)
  @doc = fragment
  @group = group
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



9
10
11
# File 'lib/hindbaer/clip.rb', line 9

def group
  @group
end

Instance Method Details

#lengthObject



20
21
22
# File 'lib/hindbaer/clip.rb', line 20

def length
  @doc['Length']
end

#leqObject



24
25
26
27
# File 'lib/hindbaer/clip.rb', line 24

def leq
  return '-' if @doc['Leq'] == '-'
  @doc['Leq'].to_f
end

#nameObject



16
17
18
# File 'lib/hindbaer/clip.rb', line 16

def name
  @doc['Name']
end

#referenceObject



11
12
13
14
# File 'lib/hindbaer/clip.rb', line 11

def reference
  id = @doc['Ref'].to_i
  self.group.session.audio_pool.files.find { |a| a.id == id }
end