Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changing Quicktime module name to QuickTime since that is proper casing

  • Loading branch information...
commit 180fcac2fef0a49e79dce9498cab3273ce3ae9fb 1 parent 6edb9fc
@ryanb authored
View
2  CHANGELOG
@@ -1,3 +1,5 @@
+* changing Quicktime module name to QuickTime.
+
0.1.2 (October 3rd, 2008)
* movie.poster_time and movie.poster_time=(seconds) for getting and setting a movie's poster time
View
2  README.rdoc
@@ -56,7 +56,7 @@ the user with the dialog again.
puts "#{percent}% complete"
end
-See Quicktime::Movie in the RDoc for more information.
+See QuickTime::Movie in the RDoc for more information.
http://rmov.rubyforge.org
View
22 ext/exporter.c
@@ -58,12 +58,12 @@ static VALUE exporter_export_to_file(VALUE obj, VALUE filepath)
err = NativePathNameToFSSpec(RSTRING(filepath)->ptr, &fs, 0);
if (err != fnfErr)
- rb_raise(eQuicktime, "Error %d occurred while opening file for export at %s.", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while opening file for export at %s.", err, RSTRING(filepath)->ptr);
// TODO use exporter settings when converting movie
err = ConvertMovieToFile(movie, 0, &fs, 'MooV', 'TVOD', 0, 0, 0, component);
if (err != noErr)
- rb_raise(eQuicktime, "Error %d occurred while attempting to export movie to file %s.", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while attempting to export movie to file %s.", err, RSTRING(filepath)->ptr);
if (rb_block_given_p())
SetMovieProgressProc(movie, 0, 0);
@@ -93,14 +93,14 @@ static VALUE exporter_open_settings_dialog(VALUE obj)
// Bring this process to the front
err = TransformProcessType(&current_process, kProcessTransformToForegroundApplication);
if (err != noErr) {
- rb_raise(eQuicktime, "Error %d occurred while brining this application to the forground.", err);
+ rb_raise(eQuickTime, "Error %d occurred while brining this application to the forground.", err);
}
SetFrontProcess(&current_process);
// Show export dialog and save settings
err = MovieExportDoUserDialog(component, movie, 0, 0, GetMovieDuration(movie), &canceled);
if (err != noErr) {
- rb_raise(eQuicktime, "Error %d occurred while opening export dialog.", err);
+ rb_raise(eQuickTime, "Error %d occurred while opening export dialog.", err);
}
if (!canceled) {
@@ -132,7 +132,7 @@ static VALUE exporter_load_settings(VALUE obj, VALUE filepath)
file = fopen(RSTRING(filepath)->ptr, "r+b");
if (!file) {
- rb_raise(eQuicktime, "Unable to open file for loading at %s.", RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Unable to open file for loading at %s.", RSTRING(filepath)->ptr);
}
// obtain file size:
@@ -149,7 +149,7 @@ static VALUE exporter_load_settings(VALUE obj, VALUE filepath)
REXPORTER(obj)->settings = (QTAtomContainer)NewHandleClear(length);
read_length = fread(*(Handle)REXPORTER(obj)->settings, 1, length, file);
if (read_length != length) {
- rb_raise(eQuicktime, "Unable to read entire file at %s.", RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Unable to read entire file at %s.", RSTRING(filepath)->ptr);
}
fclose(file);
@@ -169,12 +169,12 @@ static VALUE exporter_save_settings(VALUE obj, VALUE filepath)
QTAtomContainer settings = REXPORTER(obj)->settings;
if (!settings) {
- rb_raise(eQuicktime, "Unable to save settings because no settings are specified.");
+ rb_raise(eQuickTime, "Unable to save settings because no settings are specified.");
}
file = fopen(RSTRING(filepath)->ptr, "wb");
if (!file) {
- rb_raise(eQuicktime, "Unable to open file for saving at %s.", RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Unable to open file for saving at %s.", RSTRING(filepath)->ptr);
}
fwrite(&settings, GetHandleSize((Handle)settings), 1, file);
fclose(file);
@@ -184,9 +184,9 @@ static VALUE exporter_save_settings(VALUE obj, VALUE filepath)
void Init_quicktime_exporter()
{
- VALUE mQuicktime;
- mQuicktime = rb_define_module("Quicktime");
- cExporter = rb_define_class_under(mQuicktime, "Exporter", rb_cObject);
+ VALUE mQuickTime;
+ mQuickTime = rb_define_module("QuickTime");
+ cExporter = rb_define_class_under(mQuickTime, "Exporter", rb_cObject);
rb_define_alloc_func(cExporter, exporter_new);
rb_define_method(cExporter, "export", exporter_export_to_file, 1);
rb_define_method(cExporter, "open_settings_dialog", exporter_open_settings_dialog, 0);
View
2  ext/extconf.rb
@@ -1,4 +1,4 @@
require 'mkmf'
-$LDFLAGS = '-framework Quicktime'
+$LDFLAGS = '-framework QuickTime'
create_makefile('rmov_ext')
View
30 ext/movie.c
@@ -60,7 +60,7 @@ static VALUE movie_dispose(VALUE obj)
static VALUE movie_load_from_file(VALUE obj, VALUE filepath)
{
if (MOVIE(obj)) {
- rb_raise(eQuicktime, "Movie has already been loaded.");
+ rb_raise(eQuickTime, "Movie has already been loaded.");
} else {
OSErr err;
FSSpec fs;
@@ -70,19 +70,19 @@ static VALUE movie_load_from_file(VALUE obj, VALUE filepath)
err = NativePathNameToFSSpec(RSTRING(filepath)->ptr, &fs, 0);
if (err != 0)
- rb_raise(eQuicktime, "Error %d occurred while reading file at %s", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while reading file at %s", err, RSTRING(filepath)->ptr);
err = OpenMovieFile(&fs, &frefnum, fsRdPerm);
if (err != 0)
- rb_raise(eQuicktime, "Error %d occurred while opening movie at %s", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while opening movie at %s", err, RSTRING(filepath)->ptr);
err = NewMovieFromFile(movie, frefnum, &movie_resid, 0, newMovieActive, 0);
if (err != 0)
- rb_raise(eQuicktime, "Error %d occurred while loading movie at %s", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while loading movie at %s", err, RSTRING(filepath)->ptr);
err = CloseMovieFile(frefnum);
if (err != 0)
- rb_raise(eQuicktime, "Error %d occurred while closing movie file at %s", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while closing movie file at %s", err, RSTRING(filepath)->ptr);
RMOVIE(obj)->movie = *movie;
@@ -100,7 +100,7 @@ static VALUE movie_load_from_file(VALUE obj, VALUE filepath)
static VALUE movie_load_empty(VALUE obj)
{
if (MOVIE(obj)) {
- rb_raise(eQuicktime, "Movie has already been loaded.");
+ rb_raise(eQuickTime, "Movie has already been loaded.");
} else {
RMOVIE(obj)->movie = NewMovie(0);
return obj;
@@ -333,7 +333,7 @@ static VALUE movie_flatten(VALUE obj, VALUE filepath)
err = NativePathNameToFSSpec(RSTRING(filepath)->ptr, &fs, 0);
if (err != fnfErr)
- rb_raise(eQuicktime, "Error %d occurred while opening file for export at %s", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while opening file for export at %s", err, RSTRING(filepath)->ptr);
// TODO make these flags settable through an options hash
RMOVIE(new_movie_obj)->movie = FlattenMovieData(MOVIE(obj),
@@ -364,26 +364,26 @@ static VALUE movie_export_pict(VALUE obj, VALUE filepath, VALUE frame_time)
err = NativePathNameToFSSpec(RSTRING(filepath)->ptr, &fs, 0);
if (err != fnfErr)
- rb_raise(eQuicktime, "Error %d occurred while opening file for export at %s.", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while opening file for export at %s.", err, RSTRING(filepath)->ptr);
// Convert the picture handle into a PICT file (still in a handle)
// by adding a 512-byte header to the start.
handle = NewHandleClear(512);
err = HandAndHand((Handle)picture, handle);
if (err != noErr)
- rb_raise(eQuicktime, "Error %d occurred while converting handle for pict export %s.", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while converting handle for pict export %s.", err, RSTRING(filepath)->ptr);
err = OpenADefaultComponent(GraphicsImporterComponentType, kQTFileTypePicture, &component);
if (err != noErr)
- rb_raise(eQuicktime, "Error %d occurred while opening picture component for %s.", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while opening picture component for %s.", err, RSTRING(filepath)->ptr);
err = GraphicsImportSetDataHandle(component, handle);
if (err != noErr)
- rb_raise(eQuicktime, "Error %d occurred while setting graphics importer data handle for %s.", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while setting graphics importer data handle for %s.", err, RSTRING(filepath)->ptr);
err = GraphicsImportExportImageFile(component, 0, 0, &fs, smSystemScript);
if (err != noErr)
- rb_raise(eQuicktime, "Error %d occurred while exporting pict to file %s.", err, RSTRING(filepath)->ptr);
+ rb_raise(eQuickTime, "Error %d occurred while exporting pict to file %s.", err, RSTRING(filepath)->ptr);
CloseComponent(component);
DisposeHandle(handle);
@@ -415,9 +415,9 @@ static VALUE movie_set_poster_time(VALUE obj, VALUE seconds)
void Init_quicktime_movie()
{
- VALUE mQuicktime;
- mQuicktime = rb_define_module("Quicktime");
- cMovie = rb_define_class_under(mQuicktime, "Movie", rb_cObject);
+ VALUE mQuickTime;
+ mQuickTime = rb_define_module("QuickTime");
+ cMovie = rb_define_class_under(mQuickTime, "Movie", rb_cObject);
rb_define_alloc_func(cMovie, movie_new);
rb_define_method(cMovie, "load_from_file", movie_load_from_file, 1);
rb_define_method(cMovie, "load_empty", movie_load_empty, 0);
View
8 ext/rmov_ext.c
@@ -1,15 +1,15 @@
#include "rmov_ext.h"
-VALUE eQuicktime;
+VALUE eQuickTime;
void Init_rmov_ext()
{
- VALUE mQuicktime;
+ VALUE mQuickTime;
EnterMovies(); // Enables the QuickTime framework
- mQuicktime = rb_define_module("Quicktime");
- eQuicktime = rb_define_class_under(mQuicktime, "Error", rb_eStandardError);
+ mQuickTime = rb_define_module("QuickTime");
+ eQuickTime = rb_define_class_under(mQuickTime, "Error", rb_eStandardError);
Init_quicktime_movie();
Init_quicktime_track();
Init_quicktime_exporter();
View
2  ext/rmov_ext.h
@@ -1,7 +1,7 @@
#include <ruby.h>
#include <QuickTime/QuickTime.h>
-extern VALUE eQuicktime, cMovie, cTrack, cExporter;
+extern VALUE eQuickTime, cMovie, cTrack, cExporter;
/*** MOVIE ***/
View
8 ext/track.c
@@ -32,7 +32,7 @@ static VALUE track_load(VALUE obj, VALUE movie_obj, VALUE index_obj)
{
RTRACK(obj)->track = GetMovieIndTrack(MOVIE(movie_obj), NUM2INT(index_obj));
if (!RTRACK(obj)->track)
- rb_raise(eQuicktime, "Unable to fetch track for movie at index %d", NUM2INT(index_obj));
+ rb_raise(eQuickTime, "Unable to fetch track for movie at index %d", NUM2INT(index_obj));
return obj;
}
@@ -191,9 +191,9 @@ static VALUE track_set_offset(VALUE obj, VALUE seconds)
void Init_quicktime_track()
{
- VALUE mQuicktime;
- mQuicktime = rb_define_module("Quicktime");
- cTrack = rb_define_class_under(mQuicktime, "Track", rb_cObject);
+ VALUE mQuickTime;
+ mQuickTime = rb_define_module("QuickTime");
+ cTrack = rb_define_class_under(mQuickTime, "Track", rb_cObject);
rb_define_alloc_func(cTrack, track_new);
rb_define_method(cTrack, "load_from_movie", track_load, 2);
rb_define_method(cTrack, "raw_duration", track_raw_duration, 0);
View
2  lib/quicktime/exporter.rb
@@ -1,4 +1,4 @@
-module Quicktime
+module QuickTime
# see ext/exporter.c for additional methods
class Exporter
attr_reader :movie
View
2  lib/quicktime/movie.rb
@@ -1,4 +1,4 @@
-module Quicktime
+module QuickTime
# see ext/movie.c for additional methods
class Movie
# Opens a movie at filepath.
View
2  lib/quicktime/track.rb
@@ -1,4 +1,4 @@
-module Quicktime
+module QuickTime
# see ext/track.c for additional methods
class Track
# Returns the length of this track in seconds
View
4 lib/rmov.rb
@@ -7,6 +7,6 @@
require 'quicktime/exporter'
-# RMov is made up of several parts. To start, see Quicktime::Movie.
-module Quicktime
+# RMov is made up of several parts. To start, see QuickTime::Movie.
+module QuickTime
end
View
10 spec/quicktime/exporter_spec.rb
@@ -1,18 +1,18 @@
require File.dirname(__FILE__) + '/../spec_helper.rb'
-describe Quicktime::Exporter do
+describe QuickTime::Exporter do
it "should raise error when saving with no settings" do
- lambda { Quicktime::Exporter.new(nil).save_settings('foo') }.should raise_error(Quicktime::Error)
+ lambda { QuickTime::Exporter.new(nil).save_settings('foo') }.should raise_error(QuickTime::Error)
end
it "should raise error when atempting to load no file" do
- lambda { Quicktime::Exporter.new(nil).load_settings('foo/bar/baz') }.should raise_error(Quicktime::Error)
+ lambda { QuickTime::Exporter.new(nil).load_settings('foo/bar/baz') }.should raise_error(QuickTime::Error)
end
describe "loaded settings.st" do
before(:each) do
@load_path = File.dirname(__FILE__) + '/../fixtures/settings.st'
- @exporter = Quicktime::Exporter.new(nil)
+ @exporter = QuickTime::Exporter.new(nil)
@exporter.load_settings(@load_path)
end
@@ -23,7 +23,7 @@
end
it "should complain when attempting to save to an invalid file" do
- lambda { @exporter.save_settings('foo/bar/baz') }.should raise_error(Quicktime::Error)
+ lambda { @exporter.save_settings('foo/bar/baz') }.should raise_error(QuickTime::Error)
end
end
end
View
30 spec/quicktime/movie_spec.rb
@@ -1,17 +1,17 @@
require File.dirname(__FILE__) + '/../spec_helper.rb'
-describe Quicktime::Movie do
+describe QuickTime::Movie do
it "should raise an exception when attempting to open a nonexisting file" do
- lambda { Quicktime::Movie.open('foo.mov') }.should raise_error(Quicktime::Error)
+ lambda { QuickTime::Movie.open('foo.mov') }.should raise_error(QuickTime::Error)
end
it "should raise an exception when attempting to open a non movie file" do
- lambda { Quicktime::Movie.open(__FILE__) }.should raise_error(Quicktime::Error)
+ lambda { QuickTime::Movie.open(__FILE__) }.should raise_error(QuickTime::Error)
end
describe "example.mov" do
before(:each) do
- @movie = Quicktime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
+ @movie = QuickTime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
end
it "duration should be 3.1 seconds" do
@@ -31,7 +31,7 @@
end
it "should have 2 tracks" do
- @movie.tracks.map { |t| t.class }.should == [Quicktime::Track, Quicktime::Track]
+ @movie.tracks.map { |t| t.class }.should == [QuickTime::Track, QuickTime::Track]
@movie.tracks.map { |t| t.id }.should == [1, 2]
end
@@ -43,7 +43,7 @@
@movie.export(path) { |p| progress = p }
progress.should == 1.0
- exported_movie = Quicktime::Movie.open(path)
+ exported_movie = QuickTime::Movie.open(path)
exported_movie.duration.should == @movie.duration
exported_movie.tracks.size == @movie.tracks.size
end
@@ -57,19 +57,19 @@
end
it "composite should add another movie's tracks at a given location" do
- m2 = Quicktime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
+ m2 = QuickTime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
@movie.composite_movie(m2, 2)
@movie.duration.should == 5.1
end
it "insert should insert another movie's tracks at a given location" do
- m2 = Quicktime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
+ m2 = QuickTime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
@movie.insert_movie(m2, 2)
@movie.duration.should == 6.2
end
it "append_movie should insert movie at the end" do
- m2 = Quicktime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
+ m2 = QuickTime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
@movie.append_movie(m2)
@movie.duration.should == 6.2
end
@@ -93,7 +93,7 @@
it "should have an exporter with this movie" do
exporter = @movie.exporter
- exporter.should be_kind_of(Quicktime::Exporter)
+ exporter.should be_kind_of(QuickTime::Exporter)
exporter.movie.should == @movie
end
@@ -113,7 +113,7 @@
path = File.dirname(__FILE__) + '/../output/flattened_example.mov'
File.delete(path) rescue nil
@movie.flatten(path)
- mov = Quicktime::Movie.open(path)
+ mov = QuickTime::Movie.open(path)
mov.duration.should == 3.1
end
@@ -135,7 +135,7 @@
describe "empty movie" do
before(:each) do
- @movie = Quicktime::Movie.empty
+ @movie = QuickTime::Movie.empty
end
it "should have 0 duration" do
@@ -143,14 +143,14 @@
end
it "should be able to append an existing movie" do
- m2 = Quicktime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
+ m2 = QuickTime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
@movie.append_movie(m2)
@movie.duration.should == 3.1
end
it "should raise MovieAlreadyLoaded exception when attempting to load it again" do
- lambda { @movie.load_empty }.should raise_error(Quicktime::Error)
- lambda { @movie.load_from_file('example.mov') }.should raise_error(Quicktime::Error)
+ lambda { @movie.load_empty }.should raise_error(QuickTime::Error)
+ lambda { @movie.load_from_file('example.mov') }.should raise_error(QuickTime::Error)
end
end
end
View
4 spec/quicktime/track_spec.rb
@@ -1,9 +1,9 @@
require File.dirname(__FILE__) + '/../spec_helper.rb'
-describe Quicktime::Track do
+describe QuickTime::Track do
describe "example.mov" do
before(:each) do
- @movie = Quicktime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
+ @movie = QuickTime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
end
describe "example.mov video track" do
Please sign in to comment.
Something went wrong with that request. Please try again.