![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
RBEncoder; struct RBEncoderIface; RBEncoder * rb_encoder_new (void
); void rb_encoder_encode (RBEncoder *encoder
,RhythmDBEntry *entry
,const char *dest
,GstEncodingProfile *profile
); void rb_encoder_cancel (RBEncoder *encoder
); gboolean rb_encoder_get_missing_plugins (RBEncoder *encoder
,GstEncodingProfile *profile
,char ***details
,char ***descriptions
);
The RBEncoder interface provides transcoding between audio formats based on encoding profiles. The encoder implementation operates asynchronously and provides status updates in the form of signals emitted on the main thread. A new encoder instance should be created for each file that is transcoded or copied.
struct RBEncoderIface { GTypeInterface g_iface; /* vtable */ void (*encode) (RBEncoder *encoder, RhythmDBEntry *entry, const char *dest, GstEncodingProfile *profile); void (*cancel) (RBEncoder *encoder); gboolean (*get_missing_plugins) (RBEncoder *encoder, GstEncodingProfile *profile, char ***details, char ***descriptions); /* signals */ void (*progress) (RBEncoder *encoder, double fraction); gboolean (*overwrite) (RBEncoder *encoder, GFile *file); void (*completed) (RBEncoder *encoder, guint64 dest_size, const char *mediatype, GError *error); };
RBEncoder * rb_encoder_new (void
);
Creates a new RBEncoder instance.
Returns : |
the new RBEncoder. [transfer full] |
void rb_encoder_encode (RBEncoder *encoder
,RhythmDBEntry *entry
,const char *dest
,GstEncodingProfile *profile
);
Initiates encoding, transcoding to the specified profile if specified.
Encoding and error reporting takes place asynchronously. The caller should wait for the 'completed' signal which indicates it has either completed or failed.
|
the RBEncoder |
|
the RhythmDBEntry to transcode |
|
destination file URI |
|
encoding profile to use, or NULL to just copy |
void rb_encoder_cancel (RBEncoder *encoder
);
Attempts to cancel any in progress encoding. The encoder should delete the destination file, if it created one, and emit the 'completed' signal.
|
a RBEncoder |
gboolean rb_encoder_get_missing_plugins (RBEncoder *encoder
,GstEncodingProfile *profile
,char ***details
,char ***descriptions
);
Retrieves the plugin installer detail strings and descriptions for any missing plugins required to use the specified encoding profile.
"completed"
signalvoid user_function (RBEncoder *encoder,
guint64 dest_size,
gchar *mediatype,
gpointer error,
gpointer user_data) : Run Last
Emitted when the encoding process is complete, or when a fatal error has occurred. The destination file, if one exists, will be closed and flushed to disk before this signal is emitted.
|
the RBEncoder instance |
|
size of the output file |
|
output media type |
|
encoding error, or NULL if successful |
|
user data set when the signal handler was connected. |
"overwrite"
signalgboolean user_function (RBEncoder *encoder,
GObject *file,
gpointer user_data) : Run Last
Emitted when a destination file already exists. If the
return value if TRUE
, the file will be overwritten, otherwise
the transfer will be aborted.
|
the RBEncoder instance |
|
the GFile that may be overwritten |
|
user data set when the signal handler was connected. |
"progress"
signalvoid user_function (RBEncoder *encoder,
gdouble fraction,
gpointer user_data) : Run Last
Emitted regularly during the encoding process to provide progress updates.
|
the RBEncoder instance |
|
progress as a fraction (0..1) |
|
user data set when the signal handler was connected. |