Top | ![]() |
![]() |
![]() |
![]() |
void | mirage_writer_add_parameter_boolean () |
void | mirage_writer_add_parameter_enum () |
void | mirage_writer_add_parameter_int () |
void | mirage_writer_add_parameter_string () |
gboolean | mirage_writer_convert_image () |
MirageFragment * | mirage_writer_create_fragment () |
gboolean | mirage_writer_finalize_image () |
void | mirage_writer_generate_info () |
guint | mirage_writer_get_conversion_progress_step () |
const MirageWriterInfo * | mirage_writer_get_info () |
gboolean | mirage_writer_get_parameter_boolean () |
const gchar * | mirage_writer_get_parameter_enum () |
gint | mirage_writer_get_parameter_int () |
const gchar * | mirage_writer_get_parameter_string () |
void | mirage_writer_info_copy () |
void | mirage_writer_info_free () |
GList * | mirage_writer_lookup_parameter_ids () |
const MirageWriterParameter * | mirage_writer_lookup_parameter_info () |
gboolean | mirage_writer_open_image () |
void | mirage_writer_set_conversion_progress_step () |
enum | MirageFragmentRole |
struct | MirageWriterInfo |
struct | MirageWriterParameter |
struct | MirageWriter |
struct | MirageWriterClass |
MirageWriter object is a base object for image writer implementations.
In contrast to image loading process, which is done by a single
function call, the image writing process is designed to be interactive:
first, the user creates a MirageDisc object. On created disc, the
medium type should be set, and the filename should be changed to the
desired output filename, before passing the disc object to
mirage_writer_open_image()
, which initializes the writer. Afterwards,
the disc layout should be populated with session(s) and track(s), and
tracks with fragments. Fragments for tracks are requested from writer
using mirage_writer_create_fragment()
function. After the fragment
is set up for the track, sectors can be written to it using mirage_track_put_sector()
,
or mirage_disc_put_sector()
. To finish image writing, call mirage_writer_finalize_image()
,
which might write the image descriptor file and rename image data files,
if necessary.
The above-outlined process makes image writing flexible enough to accomodate both scenarios where all image data to be written is given in advance (e.g., from another image) and cases where image data is arriving incrementally, sector-by-sector.
A MirageWriter provides mirage_writer_convert_image()
function, which
allows writer to be used for converting an existing image by copying
all relevant data from it. In addition, conversion progress reporting
can be controlled using mirage_writer_set_conversion_progress_step()
and followed using “conversion-progress”.
To control image writer parameters, MirageWriter implements parameter sheet with API for defining parameters and validation/retrieval of user-supplied values.
void mirage_writer_add_parameter_boolean (MirageWriter *self
,const gchar *id
,const gchar *name
,const gchar *description
,gboolean default_value
);
Adds a boolean parameter to writer's parameter sheet.
void mirage_writer_add_parameter_enum (MirageWriter *self
,const gchar *id
,const gchar *name
,const gchar *description
,const gchar *default_value
,...
);
Adds an enum parameter to writer's parameter sheet. The enum parameters are treated as string parameters, except they have a pre-defined set of valid values.
void mirage_writer_add_parameter_int (MirageWriter *self
,const gchar *id
,const gchar *name
,const gchar *description
,gint default_value
);
Adds an integer parameter to writer's parameter sheet.
void mirage_writer_add_parameter_string (MirageWriter *self
,const gchar *id
,const gchar *name
,const gchar *description
,const gchar *default_value
);
Adds a string parameter to writer's parameter sheet.
gboolean mirage_writer_convert_image (MirageWriter *self
,const gchar *filename
,MirageDisc *original_disc
,GHashTable *parameters
,GCancellable *cancellable
,GError **error
);
Convenience function that converts an already-opened image stored in
original_disc
and writes it to filename
. If conversion progress
reporting is enabled via mirage_writer_set_conversion_progress_step()
,
the “conversion-progress” signal is emitted at specified
time intervals during conversion.
self |
||
filename |
filename of output image. |
[in] |
original_disc |
disc layout obtained from original image. |
[in] |
parameters |
writer parameters. |
[in][element-type utf8 GLib.Variant] |
cancellable |
optional |
[in][allow-none] |
error |
location to store error, or |
[out][allow-none] |
MirageFragment * mirage_writer_create_fragment (MirageWriter *self
,MirageTrack *track
,MirageFragmentRole role
,GError **error
);
Creates a fragment with specified role
for given track
. The latter
needs to already be part of disc's layout.
The role helps writer implementation determine what kind of fragment to create; for example, some writer implementations create dummy fragments for pregaps.
gboolean mirage_writer_finalize_image (MirageWriter *self
,MirageDisc *disc
,GError **error
);
Finalizes the image, possibly creating the image descriptor file if necessary.
void mirage_writer_generate_info (MirageWriter *self
,const gchar *id
,const gchar *name
);
Generates writer information from the input fields. It is intended as a function for creating writer information in writer implementations.
guint
mirage_writer_get_conversion_progress_step
(MirageWriter *self
);
Retrieves conversion progress step setting.
const MirageWriterInfo *
mirage_writer_get_info (MirageWriter *self
);
Retrieves writer information.
gboolean mirage_writer_get_parameter_boolean (MirageWriter *self
,const gchar *id
);
Looks up the boolean parameter with specified id
from user-supplied
writer parameters and returns its value. If user did not supply the
parameter, its default value is returned instead.
const gchar * mirage_writer_get_parameter_enum (MirageWriter *self
,const gchar *id
);
Looks up the enum parameter with specified id
from user-supplied
writer parameters and returns its value. If user did not supply the
parameter, its default value is returned instead.
gint mirage_writer_get_parameter_int (MirageWriter *self
,const gchar *id
);
Looks up the string parameter with specified id
from user-supplied
writer parameters and returns its value. If user did not supply the
parameter, its default value is returned instead.
const gchar * mirage_writer_get_parameter_string (MirageWriter *self
,const gchar *id
);
Looks up the string parameter with specified id
from user-supplied
writer parameters and returns its value. If user did not supply the
parameter, its default value is returned instead.
void mirage_writer_info_copy (const MirageWriterInfo *info
,MirageWriterInfo *dest
);
Copies parser information from info
to dest
.
info |
a MirageWriterInfo to copy data from. |
[in] |
dest |
a MirageWriterInfo to copy data to. |
[in] |
void
mirage_writer_info_free (MirageWriterInfo *info
);
Frees the allocated fields in info
(but not the structure itself!).
GList *
mirage_writer_lookup_parameter_ids (MirageWriter *self
);
Retrieves the list of parameter ID strings from writer's parameter sheet. The IDs are ordered in the same way as they were inserted into the parameter sheet.
const MirageWriterParameter * mirage_writer_lookup_parameter_info (MirageWriter *self
,const gchar *id
);
Looks up the parameter with specified id
in writer's parameter sheet
and retrieves the parameter's information structure.
gboolean mirage_writer_open_image (MirageWriter *self
,MirageDisc *disc
,GHashTable *parameters
,GError **error
);
Initializes the image writer to start the writing process for disc
.
The latter should have set the image filename(s) and medium type, but
does not have to have disc layout (sessions, tracks) built yet.
void mirage_writer_set_conversion_progress_step (MirageWriter *self
,guint step
);
Sets conversion progress step. Setting step
to 0 disables conversion
progress reporting.
struct MirageWriterInfo { gchar *id; gchar *name; };
A structure containing writer information. It can be obtained with call to
mirage_writer_get_info()
.
struct MirageWriterParameter { gchar *name; gchar *description; GVariant *default_value; GVariant *enum_values; };
A structure encapsulating information about image writer parameters, using in writer's parameter sheet.
struct MirageWriter;
All the fields in the MirageWriter structure are private to the MirageWriter implementation and should never be accessed directly.
struct MirageWriterClass { MirageObjectClass parent_class; /* Class members */ gboolean (*open_image_impl) (MirageWriter *self, MirageDisc *disc, GError **error); MirageFragment *(*create_fragment) (MirageWriter *self, MirageTrack *track, MirageFragmentRole role, GError **error); gboolean (*finalize_image) (MirageWriter *self, MirageDisc *disc, GError **error); };
The class structure for the MirageWriter type.
“conversion-progress”
signalvoid user_function (MirageWriter *object, guint progress, gpointer user_data)
Emitted when the image conversion progress reaches a new progress mark.
object |
||
progress |
percentual image conversion progress |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last