[svn r897] fixed channel_id, program_id types trunk
authorrenatofilho
Wed Jan 23 20:04:59 2008 +0000 (2008-01-23)
branchtrunk
changeset 8910cc42675b88d
parent 890 6b565181036e
child 892 e4323b3483bf
[svn r897] fixed channel_id, program_id types
gmyth-dbus/src/Makefile.am
gmyth-dbus/src/gmyth-dbus-common.h
gmyth-dbus/src/gmyth-dbus-server.c
gmyth-dbus/src/gmyth-dbus-server.xml
     1.1 --- a/gmyth-dbus/src/Makefile.am	Wed Jan 23 20:04:22 2008 +0000
     1.2 +++ b/gmyth-dbus/src/Makefile.am	Wed Jan 23 20:04:59 2008 +0000
     1.3 @@ -4,6 +4,8 @@
     1.4  gmythdbus_SOURCES = \
     1.5  	gmyth-dbus-server.h \
     1.6  	gmyth-dbus-server.c \
     1.7 +	gmyth-debug.h \
     1.8 +	gmyth-debug.c \
     1.9  	main.c
    1.10  
    1.11  gmythdbus_LDADD = \
     2.1 --- a/gmyth-dbus/src/gmyth-dbus-common.h	Wed Jan 23 20:04:22 2008 +0000
     2.2 +++ b/gmyth-dbus/src/gmyth-dbus-common.h	Wed Jan 23 20:04:59 2008 +0000
     2.3 @@ -7,7 +7,7 @@
     2.4  
     2.5  #define GMYTH_DBUS_PROGRAM_G_TYPE \
     2.6      dbus_g_type_get_struct ("GValueArray", \
     2.7 -                            G_TYPE_STRING, \
     2.8 +                            G_TYPE_INT, \
     2.9                              G_TYPE_STRING, \
    2.10                              G_TYPE_STRING, \
    2.11                              G_TYPE_STRING, \
    2.12 @@ -27,8 +27,8 @@
    2.13  #define GMYTH_DBUS_RECORD_G_TYPE \
    2.14      dbus_g_type_get_struct ("GValueArray", \
    2.15                              G_TYPE_UINT, \
    2.16 -                            G_TYPE_UINT, \
    2.17 -                            G_TYPE_UINT, \
    2.18 +                            G_TYPE_STRING, \
    2.19 +                            G_TYPE_INT, \
    2.20                              G_TYPE_STRING, \
    2.21                              G_TYPE_STRING, \
    2.22                              G_TYPE_STRING, \
    2.23 @@ -42,8 +42,8 @@
    2.24  #define GMYTH_DBUS_SCHEDULE_G_TYPE \
    2.25      dbus_g_type_get_struct ("GValueArray", \
    2.26                              G_TYPE_UINT, \
    2.27 -                            G_TYPE_UINT, \
    2.28 -                            G_TYPE_UINT, \
    2.29 +                            G_TYPE_STRING, \
    2.30 +                            G_TYPE_INT, \
    2.31                              G_TYPE_STRING, \
    2.32                              G_TYPE_STRING, \
    2.33                              G_TYPE_STRING, \
     3.1 --- a/gmyth-dbus/src/gmyth-dbus-server.c	Wed Jan 23 20:04:22 2008 +0000
     3.2 +++ b/gmyth-dbus/src/gmyth-dbus-server.c	Wed Jan 23 20:04:59 2008 +0000
     3.3 @@ -140,7 +140,7 @@
     3.4                                                       GError **error);
     3.5  static gboolean gmyth_dbus_server_add_schedule      (GObject *obj,
     3.6                                                       guint channel_id,
     3.7 -                                                     guint program_id,
     3.8 +                                                     const gchar *program_id,
     3.9                                                       const gchar *start_time,
    3.10                                                       const gchar *end_time,
    3.11                                                       gboolean recurring,
    3.12 @@ -150,7 +150,7 @@
    3.13  static gboolean gmyth_dbus_server_add_exception     (GObject *obj,
    3.14                                                       guint schedule_id,
    3.15                                                       guint channel_id,
    3.16 -                                                     guint program_id,
    3.17 +                                                     const gchar *program_id,
    3.18                                                       const gchar *start_time,
    3.19                                                       const gchar *end_time,
    3.20                                                       const gchar *description,
    3.21 @@ -220,6 +220,7 @@
    3.22                       GMYTH_DBUS_ERROR_CONNECTION,
    3.23                       _("Not connected"));
    3.24  
    3.25 +        gmyth_debug ("Not connected with MythTV Server");
    3.26          return FALSE;
    3.27      }
    3.28  
    3.29 @@ -235,12 +236,13 @@
    3.30                           GMYTH_DBUS_ERROR,
    3.31                           GMYTH_DBUS_ERROR_EPG,
    3.32                           _("Fail to connect with EPG"));
    3.33 -
    3.34 +            gmyth_debug ("Fail to connected with EPG");
    3.35              return FALSE;
    3.36  
    3.37          }
    3.38      }
    3.39  
    3.40 +    gmyth_debug ("Connected EPG");
    3.41      return TRUE;
    3.42  }
    3.43  
    3.44 @@ -258,6 +260,7 @@
    3.45                       GMYTH_DBUS_ERROR_CONNECTION,
    3.46                       _("Not connected"));
    3.47  
    3.48 +        gmyth_debug ("Not connected with MythTV Server");
    3.49          return FALSE;
    3.50      }
    3.51  
    3.52 @@ -275,10 +278,12 @@
    3.53                           GMYTH_DBUS_ERROR_SCHEDULE,
    3.54                           _("Fail to connect with Schedule"));
    3.55  
    3.56 +            gmyth_debug (_("Fail to connect with Schedule"));
    3.57              return FALSE;
    3.58          }
    3.59      }
    3.60  
    3.61 +    gmyth_debug ("Connected with Schedule");
    3.62      return TRUE;
    3.63  }
    3.64  
    3.65 @@ -293,12 +298,13 @@
    3.66      GMythSocket *s;
    3.67      GMythDbusServerPrivate *priv;
    3.68  
    3.69 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
    3.70  
    3.71 +    gmyth_debug ("");
    3.72      priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
    3.73  
    3.74      if (priv->connected)
    3.75      {
    3.76 +        gmyth_debug ("Release Old connection");
    3.77          gmyth_dbus_server_internal_disconnect (obj, NULL);
    3.78      }
    3.79  
    3.80 @@ -313,11 +319,13 @@
    3.81      s = gmyth_backend_info_get_connected_socket (priv->myth_backend);
    3.82      if (s)
    3.83      {
    3.84 +        gmyth_debug ("Connected");
    3.85          priv->connected = TRUE;
    3.86          g_object_unref (s);
    3.87      }
    3.88      else
    3.89      {
    3.90 +        gmyth_debug ("Fail to connect with MythTVServer");
    3.91          priv->connected = FALSE;
    3.92          g_object_unref (priv->myth_backend);
    3.93          priv->myth_backend = NULL;
    3.94 @@ -338,8 +346,8 @@
    3.95  {
    3.96      GMythDbusServerPrivate *priv;
    3.97  
    3.98 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
    3.99  
   3.100 +    gmyth_debug ("");
   3.101      priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
   3.102  
   3.103      if (priv->myth_backend)
   3.104 @@ -625,7 +633,7 @@
   3.105          end_str = g_time_val_to_iso8601 (data->endts);
   3.106  
   3.107          dbus_g_type_struct_set (&program,
   3.108 -                                0, data->chanid->str,
   3.109 +                                0, data->xx_channel_id,
   3.110                                  1, start_str,
   3.111                                  2, end_str,
   3.112                                  3, data->title->str,
   3.113 @@ -658,8 +666,8 @@
   3.114  
   3.115      dbus_g_type_struct_set (val,
   3.116                              0, info->record_id,
   3.117 -                            1, info->program_id,
   3.118 -                            2, info->channel_id,
   3.119 +                            1, info->xx_program_id->str,
   3.120 +                            2, info->xx_channel_id,
   3.121                              3, start_str,
   3.122                              4, end_str,
   3.123                              5, info->title->str,
   3.124 @@ -816,8 +824,8 @@
   3.125  
   3.126          dbus_g_type_struct_set (&schedule,
   3.127                              0, data->schedule_id,
   3.128 -                            1, data->program_id,
   3.129 -                            2, data->channel_id,
   3.130 +                            1, data->xx_program_id->str,
   3.131 +                            2, data->xx_channel_id,
   3.132                              3, start_str_time,
   3.133                              4, end_str_time,
   3.134                              5, data->title->str,
   3.135 @@ -1006,7 +1014,7 @@
   3.136  static ScheduleInfo*
   3.137  gmyth_dbus_server_new_schedule_info (const gchar* description,
   3.138                                       guint channel_id,
   3.139 -                                     guint program_id,
   3.140 +                                     const gchar* program_id,
   3.141                                       GTimeVal *start_vtime,
   3.142                                       GTimeVal *end_vtime)
   3.143  {
   3.144 @@ -1017,8 +1025,8 @@
   3.145      /* record_id == -1 for generating a new id */
   3.146      new_sched_info->schedule_id = -1;
   3.147  
   3.148 -    new_sched_info->channel_id = channel_id;
   3.149 -    new_sched_info->program_id = program_id;
   3.150 +    new_sched_info->xx_channel_id = channel_id;
   3.151 +    new_sched_info->xx_program_id = g_string_new (program_id);
   3.152      new_sched_info->start_time = g_new0 (GTimeVal, 1);
   3.153      *new_sched_info->start_time = *start_vtime;
   3.154      new_sched_info->end_time = g_new0 (GTimeVal, 1);
   3.155 @@ -1039,7 +1047,7 @@
   3.156  static gboolean
   3.157  gmyth_dbus_server_add_schedule (GObject *obj,
   3.158                                  guint channel_id,
   3.159 -                                guint program_id,
   3.160 +                                const gchar *program_id,
   3.161                                  const gchar *start_time,
   3.162                                  const gchar *end_time,
   3.163                                  gboolean recurring,
   3.164 @@ -1065,11 +1073,14 @@
   3.165  
   3.166      g_time_val_from_iso8601 (start_time, &start_vtime);
   3.167      g_time_val_from_iso8601 (end_time, &end_vtime);
   3.168 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.169      sch_info = gmyth_dbus_server_new_schedule_info (description,
   3.170                                                      channel_id,
   3.171                                                      program_id,
   3.172                                                      &start_vtime,
   3.173                                                      &end_vtime);
   3.174 +
   3.175 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.176      if (sch_info != NULL) {
   3.177          GMythScheduleType type;
   3.178          GTimeVal t_now;
   3.179 @@ -1081,17 +1092,20 @@
   3.180  
   3.181          g_get_current_time (&t_now);
   3.182  
   3.183 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.184          has_record = gmyth_scheduler_was_recorded_before (priv->myth_scheduler, 
   3.185                                                            channel_id,
   3.186                                                            (time_t) start_vtime.tv_sec);
   3.187  
   3.188  
   3.189 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.190          if ((t_now.tv_sec >= start_vtime.tv_sec)
   3.191              && (t_now.tv_sec <= end_vtime.tv_sec) && has_record)
   3.192          {
   3.193              GMythSocket    *socket;
   3.194              gboolean        res = FALSE;
   3.195  
   3.196 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.197              socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
   3.198              res = gmyth_scheduler_reactivate_schedule(priv->myth_scheduler,
   3.199                                                        channel_id,
   3.200 @@ -1099,17 +1113,21 @@
   3.201              if (res) {
   3.202                  GMythStringList *slist = gmyth_string_list_new();
   3.203  
   3.204 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.205                  gmyth_string_list_append_char_array(slist, "RESCHEDULE_RECORDINGS 0");
   3.206                  gmyth_socket_sendreceive_stringlist(socket, slist);
   3.207                  res = (gmyth_string_list_get_int(slist, 0) == 1);
   3.208                  g_object_unref(slist);
   3.209 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.210              }
   3.211 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.212  
   3.213              g_object_unref(socket);
   3.214              return res;
   3.215          }
   3.216          else
   3.217          {
   3.218 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.219              if (!gmyth_scheduler_add_schedule_full (priv->myth_scheduler,
   3.220                                                      sch_info,
   3.221                                                      type))
   3.222 @@ -1118,8 +1136,11 @@
   3.223                  return FALSE;
   3.224              }
   3.225  
   3.226 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.227              (*schedule_id) = sch_info->schedule_id;
   3.228 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.229              gmyth_schedule_info_free (sch_info);
   3.230 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
   3.231              return TRUE;
   3.232          }
   3.233      }
   3.234 @@ -1130,7 +1151,7 @@
   3.235  gmyth_dbus_server_add_exception (GObject *obj,
   3.236                                   guint schedule_id,
   3.237                                   guint channel_id,
   3.238 -                                 guint program_id,
   3.239 +                                 const gchar *program_id,
   3.240                                   const gchar *start_time,
   3.241                                   const gchar *end_time,
   3.242                                   const gchar *description,
     4.1 --- a/gmyth-dbus/src/gmyth-dbus-server.xml	Wed Jan 23 20:04:22 2008 +0000
     4.2 +++ b/gmyth-dbus/src/gmyth-dbus-server.xml	Wed Jan 23 20:04:59 2008 +0000
     4.3 @@ -36,20 +36,20 @@
     4.4        <arg type="i" name="channel" direction="in" />
     4.5        <arg type="s" name="start_time" direction="in" />
     4.6        <arg type="s" name="end_time" direction="in" />
     4.7 -      <arg type="a(sssssss)" name="program_list" direction="out" />
     4.8 +      <arg type="a(issssss)" name="program_list" direction="out" />
     4.9      </method>
    4.10  
    4.11      <method name="GetRecordedList">
    4.12 -      <arg type="a(uuussssssst)" name="records" direction="out" />
    4.13 +      <arg type="a(usissssssst)" name="records" direction="out" />
    4.14      </method>
    4.15  
    4.16      <method name="GetRecordedInfo">
    4.17        <arg type="s" name="basename" direction="in" />
    4.18 -      <arg type="(uuussssssst)" name="details" direction="out" />
    4.19 +      <arg type="(usissssssst)" name="details" direction="out" />
    4.20      </method>
    4.21  
    4.22      <method name="GetScheduleList">
    4.23 -      <arg type="a(uuussssu)" name="schedules" direction="out" />
    4.24 +      <arg type="a(usissssu)" name="schedules" direction="out" />
    4.25      </method>
    4.26  
    4.27      <method name="FileExists">
    4.28 @@ -68,13 +68,13 @@
    4.29      </method>
    4.30  
    4.31      <method name="StopRecording">
    4.32 -      <arg type="u" name="channel_id" direction="in" />
    4.33 +      <arg type="i" name="channel_id" direction="in" />
    4.34        <arg type="b" name="result" direction="out" />
    4.35      </method>
    4.36  
    4.37      <method name="AddSchedule">
    4.38 -      <arg type="u" name="channel_id" direction="in" />
    4.39 -      <arg type="u" name="program_id" direction="in" />
    4.40 +      <arg type="i" name="channel_id" direction="in" />
    4.41 +      <arg type="s" name="program_id" direction="in" />
    4.42        <arg type="s" name="start_time" direction="in" />
    4.43        <arg type="s" name="end_time" direction="in" />
    4.44        <arg type="b" name="recurring" direction="in" />
    4.45 @@ -84,8 +84,8 @@
    4.46  
    4.47      <method name="AddException">
    4.48        <arg type="u" name="schedule_id" direction="in" />
    4.49 -      <arg type="u" name="program_id" direction="in" />
    4.50 -      <arg type="u" name="channel_id" direction="in" />
    4.51 +      <arg type="s" name="program_id" direction="in" />
    4.52 +      <arg type="i" name="channel_id" direction="in" />
    4.53        <arg type="s" name="start_time" direction="in" />
    4.54        <arg type="s" name="end_time" direction="in" />
    4.55        <arg type="s" name="description" direction="in" />