RB.TrackTransferBatch¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|
||
r |
Number of entries already transferred |
||
r/w/c |
|||
r |
list of all entries in the batch |
||
r |
Fraction of the batch that has been transferred |
||
r/w/co |
|
||
r/w/co |
|
||
r/w/co |
|
||
r |
Number of entries in the batch |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the batch is cancelled. |
|
Emitted when the batch is complete. |
|
The batch emits this to allow the creator to provide a destination URI for an entry being transferred. |
|
Emitted when the destination URI for a transfer already exists. |
|
Emitted when the batch is started. |
|
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..). |
|
Emitted when a track transfer is finishing, allowing signal handlers to perform any post-processing required. |
|
Emitted when a track transfer is about to start, allowing signal handlers to perform any preparation required. |
|
Emitted regularly throughout the transfer to allow progress bars and other UI elements to be updated. |
|
Emitted when a new entry is about to be transferred. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class RB.TrackTransferBatch(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(target, settings, source, destination, queue)¶
- Parameters:
target (
GstPbutils.EncodingTarget
) – aGstPbutils.EncodingTarget
describing allowable encodings (orNone
for defaults)settings (
Gio.Settings
) –source (
GObject.Object
) – theRB.Source
from which the entries are to be transferreddestination (
GObject.Object
) – theRB.Source
to which the entries are to be transferredqueue (
GObject.Object
) – theRB.TrackTransferQueue
instance
- Returns:
new
RB.TrackTransferBatch
object- Return type:
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 sourceRB.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
ofGstPbutils.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:
entry (
RB.RhythmDBEntry
) –mediatype (
str
) –extension (
str
) –
- Return type:
- do_started() virtual¶
- do_track_done(entry, dest, dest_size, mediatype, error) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –dest (
str
) –dest_size (
int
) –mediatype (
str
) –error (
GLib.Error
) –
- do_track_postprocess(task, entry, dest, dest_size, mediatype) virtual¶
- Parameters:
task (
Gio.Task
) –entry (
RB.RhythmDBEntry
) –dest (
str
) –dest_size (
int
) –mediatype (
str
) –
- do_track_prepare(task, entry, dest) virtual¶
- Parameters:
task (
Gio.Task
) –entry (
RB.RhythmDBEntry
) –dest (
str
) –
- do_track_progress(entry, dest, done, total, fraction) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –dest (
str
) –done (
int
) –total (
int
) –fraction (
float
) –
- do_track_started(entry, dest) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –dest (
str
) –
Signal Details¶
- RB.TrackTransferBatch.signals.cancelled(track_transfer_batch)¶
- Signal Name:
cancelled
- Flags:
- 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:
- 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:
- Parameters:
track_transfer_batch (
RB.TrackTransferBatch
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
to be transferredmediatype (
str
) – the destination media type for the transferextension (
str
) – usual extension for the destionation media type
- Return type:
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:
- Parameters:
track_transfer_batch (
RB.TrackTransferBatch
) – The object which received the signaluri (
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:
- 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:
- Parameters:
track_transfer_batch (
RB.TrackTransferBatch
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that was transferreddest (
str
) – the destination URI for the transferdest_size (
int
) – size of the destination filedest_mediatype (
str
) – the media type of the destination fileerror (
object
orNone
) – 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:
- Parameters:
track_transfer_batch (
RB.TrackTransferBatch
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
being transferreddest (
str
) – the destination URI for the transferdest_size (
int
) – the size of the destination filedest_mediatype (
str
) – the media type of the destination file
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 providedGio.Task
to report errors.
- RB.TrackTransferBatch.signals.track_prepare(track_transfer_batch, task, entry, dest)¶
- Signal Name:
track-prepare
- Flags:
- Parameters:
track_transfer_batch (
RB.TrackTransferBatch
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
being transferreddest (
str
) – the destination URI for the transfer
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 providedGio.Task
to report errors.
- RB.TrackTransferBatch.signals.track_progress(track_transfer_batch, entry, dest, done, total, fraction)¶
- Signal Name:
track-progress
- Flags:
- Parameters:
track_transfer_batch (
RB.TrackTransferBatch
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
being transferreddest (
str
) – the destination URI for the transferdone (
int
) – some measure of how much of the transfer is donetotal (
int
) – the total amount of that same measurefraction (
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:
- Parameters:
track_transfer_batch (
RB.TrackTransferBatch
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
being transferreddest (
str
) – the destination URI for the transfer
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:
- Default Value:
- Flags:
The
RB.Source
to which the tracks are being transferred.
- RB.TrackTransferBatch.props.done_entries¶
-
Number of entries in the batch that have been transferred.
- RB.TrackTransferBatch.props.encoding_target¶
- Name:
encoding-target
- Type:
- Default Value:
- Flags:
A
GstPbutils.EncodingTarget
describing allowable target formats. IfNone
, the default set of profiles will be used.
- RB.TrackTransferBatch.props.entry_list¶
-
A list of all entries in the batch.
- RB.TrackTransferBatch.props.progress¶
-
Fraction of the transfer batch that has been processed.
- RB.TrackTransferBatch.props.queue¶
- Name:
queue
- Type:
- Default Value:
- Flags:
The
RB.TrackTransferQueue
instance
- RB.TrackTransferBatch.props.settings¶
- Name:
settings
- Type:
- Default Value:
- Flags:
Gio.Settings
instance holding profile preferences