Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: Given an Avid ALE file, it will adjust the start, end, and duration times a given amount
Homepage: http://www.bjeanes.com/
Clone URL: git://github.com/bjeanes/ale-adjust.git
Search Repo:
Added tests and made them pass. Should add some more but got other things 
to do
bjeanes (author)
Thu May 15 18:45:03 -0700 2008
commit  602c4f2b517cc37b41c4844fd9b4f277b67d5963
tree    a981ba527b68931edb617f4c04fc8510fc062752
parent  1762475dc5a78582759605f8dcf30784caa2d440
...
17
18
19
 
 
 
 
 
 
 
 
 
 
20
21
22
...
27
28
29
30
 
31
32
33
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
36
...
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
...
37
38
39
 
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
0
@@ -17,6 +17,16 @@ class FrameTime
0
     end
0
   end
0
   
0
+ def +(timecode)
0
+ seconds, frames = to_sec_and_frame(timecode)
0
+ self.add!(seconds, frames)
0
+ end
0
+
0
+ def -(timecode)
0
+ seconds, frames = to_sec_and_frame(timecode)
0
+ self.add!(-seconds, -frames)
0
+ end
0
+
0
   # this should be named nicer
0
   def add!(s, f=0)
0
     @frame = @frame + f
0
@@ -27,9 +37,28 @@ class FrameTime
0
   
0
   # this should be named nicer
0
   def minus!(s, f=0)
0
- self.add(-s, -f)
0
+ self.add!(-s, -f)
0
   end
0
   
0
   def to_s; @time.strftime("%H:%M:%S:#{@frame.to_s.rjust(2,'0')}"); end
0
   def inspect; self.to_s; end
0
+
0
+ class << self
0
+ private :new
0
+ end
0
+
0
+ protected
0
+ def to_sec_and_frame(timecode)
0
+ if timecode =~ /(\d\d):(\d\d):(\d\d):(\d\d)/
0
+ hours = $1.to_i
0
+ minutes = $2.to_i
0
+ seconds = $3.to_i
0
+ frames = $4.to_i
0
+
0
+ seconds = seconds + minutes*60 + hours*3600
0
+ return seconds, frames
0
+ else
0
+ return 0,0
0
+ end
0
+ end
0
 end
0
\ No newline at end of file

Comments

    No one has commented yet.