Class: ActiveVlc::LibVlc::MediaListPlayer
- Inherits:
-
Object
- Object
- ActiveVlc::LibVlc::MediaListPlayer
- Defined in:
- lib/activevlc/libvlc/media_list_player.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#player ⇒ Object
readonly
Returns the value of attribute player.
-
#ptr ⇒ Object
readonly
Returns the value of attribute ptr.
Instance Method Summary collapse
- #event_manager ⇒ Object
-
#initialize(ptr, media_list = nil, media_player = nil) ⇒ MediaListPlayer
constructor
A new instance of MediaListPlayer.
- #media_list=(list) ⇒ Object
- #media_player=(player) ⇒ Object
- #next ⇒ Object
- #pause ⇒ Object
- #play ⇒ Object
- #playing? ⇒ Boolean
- #previous ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(ptr, media_list = nil, media_player = nil) ⇒ MediaListPlayer
Returns a new instance of MediaListPlayer.
14 15 16 17 18 19 20 21 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 14 def initialize(ptr, media_list = nil, media_player = nil) @ptr = MediaListPlayerPtr.new(ptr) @list = media_list @player = media_player self.media_list = media_list if media_list self.media_player = media_player if media_player end |
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
12 13 14 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 12 def list @list end |
#player ⇒ Object (readonly)
Returns the value of attribute player.
12 13 14 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 12 def player @player end |
#ptr ⇒ Object (readonly)
Returns the value of attribute ptr.
12 13 14 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 12 def ptr @ptr end |
Instance Method Details
#event_manager ⇒ Object
32 33 34 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 32 def event_manager EventManager.new Api.libvlc_media_list_player_event_manager(@ptr) end |
#media_list=(list) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 23 def media_list=(list) if list and list.is_a?(MediaList) @list = list Api.libvlc_media_list_player_set_media_list(@ptr, list.ptr) else raise "You must provide a valid MediaList" end end |
#media_player=(player) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 40 def media_player=(player) if player.is_a?(MediaPlayer) and not raise "Player already has a media" if player.media @player = player Api.libvlc_media_list_player_set_media_player(@ptr, player.ptr) end end |
#next ⇒ Object
57 58 59 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 57 def next Api.libvlc_media_list_player_next(@ptr) end |
#pause ⇒ Object
51 52 53 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 51 def pause Api.libvlc_media_list_player_pause(@ptr) end |
#play ⇒ Object
48 49 50 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 48 def play Api.libvlc_media_list_player_play(@ptr) end |
#playing? ⇒ Boolean
36 37 38 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 36 def Api.(@ptr) != 0 end |
#previous ⇒ Object
60 61 62 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 60 def previous Api.libvlc_media_list_player_previous(@ptr) end |
#stop ⇒ Object
54 55 56 |
# File 'lib/activevlc/libvlc/media_list_player.rb', line 54 def stop Api.libvlc_media_list_player_stop(@ptr) end |