|
From: <ren...@us...> - 2008-01-23 20:04:56
|
Revision: 897
http://gmyth.svn.sourceforge.net/gmyth/?rev=897&view=rev
Author: renatofilho
Date: 2008-01-23 12:04:59 -0800 (Wed, 23 Jan 2008)
Log Message:
-----------
fixed channel_id, program_id types
Modified Paths:
--------------
trunk/gmyth-dbus/src/Makefile.am
trunk/gmyth-dbus/src/gmyth-dbus-common.h
trunk/gmyth-dbus/src/gmyth-dbus-server.c
trunk/gmyth-dbus/src/gmyth-dbus-server.xml
Modified: trunk/gmyth-dbus/src/Makefile.am
===================================================================
--- trunk/gmyth-dbus/src/Makefile.am 2008-01-23 20:04:22 UTC (rev 896)
+++ trunk/gmyth-dbus/src/Makefile.am 2008-01-23 20:04:59 UTC (rev 897)
@@ -4,6 +4,8 @@
gmythdbus_SOURCES = \
gmyth-dbus-server.h \
gmyth-dbus-server.c \
+ gmyth-debug.h \
+ gmyth-debug.c \
main.c
gmythdbus_LDADD = \
Modified: trunk/gmyth-dbus/src/gmyth-dbus-common.h
===================================================================
--- trunk/gmyth-dbus/src/gmyth-dbus-common.h 2008-01-23 20:04:22 UTC (rev 896)
+++ trunk/gmyth-dbus/src/gmyth-dbus-common.h 2008-01-23 20:04:59 UTC (rev 897)
@@ -7,13 +7,13 @@
#define GMYTH_DBUS_PROGRAM_G_TYPE \
dbus_g_type_get_struct ("GValueArray", \
+ G_TYPE_INT, \
G_TYPE_STRING, \
G_TYPE_STRING, \
G_TYPE_STRING, \
G_TYPE_STRING, \
G_TYPE_STRING, \
G_TYPE_STRING, \
- G_TYPE_STRING, \
G_TYPE_INVALID);
#define GMYTH_DBUS_CHANNEL_G_TYPE \
@@ -27,29 +27,29 @@
#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, \
G_TYPE_STRING, \
G_TYPE_STRING, \
G_TYPE_STRING, \
+ G_TYPE_STRING, \
G_TYPE_UINT64, \
G_TYPE_INVALID);
#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, \
G_TYPE_STRING, \
G_TYPE_STRING, \
+ G_TYPE_STRING, \
G_TYPE_UINT, \
G_TYPE_INVALID);
Modified: trunk/gmyth-dbus/src/gmyth-dbus-server.c
===================================================================
--- trunk/gmyth-dbus/src/gmyth-dbus-server.c 2008-01-23 20:04:22 UTC (rev 896)
+++ trunk/gmyth-dbus/src/gmyth-dbus-server.c 2008-01-23 20:04:59 UTC (rev 897)
@@ -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,
Modified: trunk/gmyth-dbus/src/gmyth-dbus-server.xml
===================================================================
--- trunk/gmyth-dbus/src/gmyth-dbus-server.xml 2008-01-23 20:04:22 UTC (rev 896)
+++ trunk/gmyth-dbus/src/gmyth-dbus-server.xml 2008-01-23 20:04:59 UTC (rev 897)
@@ -36,20 +36,20 @@
<arg type="i" name="channel" direction="in" />
<arg type="s" name="start_time" direction="in" />
<arg type="s" name="end_time" direction="in" />
- <arg type="a(sssssss)" name="program_list" direction="out" />
+ <arg type="a(issssss)" name="program_list" direction="out" />
</method>
<method name="GetRecordedList">
- <arg type="a(uuussssssst)" name="records" direction="out" />
+ <arg type="a(usissssssst)" name="records" direction="out" />
</method>
<method name="GetRecordedInfo">
<arg type="s" name="basename" direction="in" />
- <arg type="(uuussssssst)" name="details" direction="out" />
+ <arg type="(usissssssst)" name="details" direction="out" />
</method>
<method name="GetScheduleList">
- <arg type="a(uuussssu)" name="schedules" direction="out" />
+ <arg type="a(usissssu)" name="schedules" direction="out" />
</method>
<method name="FileExists">
@@ -68,13 +68,13 @@
</method>
<method name="StopRecording">
- <arg type="u" name="channel_id" direction="in" />
+ <arg type="i" name="channel_id" direction="in" />
<arg type="b" name="result" direction="out" />
</method>
<method name="AddSchedule">
- <arg type="u" name="channel_id" direction="in" />
- <arg type="u" name="program_id" direction="in" />
+ <arg type="i" name="channel_id" direction="in" />
+ <arg type="s" name="program_id" direction="in" />
<arg type="s" name="start_time" direction="in" />
<arg type="s" name="end_time" direction="in" />
<arg type="b" name="recurring" direction="in" />
@@ -84,8 +84,8 @@
<method name="AddException">
<arg type="u" name="schedule_id" direction="in" />
- <arg type="u" name="program_id" direction="in" />
- <arg type="u" name="channel_id" direction="in" />
+ <arg type="s" name="program_id" direction="in" />
+ <arg type="i" name="channel_id" direction="in" />
<arg type="s" name="start_time" direction="in" />
<arg type="s" name="end_time" direction="in" />
<arg type="s" name="description" direction="in" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|