Class: Rabbit::VideoWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbit/video-window.rb

Defined Under Namespace

Classes: VideoWidget

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ VideoWindow

Returns a new instance of VideoWindow.



7
8
9
10
# File 'lib/rabbit/video-window.rb', line 7

def initialize(element)
  @element = element
  @video = VideoWidget.new(@element.filename)
end

Instance Attribute Details

#directionObject

Returns the value of attribute direction.



6
7
8
# File 'lib/rabbit/video-window.rb', line 6

def direction
  @direction
end

#entryObject

Returns the value of attribute entry.



6
7
8
# File 'lib/rabbit/video-window.rb', line 6

def entry
  @entry
end

#windowObject

Returns the value of attribute window.



6
7
8
# File 'lib/rabbit/video-window.rb', line 6

def window
  @window
end

Instance Method Details

#hideObject



31
32
33
34
# File 'lib/rabbit/video-window.rb', line 31

def hide
  @video.pause
  @video_window.hide
end

#setup(window) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/rabbit/video-window.rb', line 12

def setup(window)
  if not @completed
    @window = window
    init_window
    init_keys
    @completed = true
  end
end

#show(window) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/rabbit/video-window.rb', line 21

def show(window)
  setup(window) if not window.nil?
  Utils.move_to(window, @video_window) do |bx, by, bw, bh, tw, th, sw, sh|
    [bx+@element.x, by+@element.y]
  end
  @video_window.resize(@element.width, @element.height)
  @video_window.show_all
  @video.play
end