module DiscId::Lib

This module encapsulates the C interface for libdiscid using FFI. The Lib module is intended for internal use only and should be considered private.

@private

Constants

Features

Public Class Methods

features_to_int(features) click to toggle source
# File lib/discid/lib.rb, line 112
def self.features_to_int(features)
  feature_flags = 0
  features.each do |feature|
    if feature.respond_to? :to_sym
      feature = feature.to_sym
      feature_flags = self.add_feature_to_flags(feature_flags, feature)
    end
  end

  return feature_flags
end
get_mcn(_handle) click to toggle source
# File lib/discid/lib.rb, line 77
def self.get_mcn(_handle)
  return nil
end
get_toc_string() click to toggle source
# File lib/discid/lib.rb, line 69
def self.get_toc_string
  return nil
end
get_track_isrc(_handle, _track) click to toggle source
# File lib/discid/lib.rb, line 85
def self.get_track_isrc(_handle, _track)
  return nil
end
get_version_string() click to toggle source
# File lib/discid/lib.rb, line 107
def self.get_version_string
  return "libdiscid < 0.4.0"
end
has_feature(feature) click to toggle source
# File lib/discid/lib.rb, line 97
def self.has_feature(feature)
  return feature.to_sym == :read ? 1 : 0
end
read(handle, device, _features) click to toggle source
# File lib/discid/lib.rb, line 39
def self.read(handle, device, _features)
  legacy_read(handle, device)
end

Private Class Methods

add_feature_to_flags(flags, feature) click to toggle source
# File lib/discid/lib.rb, line 126
def self.add_feature_to_flags(flags, feature)
  flags |= self::Features[feature] if
    self::Features.symbols.include?(feature) and
    self.has_feature(feature)
  return flags
end