RB.TrackTransferBatch

g GObject.GInterface GObject.GInterface RB.TaskProgress RB.TaskProgress GObject.GInterface->RB.TaskProgress GObject.Object GObject.Object RB.TrackTransferBatch RB.TrackTransferBatch GObject.Object->RB.TrackTransferBatch RB.TaskProgress->RB.TrackTransferBatch

Subclasses:

None

Methods

Inherited:

GObject.Object (37), RB.TaskProgress (1)

Structs:

GObject.ObjectClass (5)

class

new (target, settings, source, destination, queue)

add (entry)

cancel ()

check_profiles (error_count)

Virtual Methods

Inherited:

GObject.Object (7), RB.TaskProgress (1)

do_cancelled ()

do_complete ()

do_get_dest_uri (entry, mediatype, extension)

do_overwrite_prompt (dest_file)

do_started ()

do_track_done (entry, dest, dest_size, mediatype, error)

do_track_postprocess (task, entry, dest, dest_size, mediatype)

do_track_prepare (task, entry, dest)

do_track_progress (entry, dest, done, total, fraction)

do_track_started (entry, dest)

Properties

Inherited:

RB.TaskProgress (6)

Name

Type

Flags

Short Description

destination

RB.Source

r/w/co

RB.Source to which the tracks are being transferred

done-entries

int

r

Number of entries already transferred

encoding-target

GstPbutils.EncodingTarget

r/w/c

GstPbutils.EncodingTarget

entry-list

int

r

list of all entries in the batch

progress

float

r

Fraction of the batch that has been transferred

queue

RB.TrackTransferQueue

r/w/co

RB.TrackTransferQueue instance

settings

Gio.Settings

r/w/co

Gio.Settings instance holding profile settings

source

RB.Source

r/w/co

RB.Source from which the tracks are being transferred

total-entries

int

r

Number of entries in the batch

Signals

Inherited:

GObject.Object (1)

Name

Short Description

cancelled

Emitted when the batch is cancelled.

complete

Emitted when the batch is complete.

get-dest-uri

The batch emits this to allow the creator to provide a destination URI for an entry being transferred.

overwrite-prompt

Emitted when the destination URI for a transfer already exists.

started

Emitted when the batch is started.

track-done

Emitted when a track transfer is complete, whether because the track was fully transferred, because an error occurred, or because the batch was cancelled (maybe..).

track-postprocess

Emitted when a track transfer is finishing, allowing signal handlers to perform any post-processing required.

track-prepare

Emitted when a track transfer is about to start, allowing signal handlers to perform any preparation required.

track-progress

Emitted regularly throughout the transfer to allow progress bars and other UI elements to be updated.

track-started

Emitted when a new entry is about to be transferred.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class RB.TrackTransferBatch(**kwargs)
Bases:

GObject.Object, RB.TaskProgress

Abstract:

No

Structure:

RB.TrackTransferBatchClass

classmethod new(target, settings, source, destination, queue)
Parameters:
Returns:

new RB.TrackTransferBatch object

Return type:

RB.TrackTransferBatch

Creates a new transfer batch with the specified encoding target. If no target is specified, the default target will be used with the user’s preferred encoding type.

