ext/exporter.c in rmov-0.1.0 vs ext/exporter.c in rmov-0.1.1
- old
+ new
@@ -12,14 +12,13 @@
static void exporter_mark(struct RExporter *rExporter)
{
}
/*
+ call-seq: new(movie) -> exporter
+
Creates a new exporter instance. Usually this is done through movie.exporter.
-
-call-seq:
- new(movie) -> exporter
*/
static VALUE exporter_new(VALUE klass)
{
struct RExporter *rExporter;
return Data_Make_Struct(klass, struct RExporter, exporter_mark, exporter_free, rExporter);
@@ -33,19 +32,18 @@
}
return component;
}
/*
+ call-seq: export_to_file(filepath)
+
Exports a movie to the given filepath. This will use either the
settings you set beforehand, or QuickTime's defaults.
You can track the progress of this operation by passing a block to this
method. It will be called regularly during the process and pass the
percentage complete (0.0 to 1.0) as an argument to the block.
-
-call-seq:
- export_to_file(filepath)
*/
static VALUE exporter_export_to_file(VALUE obj, VALUE filepath)
{
OSErr err;
FSSpec fs;
@@ -74,18 +72,17 @@
return Qnil;
}
/*
+ call-seq: open_settings_dialog()
+
Opens the offical QuickTime GUI settings dialog. The process will be
suspended until the user closes the dialogue. If the user clicks Okay
the settings will be applied to this Exporter. You can then use
save_settings to save them to a file, and load_settings to load them
back again.
-
-call-seq:
- open_settings_dialog()
*/
static VALUE exporter_open_settings_dialog(VALUE obj)
{
Boolean canceled;
OSErr err;
@@ -124,14 +121,13 @@
return Qtrue;
}
}
/*
+ call-seq: load_settings(filepath)
+
Loads the settings at the given filepath. See save_settings.
-
-call-seq:
- load_settings(filepath)
*/
static VALUE exporter_load_settings(VALUE obj, VALUE filepath)
{
FILE *file;
long length, read_length;
@@ -162,15 +158,14 @@
return Qnil;
}
/*
+ call-seq: save_settings(filepath)
+
Saves the settings to the given filepath (usually with .st extension).
See open_settings_dialog and load_settings.
-
-call-seq:
- save_settings(filepath)
*/
static VALUE exporter_save_settings(VALUE obj, VALUE filepath)
{
FILE *file;
QTAtomContainer settings = REXPORTER(obj)->settings;
@@ -189,9 +184,11 @@
return Qnil;
}
void Init_quicktime_exporter()
{
+ 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);
rb_define_method(cExporter, "load_settings", exporter_load_settings, 1);