class MultimediaParadise::GUI::VideoPlayer

Constants

HEIGHT
#

HEIGHT

#
NAMESPACE
#

NAMESPACE

#
TITLE
#

TITLE

#
WIDTH
#

WIDTH

#

Public Class Methods

new( run_already = true ) click to toggle source
#

initialize

#
Calls superclass method
# File lib/multimedia_paradise/gui/gosu/video_player/video_player.rb, line 38
def initialize(
    run_already = true
  )
  super(WIDTH, HEIGHT)
  set_title(TITLE)
  reset
  run if run_already
end

Public Instance Methods

button_down(id) click to toggle source
#

button_down

#
# File lib/multimedia_paradise/gui/gosu/video_player/video_player.rb, line 71
def button_down(id)
  case id
  when Gosu::KbEscape,
       Gosu::KbQ
    close # Exit on 'Q'.
  end
end
draw() click to toggle source
#

draw

#
# File lib/multimedia_paradise/gui/gosu/video_player/video_player.rb, line 82
def draw
  y_position = 10 
  @font.red('A simple videoplayer in Gosu', 15, y_position)
  @available_songs.each {|this_song|
    y_position += 24
    @font.green(this_song, 15, y_position)
  }
end
reset() click to toggle source
#

reset (reset tag)

#
# File lib/multimedia_paradise/gui/gosu/video_player/video_player.rb, line 50
def reset
  # ======================================================================= #
  # === @song
  # ======================================================================= #
  @song = Gosu::Song.new(
    '/home/x/songs/Youtube2008_Soundmix.mp3'
  )
  @song.play
  # ======================================================================= #
  # === @font
  # ======================================================================= #
  @font = set_font(:hack_30)
  # ======================================================================= #
  # === @available_songs
  # ======================================================================= #
  @available_songs = Dir['/home/x/songs/**']
end
run() click to toggle source
#

run

#
# File lib/multimedia_paradise/gui/gosu/video_player/video_player.rb, line 102
def run
end
update() click to toggle source
#

update

We can not call draw methods from within the main update method.

#
# File lib/multimedia_paradise/gui/gosu/video_player/video_player.rb, line 96
def update
end