本文整理汇总了C++中rhythmdb_entry_get_string函数的典型用法代码示例。如果您正苦于以下问题:C++ rhythmdb_entry_get_string函数的具体用法?C++ rhythmdb_entry_get_string怎么用?C++ rhythmdb_entry_get_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rhythmdb_entry_get_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: playing_song_changed_cb
static void
playing_song_changed_cb (RBShellPlayer *player, RhythmDBEntry *entry, RBGriloPlugin *plugin)
{
const char *uri;
RhythmDBEntryType *entry_type;
RBGriloEntryData *data;
if (entry == NULL)
return;
entry_type = rhythmdb_entry_get_entry_type (entry);
if (RB_IS_GRILO_ENTRY_TYPE (entry_type) == FALSE) {
return;
}
data = RHYTHMDB_ENTRY_GET_TYPE_DATA (entry, RBGriloEntryData);
uri = grl_data_get_string (data->grilo_data, GRL_METADATA_KEY_THUMBNAIL);
if (uri != NULL) {
RBExtDBKey *key;
key = rb_ext_db_key_create_storage ("album", rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ALBUM));
rb_ext_db_key_add_field (key, "artist", rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ARTIST));
rb_ext_db_store_uri (plugin->art_store,
key,
RB_EXT_DB_SOURCE_SEARCH,
uri);
rb_ext_db_key_free (key);
}
}
示例2: entry_added_cb
static void
entry_added_cb (RhythmDB *db,
RhythmDBEntry *entry,
RhythmDBImportJob *job)
{
const char *uri;
gboolean ours;
uri = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION);
g_mutex_lock (&job->priv->lock);
ours = g_hash_table_remove (job->priv->outstanding, uri);
if (ours) {
const char *details;
job->priv->imported++;
rb_debug ("got entry %s; %d now imported", uri, job->priv->imported);
g_signal_emit (job, signals[ENTRY_ADDED], 0, entry);
/* if it's an import error with missing plugins, add it to the retry list */
details = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_COMMENT);
if (rhythmdb_entry_get_entry_type (entry) == job->priv->error_type &&
(details != NULL && details[0] != '\0')) {
rb_debug ("entry %s is an import error with missing plugin details: %s", uri, details);
job->priv->retry_entries = g_slist_prepend (job->priv->retry_entries, rhythmdb_entry_ref (entry));
}
if (job->priv->status_changed_id == 0) {
job->priv->status_changed_id = g_idle_add ((GSourceFunc) emit_status_changed, job);
}
}
g_mutex_unlock (&job->priv->lock);
}
示例3: START_TEST
END_TEST
START_TEST (test_rhythmdb_podcast_upgrade)
{
RhythmDBEntry *entry;
const char *mountpoint;
/* load db with old podcasts setups */
g_object_set (G_OBJECT (db), "name", SHARE_UNINSTALLED_DIR "/../tests/podcast-upgrade.xml", NULL);
set_waiting_signal (G_OBJECT (db), "load-complete");
rhythmdb_load (db);
wait_for_signal ();
entry = rhythmdb_entry_lookup_by_location (db, "file:///home/tester/Desktop/BBC%20Xtra/xtra_20080906-1226a.mp3");
fail_unless (entry != NULL, "entry missing");
fail_unless (rhythmdb_entry_get_entry_type (entry) == RHYTHMDB_ENTRY_TYPE_PODCAST_POST, "entry isn't a podcast");
mountpoint = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MOUNTPOINT);
fail_unless (mountpoint != NULL, "no mountpoint for podcast");
fail_unless (strcmp (mountpoint, "http://downloads.bbc.co.uk/podcasts/worldservice/xtra/xtra_20080906-1226a.mp3") == 0, "wrong mountpoint for podcast");
entry = rhythmdb_entry_lookup_by_location (db, "http://downloads.bbc.co.uk/podcasts/worldservice/xtra/xtra_20080903-1217a.mp3");
fail_unless (entry != NULL, "entry not upgraded");
fail_unless (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MOUNTPOINT) == NULL, "wrong mountpoint for podcast");
}
示例4: entry_activated_cb
static void
entry_activated_cb (RBEntryView *entry_view, RhythmDBEntry *entry, RBImportDialog *dialog)
{
rb_debug ("import dialog entry %s activated", rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION));
rb_shell_load_uri (dialog->priv->shell,
rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION),
TRUE,
NULL);
}
示例5: MTP_SOURCE_GET_PRIVATE
static void
impl_delete_entries (RBMediaPlayerSource *source,
GList *entries,
RBMediaPlayerSourceDeleteCallback callback,
gpointer user_data,
GDestroyNotify destroy_data)
{
RBMtpSourcePrivate *priv = MTP_SOURCE_GET_PRIVATE (source);
RhythmDB *db;
GList *i;
TracksDeletedCallbackData *cb_data;
cb_data = g_new0 (TracksDeletedCallbackData, 1);
cb_data->source = g_object_ref (source);
cb_data->callback_data = user_data;
cb_data->callback = callback;
cb_data->destroy_data = destroy_data;
cb_data->check_folders = g_hash_table_new (g_direct_hash, g_direct_equal);
db = get_db_for_source (RB_MTP_SOURCE (source));
for (i = entries; i != NULL; i = i->next) {
LIBMTP_track_t *track;
const char *uri;
const char *album_name;
RhythmDBEntry *entry;
entry = i->data;
uri = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION);
track = g_hash_table_lookup (priv->entry_map, entry);
if (track == NULL) {
rb_debug ("Couldn't find track on mtp-device! (%s)", uri);
continue;
}
album_name = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ALBUM);
if (g_strcmp0 (album_name, _("Unknown")) != 0) {
rb_mtp_thread_remove_from_album (priv->device_thread, track, album_name);
}
rb_mtp_thread_delete_track (priv->device_thread, track);
g_hash_table_insert (cb_data->check_folders,
GUINT_TO_POINTER (track->parent_id),
GINT_TO_POINTER (1));
g_hash_table_remove (priv->entry_map, entry);
rhythmdb_entry_delete (db, entry);
}
/* callback when all tracks have been deleted */
rb_mtp_thread_queue_callback (priv->device_thread,
(RBMtpThreadCallback) delete_done_cb,
cb_data,
(GDestroyNotify) free_delete_data);
rhythmdb_commit (db);
}
示例6: rb_static_playlist_source_filter_entry_drop
static gboolean
rb_static_playlist_source_filter_entry_drop (RhythmDBQueryModel *model,
RhythmDBEntry *entry,
RBStaticPlaylistSource *source)
{
if (_rb_source_check_entry_type (RB_SOURCE (source), entry)) {
rb_debug ("allowing drop of entry %s", rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION));
return TRUE;
}
rb_debug ("preventing drop of entry %s", rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION));
return FALSE;
}
示例7: update_track_info
static void
update_track_info (MxLabel *label, RhythmDB *db, RhythmDBEntry *entry, const char *streaming_title)
{
const char *title;
ClutterActor *text;
GString *str;
text = mx_label_get_clutter_text (label);
str = g_string_sized_new (100);
if (entry == NULL) {
g_string_append_printf (str, "<big>%s</big>", _("Not Playing"));
} else {
title = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_TITLE);
if (streaming_title) {
str_append_printf_escaped (str, "<big>%s</big>\n", streaming_title);
str_append_printf_escaped (str, _("from <i>%s</i>"), title);
} else {
const char *artist_template = NULL;
const char *album_template = NULL;
const char *artist;
const char *album;
gboolean space = FALSE;
artist = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ARTIST);
album = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ALBUM);
get_artist_album_templates (artist, album, &artist_template, &album_template);
str_append_printf_escaped (str, "<big>%s</big>\n", title);
if (album != NULL && album[0] != '\0') {
str_append_printf_escaped (str, album_template, album);
space = TRUE;
}
if (artist != NULL && artist[0] != '\0') {
if (space) {
g_string_append_c (str, ' ');
}
str_append_printf_escaped (str, artist_template, artist);
}
}
}
/* tiny bit of extra padding */
g_string_append (str, " ");
clutter_text_set_markup (CLUTTER_TEXT (text), str->str);
clutter_text_set_ellipsize (CLUTTER_TEXT (text), PANGO_ELLIPSIZE_NONE);
g_string_free (str, TRUE);
}
示例8: impl_delete
static void
impl_delete (RBSource *source)
{
RBMtpSourcePrivate *priv = MTP_SOURCE_GET_PRIVATE (source);
GList *sel;
GList *tem;
RBEntryView *tracks;
RhythmDB *db;
int ret;
db = get_db_for_source (RB_MTP_SOURCE (source));
tracks = rb_source_get_entry_view (source);
sel = rb_entry_view_get_selected_entries (tracks);
for (tem = sel; tem != NULL; tem = tem->next) {
LIBMTP_track_t *track;
RhythmDBEntry *entry;
const char *uri;
const char *album_name;
entry = (RhythmDBEntry *)tem->data;
uri = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION);
track = g_hash_table_lookup (priv->entry_map, entry);
if (track == NULL) {
rb_debug ("Couldn't find track on mtp-device! (%s)", uri);
continue;
}
ret = LIBMTP_Delete_Object (priv->device, track->item_id);
if (ret != 0) {
rb_debug ("Delete track %d failed", track->item_id);
report_libmtp_errors (priv->device, TRUE);
continue;
}
album_name = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ALBUM);
if (strcmp (album_name, _("Unknown")) != 0) {
remove_track_from_album (RB_MTP_SOURCE (source), album_name, track);
}
g_hash_table_remove (priv->entry_map, entry);
rhythmdb_entry_delete (db, entry);
}
rhythmdb_commit (db);
g_list_free (sel);
g_list_free (tem);
}
示例9: impl_get_entries
static void
impl_get_entries (RBMediaPlayerSource *source,
const char *category,
GHashTable *map)
{
RhythmDBQueryModel *model;
GtkTreeIter iter;
gboolean podcast;
/* we don't have anything else to distinguish podcasts from regular
* tracks, so just use the genre.
*/
podcast = (g_str_equal (category, SYNC_CATEGORY_PODCAST));
g_object_get (source, "base-query-model", &model, NULL);
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter) == FALSE) {
g_object_unref (model);
return;
}
do {
RhythmDBEntry *entry;
const char *genre;
entry = rhythmdb_query_model_iter_to_entry (model, &iter);
genre = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_GENRE);
if (g_str_equal (genre, "Podcast") == podcast) {
_rb_media_player_source_add_to_map (map, entry);
}
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter));
g_object_unref (model);
}
示例10: impl_save_contents_to_xml
static void
impl_save_contents_to_xml (RBPlaylistSource *source,
xmlNodePtr node)
{
RBStaticPlaylistSourcePrivate *priv = RB_STATIC_PLAYLIST_SOURCE_GET_PRIVATE (source);
GtkTreeIter iter;
xmlSetProp (node, RB_PLAYLIST_TYPE, RB_PLAYLIST_STATIC);
if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->base_model), &iter))
return;
do {
xmlNodePtr child_node = xmlNewChild (node, NULL, RB_PLAYLIST_LOCATION, NULL);
RhythmDBEntry *entry;
xmlChar *encoded;
const char *location;
gtk_tree_model_get (GTK_TREE_MODEL (priv->base_model), &iter, 0, &entry, -1);
location = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION);
encoded = xmlEncodeEntitiesReentrant (NULL, BAD_CAST location);
xmlNodeSetContent (child_node, encoded);
g_free (encoded);
rhythmdb_entry_unref (entry);
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->base_model), &iter));
}
示例11: rb_mtp_source_get_playback_uri
static char *
rb_mtp_source_get_playback_uri (RhythmDBEntry *entry, gpointer data)
{
RBMtpSourcePrivate *priv;
LIBMTP_track_t *track;
char *path;
char *uri = NULL;
GError *error = NULL;
priv = MTP_SOURCE_GET_PRIVATE (data);
track = g_hash_table_lookup (priv->entry_map, entry);
path = g_strdup_printf ("%s/%s-%s",
g_get_tmp_dir (),
rhythmdb_entry_dup_string (entry, RHYTHMDB_PROP_ARTIST),
rhythmdb_entry_dup_string (entry, RHYTHMDB_PROP_TITLE));
uri = g_filename_to_uri (path, NULL, &error);
g_free (path);
if (error != NULL) {
g_warning ("unable to convert path %s to filename: %s", path, error->message);
g_error_free (error);
g_free (path);
return NULL;
}
if (rb_mtp_source_transfer_track_to_disk (priv->device, track, uri) == TRUE) {
rb_debug ("playback URI for %s: %s",
rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION),
uri);
return uri;
} else {
g_free (uri);
return NULL;
}
}
示例12: rb_source_gather_selected_properties
/**
* rb_source_gather_selected_properties:
* @source: a #RBSource
* @prop: property for which to gather selection
*
* Returns a list containing the values of the specified
* property from the selected entries in the source.
* This is used to implement the 'browse this artist' (etc.)
* actions.
*
* Return value: (element-type utf8) (transfer full): list of property values
*/
GList *
rb_source_gather_selected_properties (RBSource *source,
RhythmDBPropType prop)
{
RBEntryView *entryview;
GList *selected, *tem;
GHashTable *selected_set;
entryview = rb_source_get_entry_view (source);
if (entryview == NULL)
return NULL;
selected_set = g_hash_table_new (g_str_hash, g_str_equal);
selected = rb_entry_view_get_selected_entries (entryview);
for (tem = selected; tem; tem = tem->next) {
RhythmDBEntry *entry = tem->data;
char *val = g_strdup (rhythmdb_entry_get_string (entry, prop));
g_hash_table_insert (selected_set, val, NULL);
}
g_list_foreach (selected, (GFunc)rhythmdb_entry_unref, NULL);
g_list_free (selected);
tem = NULL;
g_hash_table_foreach (selected_set, (GHFunc) rb_source_gather_hash_keys,
&tem);
g_hash_table_destroy (selected_set);
return tem;
}
示例13: missing_plugins_retry_cb
static void
missing_plugins_retry_cb (gpointer instance, gboolean installed, RBImportErrorsSource *source)
{
GtkTreeIter iter;
RhythmDBEntryType *error_entry_type;
gtk_info_bar_set_response_sensitive (GTK_INFO_BAR (source->priv->infobar),
GTK_RESPONSE_OK,
TRUE);
if (installed == FALSE) {
rb_debug ("installer failed, not retrying imports");
return;
}
g_object_get (source, "entry-type", &error_entry_type, NULL);
do {
RhythmDBEntry *entry;
entry = rhythmdb_query_model_iter_to_entry (source->priv->missing_plugin_model, &iter);
rhythmdb_add_uri_with_types (source->priv->db,
rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION),
source->priv->normal_entry_type,
source->priv->ignore_entry_type,
error_entry_type);
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (source->priv->missing_plugin_model), &iter));
g_object_unref (error_entry_type);
}
示例14: request_album_art_idle
static gboolean
request_album_art_idle (RequestAlbumArtData *data)
{
RBMtpSourcePrivate *priv = MTP_SOURCE_GET_PRIVATE (data->source);
const char *album;
/* pretty sure we don't need any extra locking here - we only touch the artwork
* request map on the main thread anyway.
*/
album = rhythmdb_entry_get_string (data->entry, RHYTHMDB_PROP_ALBUM);
if (g_hash_table_lookup (priv->artwork_request_map, album) == NULL) {
GValue *metadata;
RhythmDB *db = get_db_for_source (data->source);
rb_debug ("requesting cover art image for album %s", album);
g_hash_table_insert (priv->artwork_request_map, (gpointer) album, GINT_TO_POINTER (1));
metadata = rhythmdb_entry_request_extra_metadata (db, data->entry, "rb:coverArt");
if (metadata) {
artwork_notify_cb (db, data->entry, "rb:coverArt", metadata, data->source);
g_value_unset (metadata);
g_free (metadata);
}
g_object_unref (db);
}
g_object_unref (data->source);
rhythmdb_entry_unref (data->entry);
g_free (data);
return FALSE;
}
示例15: artwork_notify_cb
static void
artwork_notify_cb (RhythmDB *db,
RhythmDBEntry *entry,
const char *property_name,
const GValue *metadata,
RBMtpSource *source)
{
RBMtpSourcePrivate *priv = MTP_SOURCE_GET_PRIVATE (source);
GdkPixbuf *pixbuf;
const char *album_name;
album_name = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ALBUM);
/* check if we're looking for art for this entry, and if we actually got some */
if (g_hash_table_remove (priv->artwork_request_map, album_name) == FALSE)
return;
if (G_VALUE_HOLDS (metadata, GDK_TYPE_PIXBUF) == FALSE)
return;
pixbuf = GDK_PIXBUF (g_value_get_object (metadata));
rb_mtp_thread_set_album_image (priv->device_thread, album_name, pixbuf);
queue_free_space_update (source);
}