Class: Mp3gain::ApplyGainChange

Inherits:
Object
  • Object
show all
Defined in:
lib/mp3gain/apply_gain_change.rb

Overview

data object when gain is applied

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path, mp3_gain, db_gain, max_amplitude, max_global_gain, min_global_gain) ⇒ ApplyGainChange

Returns a new instance of ApplyGainChange.



9
10
11
12
13
14
15
16
# File 'lib/mp3gain/apply_gain_change.rb', line 9

def initialize(file_path, mp3_gain, db_gain, max_amplitude, max_global_gain, min_global_gain)
  @file_path = file_path
  @mp3_gain = mp3_gain
  @db_gain = db_gain
  @max_amplitude = max_amplitude
  @max_global_gain = max_global_gain
  @min_global_gain = min_global_gain
end

Instance Attribute Details

#db_gainObject (readonly)

Returns the value of attribute db_gain.



7
8
9
# File 'lib/mp3gain/apply_gain_change.rb', line 7

def db_gain
  @db_gain
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



7
8
9
# File 'lib/mp3gain/apply_gain_change.rb', line 7

def file_path
  @file_path
end

#max_amplitudeObject (readonly)

Returns the value of attribute max_amplitude.



7
8
9
# File 'lib/mp3gain/apply_gain_change.rb', line 7

def max_amplitude
  @max_amplitude
end

#max_global_gainObject (readonly)

Returns the value of attribute max_global_gain.



7
8
9
# File 'lib/mp3gain/apply_gain_change.rb', line 7

def max_global_gain
  @max_global_gain
end

#min_global_gainObject (readonly)

Returns the value of attribute min_global_gain.



7
8
9
# File 'lib/mp3gain/apply_gain_change.rb', line 7

def min_global_gain
  @min_global_gain
end

#mp3_gainObject (readonly)

Returns the value of attribute mp3_gain.



7
8
9
# File 'lib/mp3gain/apply_gain_change.rb', line 7

def mp3_gain
  @mp3_gain
end

Instance Method Details

#clipping?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/mp3gain/apply_gain_change.rb', line 18

def clipping?
  # if > 31000 -> clipping
  @max_amplitude > 31_000
end