Class: Rabbit::VideoWindow
- Inherits:
-
Object
- Object
- Rabbit::VideoWindow
- Defined in:
- lib/rabbit/video-window.rb
Defined Under Namespace
Classes: VideoWidget
Instance Attribute Summary collapse
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#entry ⇒ Object
Returns the value of attribute entry.
-
#window ⇒ Object
Returns the value of attribute window.
Instance Method Summary collapse
- #hide ⇒ Object
-
#initialize(element) ⇒ VideoWindow
constructor
A new instance of VideoWindow.
- #setup(window) ⇒ Object
- #show(window) ⇒ Object
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
#direction ⇒ Object
Returns the value of attribute direction.
6 7 8 |
# File 'lib/rabbit/video-window.rb', line 6 def direction @direction end |
#entry ⇒ Object
Returns the value of attribute entry.
6 7 8 |
# File 'lib/rabbit/video-window.rb', line 6 def entry @entry end |
#window ⇒ Object
Returns the value of attribute window.
6 7 8 |
# File 'lib/rabbit/video-window.rb', line 6 def window @window end |
Instance Method Details
#hide ⇒ Object
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 |