Module: CineSync
- Defined in:
- lib/cinesync.rb,
lib/cinesync/ui.rb,
lib/cinesync/xml.rb,
lib/cinesync/mask.rb,
lib/cinesync/session.rb,
lib/cinesync/commands.rb,
lib/cinesync/media_file.rb,
lib/cinesync/play_range.rb,
lib/cinesync/zoom_state.rb,
lib/cinesync/pixel_ratio.rb,
lib/cinesync/color_grading.rb,
lib/cinesync/event_handler.rb,
lib/cinesync/frame_annotation.rb
Defined Under Namespace
Modules: Commands, UI Classes: BrightnessArray, ColorGrading, EventHandler, FrameAnnotation, GroupMovie, Mask, MediaBase, MediaFile, MediaLocator, PixelRatio, PlayRange, RGBArray, Session, ZoomState
Constant Summary collapse
- SessionV3XMLFileVersion =
3
- ShortHashSampleSize =
2048
- AllFilesGroup =
'All Files'
- OfflineKey =
'_OFFLINE_'
- SessionV3Namespace =
'http://www.cinesync.com/ns/session/3.0'
Class Method Summary collapse
- .event_handler(argv = ARGV, stdin = $stdin) {|CineSync::EventHandler.new(argv, session)| ... } ⇒ Object
-
.short_hash(path) ⇒ Object
Utility functions.
Class Method Details
.event_handler(argv = ARGV, stdin = $stdin) {|CineSync::EventHandler.new(argv, session)| ... } ⇒ Object
39 40 41 42 |
# File 'lib/cinesync.rb', line 39 def self.event_handler(argv = ARGV, stdin = $stdin) session = Session::load(stdin) rescue nil yield CineSync::EventHandler.new(argv, session) end |
.short_hash(path) ⇒ Object
Utility functions
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cinesync.rb', line 22 def self.short_hash(path) File.open(path, 'rb') do |f| size = f.stat.size buf = '' if size <= ShortHashSampleSize buf << f.read(size) buf << [].pack('x' * (ShortHashSampleSize - size)) else buf << f.read(ShortHashSampleSize / 2) f.seek(-ShortHashSampleSize / 2, IO::SEEK_END) buf << f.read(ShortHashSampleSize / 2) end Digest::SHA1.hexdigest([size].pack('N').reverse + buf) end end |