Example #1
0
static void
search_complete_cb (OlLyricSourceSearchTask *task,
                    enum OlLyricSourceStatus status,
                    GList *results,
                    gpointer userdata)
{
  printf ("search complete: ");
  print_status (status);
  ol_test_expect (status == (gsize)userdata);
  if (status == OL_LYRIC_SOURCE_STATUS_SUCCESS)
  {
    if (results)
    {
      test_download (OL_LYRIC_SOURCE_CANDIDATE (results->data));
      test_download_cancel (OL_LYRIC_SOURCE_CANDIDATE (results->data));
    }
    for (; results; results = results->next)
    {
      OlLyricSourceCandidate *candidate;
      candidate = OL_LYRIC_SOURCE_CANDIDATE (results->data);
      printf ("(%s)%s - %s - %s\n",
              ol_lyric_source_candidate_get_sourceid (candidate),
              ol_lyric_source_candidate_get_title (candidate),
              ol_lyric_source_candidate_get_artist (candidate),
              ol_lyric_source_candidate_get_album (candidate));
    }
  }
  task_cnt--;
  check_quit ();
}
Example #2
0
static OlLyricSourceCandidate *
ol_lyric_source_candidate_new (const gchar *title,
                               const gchar *artist,
                               const gchar *album,
                               const gchar *comment,
                               const gchar *sourceid,
                               GVariant *downloadinfo)
{
  ol_assert_ret (sourceid != NULL, NULL);
  ol_assert_ret (downloadinfo != NULL, NULL);
  return OL_LYRIC_SOURCE_CANDIDATE (g_object_new (OL_TYPE_LYRIC_SOURCE_CANDIDATE,
                                                  "title", title,
                                                  "artist", artist,
                                                  "album", album,
                                                  "comment", comment,
                                                  "sourceid", sourceid,
                                                  "downloadinfo", downloadinfo,
                                                  NULL));
}