1 #include <glib-object.h>
3 #include <gmyth/gmyth_uri.h>
4 #include <gmyth/gmyth_backendinfo.h>
5 #include <gmyth/gmyth_scheduler.h>
6 #include <gmyth/gmyth_epg.h>
7 #include <gmyth/gmyth_common.h>
12 test_recording_list(GMythBackendInfo * backend_info)
16 GMythScheduler *scheduler = gmyth_scheduler_new();
18 if (gmyth_scheduler_connect_with_timeout(scheduler,
19 backend_info, 10) == TRUE)
21 g_debug("===== Scheduler connection success =====");
25 g_debug("===== Scheduler connection failed =====");
29 length = gmyth_scheduler_get_recorded_list(scheduler, &list);
31 g_debug("===== %d Recordings found =====\n", length);
35 RecordedInfo *record = (RecordedInfo *) g_list_nth_data(list, length);
38 g_debug("===== Recorded list returned NULL pointer =====\n");
42 g_debug("===== Record id = %d =====\n", record->record_id);
43 g_debug("===== Record name = %s =====\n",
44 (record ? record->basename->str : "NULL"));
48 gmyth_scheduler_disconnect(scheduler);
50 if (scheduler != NULL)
51 g_object_unref(scheduler);
59 main(int args, const char **argv)
61 GMythBackendInfo *backend_info;
64 backend_info = gmyth_backend_info_new_with_uri(argv[1]);
66 test_recording_list(backend_info);
68 fprintf(stdout, SYNC_STRING);
72 if (backend_info != NULL)
73 g_object_unref(backend_info);