rmov 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 0.1.1 (October 3rd, 2008)
2
+
3
+ * RubyGems 1.3 compatibility (updated Echoe)
4
+
5
+ * fixing inline RDocs so call sequence is handled properly
6
+
1
7
  0.1.0 (October 2nd, 2008)
2
8
 
3
9
  * initial release
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('rmov', '0.1.0') do |p|
5
+ Echoe.new('rmov', '0.1.1') do |p|
6
6
  p.summary = "Ruby wrapper for the QuickTime C API."
7
7
  p.description = "Ruby wrapper for the QuickTime C API."
8
8
  p.url = "http://github.com/ryanb/rmov"
data/ext/exporter.c CHANGED
@@ -14,10 +14,9 @@ static void exporter_mark(struct RExporter *rExporter)
14
14
  }
15
15
 
16
16
  /*
17
+ call-seq: new(movie) -> exporter
18
+
17
19
  Creates a new exporter instance. Usually this is done through movie.exporter.
18
-
19
- call-seq:
20
- new(movie) -> exporter
21
20
  */
22
21
  static VALUE exporter_new(VALUE klass)
23
22
  {
@@ -35,15 +34,14 @@ static ComponentInstance exporter_component(VALUE obj)
35
34
  }
36
35
 
37
36
  /*
37
+ call-seq: export_to_file(filepath)
38
+
38
39
  Exports a movie to the given filepath. This will use either the
39
40
  settings you set beforehand, or QuickTime's defaults.
40
41
 
41
42
  You can track the progress of this operation by passing a block to this
42
43
  method. It will be called regularly during the process and pass the
43
44
  percentage complete (0.0 to 1.0) as an argument to the block.
44
-
45
- call-seq:
46
- export_to_file(filepath)
47
45
  */
48
46
  static VALUE exporter_export_to_file(VALUE obj, VALUE filepath)
49
47
  {
@@ -76,14 +74,13 @@ static VALUE exporter_export_to_file(VALUE obj, VALUE filepath)
76
74
  }
77
75
 
78
76
  /*
77
+ call-seq: open_settings_dialog()
78
+
79
79
  Opens the offical QuickTime GUI settings dialog. The process will be
80
80
  suspended until the user closes the dialogue. If the user clicks Okay
81
81
  the settings will be applied to this Exporter. You can then use
82
82
  save_settings to save them to a file, and load_settings to load them
83
83
  back again.
84
-
85
- call-seq:
86
- open_settings_dialog()
87
84
  */
88
85
  static VALUE exporter_open_settings_dialog(VALUE obj)
89
86
  {
@@ -126,10 +123,9 @@ static VALUE exporter_open_settings_dialog(VALUE obj)
126
123
  }
127
124
 
128
125
  /*
126
+ call-seq: load_settings(filepath)
127
+
129
128
  Loads the settings at the given filepath. See save_settings.
130
-
131
- call-seq:
132
- load_settings(filepath)
133
129
  */
134
130
  static VALUE exporter_load_settings(VALUE obj, VALUE filepath)
135
131
  {
@@ -164,11 +160,10 @@ static VALUE exporter_load_settings(VALUE obj, VALUE filepath)
164
160
  }
165
161
 
166
162
  /*
163
+ call-seq: save_settings(filepath)
164
+
167
165
  Saves the settings to the given filepath (usually with .st extension).
168
166
  See open_settings_dialog and load_settings.
169
-
170
- call-seq:
171
- save_settings(filepath)
172
167
  */
173
168
  static VALUE exporter_save_settings(VALUE obj, VALUE filepath)
