Skip to content

Commit

Permalink
clients/gmusic/libtizgmusic: display genre and album art info if avai…
Browse files Browse the repository at this point in the history
…lable (closes #694)
  • Loading branch information
juanrubio committed Mar 5, 2020
1 parent d5736f0 commit cf212ce
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clients/gmusic/libtizgmusic/src/tizgmusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ void tizgmusic::get_current_song ()
current_track_num_.assign (boost::lexical_cast< std::string >(track_num));
current_song_tracks_total_.assign (boost::lexical_cast< std::string >(total_tracks));

const int song_year = bp::extract< int >(py_gm_proxy_.attr ("current_song_year")());
current_song_year_.assign (boost::lexical_cast< std::string >(song_year));
current_song_year_ = bp::extract< std::string >(
py_gm_proxy_.attr ("current_song_year")());

current_song_genre_ = bp::extract< std::string >(
py_gm_proxy_.attr ("current_song_genre")());
Expand Down
19 changes: 19 additions & 0 deletions plugins/http_source/src/gmusicprc.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,15 @@ update_metadata (gmusic_prc_t * ap_prc)
tiz_check_omx (store_metadata (
ap_prc, "Album", tiz_gmusic_get_current_song_album (ap_prc->p_gmusic_)));

/* Store the genre if not NULL */
{
const char * p_genre = tiz_gmusic_get_current_song_genre (ap_prc->p_gmusic_);
if (p_genre)
{
tiz_check_omx (store_metadata (ap_prc, "Genre", p_genre));
}
}

/* Store the year if not 0 */
{
const char * p_year = tiz_gmusic_get_current_song_year (ap_prc->p_gmusic_);
Expand Down Expand Up @@ -340,6 +349,16 @@ update_metadata (gmusic_prc_t * ap_prc)
}
}

/* Store album art if not NULL */
{
const char * p_album_art
= tiz_gmusic_get_current_song_album_art (ap_prc->p_gmusic_);
if (p_album_art)
{
tiz_check_omx (store_metadata (ap_prc, "Album art", p_album_art));
}
}

/* Signal that a new set of metatadata items is available */
(void) tiz_srv_issue_event ((OMX_PTR) ap_prc, OMX_EventIndexSettingChanged,
OMX_ALL, /* no particular port associated */
Expand Down

0 comments on commit cf212ce

Please sign in to comment.