| Rhythmbox Development Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | Signals | ||||
RBTrackTransferBatch; RBTrackTransferBatchClass; RBTrackTransferBatch * rb_track_transfer_batch_new (GList *media_type_list,const char * const *media_types,RBSource *source,RBSource *destination); void rb_track_transfer_batch_add (RBTrackTransferBatch *batch,RhythmDBEntry *entry);
"destination" RBSource* : Read / Write / Construct Only "done-entries" gint : Read "media-types" gpointer : Write / Construct Only "media-types-strv" GStrv* : Read / Write / Construct Only "progress" gdouble : Read "source" RBSource* : Read / Write / Construct Only "total-entries" gint : Read
"cancelled" : Run Last "complete" : Run Last "get-dest-uri" : Run Last "overwrite-prompt" : Run Last "started" : Run Last "track-done" : Run Last "track-progress" : Run Last "track-started" : Run Last
Manages the transfer of a set of tracks (using RBEncoder), providing overall status information and allowing the transfer to be cancelled as a single unit.
typedef struct {
GObjectClass parent_class;
/* signals */
void (*started) (RBTrackTransferBatch *batch);
void (*cancelled) (RBTrackTransferBatch *batch);
void (*complete) (RBTrackTransferBatch *batch);
char * (*get_dest_uri) (RBTrackTransferBatch *batch,
RhythmDBEntry *entry,
const char *mediatype,
const char *extension);
gboolean (*overwrite_prompt) (RBTrackTransferBatch *batch,
GFile *dest_file);
void (*track_started) (RBTrackTransferBatch *batch,
RhythmDBEntry *entry,
const char *dest);
void (*track_progress) (RBTrackTransferBatch *batch,
RhythmDBEntry *entry,
const char *dest,
int done,
int total,
double fraction);
void (*track_done) (RBTrackTransferBatch *batch,
RhythmDBEntry *entry,
const char *dest,
guint64 dest_size,
GError *error);
} RBTrackTransferBatchClass;
RBTrackTransferBatch * rb_track_transfer_batch_new (GList *media_type_list,const char * const *media_types,RBSource *source,RBSource *destination);
Creates a new transfer batch with the specified output types. Only one of media_types and media_types_list may be specified.
One or more entries must be added to the batch (using rb_track_transfer_batch_add) before the batch can be started (rb_track_transfer_manager_start_batch).
|
GList containing media type strings. |
|
array containing media type strings describing allowable output formats |
|
the RBSource from which the entries are to be transferred |
|
the RBSource to which the entries are to be transferred |
Returns : |
new RBTrackTransferBatch object |
void rb_track_transfer_batch_add (RBTrackTransferBatch *batch,RhythmDBEntry *entry);
Adds an entry to be transferred.
|
a RBTrackTransferBatch |
|
the source RhythmDBEntry to transfer |
"destination" property"destination" RBSource* : Read / Write / Construct Only
The RBSource to which the tracks are being transferred.
"done-entries" property"done-entries" gint : Read
Number of entries in the batch that have been transferred.
Allowed values: >= 0
Default value: 0
"media-types" property"media-types" gpointer : Write / Construct Only
GList of media type strings describing the acceptable destination formats. If NULL, no format conversion will be done.
"media-types-strv" property"media-types-strv" GStrv* : Read / Write / Construct Only
Set of allowable destination media types.
"progress" property"progress" gdouble : Read
Fraction of the transfer batch that has been processed.
Allowed values: [0,1]
Default value: 0
"source" property"source" RBSource* : Read / Write / Construct Only
The RBSource from which the tracks are being transferred.
"total-entries" property"total-entries" gint : Read
Total number of entries in the transfer batch.
Allowed values: >= 0
Default value: 0
"cancelled" signalvoid user_function (RBTrackTransferBatch *batch, gpointer user_data) : Run Last
Emitted when the batch is cancelled.
hmm. will 'complete' still be emitted in this case?
|
the RBTrackTransferBatch |
|
user data set when the signal handler was connected. |
"complete" signalvoid user_function (RBTrackTransferBatch *batch, gpointer user_data) : Run Last
Emitted when the batch is complete. This will be immediately after the final entry transfer is complete.
|
the RBTrackTransferBatch |
|
user data set when the signal handler was connected. |
"get-dest-uri" signalgchar* user_function (RBTrackTransferBatch *batch, RhythmDBEntry *entry, gchar *mediatype, gchar *extension, gpointer user_data) : Run Last
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.
|
the RBTrackTransferBatch |
|
the RhythmDBEntry to be transferred |
|
the destination media type for the transfer |
|
usual extension for the destionation media type |
|
user data set when the signal handler was connected. |
"overwrite-prompt" signalgboolean user_function (RBTrackTransferBatch *batch, GFile *file, gpointer user_data) : Run Last
Emitted when the destination URI for a transfer already exists. If a handler returns TRUE, the file will be overwritten, otherwise the transfer will be skipped.
|
the RBTrackTransferBatch |
|
the GFile that may be overwritten |
|
user data set when the signal handler was connected. |
"started" signalvoid user_function (RBTrackTransferBatch *batch, gpointer user_data) : Run Last
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.
|
the RBTrackTransferBatch |
|
user data set when the signal handler was connected. |
"track-done" signalvoid user_function (RBTrackTransferBatch *batch, RhythmDBEntry *entry, gchar *dest, guint64 dest_size, gchar *dest_mediatype, gpointer error, gpointer user_data) : Run Last
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..).
|
the RBTrackTransferBatch |
|
the RhythmDBEntry that was transferred |
|
the destination URI for the transfer |
|
size of the destination file |
|
the media type of the destination file |
|
any error that occurred during transfer |
|
user data set when the signal handler was connected. |
"track-progress" signalvoid user_function (RBTrackTransferBatch *batch, RhythmDBEntry *entry, gchar *dest, gint done, gint total, gdouble fraction, gpointer user_data) : Run Last
Emitted regularly throughout the transfer to allow progress bars and other UI elements to be updated.
|
the RBTrackTransferBatch |
|
the RhythmDBEntry being transferred |
|
the destination URI for the transfer |
|
some measure of how much of the transfer is done |
|
the total amount of that same measure |
|
the fraction of the transfer that is done |
|
user data set when the signal handler was connected. |
"track-started" signalvoid user_function (RBTrackTransferBatch *batch, RhythmDBEntry *entry, gchar *dest, gpointer user_data) : Run Last
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.
|
the RBTrackTransferBatch |
|
the RhythmDBEntry being transferred |
|
the destination URI for the transfer |
|
user data set when the signal handler was connected. |