class FrameReader
Attributes
size[R]
Public Class Methods
new(channels, sample_type, frames_count, frames_ptr)
click to toggle source
# File lib/terminal_player/spotiphy.rb, line 17 def initialize(channels, sample_type, frames_count, frames_ptr) @channels = channels @sample_type = sample_type @size = frames_count * @channels @pointer = FFI::Pointer.new(@sample_type, frames_ptr) end
Public Instance Methods
each() { |public_send| ... }
click to toggle source
# File lib/terminal_player/spotiphy.rb, line 26 def each return enum_for(__method__) unless block_given? ffi_read = :"read_#{@sample_type}" (0...size).each do |index| yield @pointer[index].public_send(ffi_read) end end