# HG changeset patch # User renatofilho # Date 1201118699 0 # Node ID 0cc42675b88d1ef024d9f01a7dc569a9e207fcd8 # Parent 6b565181036efbeafefc9bc136da8687f90a6739 [svn r897] fixed channel_id, program_id types diff -r 6b565181036e -r 0cc42675b88d gmyth-dbus/src/Makefile.am --- a/gmyth-dbus/src/Makefile.am Wed Jan 23 20:04:22 2008 +0000 +++ b/gmyth-dbus/src/Makefile.am Wed Jan 23 20:04:59 2008 +0000 @@ -4,6 +4,8 @@ gmythdbus_SOURCES = \ gmyth-dbus-server.h \ gmyth-dbus-server.c \ + gmyth-debug.h \ + gmyth-debug.c \ main.c gmythdbus_LDADD = \ diff -r 6b565181036e -r 0cc42675b88d gmyth-dbus/src/gmyth-dbus-common.h --- a/gmyth-dbus/src/gmyth-dbus-common.h Wed Jan 23 20:04:22 2008 +0000 +++ b/gmyth-dbus/src/gmyth-dbus-common.h Wed Jan 23 20:04:59 2008 +0000 @@ -7,7 +7,7 @@ #define GMYTH_DBUS_PROGRAM_G_TYPE \ dbus_g_type_get_struct ("GValueArray", \ - G_TYPE_STRING, \ + G_TYPE_INT, \ G_TYPE_STRING, \ G_TYPE_STRING, \ G_TYPE_STRING, \ @@ -27,8 +27,8 @@ #define GMYTH_DBUS_RECORD_G_TYPE \ dbus_g_type_get_struct ("GValueArray", \ G_TYPE_UINT, \ - G_TYPE_UINT, \ - G_TYPE_UINT, \ + G_TYPE_STRING, \ + G_TYPE_INT, \ G_TYPE_STRING, \ G_TYPE_STRING, \ G_TYPE_STRING, \ @@ -42,8 +42,8 @@ #define GMYTH_DBUS_SCHEDULE_G_TYPE \ dbus_g_type_get_struct ("GValueArray", \ G_TYPE_UINT, \ - G_TYPE_UINT, \ - G_TYPE_UINT, \ + G_TYPE_STRING, \ + G_TYPE_INT, \ G_TYPE_STRING, \ G_TYPE_STRING, \ G_TYPE_STRING, \ diff -r 6b565181036e -r 0cc42675b88d gmyth-dbus/src/gmyth-dbus-server.c --- a/gmyth-dbus/src/gmyth-dbus-server.c Wed Jan 23 20:04:22 2008 +0000 +++ b/gmyth-dbus/src/gmyth-dbus-server.c Wed Jan 23 20:04:59 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, diff -r 6b565181036e -r 0cc42675b88d gmyth-dbus/src/gmyth-dbus-server.xml --- a/gmyth-dbus/src/gmyth-dbus-server.xml Wed Jan 23 20:04:22 2008 +0000 +++ b/gmyth-dbus/src/gmyth-dbus-server.xml Wed Jan 23 20:04:59 2008 +0000 @@ -36,20 +36,20 @@ - + - + - + - + @@ -68,13 +68,13 @@ - + - - + + @@ -84,8 +84,8 @@ - - + +