![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
RBRemovableMediaSource; RBRemovableMediaSourceClass; char* rb_removable_media_source_build_dest_uri (RBRemovableMediaSource *source, RhythmDBEntry *entry, const char *mimetype, const char *extension); void rb_removable_media_source_track_added (RBRemovableMediaSource *source, RhythmDBEntry *entry, const char *uri, guint64 filesize, const char *mimetype); void rb_removable_media_source_track_add_error (RBRemovableMediaSource *source, RhythmDBEntry *entry, const char *uri, GError *error); GList * rb_removable_media_source_get_mime_types (RBRemovableMediaSource *source); GList * rb_removable_media_source_get_format_descriptions (RBRemovableMediaSource *source); gboolean rb_removable_media_source_should_paste (RBRemovableMediaSource *source, RhythmDBEntry *entry); gboolean rb_removable_media_source_should_paste_no_duplicate (RBRemovableMediaSource *source, RhythmDBEntry *entry);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBox +----GtkHBox +----RBSource +----RBBrowserSource +----RBRemovableMediaSource
RBRemovableMediaSource implements AtkImplementorIface, GtkBuildable and GtkOrientable.
"mount" GMount* : Read / Write / Construct Only "volume" GVolume* : Read / Write / Construct Only
This class provides support for transferring (and transcoding) entries to the device using drag and drop or cut and paste. The implementation must at minimum provide methods for returning a list of supported media types, and for constructing destination URIs for transfers.
typedef struct { RBBrowserSourceClass parent; char* (*impl_build_dest_uri) (RBRemovableMediaSource *source, RhythmDBEntry *entry, const char *mimetype, const char *extension); GList* (*impl_get_mime_types) (RBRemovableMediaSource *source); gboolean (*impl_track_added) (RBRemovableMediaSource *source, RhythmDBEntry *entry, const char *uri, guint64 dest_size, const char *mimetype); gboolean (*impl_track_add_error) (RBRemovableMediaSource *source, RhythmDBEntry *entry, const char *uri, GError *error); gboolean (*impl_should_paste) (RBRemovableMediaSource *source, RhythmDBEntry *entry); } RBRemovableMediaSourceClass;
char* rb_removable_media_source_build_dest_uri (RBRemovableMediaSource *source, RhythmDBEntry *entry, const char *mimetype, const char *extension);
Constructs a URI to use as the destination for a transfer or transcoding operation. The URI may be on the device itself, if the device is mounted into the normal filesystem or through gvfs, or it may be a temporary location used to store the file before uploading it to the device.
The destination URI should conform to the device's normal URI format, and should use the provided extension instead of the extension from the source entry.
|
an RBRemovableMediaSource |
|
the RhythmDBEntry to build a URI for |
|
destination media type |
|
extension associated with destination media type |
Returns : |
constructed URI |
void rb_removable_media_source_track_added (RBRemovableMediaSource *source, RhythmDBEntry *entry, const char *uri, guint64 filesize, const char *mimetype);
This is called when a transfer to the device has completed.
If the source's impl_track_added method returns TRUE
, the destination
URI will be added to the database using the entry type for the device.
If the source uses a temporary area as the destination for transfers,
it can instead upload the destination file to the device and create an
entry for it, then return FALSE
.
|
an RBRemovableMediaSource |
|
the source RhythmDBEntry for the transfer |
|
the destination URI |
|
size of the destination file |
|
media type of the destination file |
void rb_removable_media_source_track_add_error (RBRemovableMediaSource *source, RhythmDBEntry *entry, const char *uri, GError *error);
This is called when a transfer fails. If the source's
impl_track_add_error implementation returns TRUE
, an error dialog
will be displayed to the user containing the error message, unless
the error indicates that the destination file already exists.
|
an RBRemovableMediaSource |
|
the source RhythmDBEntry for the transfer |
|
the destination URI |
|
the transfer error information |
GList * rb_removable_media_source_get_mime_types (RBRemovableMediaSource *source);
Returns a GList of allocated media type strings describing the formats supported by the device. If possible, these should be sorted in order of preference, as the first entry in the list for which an encoder is available will be used.
Common media types include "audio/mpeg" for MP3, "application/ogg" for Ogg Vorbis, "audio/x-flac" for FLAC, and "audio/x-aac" for MP4/AAC.
|
an RBRemovableMediaSource |
Returns : |
list of media types |
GList * rb_removable_media_source_get_format_descriptions (RBRemovableMediaSource *source);
Returns a GList of allocated media format descriptions for the formats supported by the device. The list and the strings it holds must be freed by the caller.
|
a RBRemovableMediaSource |
Returns : |
list of descriptions. |
gboolean rb_removable_media_source_should_paste (RBRemovableMediaSource *source, RhythmDBEntry *entry);
Checks whether entry
should be transferred to the device.
The source can check whether a matching entry already exists on the device,
for instance. See rb_removable_media_source_should_paste_no_duplicate
a useful implementation.
|
an RBRemovableMediaSource |
|
a RhythmDBEntry to consider pasting |
Returns : |
TRUE if the entry should be transferred to the device
|
gboolean rb_removable_media_source_should_paste_no_duplicate (RBRemovableMediaSource *source, RhythmDBEntry *entry);
This implementation of rb_removable_media_should_paste checks for an existing entry on the device that matches the title, album, artist, and track number of the entry being considered.
|
an RBRemovableMediaSource |
|
a RhythmDBEntry to consider pasting |
Returns : |
TRUE if the entry should be transferred to the device.
|