Class: FiddleFluidSynth::ModuleBase::SoundFont::Bank::Presets

Inherits:
FiddleFluidSynth::ModuleBase::SoundFont::Bank show all
Defined in:
lib/fiddle_fluidsynth/util/module_hier.rb,
lib/fiddle_fluidsynth/util/module_hier.rb

Instance Attribute Summary collapse

Attributes inherited from FiddleFluidSynth::ModuleBase::SoundFont

#map_preset, #sfid

Attributes inherited from FiddleFluidSynth::ModuleBase

#fluidsynth_instance, #parent, #settings

Instance Method Summary collapse

Methods inherited from FiddleFluidSynth::ModuleBase::SoundFont::Bank

#presets

Methods inherited from FiddleFluidSynth::ModuleBase::SoundFont

#bank, #count, #full_path, #load, #preset_iter, #preset_iter_reset, #scan_presets

Methods inherited from FiddleFluidSynth::ModuleBase

#soundfont

Constructor Details

#initialize(parent:, fluidsynth_instance:, value:, sub_new_f: true) ⇒ Presets

Returns a new instance of Presets.



345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/fiddle_fluidsynth/util/module_hier.rb', line 345

def initialize( parent: , fluidsynth_instance: , value: , sub_new_f: true )
  super(parent: parent, fluidsynth_instance: fluidsynth_instance,
        value: fluidsynth_instance.synth, sub_new_f: false)

  #
  @num = nil

  #
  if sub_new_f
    self.init_sub
  end

end

Instance Attribute Details

#numObject

Returns the value of attribute num.



358
359
360
# File 'lib/fiddle_fluidsynth/util/module_hier.rb', line 358

def num
  @num
end

Instance Method Details

#bknumObject



383
384
385
386
387
388
389
# File 'lib/fiddle_fluidsynth/util/module_hier.rb', line 383

def bknum
  preset_obj = self.value

  _bknum  = self.fluidsynth_instance.preset_get_banknum(preset_obj)
  ret = _bknum
  ret
end

#init_subObject



369
370
371
# File 'lib/fiddle_fluidsynth/util/module_hier.rb', line 369

def init_sub
  # nothing todo.
end

#nameObject

.



374
375
376
377
378
379
380
381
# File 'lib/fiddle_fluidsynth/util/module_hier.rb', line 374

def name
  preset_obj = self.value

  _name = self.fluidsynth_instance.preset_get_name(preset_obj).to_s

  ret = _name
  ret
end

#pre_numObject



391
392
393
394
395
396
397
# File 'lib/fiddle_fluidsynth/util/module_hier.rb', line 391

def pre_num
  preset_obj = self.value

  _num  = self.fluidsynth_instance.preset_get_num(preset_obj)
  ret = _num
  ret
end

#valueObject



360
361
362
363
364
365
366
367
368
# File 'lib/fiddle_fluidsynth/util/module_hier.rb', line 360

def value
  bknum = self.parent.bknum
  prenum = self.num
  sfont  = self.parent.parent.value

  ret = self.fluidsynth_instance.
          sfont_get_preset(sfont: sfont, bknum: bknum, prenum: prenum)
  ret
end