Exemplo n.º 1
0
static void
pragha_art_cache_changed_handler (PraghaArtCache *cache, PraghaApplication *pragha)
{
	PraghaBackend *backend;
	PraghaToolbar *toolbar;
	PraghaMusicobject *mobj = NULL;
	gchar *album_art_path = NULL;
	const gchar *artist = NULL, *album = NULL;

	backend = pragha_application_get_backend (pragha);
	if (pragha_backend_get_state (backend) != ST_STOPPED) {
		mobj = pragha_backend_get_musicobject (backend);

		artist = pragha_musicobject_get_artist (mobj);
		album = pragha_musicobject_get_album (mobj);

		album_art_path = pragha_art_cache_get_album_uri (cache, artist, album);

		if (album_art_path) {
			toolbar = pragha_application_get_toolbar (pragha);
			pragha_toolbar_set_image_album_art (toolbar, album_art_path);
			g_free (album_art_path);
		}
	}
}
Exemplo n.º 2
0
static void
pragha_playlist_update_change_tags (PraghaPlaylist *playlist, gint changed, PraghaMusicobject *mobj, PraghaApplication *pragha)
{
	PraghaBackend *backend;
	PraghaToolbar *toolbar;
	PraghaMusicobject *cmobj = NULL;

	backend = pragha_application_get_backend (pragha);

	if(pragha_backend_get_state (backend) != ST_STOPPED) {
		cmobj = pragha_backend_get_musicobject (backend);
		pragha_update_musicobject_change_tag (cmobj, changed, mobj);

		toolbar = pragha_application_get_toolbar (pragha);
		pragha_toolbar_set_title (toolbar, cmobj);
	}
}
Exemplo n.º 3
0
void
pragha_toolbar_update_playback_progress(PraghaBackend *backend, gpointer user_data)
{
	gint length = 0, newsec = 0;
	PraghaMusicobject *mobj = NULL;

	PraghaToolbar *toolbar = user_data;

	newsec = GST_TIME_AS_SECONDS(pragha_backend_get_current_position(backend));

	if (newsec > 0) {
		mobj = pragha_backend_get_musicobject (backend);
		length = pragha_musicobject_get_length (mobj);

		if (length > 0) {
			pragha_toolbar_update_progress (toolbar, length, newsec);
		}
		else {
			gint nlength = GST_TIME_AS_SECONDS(pragha_backend_get_current_length(backend));
			pragha_musicobject_set_length (mobj, nlength);
		}
	}
}