Class: RVideoController
- Inherits:
-
Object
- Object
- RVideoController
- Defined in:
- datavyu_api.rb
Overview
Provide access to Datavyu's video controllers.
Class Method Summary collapse
-
.mixer_controller ⇒ Object
Datavyu's mixer controller.
-
.new_video(filepath, plugin, onset = 0, timeout = 5) ⇒ True, False
Add a video to the current spreadsheet/controller.
-
.plugin_of(video) ⇒ String
Get the name of the plugin a video is using.
-
.plugin_uuid_of(video) ⇒ UUID
Get the uuid of the plugin a video is using.
-
.plugin_uuids ⇒ Hash
Mapping from plugin names to UUID.
-
.set_video_onset(stream_id, onset, timeout = 5) ⇒ Object
Set the start point of a video.
-
.tracks_controller ⇒ Object
Datavyu's video tracks controller.
-
.video_controller ⇒ Object
Datavyu's video controller.
-
.videos ⇒ Object
Video streams.
Class Method Details
.mixer_controller ⇒ Object
Returns Datavyu's mixer controller
2755 2756 2757 |
# File 'datavyu_api.rb', line 2755 def self.mixer_controller video_controller.get_mixer_controller end |
.new_video(filepath, plugin, onset = 0, timeout = 5) ⇒ True, False
Add a video to the current spreadsheet/controller.
2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 |
# File 'datavyu_api.rb', line 2788 def self.new_video(filepath, plugin, onset=0, timeout=5) if plugin_uuids.key?(plugin) plugin_id = plugin_uuids[plugin] elsif plugin_uuids.value?(plugin) plugin_id = plugin else raise "Warning: invalid plugin \"#{plugin}\"" end uuid = java.util.UUID.from_string(plugin_id) id = video_controller.open_video(filepath, uuid) return false if id.nil? p id success = set_video_onset(id, onset, timeout) puts "WARNING: added video but timed out trying to set start point." unless success end |
.plugin_of(video) ⇒ String
Get the name of the plugin a video is using
2822 2823 2824 2825 |
# File 'datavyu_api.rb', line 2822 def self.plugin_of(video) uuid = plugin_uuid_of(video) plugin_uuids.key(uuid) end |
.plugin_uuid_of(video) ⇒ UUID
Get the uuid of the plugin a video is using
2813 2814 2815 2816 2817 |
# File 'datavyu_api.rb', line 2813 def self.plugin_uuid_of(video) org.datavyu.plugins.PluginManager.get_instance .get_associated_plugin(video.get_class.get_name) .get_plugin_uuid.to_s end |
.plugin_uuids ⇒ Hash
Returns mapping from plugin names to UUID.
2742 2743 2744 2745 2746 2747 |
# File 'datavyu_api.rb', line 2742 def self.plugin_uuids { 'ffmpeg' => 'f13f226e-df7e-31dc-8bba-f35c71e53479', 'nativeosx' => 'db3fc496-58a7-3706-8538-3f61278b5bec' } end |
.set_video_onset(stream_id, onset, timeout = 5) ⇒ Object
Set the start point of a video
2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 |
# File 'datavyu_api.rb', line 2768 def self.set_video_onset(stream_id, onset, timeout = 5) success = false t = Time.now while (Time.now - t).to_f < timeout success = tracks_controller.set_track_offset(stream_id, onset) break if success sleep(0.5) end video_controller.repaint success end |
.tracks_controller ⇒ Object
Returns Datavyu's video tracks controller
2760 2761 2762 |
# File 'datavyu_api.rb', line 2760 def self.tracks_controller mixer_controller.get_tracks_editor_controller end |
.video_controller ⇒ Object
Returns Datavyu's video controller
2750 2751 2752 |
# File 'datavyu_api.rb', line 2750 def self.video_controller Datavyu.get_video_controller end |
.videos ⇒ Object
Returns video streams
2806 2807 2808 |
# File 'datavyu_api.rb', line 2806 def self.videos video_controller.get_stream_viewers end |