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

MPV, 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



24
25
26
# File 'lib/muzak/player/stub_player.rb', line 24

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



10
11
12
# File 'lib/muzak/player/stub_player.rb', line 10

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



19
20
21
# File 'lib/muzak/player/stub_player.rb', line 19

def self.available?
  true
end

.player_nameString

The player's human friendly name.

Returns:

  • (String)

    the name



14
15
16
# File 'lib/muzak/player/stub_player.rb', line 14

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.



38
39
40
# File 'lib/muzak/player/stub_player.rb', line 38

def activate!
  debug "#activate!"
end

#clear_queuevoid

Note:

NO-OP

This method returns an undefined value.

Clear the player's queue.



125
126
127
# File 'lib/muzak/player/stub_player.rb', line 125

def clear_queue
  debug "#clear_queue"
end

#deactivate!void

Note:

NO-OP

This method returns an undefined value.

Deactivates the player.



45
46
47
# File 'lib/muzak/player/stub_player.rb', line 45

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



96
97
98
# File 'lib/muzak/player/stub_player.rb', line 96

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



104
105
106
# File 'lib/muzak/player/stub_player.rb', line 104

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



88
89
90
# File 'lib/muzak/player/stub_player.rb', line 88

def enqueue_song(song)
  debug "#enqueue_song"
end

#list_queuevoid

Note:

NO-OP

This method returns an undefined value.

List the player's queue.



111
112
113
# File 'lib/muzak/player/stub_player.rb', line 111

def list_queue
  debug "#list_queue"
end

#next_songvoid

Note:

NO-OP

This method returns an undefined value.

Moves to the next song.



73
74
75
# File 'lib/muzak/player/stub_player.rb', line 73

def next_song
  debug "#next_song"
end

#now_playingvoid

Note:

NO-OP

This method returns an undefined value.

Get the currently playing song.



132
133
134
# File 'lib/muzak/player/stub_player.rb', line 132

def now_playing
  debug "#now_playing"
end

#pausevoid

Note:

NO-OP

This method returns an undefined value.

Ends playback.



59
60
61
# File 'lib/muzak/player/stub_player.rb', line 59

def pause
  debug "#pause"
end

#playvoid

Note:

NO-OP

This method returns an undefined value.

Starts playback.



52
53
54
# File 'lib/muzak/player/stub_player.rb', line 52

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



65
66
67
68
# File 'lib/muzak/player/stub_player.rb', line 65

def playing?
  debug "#playing?"
  false
end

#previous_songvoid

Note:

NO-OP

This method returns an undefined value.

Moves to the previous song.



80
81
82
# File 'lib/muzak/player/stub_player.rb', line 80

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



30
31
32
33
# File 'lib/muzak/player/stub_player.rb', line 30

def running?
  debug "#running?"
  false
end

#shuffle_queuevoid

Note:

NO-OP

This method returns an undefined value.

Shuffle the player's queue.



118
119
120
# File 'lib/muzak/player/stub_player.rb', line 118

def shuffle_queue
  debug "#shuffle_queue"
end