diff -r c5a9d9583e64 -r e4323b3483bf gmyth-dbus/src/gmyth-dbus-server.c --- a/gmyth-dbus/src/gmyth-dbus-server.c Mon Nov 19 17:57:40 2007 +0000 +++ b/gmyth-dbus/src/gmyth-dbus-server.c Wed Jan 23 20:07:03 2008 +0000 @@ -140,7 +140,7 @@ GError **error); static gboolean gmyth_dbus_server_add_schedule (GObject *obj, guint channel_id, - guint program_id, + const gchar *program_id, const gchar *start_time, const gchar *end_time, gboolean recurring, @@ -150,7 +150,7 @@ static gboolean gmyth_dbus_server_add_exception (GObject *obj, guint schedule_id, guint channel_id, - guint program_id, + const gchar *program_id, const gchar *start_time, const gchar *end_time, const gchar *description, @@ -220,6 +220,7 @@ GMYTH_DBUS_ERROR_CONNECTION, _("Not connected")); + gmyth_debug ("Not connected with MythTV Server"); return FALSE; } @@ -235,12 +236,13 @@ GMYTH_DBUS_ERROR, GMYTH_DBUS_ERROR_EPG, _("Fail to connect with EPG")); - + gmyth_debug ("Fail to connected with EPG"); return FALSE; } } + gmyth_debug ("Connected EPG"); return TRUE; } @@ -258,6 +260,7 @@ GMYTH_DBUS_ERROR_CONNECTION, _("Not connected")); + gmyth_debug ("Not connected with MythTV Server"); return FALSE; } @@ -275,10 +278,12 @@ GMYTH_DBUS_ERROR_SCHEDULE, _("Fail to connect with Schedule")); + gmyth_debug (_("Fail to connect with Schedule")); return FALSE; } } + gmyth_debug ("Connected with Schedule"); return TRUE; } @@ -293,12 +298,13 @@ GMythSocket *s; GMythDbusServerPrivate *priv; - g_debug ("%s:%d", __FUNCTION__, __LINE__); + gmyth_debug (""); priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj); if (priv->connected) { + gmyth_debug ("Release Old connection"); gmyth_dbus_server_internal_disconnect (obj, NULL); } @@ -313,11 +319,13 @@ s = gmyth_backend_info_get_connected_socket (priv->myth_backend); if (s) { + gmyth_debug ("Connected"); priv->connected = TRUE; g_object_unref (s); } else { + gmyth_debug ("Fail to connect with MythTVServer"); priv->connected = FALSE; g_object_unref (priv->myth_backend); priv->myth_backend = NULL; @@ -338,8 +346,8 @@ { GMythDbusServerPrivate *priv; - g_debug ("%s:%d", __FUNCTION__, __LINE__); + gmyth_debug (""); priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj); if (priv->myth_backend) @@ -625,7 +633,7 @@ end_str = g_time_val_to_iso8601 (data->endts); dbus_g_type_struct_set (&program, - 0, data->chanid->str, + 0, data->xx_channel_id, 1, start_str, 2, end_str, 3, data->title->str, @@ -658,8 +666,8 @@ dbus_g_type_struct_set (val, 0, info->record_id, - 1, info->program_id, - 2, info->channel_id, + 1, info->xx_program_id->str, + 2, info->xx_channel_id, 3, start_str, 4, end_str, 5, info->title->str, @@ -816,8 +824,8 @@ dbus_g_type_struct_set (&schedule, 0, data->schedule_id, - 1, data->program_id, - 2, data->channel_id, + 1, data->xx_program_id->str, + 2, data->xx_channel_id, 3, start_str_time, 4, end_str_time, 5, data->title->str, @@ -1006,7 +1014,7 @@ static ScheduleInfo* gmyth_dbus_server_new_schedule_info (const gchar* description, guint channel_id, - guint program_id, + const gchar* program_id, GTimeVal *start_vtime, GTimeVal *end_vtime) { @@ -1017,8 +1025,8 @@ /* record_id == -1 for generating a new id */ new_sched_info->schedule_id = -1; - new_sched_info->channel_id = channel_id; - new_sched_info->program_id = program_id; + new_sched_info->xx_channel_id = channel_id; + new_sched_info->xx_program_id = g_string_new (program_id); new_sched_info->start_time = g_new0 (GTimeVal, 1); *new_sched_info->start_time = *start_vtime; new_sched_info->end_time = g_new0 (GTimeVal, 1); @@ -1039,7 +1047,7 @@ static gboolean gmyth_dbus_server_add_schedule (GObject *obj, guint channel_id, - guint program_id, + const gchar *program_id, const gchar *start_time, const gchar *end_time, gboolean recurring, @@ -1065,11 +1073,14 @@ g_time_val_from_iso8601 (start_time, &start_vtime); g_time_val_from_iso8601 (end_time, &end_vtime); + g_debug ("%s:%d", __FUNCTION__, __LINE__); sch_info = gmyth_dbus_server_new_schedule_info (description, channel_id, program_id, &start_vtime, &end_vtime); + + g_debug ("%s:%d", __FUNCTION__, __LINE__); if (sch_info != NULL) { GMythScheduleType type; GTimeVal t_now; @@ -1081,17 +1092,20 @@ g_get_current_time (&t_now); + g_debug ("%s:%d", __FUNCTION__, __LINE__); has_record = gmyth_scheduler_was_recorded_before (priv->myth_scheduler, channel_id, (time_t) start_vtime.tv_sec); + g_debug ("%s:%d", __FUNCTION__, __LINE__); if ((t_now.tv_sec >= start_vtime.tv_sec) && (t_now.tv_sec <= end_vtime.tv_sec) && has_record) { GMythSocket *socket; gboolean res = FALSE; + g_debug ("%s:%d", __FUNCTION__, __LINE__); socket = gmyth_backend_info_get_connected_socket (priv->myth_backend); res = gmyth_scheduler_reactivate_schedule(priv->myth_scheduler, channel_id, @@ -1099,17 +1113,21 @@ if (res) { GMythStringList *slist = gmyth_string_list_new(); + g_debug ("%s:%d", __FUNCTION__, __LINE__); gmyth_string_list_append_char_array(slist, "RESCHEDULE_RECORDINGS 0"); gmyth_socket_sendreceive_stringlist(socket, slist); res = (gmyth_string_list_get_int(slist, 0) == 1); g_object_unref(slist); + g_debug ("%s:%d", __FUNCTION__, __LINE__); } + g_debug ("%s:%d", __FUNCTION__, __LINE__); g_object_unref(socket); return res; } else { + g_debug ("%s:%d", __FUNCTION__, __LINE__); if (!gmyth_scheduler_add_schedule_full (priv->myth_scheduler, sch_info, type)) @@ -1118,8 +1136,11 @@ return FALSE; } + g_debug ("%s:%d", __FUNCTION__, __LINE__); (*schedule_id) = sch_info->schedule_id; + g_debug ("%s:%d", __FUNCTION__, __LINE__); gmyth_schedule_info_free (sch_info); + g_debug ("%s:%d", __FUNCTION__, __LINE__); return TRUE; } } @@ -1130,7 +1151,7 @@ gmyth_dbus_server_add_exception (GObject *obj, guint schedule_id, guint channel_id, - guint program_id, + const gchar *program_id, const gchar *start_time, const gchar *end_time, const gchar *description,