Class: MPV::Event
- Inherits:
-
Object
- Object
- MPV::Event
- Defined in:
- lib/mpvlib/event.rb
Direct Known Subclasses
AudioReconfig, ChapterChange, ClientMessage, CommandReply, EndFile, FileLoaded, GetPropertyReply, Idle, LogMessage, MetadataUpdate, None, Pause, PlaybackRestart, QueueOverflow, ScriptInputDispatch, Seek, SetProperty, Shutdown, StartFile, Tick, TrackSwitched, TracksChanged, Unpause, VideoReconfig
Defined Under Namespace
Classes: AudioReconfig, ChapterChange, ClientMessage, CommandReply, EndFile, FileLoaded, GetPropertyReply, Idle, LogMessage, MetadataUpdate, None, Pause, PlaybackRestart, PropertyChange, QueueOverflow, ScriptInputDispatch, Seek, SetProperty, Shutdown, StartFile, Tick, TrackSwitched, TracksChanged, Unpause, VideoReconfig
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#event_id ⇒ Object
Returns the value of attribute event_id.
-
#reply_id ⇒ Object
Returns the value of attribute reply_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(mpv_event) ⇒ Event
constructor
A new instance of Event.
Constructor Details
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
212 213 214 |
# File 'lib/mpvlib/event.rb', line 212 def error @error end |
#event_id ⇒ Object
Returns the value of attribute event_id.
211 212 213 |
# File 'lib/mpvlib/event.rb', line 211 def event_id @event_id end |
#reply_id ⇒ Object
Returns the value of attribute reply_id.
213 214 215 |
# File 'lib/mpvlib/event.rb', line 213 def reply_id @reply_id end |
Class Method Details
.new_from_mpv_event(mpv_event) ⇒ Object
205 206 207 208 209 |
# File 'lib/mpvlib/event.rb', line 205 def self.new_from_mpv_event(mpv_event) event_class_name = mpv_event[:event_id].to_s.sub(/^MPV_EVENT_/, '').split('_').map(&:capitalize).join event_class = const_get(event_class_name) event_class.new(mpv_event) end |