Class: Muzak::Player::StubPlayer Abstract

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/muzak/player/stub_player.rb

Overview

This class is abstract.

Subclass and implement all public methods to implement a player.

A no-op player that all players inherit from.

Direct Known Subclasses

MPD, MPV, MultiPlayer, VLC

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

album_art?, #build_response, #danger, #debug, #debug?, #error, #error!, music?, #output, #pretty, #verbose, #verbose?, which?

Constructor Details

#initialize(instance) ⇒ StubPlayer

Returns a new instance of StubPlayer.

Parameters:

  • instance (Instance)

    the instance associated with the player



26
27
28
# File 'lib/muzak/player/stub_player.rb', line 26

def initialize(instance)
  @instance = instance
end

Instance Attribute Details

#instanceInstance (readonly)

Returns the instance associated with this player.

Returns:

  • (Instance)

    the instance associated with this player



12
13
14
# File 'lib/muzak/player/stub_player.rb', line 12

def instance
  @instance
end

Class Method Details

.available?true

Returns whether or not this type of player is available.

Returns:

  • (true)

    whether or not this type of player is available



21
22
23
# File 'lib/muzak/player/stub_player.rb', line 21

def self.available?
  true
end

.player_nameString

The player's human friendly name.

Returns:

  • (String)

    the name



16
17
18
# File 'lib/muzak/player/stub_player.rb', line 16

def self.player_name
  name.split("::").last.downcase
end

Instance Method Details

#activate!void

Note:

NO-OP

This method returns an undefined value.

Activates the player.



40
41
42
# File 'lib/muzak/player/stub_player.rb', line 40

def activate!
  debug "#activate!"
end

#clear_queuevoid

Note:

NO-OP

This method returns an undefined value.

Clear the player's queue.



127
128
129
# File 'lib/muzak/player/stub_player.rb', line 127

def clear_queue
  debug "#clear_queue"
end

#deactivate!void

Note:

NO-OP

This method returns an undefined value.

Deactivates the player.



47
48
49
# File 'lib/muzak/player/stub_player.rb', line 47

def deactivate!
  debug "#deactivate!"
end

#enqueue_album(_album) ⇒ void

Note:

NO-OP

This method returns an undefined value.

Enqueues the given album.

Parameters:

  • album (Album)

    the album to enqueue



98
99
100
# File 'lib/muzak/player/stub_player.rb', line 98

def enqueue_album(_album)
  debug "#enqueue_album"
end

#enqueue_playlist(_playlist) ⇒ void

Note:

NO-OP

This method returns an undefined value.

Enqueues the given playlist.

Parameters:

  • playlist (Playlist)

    the playlist to enqueue



106
107
108
# File 'lib/muzak/player/stub_player.rb', line 106

def enqueue_playlist(_playlist)
  debug "#enqueue_playlist"
end

#enqueue_song(_song) ⇒ void

Note:

NO-OP

This method returns an undefined value.

Enqueues the given song.

Parameters:

  • song (Song)

    the song to enqueue



90
91
92
# File 'lib/muzak/player/stub_player.rb', line 90

def enqueue_song(_song)
  debug "#enqueue_song"
end

#list_queuevoid

Note:

NO-OP

This method returns an undefined value.

List the player's queue.



113
114
115
# File 'lib/muzak/player/stub_player.rb', line 113

def list_queue
  debug "#list_queue"
end

#next_songvoid

Note:

NO-OP

This method returns an undefined value.

Moves to the next song.



75
76
77
# File 'lib/muzak/player/stub_player.rb', line 75

def next_song
  debug "#next_song"
end

#now_playingvoid

Note:

NO-OP

This method returns an undefined value.

Get the currently playing song.



134
135
136
# File 'lib/muzak/player/stub_player.rb', line 134

def now_playing
  debug "#now_playing"
end

#pausevoid

Note:

NO-OP

This method returns an undefined value.

Ends playback.



61
62
63
# File 'lib/muzak/player/stub_player.rb', line 61

def pause
  debug "#pause"
end

#playvoid

Note:

NO-OP

This method returns an undefined value.

Starts playback.



54
55
56
# File 'lib/muzak/player/stub_player.rb', line 54

def play
  debug "#play"
end

#playing?false

Note:

NO-OP

Returns whether or not the player is currently playing.

Returns:

  • (false)

    whether or not the player is currently playing



67
68
69
70
# File 'lib/muzak/player/stub_player.rb', line 67

def playing?
  debug "#playing?"
  false
end

#previous_songvoid

Note:

NO-OP

This method returns an undefined value.

Moves to the previous song.



82
83
84
# File 'lib/muzak/player/stub_player.rb', line 82

def previous_song
  debug "#previous_song"
end

#running?false

Note:

NO-OP

Returns whether or not the player is running.

Returns:

  • (false)

    whether or not the player is running



32
33
34
35
# File 'lib/muzak/player/stub_player.rb', line 32

def running?
  debug "#running?"
  false
end

#shuffle_queuevoid

Note:

NO-OP

This method returns an undefined value.

Shuffle the player's queue.



120
121
122
# File 'lib/muzak/player/stub_player.rb', line 120

def shuffle_queue
  debug "#shuffle_queue"
end