module Muzak::Player

The namespace for muzak players.

Constants

PLAYER_CLASSES

All classes (player implementations) under the {Player} namespace. @api private

PLAYER_MAP

An association of human-friendly player names to implementation classes. @api private

PLAYER_NAMES

All human-friendly player names. @see Player::StubPlayer.player_name @api private

Public Class Methods

load_player!(instance) click to toggle source

Returns an instantiated player as specified in `Config.player`. @return [StubPlayer] the player instance

# File lib/muzak/player.rb, line 28
def self.load_player!(instance)
  klass = PLAYER_MAP[Config.player]

  error! "#{Config.player} isn't a known player" unless klass

  if klass.available?
    klass.new(instance)
  else
    error! "#{Config.player} isn't available, do you need to install it?"
  end
end