Mirage.Writer

g GObject.GInterface GObject.GInterface Mirage.Contextual Mirage.Contextual GObject.GInterface->Mirage.Contextual GObject.Object GObject.Object Mirage.Object Mirage.Object GObject.Object->Mirage.Object Mirage.Contextual->Mirage.Object Mirage.Writer Mirage.Writer Mirage.Object->Mirage.Writer

Subclasses:

None

Methods

Inherited:

Mirage.Object (2), GObject.Object (37), Mirage.Contextual (8)

Structs:

GObject.ObjectClass (5)

add_parameter_boolean (id, name, description, default_value)

add_parameter_int (id, name, description, default_value)

add_parameter_string (id, name, description, default_value)

convert_image (filename, original_disc, parameters, cancellable)

create_fragment (track, role)

finalize_image (disc)

generate_info (id, name)

get_conversion_progress_step ()

get_info ()

get_parameter_boolean (id)

get_parameter_enum (id)

get_parameter_int (id)

get_parameter_string (id)

lookup_parameter_ids ()

lookup_parameter_info (id)

open_image (disc, parameters)

set_conversion_progress_step (step)

Virtual Methods

Inherited:

GObject.Object (7), Mirage.Contextual (2)

do_create_fragment (track, role)

do_finalize_image (disc)

do_open_image_impl (disc)

Properties

None

Signals

Inherited:

Mirage.Object (1), GObject.Object (1)

Name

Short Description

conversion-progress

Emitted when the image conversion progress reaches a new progress mark.

Fields

Inherited:

Mirage.Object (1), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Mirage.Object

r

Class Details

class Mirage.Writer(**kwargs)
Bases:

Mirage.Object

Abstract:

Yes

Structure:

Mirage.WriterClass

All the fields in the Mirage.Writer structure are private to the Mirage.Writer implementation and should never be accessed directly.

add_parameter_boolean(id, name, description, default_value)
Parameters:
  • id (str) – parameter ID

  • name (str) – parameter name

  • description (str) – parameter description

  • default_value (bool) – default value

Adds a boolean parameter to writer’s parameter sheet.

add_parameter_int(id, name, description, default_value)
Parameters:
  • id (str) – parameter ID

  • name (str) – parameter name

  • description (str) – parameter description

  • default_value (int) – default value

Adds an integer parameter to writer’s parameter sheet.

add_parameter_string(id, name, description, default_value)
Parameters:
  • id (str) – parameter ID

  • name (str) – parameter name

  • description (str) – parameter description

  • default_value (str) – default value

Adds a string parameter to writer’s parameter sheet.

convert_image(filename, original_disc, parameters, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on failure

Return type:

bool

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 Mirage.Writer ::conversion-progress signal is emitted at specified time intervals during conversion.

create_fragment(track, role)
Parameters:
Raises:

GLib.Error

Returns:

pointer to created fragment object on success, None on failure

Return type:

Mirage.Fragment

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.

finalize_image(disc)
Parameters:

disc (Mirage.Disc) – disc object for which the image is being written

Raises:

GLib.Error

Returns:

True on success, False on failure

Return type:

bool

Finalizes the image, possibly creating the image descriptor file if necessary.

generate_info(id, name)
Parameters:
  • id (str) – writer ID

  • name (str) – writer name

Generates writer information from the input fields. It is intended as a function for creating writer information in writer implementations.

get_conversion_progress_step()
Returns:

the value of conversion progress step.

Return type:

int

Retrieves conversion progress step setting.

get_info()
Returns:

a pointer to writer information structure. The structure belongs to object and should not be modified.

Return type:

Mirage.WriterInfo

Retrieves writer information.

get_parameter_boolean(id)
Parameters:

id (str) – parameter ID string

Returns:

user-supplied parameter value.

Return type:

bool

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.

get_parameter_enum(id)
Parameters:

id (str) – parameter ID string

Returns:

user-supplied parameter value.

Return type:

str

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.

get_parameter_int(id)
Parameters:

id (str) – parameter ID string

Returns:

user-supplied parameter value.

Return type:

int

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.

get_parameter_string(id)
Parameters:

id (str) – parameter ID string

Returns:

user-supplied parameter value.

Return type:

str

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.

lookup_parameter_ids()
Returns:

the list of parameter IDs. The list and its elements belong to the writer and should not be modified.

Return type:

[str]

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.

lookup_parameter_info(id)
Parameters:

id (str) – parameter ID string

Returns:

the pointer to parameter’s information structure on success, None on failure. The information structure belong to the writer and should not be modified.

Return type:

Mirage.WriterParameter

Looks up the parameter with specified id in writer’s parameter sheet and retrieves the parameter’s information structure.

open_image(disc, parameters)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on failure

Return type:

bool

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.

set_conversion_progress_step(step)
Parameters:

step (int) – new conversion progress step value

Sets conversion progress step. Setting step to 0 disables conversion progress reporting.

do_create_fragment(track, role) virtual
Parameters:
Returns:

pointer to created fragment object on success, None on failure

Return type:

Mirage.Fragment

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.

do_finalize_image(disc) virtual
Parameters:

disc (Mirage.Disc) – disc object for which the image is being written

Returns:

True on success, False on failure

Return type:

bool

Finalizes the image, possibly creating the image descriptor file if necessary.

do_open_image_impl(disc) virtual
Parameters:

disc (Mirage.Disc) –

Return type:

bool

initializes writer on specified image

Signal Details

Mirage.Writer.signals.conversion_progress(writer, progress)
Signal Name:

conversion-progress

Flags:

RUN_LAST

Parameters:
  • writer (Mirage.Writer) – The object which received the signal

  • progress (int) – percentual image conversion progress

Emitted when the image conversion progress reaches a new progress mark.