One or more entries must be added to the batch (using RB.TrackTransferBatch.add) before the batch can be started (#rb_track_transfer_manager_start_batch).

add(entry)
Parameters:

entry (RB.RhythmDBEntry) – the source RB.RhythmDBEntry to transfer

Adds an entry to be transferred.

cancel()

Cancels the batch.

check_profiles(error_count)
Parameters:

error_count (int) – holds the number of entries that cannot be transferred on return

Returns:

True if some entries can be transferred without additional plugins

missing_plugin_profiles:

holds a GLib.List of GstPbutils.EncodingProfiles on return

Return type:

(bool, missing_plugin_profiles: [GstPbutils.EncodingProfile])

Checks that all entries in the batch can be transferred in a format supported by the destination. If no encoding profile is available for some entries, but installing additional plugins could make a profile available, a list of profiles that require additional plugins is returned.

do_cancelled() virtual
do_complete() virtual
do_get_dest_uri(entry, mediatype, extension) virtual
Parameters:
Return type:

str

do_overwrite_prompt(dest_file) virtual
Parameters:

dest_file (Gio.File) –

Return type:

bool

do_started() virtual
do_track_done(entry, dest, dest_size, mediatype, error) virtual
Parameters:
do_track_postprocess(task, entry, dest, dest_size, mediatype) virtual
Parameters:
do_track_prepare(task, entry, dest) virtual
Parameters:
do_track_progress(entry, dest, done, total, fraction) virtual
Parameters:
do_track_started(entry, dest) virtual
Parameters:

Signal Details

RB.TrackTransferBatch.signals.cancelled(track_transfer_batch)
Signal Name:

cancelled

Flags:

RUN_LAST

Parameters:

track_transfer_batch (RB.TrackTransferBatch) – The object which received the signal

Emitted when the batch is cancelled.

hmm. will ‘complete’ still be emitted in this case?

RB.TrackTransferBatch.signals.complete(track_transfer_batch)
Signal Name:

complete

Flags:

RUN_LAST

Parameters:

track_transfer_batch (RB.TrackTransferBatch) – The object which received the signal

Emitted when the batch is complete. This will be immediately after the final entry transfer is complete.

RB.TrackTransferBatch.signals.get_dest_uri(track_transfer_batch, entry, mediatype, extension)
Signal Name:

get-dest-uri

Flags:

RUN_LAST

Parameters:
Return type:

str

The batch emits this to allow the creator to provide a destination URI for an entry being transferred. This is emitted after the output media type is decided, so the usual extension for the media type can be taken into consideration.

RB.TrackTransferBatch.signals.overwrite_prompt(track_transfer_batch, uri)
Signal Name:

overwrite-prompt

Flags:

RUN_LAST

Parameters:
  • track_transfer_batch (RB.TrackTransferBatch) – The object which received the signal

  • uri (str) – the destination URI that already exists

Emitted when the destination URI for a transfer already exists. The handler must call _rb_track_transfer_batch_continue or _rb_track_transfer_batch_cancel when it has figured out what to do.

RB.TrackTransferBatch.signals.started(track_transfer_batch)
Signal Name:

started

Flags:

RUN_LAST

Parameters:

track_transfer_batch (RB.TrackTransferBatch) – The object which received the signal

Emitted when the batch is started. This will be after all previous batches have finished, which is not necessarily when #rb_track_transfer_manager_start_batch is called.

RB.TrackTransferBatch.signals.track_done(track_transfer_batch, entry, dest, dest_size, dest_mediatype, error)
Signal Name:

track-done

Flags:

RUN_LAST

Parameters:
  • track_transfer_batch (RB.TrackTransferBatch) – The object which received the signal

  • entry (RB.RhythmDBEntry) – the RB.RhythmDBEntry that was transferred

  • dest (str) – the destination URI for the transfer

  • dest_size (int) – size of the destination file

  • dest_mediatype (str) – the media type of the destination file

  • error (object or None) – any error that occurred during transfer

Emitted when a track transfer is complete, whether because the track was fully transferred, because an error occurred, or because the batch was cancelled (maybe..).

RB.TrackTransferBatch.signals.track_postprocess(track_transfer_batch, task, entry, dest, dest_size, dest_mediatype)
Signal Name:

track-postprocess

Flags:

RUN_LAST

Parameters:

Emitted when a track transfer is finishing, allowing signal handlers to perform any post-processing required. The signal is emitted on the task thread, so no UI interaction is possible

Use Gio.Task.return_error() with the provided Gio.Task to report errors.

RB.TrackTransferBatch.signals.track_prepare(track_transfer_batch, task, entry, dest)
Signal Name:

track-prepare

Flags:

RUN_LAST

Parameters:

Emitted when a track transfer is about to start, allowing signal handlers to perform any preparation required. The signal is emitted on the task thread, so no UI interaction is possible.

Use Gio.Task.return_error() with the provided Gio.Task to report errors.

RB.TrackTransferBatch.signals.track_progress(track_transfer_batch, entry, dest, done, total, fraction)
Signal Name:

track-progress

Flags:

RUN_LAST

Parameters:
  • track_transfer_batch (RB.TrackTransferBatch) – The object which received the signal

  • entry (RB.RhythmDBEntry) – the RB.RhythmDBEntry being transferred

  • dest (str) – the destination URI for the transfer

  • done (int) – some measure of how much of the transfer is done

  • total (int) – the total amount of that same measure

  • fraction (float) – the fraction of the transfer that is done

Emitted regularly throughout the transfer to allow progress bars and other UI elements to be updated.

RB.TrackTransferBatch.signals.track_started(track_transfer_batch, entry, dest)
Signal Name:

track-started

Flags:

RUN_LAST

Parameters:

Emitted when a new entry is about to be transferred. This will be emitted for each entry in the batch, unless the batch is cancelled.

Property Details

RB.TrackTransferBatch.props.destination
Name:

destination

Type:

RB.Source

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The RB.Source to which the tracks are being transferred.

RB.TrackTransferBatch.props.done_entries
Name:

done-entries

Type:

int

Default Value:

0

Flags:

READABLE

Number of entries in the batch that have been transferred.

RB.TrackTransferBatch.props.encoding_target
Name:

encoding-target

Type:

GstPbutils.EncodingTarget

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

A GstPbutils.EncodingTarget describing allowable target formats. If None, the default set of profiles will be used.

RB.TrackTransferBatch.props.entry_list
Name:

entry-list

Type:

int

Default Value:

None

Flags:

READABLE

A list of all entries in the batch.

RB.TrackTransferBatch.props.progress
Name:

progress

Type:

float

Default Value:

0.0

Flags:

READABLE

Fraction of the transfer batch that has been processed.

RB.TrackTransferBatch.props.queue
Name:

queue

Type:

RB.TrackTransferQueue

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The RB.TrackTransferQueue instance

RB.TrackTransferBatch.props.settings
Name:

settings

Type:

Gio.Settings

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Gio.Settings instance holding profile preferences

RB.TrackTransferBatch.props.source
Name:

source

Type:

RB.Source

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The RB.Source from which the tracks are being transferred.

RB.TrackTransferBatch.props.total_entries
Name:

total-entries

Type:

int

Default Value:

0

Flags:

READABLE

Total number of entries in the transfer batch.