Exemplo n.º 1
0
static void
pragha_backend_parse_message_tag (PraghaBackend *backend, GstMessage *message)
{
	PraghaBackendPrivate *priv = backend->priv;
	GstTagList *tag_list;
	gchar *str = NULL;
	gint changed = 0;

	CDEBUG(DBG_BACKEND, "Parse message tag");

	gst_message_parse_tag(message, &tag_list);

	save_embedded_art (backend, tag_list);

	if (pragha_musicobject_get_source (priv->mobj) != FILE_HTTP)
		goto out;

	if (gst_tag_list_get_string(tag_list, GST_TAG_TITLE, &str))
	{
		changed |= TAG_TITLE_CHANGED;
		pragha_musicobject_set_title(priv->mobj, str);
		g_free(str);
	}
	if (gst_tag_list_get_string(tag_list, GST_TAG_ARTIST, &str))
	{
		changed |= TAG_ARTIST_CHANGED;
		pragha_musicobject_set_artist(priv->mobj, str);
		g_free(str);
	}

	g_signal_emit (backend, signals[SIGNAL_TAGS_CHANGED], 0, changed);

out:
	gst_tag_list_free(tag_list);
}
gboolean
pragha_musicobject_is_mtp_file (PraghaMusicobject *mobj)
{
	PraghaMusicEnum *enum_map = NULL;
	PraghaMusicSource file_source = FILE_NONE;

	enum_map = pragha_music_enum_get ();
	file_source = pragha_music_enum_map_get(enum_map, "MTP");
	g_object_unref (enum_map);

	return (file_source == pragha_musicobject_get_source (mobj));
}