174
169
  {
@@ -191,6 +186,8 @@ static VALUE exporter_save_settings(VALUE obj, VALUE filepath)
191
186
 
192
187
  void Init_quicktime_exporter()
193
188
  {
189
+ VALUE mQuicktime;
190
+ mQuicktime = rb_define_module("Quicktime");
194
191
  cExporter = rb_define_class_under(mQuicktime, "Exporter", rb_cObject);
195
192
  rb_define_alloc_func(cExporter, exporter_new);
196
193
  rb_define_method(cExporter, "export", exporter_export_to_file, 1);
data/ext/movie.c CHANGED
@@ -20,13 +20,12 @@ static void movie_mark(struct RMovie *rMovie)
20
20
  }
21
21
 
22
22
  /*
23
+ call-seq: new() -> movie
24
+
23
25
  Creates a new movie instance. Generally you want to go through
24
26
  Movie.open or Movie.empty to load or create a new movie respectively.
25
27
  If you do no then you will need to load the movie with load_empty or
26
28
  load_from_file before you can accomplish anything.
27
-
28
- call-seq:
29
- new() -> movie
30
29
  */
31
30
  static VALUE movie_new(VALUE klass)
32
31
  {
@@ -35,13 +34,12 @@ static VALUE movie_new(VALUE klass)
35
34
  }
36
35
 
37
36
  /*
37
+ call-seq: dispose()
38
+
38
39
  Dispose of the loaded QuickTime movie. This will automatically be done
39
40
  when this movie instance is garbage collected. However if you are
40
41
  iterating through many movies it is often helpful to dispose of it
41
42
  as soon as you're done with it.
42
-
43
- call-seq:
44
- dispose()
45
43
  */
46
44
  static VALUE movie_dispose(VALUE obj)
47
45
  {
@@ -53,12 +51,11 @@ static VALUE movie_dispose(VALUE obj)
53
51
  }
54
52
 
55
53
  /*
54
+ call-seq: load_from_file(filepath)
55
+
56
56
  Loads a new, empty QuickTime movie at given filepath. Should only be
57
57
  called if no movie has been loaded (or it has been disposed). Usually
58
58
  you go through Movie.open.
59
-
60
- call-seq:
61
- load_from_file(filepath)
62
59
  */
63
60
  static VALUE movie_load_from_file(VALUE obj, VALUE filepath)
64
61
  {
@@ -94,12 +91,11 @@ static VALUE movie_load_from_file(VALUE obj, VALUE filepath)
94
91
  }
95
92
 
96
93
  /*
94
+ call-seq: load_empty()
95
+
97
96
  Loads a new, empty QuickTime movie. Should only be called if no movie
98
97
  has been loaded (or it has been disposed). Usually you go through
99
98
  Movie.empty.
100
-
101
- call-seq:
102
- load_empty()
103
99
  */
104
100
  static VALUE movie_load_empty(VALUE obj)
105
101
  {
@@ -112,11 +108,10 @@ static VALUE movie_load_empty(VALUE obj)
112
108
  }
113
109
 
114
110
  /*
111
+ call-seq: raw_duration() -> duration_int
112
+
115
113
  Returns the raw duration of the movie. Combine this with time_scale to
116
114
  reach the duration in seconds.
117
-
118
- call-seq:
119
- raw_duration() -> duration_int
120
115
  */
121
116
  static VALUE movie_raw_duration(VALUE obj)
122
117
  {
@@ -124,11 +119,10 @@ static VALUE movie_raw_duration(VALUE obj)
124
119
  }
125
120
 
126
121
  /*
122
+ call-seq: time_scale() -> scale_int
123
+
127
124
  Returns the time scale of the movie. Usually only needed when working
128
125
  with raw_duration.
129
-
130
- call-seq:
131
- time_scale() -> scale_int
132
126
  */
133
127
  static VALUE movie_time_scale(VALUE obj)
134
128
  {
@@ -136,10 +130,10 @@ static VALUE movie_time_scale(VALUE obj)
136
130
  }
137
131
 
138
132
  /*
139
- Returns the number of tracks in the movie.
140
-
141
- call-seq:
142
- track_count() -> count
133
+ call-seq: bounds() -> bounds_hash
134
+
135
+ Returns a hash of boundaries. The hash contains four keys: :left, :top,
136
+ :right, :bottom. Each holds an integer representing the pixel value.
143
137
  */
144
138
  static VALUE movie_bounds(VALUE obj)
145
139
  {
@@ -154,10 +148,9 @@ static VALUE movie_bounds(VALUE obj)
154
148
  }
155
149
 
156
150
  /*
151
+ call-seq: track_count() -> count
152
+
157
153
  Returns the number of tracks in the movie.
158
-
159
- call-seq:
160
- track_count -> count
161
154
  */
162
155
  static VALUE movie_track_count(VALUE obj)
163
156
  {
@@ -165,14 +158,13 @@ static VALUE movie_track_count(VALUE obj)
165
158
  }
166
159
 
167
160
  /*
161
+ call-seq: composite_movie(movie, position)
162
+
168
163
  Adds the tracks of given movie into called movie at given position (in seconds).
169
164
 
170
165
  You can track the progress of this operation by passing a block to this
171
166
  method. It will be called regularly during the process and pass the
172
167
  percentage complete (0.0 to 1.0) as an argument to the block.
173
-
174
- call-seq:
175
- composite_movie(movie, position)
176
168
  */
177
169
  static VALUE movie_composite_movie(VALUE obj, VALUE src, VALUE position)
178
170
  {
@@ -189,14 +181,13 @@ static VALUE movie_composite_movie(VALUE obj, VALUE src, VALUE position)
189
181
  }
190
182
 
191
183
  /*
184
+ call-seq: append_movie(movie, position)
185
+
192
186
  Inserts given movie into called movie at given position (in seconds).
193
187
 
194
188
  You can track the progress of this operation by passing a block to this
195
189
  method. It will be called regularly during the process and pass the
196
190
  percentage complete (0.0 to 1.0) as an argument to the block.
197
-
198
- call-seq:
199
- append_movie(movie, position)
200
191
  */
201
192
  static VALUE movie_insert_movie(VALUE obj, VALUE src, VALUE position)
202
193
  {
@@ -213,14 +204,13 @@ static VALUE movie_insert_movie(VALUE obj, VALUE src, VALUE position)
213
204
  }
214
205
 
215
206
  /*
207
+ call-seq: append_movie(movie)
208
+
216
209
  Adds given movie to the end of movie which this method is called on.
217
210
 
218
211
  You can track the progress of this operation by passing a block to this
219
212
  method. It will be called regularly during the process and pass the
220
213
  percentage complete (0.0 to 1.0) as an argument to the block.
221
-
222
- call-seq:
223
- append_movie(movie)
224
214
  */
225
215
  static VALUE movie_append_movie(VALUE obj, VALUE src)
226
216
  {
@@ -237,11 +227,10 @@ static VALUE movie_append_movie(VALUE obj, VALUE src)
237
227
  }
238
228
 
239
229
  /*
230
+ call-seq: delete_section(start_time, duration)
231
+
240
232
  Deletes given section from movie. Both start_time and duration
241
233
  should be floats representing seconds.
242
-
243
- call-seq:
244
- delete_section(start_time, duration)
245
234
  */
246
235
  static VALUE movie_delete_section(VALUE obj, VALUE start, VALUE duration)
247
236
  {
@@ -251,6 +240,8 @@ static VALUE movie_delete_section(VALUE obj, VALUE start, VALUE duration)
251
240
  }
252
241
 
253
242
  /*
243
+ call-seq: clone_section(start_time, duration) -> movie
244
+
254
245
  Returns a new movie in the given section. Does not modify original
255
246
  movie. Both start_time and duration should be floats representing
256
247
  seconds.
@@ -258,9 +249,6 @@ static VALUE movie_delete_section(VALUE obj, VALUE start, VALUE duration)
258
249
  You can track the progress of this operation by passing a block to this
259
250
  method. It will be called regularly during the process and pass the
260
251
  percentage complete (0.0 to 1.0) as an argument to the block.
261
-
262
- call-seq:
263
- clone_section(start_time, duration) -> movie
264
252
  */
265
253
  static VALUE movie_clone_section(VALUE obj, VALUE start, VALUE duration)
266
254
  {
@@ -279,6 +267,8 @@ static VALUE movie_clone_section(VALUE obj, VALUE start, VALUE duration)
279
267
  }
280
268
 
281
269
  /*
270
+ call-seq: clip_section(start_time, duration) -> movie
271
+
282
272
  Deletes given section on movie and returns a new movie with that
283
273
  section. Both start_time and duration should be floats representing
284
274
  seconds.
@@ -286,9 +276,6 @@ static VALUE movie_clone_section(VALUE obj, VALUE start, VALUE duration)
286
276
  You can track the progress of this operation by passing a block to this
287
277
  method. It will be called regularly during the process and pass the
288
278
  percentage complete (0.0 to 1.0) as an argument to the block.
289
-
290
- call-seq:
291
- clip_section(start_time, duration) -> movie
292
279
  */
293
280
  static VALUE movie_clip_section(VALUE obj, VALUE start, VALUE duration)
294
281
  {
@@ -307,11 +294,10 @@ static VALUE movie_clip_section(VALUE obj, VALUE start, VALUE duration)
307
294
  }
308
295
 
309
296
  /*
297
+ call-seq: changed?() -> bool
298
+
310
299
  Determine if a movie has changed since opening. Returns true/false.
311
300
  See reset_changed_status to reset this value.
312
-
313
- call-seq:
314
- changed?() -> bool
315
301
  */
316
302
  static VALUE movie_changed(VALUE obj)
317
303
  {
@@ -323,10 +309,9 @@ static VALUE movie_changed(VALUE obj)
323
309
  }
324
310
 
325
311
  /*
312
+ call-seq: clear_changed_status()
313
+
326
314
  Resets the "changed?" status. Does not revert the movie itself.
327
-
328
- call-seq:
329
- clear_changed_status()
330
315
  */
331
316
  static VALUE movie_clear_changed_status(VALUE obj)
332
317
  {
@@ -336,12 +321,10 @@ static VALUE movie_clear_changed_status(VALUE obj)
336
321
 
337
322
 
338
323
  /*
324
+ call-seq: flatten(filepath)
325
+
339
326
  Saves the movie to the given filepath by flattening it.
340
-
341
- call-seq:
342
- flatten(filepath)
343
327
  */
344
-
345
328
  static VALUE movie_flatten(VALUE obj, VALUE filepath)
346
329
  {
347
330
  OSErr err;
@@ -363,12 +346,10 @@ static VALUE movie_flatten(VALUE obj, VALUE filepath)
363
346
  }
364
347
 
365
348
  /*
349
+ call-seq: export_pict(filepath, time)
350
+
366
351
  Exports a PICT file to given filepath (should end in .pct) at the given
367
352
  time. Time should be a floating point in seconds.
368
-
369
- call-seq:
370
- export_pict(filepath, time)
371
-
372
353
  */
373
354
 
374
355
  static VALUE movie_export_pict(VALUE obj, VALUE filepath, VALUE frame_time)
@@ -413,6 +394,8 @@ static VALUE movie_export_pict(VALUE obj, VALUE filepath, VALUE frame_time)
413
394
 
414
395
  void Init_quicktime_movie()
415
396
  {
397
+ VALUE mQuicktime;
398
+ mQuicktime = rb_define_module("Quicktime");
416
399
  cMovie = rb_define_class_under(mQuicktime, "Movie", rb_cObject);
417
400
  rb_define_alloc_func(cMovie, movie_new);
418
401
  rb_define_method(cMovie, "load_from_file", movie_load_from_file, 1);
data/ext/rmov_ext.c CHANGED
@@ -1,11 +1,13 @@
1
1
  #include "rmov_ext.h"
2
2
 
3
- VALUE mQuicktime;
4
3
  VALUE eQuicktime;
5
4
 
6
5
  void Init_rmov_ext()
7
6
  {
7
+ VALUE mQuicktime;
8
+
8
9
  EnterMovies(); // Enables the QuickTime framework
10
+
9
11
  mQuicktime = rb_define_module("Quicktime");
10
12
  eQuicktime = rb_define_class_under(mQuicktime, "Error", rb_eStandardError);
11
13
  Init_quicktime_movie();
data/ext/rmov_ext.h CHANGED
@@ -1,7 +1,7 @@
1
1
  #include <ruby.h>
2
2
  #include <QuickTime/QuickTime.h>
3
3
 
4
- extern VALUE mQuicktime, eQuicktime, cMovie, cTrack, cExporter;
4
+ extern VALUE eQuicktime, cMovie, cTrack, cExporter;
5
5
 
6
6
  /*** MOVIE ***/
7
7
 
data/ext/track.c CHANGED
@@ -11,11 +11,10 @@ static void track_mark(struct RTrack *rTrack)
11
11
  }
12
12
 
13
13
  /*
14
+ call-seq: new() -> track
15
+
14
16
  Creates a new track instance. Generally you will do this through
15
17
  movie.tracks to fetch the Track instances for a given movie.
16
-
17
- call-seq:
18
- new() -> track
19
18
  */
20
19
  static VALUE track_new(VALUE klass)
21
20
  {
@@ -24,11 +23,10 @@ static VALUE track_new(VALUE klass)
24
23
  }
25
24
 
26
25
  /*
26
+ call-seq: load(movie, index)
27
+
27
28
  Loads a QuickTime track from a given movie. This is done automatically
28
29
  when calling movie.tracks.
29
-
30
- call-seq:
31
- load(movie, index)
32
30
  */
33
31
  static VALUE track_load(VALUE obj, VALUE movie_obj, VALUE index_obj)
34
32
  {
@@ -40,11 +38,10 @@ static VALUE track_load(VALUE obj, VALUE movie_obj, VALUE index_obj)
40
38
  }
41
39
 
42
40
  /*
41
+ call-seq: raw_duration() -> duration_int
42
+
43
43
  Returns the raw duration of the track. Combine this with time_scale to
44
44
  reach the duration in seconds.
45
-
46
- call-seq:
47
- raw_duration() -> duration_int
48
45
  */
49
46
  static VALUE track_raw_duration(VALUE obj)
50
47
  {
@@ -52,11 +49,10 @@ static VALUE track_raw_duration(VALUE obj)
52
49
  }
53
50
 
54
51
  /*
52
+ call-seq: time_scale() -> scale_int
53
+
55
54
  Returns the time scale of the track. Usually only needed when working
56
55
  with raw_duration.
57
-
58
- call-seq:
59
- time_scale() -> scale_int
60
56
  */
61
57
  static VALUE track_time_scale(VALUE obj)
62
58
  {
@@ -64,10 +60,9 @@ static VALUE track_time_scale(VALUE obj)
64
60
  }
65
61
 
66
62
  /*
63
+ call-seq: frame_count() -> count
64
+
67
65
  Returns the number of frames in the track.
68
-
69
- call-seq:
70
- frame_count() -> count
71
66
  */
72
67
  static VALUE track_frame_count(VALUE obj)
73
68
  {
@@ -75,10 +70,9 @@ static VALUE track_frame_count(VALUE obj)
75
70
  }
76
71
 
77
72
  /*
73
+ call-seq: media_type() -> media_type_sym
74
+
78
75
  Returns either :audio or :video depending on the type of track this is.
79
-
80
- call-seq:
81
- media_type() -> media_type_sym
82
76
  */
83
77
  static VALUE track_media_type(VALUE obj)
84
78
  {
@@ -95,11 +89,10 @@ static VALUE track_media_type(VALUE obj)
95
89
  }
96
90
 
97
91
  /*
92
+ call-seq: id() -> quicktime_track_id_int
93
+
98
94
  Returns either id number QuickTime uses to reference this track.
99
95
  Usually only used internally.
100
-
101
- call-seq:
102
- id() -> quicktime_track_id_int
103
96
  */
104
97
  static VALUE track_id(VALUE obj)
105
98
  {
@@ -107,10 +100,9 @@ static VALUE track_id(VALUE obj)
107
100
  }
108
101
 
109
102
  /*
103
+ call-seq: delete()
104
+
110
105
  Removes the track from its movie and deletes it from memory.
111
-
112
- call-seq:
113
- delete()
114
106
  */
115
107
  static VALUE track_delete(VALUE obj)
116
108
  {
@@ -119,10 +111,9 @@ static VALUE track_delete(VALUE obj)
119
111
  }
120
112
 
121
113
  /*
114
+ call-seq: disable()
115
+
122
116
  Disables the track. See enabled? to determine if it's disabled already.
123
-
124
- call-seq:
125
- disable()
126
117
  */
127
118
  static VALUE track_disable(VALUE obj, VALUE boolean)
128
119
  {
@@ -131,10 +122,9 @@ static VALUE track_disable(VALUE obj, VALUE boolean)
131
122
  }
132
123
 
133
124
  /*
125
+ call-seq: enable()
126
+
134
127
  Enables the track. See enabled? to determine if it's enabled already.
135
-
136
- call-seq:
137
- enable()
138
128
  */
139
129
  static VALUE track_enable(VALUE obj, VALUE boolean)
140
130
  {
@@ -143,10 +133,9 @@ static VALUE track_enable(VALUE obj, VALUE boolean)
143
133
  }
144
134
 
145
135
  /*
136
+ call-seq: enabled?() -> bool
137
+
146
138
  Returns true/false depending on if the track is enabled.
147
-
148
- call-seq:
149
- enabled?() -> bool
150
139
  */
151
140
  static VALUE track_enabled(VALUE obj, VALUE boolean)
152
141
  {
@@ -159,6 +148,8 @@ static VALUE track_enabled(VALUE obj, VALUE boolean)
159
148
 
160
149
  void Init_quicktime_track()
161
150
  {
151
+ VALUE mQuicktime;
152
+ mQuicktime = rb_define_module("Quicktime");
162
153
  cTrack = rb_define_class_under(mQuicktime, "Track", rb_cObject);
163
154
  rb_define_alloc_func(cTrack, track_new);
164
155
  rb_define_method(cTrack, "load_from_movie", track_load, 2);
data/rmov.gemspec CHANGED
@@ -1,18 +1,18 @@
1
1
 
2
- # Gem::Specification for Rmov-0.1.0
2
+ # Gem::Specification for Rmov-0.1.1
3
3
  # Originally generated by Echoe
4
4
 
5
5
  --- !ruby/object:Gem::Specification
6
6
  name: rmov
7
7
  version: !ruby/object:Gem::Version
8
- version: 0.1.0
8
+ version: 0.1.1
9
9
  platform: ruby
10
10
  authors:
11
11
  - Ryan Bates
12
12
  autorequire:
13
13
  bindir: bin
14
14
 
15
- date: 2008-10-02 00:00:00 -07:00
15
+ date: 2008-10-03 00:00:00 -07:00
16
16
  default_executable:
17
17
  dependencies: []
18
18
 
@@ -88,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
88
  version:
89
89
  required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - "="
91
+ - - ">="
92
92
  - !ruby/object:Gem::Version
93
93
  version: "1.2"
94
94
  version:
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bates
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-02 00:00:00 -07:00
12
+ date: 2008-10-03 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -85,7 +85,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
85
  version:
86
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - "="
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: "1.2"
91
91
  version: