|
From: <me...@us...> - 2007-08-21 15:02:20
|
Revision: 820
http://gmyth.svn.sourceforge.net/gmyth/?rev=820&view=rev
Author: melunko
Date: 2007-08-21 08:02:24 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Added gmyth_scheduler_add_exception() function to remove only one schedule when all occurrences options has been used.
Modified Paths:
--------------
trunk/gmyth/src/gmyth_scheduler.c
trunk/gmyth/src/gmyth_scheduler.h
Modified: trunk/gmyth/src/gmyth_scheduler.c
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.c 2007-08-20 20:26:20 UTC (rev 819)
+++ trunk/gmyth/src/gmyth_scheduler.c 2007-08-21 15:02:24 UTC (rev 820)
@@ -418,7 +418,7 @@
_set_int_value(GMythQuery * myth_query, char *field, gint value,
gint rec_id)
{
- gchar *str_value = g_strdup_printf("%d", value);
+ gchar *str_value = g_strdup_printf("%d", value);
_set_value(myth_query, field, str_value, rec_id);
g_free(str_value);
@@ -500,9 +500,13 @@
_set_value(scheduler->msqlquery, "search", "0", rec_id);
if (type == GMYTH_SCHEDULE_ALL_OCCURRENCES) {
- _set_value(scheduler->msqlquery, "type", "4", rec_id);
- } else {
- _set_value(scheduler->msqlquery, "type", "1", rec_id);
+ _set_int_value(scheduler->msqlquery, "type", 4, rec_id);
+ } else if (type == GMYTH_SCHEDULE_ONE_OCCURRENCE) {
+ _set_int_value(scheduler->msqlquery, "type", 1, rec_id);
+ } else if (type == GMYTH_SCHEDULE_EXCEPTION) {
+ _set_int_value(scheduler->msqlquery, "type", 8, rec_id);
+ _set_int_value(scheduler->msqlquery, "parentid", schedule_info->parentid,
+ rec_id);
}
_set_value(scheduler->msqlquery, "recpriority", "0", rec_id);
@@ -556,26 +560,28 @@
/** Requests the Mysql database in the backend to remove an existing schedule.
*
* @param scheduler the GMythScheduler instance.
- * @param record_id The schedule's record id to be removed
+ * @param schedule_id The schedule's record id to be removed
* @return gboolean TRUE if success, FALSE if error
*/
gboolean
-gmyth_scheduler_delete_schedule(GMythScheduler * scheduler, gint record_id)
+gmyth_scheduler_delete_schedule(GMythScheduler * scheduler, gint schedule_id)
{
MYSQL_RES *msql_res;
- GString *query_str = g_string_new("");
+ GString *query_str = NULL;
- assert(scheduler);
+ g_return_val_if_fail (scheduler != NULL, FALSE);
+
if (scheduler->msqlquery == NULL) {
g_warning("[%s] Scheduler db connection not initialized",
__FUNCTION__);
return FALSE;
}
- // ========================================
+
+ query_str = g_string_new("");
g_string_printf(query_str,
- "DELETE FROM record WHERE recordid=%d", record_id);
+ "DELETE FROM record WHERE recordid=%d", schedule_id);
msql_res =
gmyth_query_process_statement(scheduler->msqlquery,
@@ -586,9 +592,33 @@
g_string_free(query_str, TRUE);
// Notify the backend of the changes
- return update_backend(scheduler, record_id);
+ return update_backend(scheduler, schedule_id);
}
+/*
+ * Add an exception program to be removed from the schedule list, when programs
+ * where scheduled with the GMYTH_SCHEDULE_ALL_OCCURRENCES option.
+ * @param scheduler the GMythScheduler instance.
+ * @param schedule_id the schedule id of the all occurrence schedule to be changed
+ * @param exception_info the ScheduleInfo to be removed from all schedule occurrences
+ * @return TRUE if success, FALSE if any error happens
+ */
+gboolean
+gmyth_scheduler_add_exception (GMythScheduler *scheduler, gint schedule_id,
+ ScheduleInfo *exception_info)
+{
+ GString *query_str;
+ gboolean res;
+
+ g_return_val_if_fail (scheduler != NULL, FALSE);
+ g_return_val_if_fail (exception_info != NULL, FALSE);
+
+ exception_info->parentid = schedule_id;
+ res = gmyth_scheduler_add_schedule_full (scheduler, exception_info, GMYTH_SCHEDULE_EXCEPTION);
+
+ return res;
+}
+
/** Requests the Mysql database in the backend to remove an existing recorded item.
*
* @param scheduler the GMythScheduler instance.
Modified: trunk/gmyth/src/gmyth_scheduler.h
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.h 2007-08-20 20:26:20 UTC (rev 819)
+++ trunk/gmyth/src/gmyth_scheduler.h 2007-08-21 15:02:24 UTC (rev 820)
@@ -39,7 +39,8 @@
typedef enum {
GMYTH_SCHEDULE_ONE_OCCURRENCE,
- GMYTH_SCHEDULE_ALL_OCCURRENCES
+ GMYTH_SCHEDULE_ALL_OCCURRENCES,
+ GMYTH_SCHEDULE_EXCEPTION
} GMythScheduleType;
@@ -109,6 +110,8 @@
GString *description;
GString *category;
+ gint parentid;
+
} ScheduleInfo;
typedef struct {
@@ -153,7 +156,10 @@
ScheduleInfo * schedule_info);
gboolean gmyth_scheduler_add_schedule_full (GMythScheduler * scheduler,
ScheduleInfo * schedule_info, GMythScheduleType type);
+gboolean gmyth_scheduler_add_exception (GMythScheduler *scheduler, gint schedule_id,
+ ScheduleInfo *exception_info);
+
gint gmyth_scheduler_delete_schedule (GMythScheduler * scheduler,
gint record_id);
gint gmyth_scheduler_delete_recorded (GMythScheduler * scheduler,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-08-22 13:06:40
|
Revision: 824
http://gmyth.svn.sourceforge.net/gmyth/?rev=824&view=rev
Author: melunko
Date: 2007-08-22 06:06:43 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
Added db_port field in the GMythBackendInfo
Modified Paths:
--------------
trunk/gmyth/src/gmyth_backendinfo.c
trunk/gmyth/src/gmyth_backendinfo.h
Modified: trunk/gmyth/src/gmyth_backendinfo.c
===================================================================
--- trunk/gmyth/src/gmyth_backendinfo.c 2007-08-21 19:04:23 UTC (rev 823)
+++ trunk/gmyth/src/gmyth_backendinfo.c 2007-08-22 13:06:43 UTC (rev 824)
@@ -57,10 +57,11 @@
gmyth_backend_info_init(GMythBackendInfo * backend_info)
{
backend_info->hostname = NULL;
+ backend_info->port = -1;
backend_info->username = NULL;
backend_info->password = NULL;
backend_info->db_name = NULL;
- backend_info->port = -1;
+ backend_info->db_port = 0;
backend_info->status_port = -1;
}
@@ -78,10 +79,11 @@
g_object_unref (backend_info->sock);
backend_info->hostname = NULL;
+ backend_info->port = -1;
backend_info->username = NULL;
backend_info->password = NULL;
backend_info->db_name = NULL;
- backend_info->port = -1;
+ backend_info->db_port = 0;
backend_info->status_port = -1;
backend_info->sock = NULL;
@@ -223,6 +225,18 @@
}
void
+gmyth_backend_info_set_db_port(GMythBackendInfo * backend_info, gint db_port)
+{
+ g_return_if_fail(backend_info != NULL);
+
+ if (db_port <= 0) {
+ gmyth_debug("Error trying to set a port less than 0.");
+ } else {
+ backend_info->db_port = db_port;
+ }
+}
+
+void
gmyth_backend_info_set_port(GMythBackendInfo * backend_info, gint port)
{
g_return_if_fail(backend_info != NULL);
@@ -281,6 +295,15 @@
}
gint
+gmyth_backend_info_get_idb_port(GMythBackendInfo * backend_info)
+{
+ g_return_val_if_fail(backend_info != NULL, -1);
+
+ return backend_info->db_port;
+}
+
+
+gint
gmyth_backend_info_get_port(GMythBackendInfo * backend_info)
{
g_return_val_if_fail(backend_info != NULL, -1);
Modified: trunk/gmyth/src/gmyth_backendinfo.h
===================================================================
--- trunk/gmyth/src/gmyth_backendinfo.h 2007-08-21 19:04:23 UTC (rev 823)
+++ trunk/gmyth/src/gmyth_backendinfo.h 2007-08-22 13:06:43 UTC (rev 824)
@@ -63,19 +63,21 @@
};
struct _GMythBackendInfo {
- GObject parent;
+ GObject parent;
/** The backend hostname or ip address. */
- gchar *hostname;
+ gchar *hostname;
+ /** The backend port. */
+ gint port;
/** The username to connect to the mysql server. */
- gchar *username;
+ gchar *username;
/** The password to connect to the mysql server. */
- gchar *password;
+ gchar *password;
/** The mythtv's mysql database name. */
- gchar *db_name;
- /** The backend port. */
- gint port;
+ gchar *db_name;
+ /** The mysql database port */
+ gint db_port;
/** The backend status port for http connection */
- gint status_port;
+ gint status_port;
/* Private */
GMythSocket *sock;
@@ -98,6 +100,8 @@
const gchar *password);
void gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info,
const gchar *db_name);
+void gmyth_backend_info_set_db_port (GMythBackendInfo *backend_info,
+ gint db_port);
void gmyth_backend_info_set_port (GMythBackendInfo *backend_info,
gint port);
void gmyth_backend_info_set_status_port (GMythBackendInfo *backend_info,
@@ -106,6 +110,7 @@
const gchar* gmyth_backend_info_get_username (GMythBackendInfo *backend_info);
const gchar* gmyth_backend_info_get_password (GMythBackendInfo *backend_info);
const gchar* gmyth_backend_info_get_db_name (GMythBackendInfo *backend_info);
+gint gmyth_backend_info_get_db_port (GMythBackendInfo *backend_info);
gint gmyth_backend_info_get_port (GMythBackendInfo *backend_info);
GMythURI* gmyth_backend_info_get_uri (GMythBackendInfo *backend_info);
gboolean gmyth_backend_info_is_local_file (GMythBackendInfo *backend_info);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-08-30 12:46:57
|
Revision: 842
http://gmyth.svn.sourceforge.net/gmyth/?rev=842&view=rev
Author: melunko
Date: 2007-08-30 05:46:59 -0700 (Thu, 30 Aug 2007)
Log Message:
-----------
Added some more fields at ScheduleInfo structure
Modified Paths:
--------------
trunk/gmyth/src/gmyth_scheduler.c
trunk/gmyth/src/gmyth_scheduler.h
Modified: trunk/gmyth/src/gmyth_scheduler.c
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.c 2007-08-30 11:51:31 UTC (rev 841)
+++ trunk/gmyth/src/gmyth_scheduler.c 2007-08-30 12:46:59 UTC (rev 842)
@@ -219,7 +219,7 @@
g_string_printf(query_str,
"SELECT recordid,programid,chanid,starttime,startdate,"
- "endtime,enddate,title,subtitle,description,category FROM record;");
+ "endtime,enddate,title,subtitle,description,category,type,parentid FROM record;");
if (scheduler->msqlquery == NULL) {
g_warning("[%s] Scheduler db connection not initialized",
@@ -240,6 +240,7 @@
while ((row = mysql_fetch_row(msql_res)) != NULL) {
schedule = g_new0(ScheduleInfo, 1);
+ gint type = 0;
schedule->schedule_id =
(guint) g_ascii_strtoull(row[0], NULL, 10);
@@ -267,6 +268,15 @@
schedule->subtitle = g_string_new(row[8]);
schedule->description = g_string_new(row[9]);
schedule->category = g_string_new(row[10]);
+ type = g_ascii_strtoull (row[11], NULL, 10);
+ if (type == 4) {
+ schedule->type = GMYTH_SCHEDULE_ALL_OCCURRENCES;
+ } else if (type == 1) {
+ schedule->type = GMYTH_SCHEDULE_ONE_OCCURRENCE;
+ } else if (type == 8) {
+ schedule->type = GMYTH_SCHEDULE_EXCEPTION;
+ schedule->parentid = (gint) g_ascii_strtoull (row[12], NULL, 10);
+ }
(*schedule_list) = g_list_append(*(schedule_list), schedule);
}
@@ -505,7 +515,7 @@
_set_int_value(scheduler->msqlquery, "type", 1, rec_id);
} else if (type == GMYTH_SCHEDULE_EXCEPTION) {
_set_int_value(scheduler->msqlquery, "type", 8, rec_id);
- _set_int_value(scheduler->msqlquery, "parentid", schedule_info->parentid,
+ _set_int_value(scheduler->msqlquery, "parentid", schedule_info->parentid,
rec_id);
}
@@ -535,9 +545,7 @@
schedule_info->schedule_id = rec_id;
- /*
- * Notify the backend of changes
- */
+ /* Notify the backend of changes */
return update_backend(scheduler, rec_id);
}
Modified: trunk/gmyth/src/gmyth_scheduler.h
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.h 2007-08-30 11:51:31 UTC (rev 841)
+++ trunk/gmyth/src/gmyth_scheduler.h 2007-08-30 12:46:59 UTC (rev 842)
@@ -110,6 +110,8 @@
GString *description;
GString *category;
+ GMythScheduleType type;
+
gint parentid;
} ScheduleInfo;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-09-12 15:47:00
|
Revision: 847
http://gmyth.svn.sourceforge.net/gmyth/?rev=847&view=rev
Author: morphbr
Date: 2007-09-12 08:47:02 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
- Fixed several bugs
- Included some help functions
Modified Paths:
--------------
trunk/gmyth/src/gmyth_programinfo.h
trunk/gmyth/src/gmyth_scheduler.c
trunk/gmyth/src/gmyth_scheduler.h
trunk/gmyth/src/gmyth_stringlist.c
trunk/gmyth/src/gmyth_stringlist.h
Modified: trunk/gmyth/src/gmyth_programinfo.h
===================================================================
--- trunk/gmyth/src/gmyth_programinfo.h 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_programinfo.h 2007-09-12 15:47:02 UTC (rev 847)
@@ -63,7 +63,6 @@
/** The channel unique ID. */
GString *chanid;
-
/** The program start time. */
GTimeVal *startts;
/** The program end time. */
@@ -136,7 +135,11 @@
GString *recgroup;
GString *playgroup;
+ gint rectype;
+ gint recstatus;
gint recpriority;
+ gint dupin;
+ gint dupmethod;
/** The file size of the recorded program.*/
gint64 filesize;
Modified: trunk/gmyth/src/gmyth_scheduler.c
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.c 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_scheduler.c 2007-09-12 15:47:02 UTC (rev 847)
@@ -510,7 +510,7 @@
_set_value(scheduler->msqlquery, "search", "0", rec_id);
if (type == GMYTH_SCHEDULE_ALL_OCCURRENCES) {
- _set_int_value(scheduler->msqlquery, "type", 4, rec_id);
+ _set_int_value(scheduler->msqlquery, "type", 3, rec_id);
} else if (type == GMYTH_SCHEDULE_ONE_OCCURRENCE) {
_set_int_value(scheduler->msqlquery, "type", 1, rec_id);
} else if (type == GMYTH_SCHEDULE_EXCEPTION) {
@@ -665,6 +665,206 @@
return update_backend(scheduler, record_id);
}
+
+gboolean gmyth_scheduler_was_recorded_before(GMythScheduler* scheduler, gint channel_id,
+ time_t start_time)
+{
+ MYSQL_RES *msql_res;
+ GString *query_str = g_string_new("");
+
+ assert(scheduler);
+ g_string_printf(query_str, "SELECT callsign FROM channel "
+ "WHERE chanid = \"%d\"", channel_id);
+
+ msql_res = gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+ if (msql_row) {
+ GString* callsign = g_string_new(msql_row[0]);
+ GString* startts = gmyth_util_time_to_string(start_time);
+ g_string_printf(query_str, "SELECT * FROM oldrecorded "
+ "WHERE station = \"%s\" AND starttime = \"%s\"",
+ callsign->str, startts->str);
+ msql_res = gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+ g_string_free(callsign, TRUE);
+ g_string_free(startts, TRUE);
+ g_string_free(query_str, TRUE);
+ if (mysql_fetch_row(msql_res)) return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+
+gboolean gmyth_scheduler_reactivate_schedule(GMythScheduler* scheduler, gint channel_id,
+ time_t start_time)
+
+{
+ MYSQL_RES *msql_res;
+ GString *query_str = g_string_new("");
+
+ assert(scheduler);
+ g_string_printf(query_str, "SELECT callsign FROM channel "
+ "WHERE chanid = \"%d\"", channel_id);
+
+ msql_res = gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+ if (msql_row) {
+ GString* callsign = g_string_new(msql_row[0]);
+ GString* startts = gmyth_util_time_to_string(start_time);
+ g_string_printf(query_str, "UPDATE oldrecorded SET reactivate = 1 "
+ "WHERE station = \"%s\" AND starttime = \"%s\"",
+ callsign->str, startts->str);
+ gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+ g_string_free(callsign, TRUE);
+ g_string_free(startts, TRUE);
+ g_string_free(query_str, TRUE);
+ return TRUE;
+ }
+
+ }
+
+ return FALSE;
+}
+
+
+/*
+ * This should only be used in special situations. We do not know the time that
+ * the recording was set. We just know that it is an "ongoing" record and then
+ * we have to use this to get it's info. It's always the oldest one -> first on list
+ *
+ */
+GMythProgramInfo*
+gmyth_scheduler_get_recorded_on_time(GMythScheduler* scheduler,
+ GString* channel)
+{
+ MYSQL_RES *msql_res;
+ GMythProgramInfo *proginfo = NULL;
+ GString *query_str = g_string_new("");
+
+ assert(scheduler);
+
+ g_string_printf(query_str,
+ "SELECT recorded.chanid,starttime,endtime,title,"
+ "subtitle,description,channel.channum,"
+ "channel.callsign,channel.name,channel.commfree,"
+ "channel.outputfilters,seriesid,programid,filesize,"
+ "lastmodified,stars,previouslyshown,originalairdate,"
+ "hostname,recordid,transcoder,playgroup,"
+ "recorded.recpriority,progstart,progend,basename,recgroup,"
+ "category,findid,duplicate "
+ "FROM recorded " "LEFT JOIN channel "
+ "ON recorded.chanid = channel.chanid "
+ "WHERE recorded.chanid = \"%s\" "
+ "ORDER BY starttime DESC", channel->str);
+
+ msql_res =
+ gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+
+ if (msql_row) {
+ proginfo = gmyth_program_info_new();
+
+ proginfo->chanid = g_string_new(msql_row[0]);
+ proginfo->recstartts = gmyth_util_string_to_time_val(msql_row[1]);
+ proginfo->recendts = gmyth_util_string_to_time_val(msql_row[2]);
+
+ proginfo->title = g_string_new(msql_row[3]);
+ proginfo->subtitle = g_string_new(msql_row[4]);
+ proginfo->description = g_string_new(msql_row[5]);
+
+ proginfo->chanstr = g_string_new(msql_row[6]);
+ proginfo->chansign = g_string_new(msql_row[7]);
+ proginfo->channame = g_string_new(msql_row[8]);
+ proginfo->chancommfree = (gint) g_ascii_strtoull(msql_row[9], NULL, 10);
+ proginfo->chanOutputFilters = g_string_new(msql_row[10]);
+ proginfo->seriesid = g_string_new(msql_row[11]);
+ proginfo->programid = g_string_new(msql_row[12]);
+ proginfo->filesize = g_ascii_strtoull(msql_row[13], NULL, 10);
+
+ proginfo->lastmodified = gmyth_util_string_to_time_val(msql_row[14]);
+ proginfo->stars = g_ascii_strtod(msql_row[15], NULL);
+ proginfo->repeat = (gint)g_ascii_strtoull(msql_row[16], NULL, 10);
+
+ if (msql_row[17] == NULL) {
+ proginfo->originalAirDate = 0;
+ proginfo->hasAirDate = FALSE;
+ } else {
+ proginfo->originalAirDate = gmyth_util_string_to_time_val(msql_row[17]);
+ proginfo->hasAirDate = TRUE;
+ }
+
+ proginfo->hostname = g_string_new(msql_row[18]);
+ proginfo->recordid = (gint) g_ascii_strtoull(msql_row[19], NULL, 10);
+ proginfo->transcoder = (gint) g_ascii_strtoull(msql_row[20], NULL, 10);
+
+ proginfo->playgroup = g_string_new(msql_row[21]);
+ proginfo->recpriority = (gint) g_ascii_strtoull(msql_row[22], NULL, 10);
+
+ proginfo->startts = gmyth_util_string_to_time_val(msql_row[23]);
+ proginfo->endts = gmyth_util_string_to_time_val(msql_row[24]);
+ proginfo->pathname = g_string_new(g_strdup(msql_row[25]));
+ proginfo->recgroup = g_string_new(msql_row[26]);
+ proginfo->category = g_string_new(msql_row[27]);
+ proginfo->findid = (gint) g_ascii_strtoull(msql_row[28], NULL, 10);
+
+ proginfo->recpriority2 = 0;
+
+ g_string_printf(query_str,
+ "SELECT dupmethod,dupin,parentid,type "
+ "FROM record WHERE recordid = \"%d\"", proginfo->recordid);
+
+ msql_res =
+ gmyth_query_process_statement(scheduler->msqlquery,
+ query_str->str);
+
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+
+ if (msql_row) {
+ proginfo->dupmethod = (gint) g_ascii_strtoull(msql_row[0], NULL, 10);
+ proginfo->dupin = (gint) g_ascii_strtoull(msql_row[1], NULL, 10);
+ proginfo->parentid = (gint) g_ascii_strtoull(msql_row[2], NULL, 10);
+ proginfo->rectype = 0;
+ }
+ }
+
+
+ g_string_printf(query_str,
+ "SELECT sourceid,cardid,cardinputid,shareable "
+ "FROM cardinput");
+
+ msql_res =
+ gmyth_query_process_statement(scheduler->msqlquery,
+ query_str->str);
+
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+
+ if (msql_row) {
+ proginfo->sourceid = 0;
+ proginfo->cardid = 0;
+ proginfo->inputid = 0;
+ if (msql_row[3] != NULL && g_ascii_strcasecmp("Y", msql_row[3]) == 0)
+ proginfo->shareable = 1;
+ else
+ proginfo->shareable = 0;
+ }
+ }
+
+
+
+ }
+ }
+
+ g_string_free(query_str, TRUE);
+ return proginfo;
+}
+
/** Retrieves an existing recorded item information from database. The information
* is used to fill the returned GMythProgramInfo.
*
Modified: trunk/gmyth/src/gmyth_scheduler.h
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.h 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_scheduler.h 2007-09-12 15:47:02 UTC (rev 847)
@@ -151,6 +151,15 @@
GList ** rec_list);
RecordedInfo* gmyth_scheduler_get_recorded_info (GMythScheduler *scheduler,
const char *basename);
+
+gboolean gmyth_scheduler_was_recorded_before(GMythScheduler* scheduler, gint channel_id,
+ time_t start_time);
+
+gboolean gmyth_scheduler_reactivate_schedule(GMythScheduler* scheduler, gint channel_id,
+ time_t start_time);
+GMythProgramInfo*
+gmyth_scheduler_get_recorded_on_time(GMythScheduler* scheduler,
+ GString* channel);
GMythProgramInfo *gmyth_scheduler_get_recorded (GMythScheduler * scheduler,
GString * channel,
GTimeVal * starttime);
Modified: trunk/gmyth/src/gmyth_stringlist.c
===================================================================
--- trunk/gmyth/src/gmyth_stringlist.c 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_stringlist.c 2007-09-12 15:47:02 UTC (rev 847)
@@ -109,6 +109,24 @@
return value_str;
}
+
+/** Appends a gdouble to the string list.
+ *
+ * @param strlist The GMythStringList instance.
+ * @param value The gdouble to be appended.
+ *
+ * @return The appended gdouble converted to a GString object.
+ */
+GString *
+gmyth_string_list_append_float(GMythStringList * strlist, const gdouble value)
+{
+ GString *value_str = g_string_new("");
+ g_string_printf(value_str, "%f", value);
+ strlist->glist = g_list_append(strlist->glist, value_str);
+ return value_str;
+}
+
+
/** Appends a guint64 to the string list.
*
* @param strlist The GMythStringList instance.
Modified: trunk/gmyth/src/gmyth_stringlist.h
===================================================================
--- trunk/gmyth/src/gmyth_stringlist.h 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_stringlist.h 2007-09-12 15:47:02 UTC (rev 847)
@@ -75,6 +75,9 @@
void gmyth_string_list_clear_all(GMythStringList * strlist);
int gmyth_string_list_length(GMythStringList * strlist);
+GString *gmyth_string_list_append_float(GMythStringList * strlist,
+ const gdouble value);
+
GString *gmyth_string_list_append_int(GMythStringList * strlist,
const gint value);
GString *gmyth_string_list_append_uint64(GMythStringList * strlist,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-08-21 19:04:20
|
Revision: 823
http://gmyth.svn.sourceforge.net/gmyth/?rev=823&view=rev
Author: renatofilho
Date: 2007-08-21 12:04:23 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
fixed monitor_handler dispose
Modified Paths:
--------------
trunk/gmyth/src/gmyth_backendinfo.c
trunk/gmyth/src/gmyth_file_transfer.c
trunk/gmyth/src/gmyth_livetv.c
trunk/gmyth/src/gmyth_monitor_handler.c
trunk/gmyth/src/gmyth_monitor_handler.h
trunk/gmyth/src/gmyth_socket.c
Modified: trunk/gmyth/src/gmyth_backendinfo.c
===================================================================
--- trunk/gmyth/src/gmyth_backendinfo.c 2007-08-21 16:14:42 UTC (rev 822)
+++ trunk/gmyth/src/gmyth_backendinfo.c 2007-08-21 19:04:23 UTC (rev 823)
@@ -73,14 +73,17 @@
g_free(backend_info->username);
g_free(backend_info->password);
g_free(backend_info->db_name);
- g_object_unref (backend_info->sock);
+ if (backend_info->sock)
+ g_object_unref (backend_info->sock);
+
backend_info->hostname = NULL;
backend_info->username = NULL;
backend_info->password = NULL;
backend_info->db_name = NULL;
backend_info->port = -1;
backend_info->status_port = -1;
+ backend_info->sock = NULL;
G_OBJECT_CLASS(gmyth_backend_info_parent_class)->dispose(object);
}
Modified: trunk/gmyth/src/gmyth_file_transfer.c
===================================================================
--- trunk/gmyth/src/gmyth_file_transfer.c 2007-08-21 16:14:42 UTC (rev 822)
+++ trunk/gmyth/src/gmyth_file_transfer.c 2007-08-21 19:04:23 UTC (rev 823)
@@ -142,8 +142,8 @@
g_signal_connect(G_OBJECT(transfer), "program-info-changed",
(GCallback) (GMYTH_FILE_TRANSFER_GET_CLASS
- (transfer)->
- program_info_changed_handler), NULL);
+ (transfer)->program_info_changed_handler),
+ NULL);
}
static void
Modified: trunk/gmyth/src/gmyth_livetv.c
===================================================================
--- trunk/gmyth/src/gmyth_livetv.c 2007-08-21 16:14:42 UTC (rev 822)
+++ trunk/gmyth/src/gmyth_livetv.c 2007-08-21 19:04:23 UTC (rev 823)
@@ -109,12 +109,12 @@
livetv->monitor = NULL;
}
+
if (livetv->file != NULL) {
g_object_unref(livetv->file);
livetv->file = NULL;
}
-
if (livetv->recorder != NULL) {
// gmyth_recorder_close(livetv->recorder);
g_object_unref(livetv->recorder);
@@ -131,7 +131,6 @@
livetv->tvchain = NULL;
}
-
if (livetv->proginfo != NULL) {
g_object_unref(livetv->proginfo);
livetv->proginfo = NULL;
@@ -142,7 +141,6 @@
livetv->backend_info = NULL;
}
-
if (livetv->uri != NULL) {
g_object_unref(livetv->uri);
livetv->uri = NULL;
@@ -153,7 +151,6 @@
livetv->mutex = NULL;
}
-
if (livetv->local_hostname != NULL) {
g_string_free(livetv->local_hostname, TRUE);
livetv->local_hostname = NULL;
@@ -321,7 +318,6 @@
}
livetv->monitor = gmyth_monitor_handler_new();
-
res =
gmyth_monitor_handler_open(livetv->monitor,
livetv->backend_info->hostname,
@@ -403,9 +399,8 @@
g_return_val_if_fail(livetv != NULL, FALSE);
- if (NULL == livetv->socket) {
+ if (livetv->socket == NULL) {
livetv->socket = gmyth_socket_new();
-
/*
* FIME: Implement this at gmyth_socket
*/
Modified: trunk/gmyth/src/gmyth_monitor_handler.c
===================================================================
--- trunk/gmyth/src/gmyth_monitor_handler.c 2007-08-21 16:14:42 UTC (rev 822)
+++ trunk/gmyth/src/gmyth_monitor_handler.c 2007-08-21 19:04:23 UTC (rev 823)
@@ -70,7 +70,9 @@
#define GMYTHTV_ENABLE_DEBUG 1
#endif
-gpointer gmyth_monitor_handler_listener(gpointer data);
+gboolean gmyth_monitor_handler_listener (GIOChannel *io_channel,
+ GIOCondition condition,
+ gpointer data);
static void gmyth_monitor_handler_default_listener(GMythMonitorHandler
* monitor,
@@ -92,51 +94,10 @@
void gmyth_monitor_handler_close(GMythMonitorHandler * monitor);
-G_DEFINE_TYPE(GMythMonitorHandler, gmyth_monitor_handler, G_TYPE_OBJECT)
- static void
+G_DEFINE_TYPE(GMythMonitorHandler, gmyth_monitor_handler, G_TYPE_OBJECT);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- gmyth_monitor_handler_class_init(GMythMonitorHandlerClass * klass)
+static void
+gmyth_monitor_handler_class_init(GMythMonitorHandlerClass * klass)
{
GObjectClass *gobject_class;
GMythMonitorHandlerClass *gmonitor_class;
@@ -169,23 +130,11 @@
monitor->hostname = NULL;
monitor->port = 0;
monitor->actual_index = 0;
-
monitor->allow_msgs_listener = FALSE;
-
/*
- * monitor->backend_msgs = g_hash_table_new( g_int_hash, g_int_equal
- * );
- */
-
- /*
* it is used for signalizing the event socket consumer thread
*/
monitor->mutex = g_mutex_new();
-
- monitor->th = NULL;
-
- monitor->gmyth_monitor_handler_listener =
- gmyth_monitor_handler_listener;
}
static void
@@ -197,14 +146,9 @@
monitor->allow_msgs_listener = FALSE;
- if (monitor->th != NULL) {
- gboolean *ret = (gboolean *) g_thread_join(monitor->th);
-
- if (*ret == FALSE)
- gmyth_debug("Error closing GThread listener socket!");
- else
- gmyth_debug("Closed GThread listener socket.");
- // g_object_unref( monitor->th );
+ if (monitor->io_source != 0) {
+ g_source_remove (monitor->io_source);
+ monitor->io_source = 0;
}
/*
@@ -226,6 +170,7 @@
monitor->hostname = NULL;
}
+
if (monitor->backend_msgs != NULL) {
g_hash_table_destroy(monitor->backend_msgs);
monitor->backend_msgs = NULL;
@@ -236,6 +181,7 @@
* io_watcher_cond = NULL; }
*/
+
G_OBJECT_CLASS(gmyth_monitor_handler_parent_class)->dispose(object);
}
@@ -353,30 +299,22 @@
gmyth_debug("Monitor event socket --- hostname: %s, port %d\n",
monitor->hostname, monitor->port);
- if (NULL != monitor->event_sock) {
+ if (monitor->event_sock != NULL) {
g_object_unref(monitor->event_sock);
monitor->event_sock = NULL;
}
/*
- * configure the event socket
+ * configure the event socket
*/
- if (NULL == monitor->event_sock) {
- if (!gmyth_connect_to_backend_monitor(monitor)) {
- gmyth_debug("Connection to backend failed (Event Socket)!");
- ret = FALSE;
- } else {
- gmyth_debug
- ("Remote monitor event socket had been succesfully created. (io_fd == %d)\n",
- g_io_channel_unix_get_fd(monitor->event_sock->sd_io_ch));
- }
+ if (!gmyth_connect_to_backend_monitor(monitor)) {
+ gmyth_debug("Connection to backend failed (Event Socket)!");
+ ret = FALSE;
} else {
- gmyth_debug
- ("ASSERT ERROR: Remote monitor event socket is not NULL at the setup...\n");
+ gmyth_debug ("Remote monitor event socket had been succesfully create");
}
return ret;
-
}
/**
@@ -493,122 +431,73 @@
* @return Pointer to a gboolean <code>true</code> value, if the data was
* successfully read.
*/
-gpointer
-gmyth_monitor_handler_listener(gpointer data)
+gboolean
+gmyth_monitor_handler_listener (GIOChannel *io_channel,
+ GIOCondition io_cond,
+ gpointer data)
{
- GMythMonitorHandler *monitor = (GMythMonitorHandler *) data;
+ GMythMonitorHandler *monitor;
guint recv = 0;
- gboolean *ret = g_new0(gboolean, 1);
gsize len = 0;
- GIOChannel *io_channel = monitor->event_sock->sd_io_ch;
- GIOCondition io_cond =
- g_io_channel_get_buffer_condition(io_channel);
- static guint count = 0;
+ GMythStringList *strlist = NULL;
+ gint bytes_sent = 0;
- *ret = TRUE;
+ monitor = (GMythMonitorHandler *) data;
gmyth_debug("Entering MONITOR handler listener...");
myth_control_acquire_context(monitor, TRUE);
- if ((io_cond & G_IO_HUP) != 0) {
- *ret = FALSE;
+ if (((io_cond & G_IO_HUP) != 0) ||
+ ((io_cond & G_IO_ERR) != 0)) {
goto clean_up;
}
- GMythStringList *strlist = NULL;
- if (NULL == io_channel) {
- gmyth_debug("Monitor socket is NULL! (GIOChannel)");
- *ret = FALSE;
- goto clean_up;
- }
+ gmyth_debug("%d - Listening on Monitor socket...!\n", count);
+ strlist = gmyth_string_list_new();
- while (monitor->allow_msgs_listener) {
- ++count;
+ len = gmyth_socket_read_stringlist(monitor->event_sock, strlist);
+ if ((len > 0) && strlist != NULL && gmyth_string_list_length(strlist) > 0) {
+ gchar *back_msg_action;
+ gint msg_type;
- gmyth_debug("%d - Listening on Monitor socket...!\n", count);
+ bytes_sent = gmyth_string_list_get_int(strlist, 0);
+ // on backend error
+ gmyth_debug ("received data buffer from IO event channel... %d strings gone!\n", len);
+ recv += len;
- do {
+ /*
+ * debug purpose: prints out all the string list
+ * elements
+ */
+ g_list_foreach(strlist->glist,
+ (GFunc) gmyth_monitor_handler_print,
+ NULL);
- gint bytes_sent = 0;
+ back_msg_action = g_new0(gchar, 1);
+ msg_type = gmyth_monitor_handler_is_backend_message(monitor,
+ strlist,
+ &back_msg_action);
- strlist = gmyth_string_list_new();
-
- if (monitor->event_sock != NULL) {
-
- len =
- gmyth_socket_read_stringlist(monitor->event_sock,
- strlist);
-
- if ((len > 0) && strlist != NULL
- && gmyth_string_list_length(strlist) > 0) {
- bytes_sent = gmyth_string_list_get_int(strlist, 0); // -1
- //
- //
- // on
- // backend
- // error
-
- gmyth_debug
- ("[%s] MONITOR: received data buffer from IO event channel... %d strings gone!\n",
- __FUNCTION__, len);
-
- recv += len;
-
- /*
- * debug purpose: prints out all the string list
- * elements
- */
- g_list_foreach(strlist->glist,
- (GFunc) gmyth_monitor_handler_print,
- NULL);
-
- gchar *back_msg_action = g_new0(gchar, 1);
- gint msg_type =
- gmyth_monitor_handler_is_backend_message(monitor,
- strlist,
- &back_msg_action);
-
- if (monitor != NULL
- && msg_type != GMYTH_BACKEND_NO_MESSAGE)
- g_signal_emit(monitor, GMYTH_MONITOR_HANDLER_GET_CLASS(monitor)->backend_events_handler_signal_id, 0, /* details
- */
- msg_type, back_msg_action);
-
- if (back_msg_action != NULL)
- g_free(back_msg_action);
-
- }
-
- }
-
- if (strlist != NULL) {
- g_object_unref(strlist);
- strlist = NULL;
- }
-
- io_cond = g_io_channel_get_buffer_condition(io_channel);
-
- g_usleep(500);
-
+ if (msg_type != GMYTH_BACKEND_NO_MESSAGE) {
+ g_signal_emit(monitor,
+ GMYTH_MONITOR_HANDLER_GET_CLASS(monitor)->backend_events_handler_signal_id,
+ 0, msg_type, back_msg_action);
}
- while (recv <= 0 && ((io_cond & G_IO_HUP) == 0));
- gmyth_debug("\tMONITOR EVENT: Read %d bytes\n", recv);
+ if (back_msg_action != NULL)
+ g_free(back_msg_action);
- } /* main GThread while */
+ g_object_unref(strlist);
+ }
- clean_up:
+clean_up:
myth_control_release_context(monitor);
-
- g_thread_exit(ret);
-
- return (gpointer) ret;
-
+ return TRUE;
}
-/**
+/**
* Opens connection events' socket the the Monitor socket on
* MythTV backend server.
*
@@ -616,7 +505,7 @@
*
* @return <code>true</code>, if the socket was successfully opened.
*/
-static gboolean
+static gboolean
gmyth_connect_to_backend_monitor(GMythMonitorHandler * monitor)
{
gboolean ret = TRUE;
@@ -625,7 +514,7 @@
/*
* Connects the socket, send Mythtv ANN Monitor and verify Mythtv
- * protocol version
+ * protocol version
*/
if (!gmyth_socket_connect_to_backend_events(monitor->event_sock,
monitor->hostname,
@@ -638,52 +527,38 @@
return ret;
}
-/**
+/**
* Opens connection the the Monitor socket on MythTV backend server,
* where all status messages are notified to the client.
- *
+ *
* @param monitor The GMythMonitorHandler instance.
* @param channel The GIOChannel instance to the Monitor socket.
- *
+ *
* @return Pointer to the boolean value, and it is <code>true</code> only if the
- * GMythMonitorHandler could be configured.
+ * GMythMonitorHandler could be configured.
*/
-static gboolean
+static gboolean
gmyth_monitor_handler_setup(GMythMonitorHandler * monitor,
GIOChannel * channel)
{
- gboolean ret = TRUE;
+ gboolean ret = TRUE;
if (channel != NULL) {
monitor->allow_msgs_listener = TRUE;
-
- monitor->th =
- g_thread_create((GThreadFunc) gmyth_monitor_handler_listener,
- monitor, TRUE, NULL);
- gmyth_debug("MONITOR GThread created!");
+ monitor->io_source = g_io_add_watch (channel, G_IO_IN | G_IO_ERR | G_IO_HUP,
+ gmyth_monitor_handler_listener,
+ monitor);
} else {
ret = FALSE;
- goto cleanup;
}
-
- if (NULL == monitor->th) {
- gmyth_debug
- ("[%s] Error adding GThread listener function to the IO control channel!\n",
- __FUNCTION__);
- ret = FALSE;
- goto cleanup;
- }
-
- cleanup:
-
return ret;
}
-/**
+/**
* Starts the MonitorHandler thread to the GIOWatcher.
- *
+ *
* @param monitor The GMythMonitorHandler instance.
- *
+ *
* @return <code>true</code>, if the MonitorHandler was started.
*/
gboolean
Modified: trunk/gmyth/src/gmyth_monitor_handler.h
===================================================================
--- trunk/gmyth/src/gmyth_monitor_handler.h 2007-08-21 16:14:42 UTC (rev 822)
+++ trunk/gmyth/src/gmyth_monitor_handler.h 2007-08-21 19:04:23 UTC (rev 823)
@@ -63,12 +63,12 @@
GObjectClass parent_class;
/*
- * callbacks
+ * callbacks
*/
guint backend_events_handler_signal_id;
/*
- * signal default handlers
+ * signal default handlers
*/
void (*backend_events_handler) (GMythMonitorHandler *
monitor, gint msg_code,
@@ -88,14 +88,8 @@
*/
GMythSocket *event_sock;
+ //gpointer(*gmyth_monitor_handler_listener) (gpointer data);
-
-
-
-
-
- gpointer(*gmyth_monitor_handler_listener) (gpointer data);
-
gchar *hostname;
gint port;
@@ -109,9 +103,7 @@
GHashTable *backend_msgs;
GMutex *mutex;
-
- GThread *th;
-
+ guint io_source;
};
GType gmyth_monitor_handler_get_type(void);
Modified: trunk/gmyth/src/gmyth_socket.c
===================================================================
--- trunk/gmyth/src/gmyth_socket.c 2007-08-21 16:14:42 UTC (rev 822)
+++ trunk/gmyth/src/gmyth_socket.c 2007-08-21 19:04:23 UTC (rev 823)
@@ -1071,7 +1071,7 @@
GIOCondition io_cond;
/*
- * verify if the input (read) buffer is ready to receive data
+ * verify if the input (read) buffer is ready to receive data
*/
g_mutex_lock(gmyth_socket->mutex);
@@ -1085,10 +1085,10 @@
/*
* if ( NULL == gmyth_socket->sd_io_ch->read_buf || ( NULL ==
* gmyth_socket->sd_io_ch->read_buf->str ) ) gmyth_socket->sd_io_ch =
- * g_io_channel_unix_new( gmyth_socket->sd );
+ * g_io_channel_unix_new( gmyth_socket->sd );
*/
- if (gmyth_socket->sd_io_ch->is_readable /* && !( ( io_cond & G_IO_IN )
+ if (gmyth_socket->sd_io_ch->is_readable /* && !( ( io_cond & G_IO_IN )
* == 0 ) */ )
io_status =
g_io_channel_read_chars(gmyth_socket->sd_io_ch, buffer,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-10-08 18:18:35
|
Revision: 864
http://gmyth.svn.sourceforge.net/gmyth/?rev=864&view=rev
Author: renatofilho
Date: 2007-10-08 11:17:47 -0700 (Mon, 08 Oct 2007)
Log Message:
-----------
fixed bug on uri without port
Modified Paths:
--------------
trunk/gmyth/src/gmyth_backendinfo.c
trunk/gmyth/src/gmyth_backendinfo.h
trunk/gmyth/src/gmyth_uri.c
trunk/gmyth/src/gmyth_uri.h
Modified: trunk/gmyth/src/gmyth_backendinfo.c
===================================================================
--- trunk/gmyth/src/gmyth_backendinfo.c 2007-09-26 18:04:24 UTC (rev 863)
+++ trunk/gmyth/src/gmyth_backendinfo.c 2007-10-08 18:17:47 UTC (rev 864)
@@ -152,14 +152,13 @@
GMythBackendInfo *
gmyth_backend_info_new_with_uri(const gchar * uri_str)
{
- GMythBackendInfo *backend_info =
- GMYTH_BACKEND_INFO(g_object_new(GMYTH_BACKEND_INFO_TYPE, NULL));
+ GMythBackendInfo *backend_info;
+ GMythURI *uri;
+ gchar **path_parts;
- GMythURI *uri = gmyth_uri_new_with_value(uri_str);
-
- gchar **path_parts =
- g_strsplit(gmyth_uri_get_path(uri), "&", -1);
-
+ backend_info = GMYTH_BACKEND_INFO(g_object_new(GMYTH_BACKEND_INFO_TYPE, NULL));
+ uri = gmyth_uri_new_with_value (uri_str);
+ path_parts = g_strsplit(gmyth_uri_get_path(uri), "&", -1);
gmyth_backend_info_set_hostname(backend_info, gmyth_uri_get_host(uri));
gmyth_backend_info_set_username(backend_info, gmyth_uri_get_user(uri));
gmyth_backend_info_set_password(backend_info,
Modified: trunk/gmyth/src/gmyth_backendinfo.h
===================================================================
--- trunk/gmyth/src/gmyth_backendinfo.h 2007-09-26 18:04:24 UTC (rev 863)
+++ trunk/gmyth/src/gmyth_backendinfo.h 2007-10-08 18:17:47 UTC (rev 864)
@@ -100,9 +100,9 @@
const gchar *password);
void gmyth_backend_info_set_db_name (GMythBackendInfo *backend_info,
const gchar *db_name);
-void gmyth_backend_info_set_db_port (GMythBackendInfo *backend_info,
- gint db_port);
-void gmyth_backend_info_set_port (GMythBackendInfo *backend_info,
+void gmyth_backend_info_set_db_port (GMythBackendInfo *backend_info,
+ gint db_port);
+void gmyth_backend_info_set_port (GMythBackendInfo *backend_info,
gint port);
void gmyth_backend_info_set_status_port (GMythBackendInfo *backend_info,
gint port);
Modified: trunk/gmyth/src/gmyth_uri.c
===================================================================
--- trunk/gmyth/src/gmyth_uri.c 2007-09-26 18:04:24 UTC (rev 863)
+++ trunk/gmyth/src/gmyth_uri.c 2007-10-08 18:17:47 UTC (rev 864)
@@ -39,6 +39,33 @@
#include "gmyth_debug.h"
+/****************************************
+* Define
+****************************************/
+
+#define GMYTH_URI_KNKOWN_PORT (-1)
+#define GMYTH_URI_DEFAULT_HTTP_PORT 80
+#define GMYTH_URI_DEFAULT_FTP_PORT 21
+#define GMYTH_URI_DEFAULT_MYTH_PORT 6543
+#define GMYTH_URI_DEFAULT_PATH "/"
+#define GMYTH_URI_MAXLEN 256
+
+#define GMYTH_URI_PROTOCOL_DELIM "://"
+#define GMYTH_URI_USER_DELIM "@"
+#define GMYTH_URI_COLON_DELIM ":"
+#define GMYTH_URI_SLASH_DELIM "/"
+#define GMYTH_URI_SBLACET_DELIM "["
+#define GMYTH_URI_EBLACET_DELIM "]"
+#define GMYTH_URI_SHARP_DELIM "#"
+#define GMYTH_URI_QUESTION_DELIM "?"
+#define GMYTH_URI_E_DELIM "&"
+#define GMYTH_URI_ESCAPING_CHAR "%"
+
+#define GMYTH_URI_PROTOCOL_MYTH "myth"
+#define GMYTH_URI_PROTOCOL_HTTP "http"
+#define GMYTH_URI_PROTOCOL_FTP "ftp"
+
+
static void gmyth_uri_class_init(GMythURIClass * klass);
static void gmyth_uri_init(GMythURI * object);
@@ -248,6 +275,21 @@
return "";
}
+static gint
+gmyth_uri_get_default_port (GMythURI * uri)
+{
+ const gchar *protocol = gmyth_uri_get_protocol(uri);
+
+ if (strcmp(protocol, GMYTH_URI_PROTOCOL_HTTP) == 0)
+ return GMYTH_URI_DEFAULT_HTTP_PORT;
+ if (strcmp(protocol, GMYTH_URI_PROTOCOL_FTP) == 0)
+ return GMYTH_URI_DEFAULT_FTP_PORT;
+ if (strcmp(protocol, GMYTH_URI_PROTOCOL_MYTH) == 0)
+ return GMYTH_URI_DEFAULT_MYTH_PORT;
+
+ return GMYTH_URI_KNKOWN_PORT;
+}
+
/**
* Parses a URI string into a GMythURI instance.
*
@@ -327,21 +369,15 @@
uri->host =
g_string_new_len(hostStr->str + 1, colonIdx - 2);
}
+
/**** port ****/
- portStr =
- g_string_new_len(hostStr->str + colonIdx + 1,
- hostLen - colonIdx - 1);
+ portStr = g_string_new_len(hostStr->str + colonIdx + 1,
+ hostLen - colonIdx - 1);
uri->port = (gint) g_ascii_strtoull(portStr->str, NULL, 10);
g_string_free(portStr, TRUE);
g_string_free(hostStr, TRUE);
} else {
- const gchar *protocol = gmyth_uri_get_protocol(uri);
-
- uri->port = GMYTH_URI_KNKOWN_PORT;
- if (strcmp(protocol, GMYTH_URI_PROTOCOL_HTTP) == 0)
- uri->port = GMYTH_URI_DEFAULT_HTTP_PORT;
- if (strcmp(protocol, GMYTH_URI_PROTOCOL_FTP) == 0)
- uri->port = GMYTH_URI_DEFAULT_FTP_PORT;
+ uri->port = gmyth_uri_get_default_port (uri);
}
if (shashIdx > 0)
Modified: trunk/gmyth/src/gmyth_uri.h
===================================================================
--- trunk/gmyth/src/gmyth_uri.h 2007-09-26 18:04:24 UTC (rev 863)
+++ trunk/gmyth/src/gmyth_uri.h 2007-10-08 18:17:47 UTC (rev 864)
@@ -46,31 +46,7 @@
typedef struct _GMythURI GMythURI;
typedef struct _GMythURIClass GMythURIClass;
- /****************************************
- * Define
- ****************************************/
-#define GMYTH_URI_KNKOWN_PORT (-1)
-#define GMYTH_URI_DEFAULT_HTTP_PORT 80
-#define GMYTH_URI_DEFAULT_FTP_PORT 21
-#define GMYTH_URI_DEFAULT_PATH "/"
-#define GMYTH_URI_MAXLEN 256
-
-#define GMYTH_URI_PROTOCOL_DELIM "://"
-#define GMYTH_URI_USER_DELIM "@"
-#define GMYTH_URI_COLON_DELIM ":"
-#define GMYTH_URI_SLASH_DELIM "/"
-#define GMYTH_URI_SBLACET_DELIM "["
-#define GMYTH_URI_EBLACET_DELIM "]"
-#define GMYTH_URI_SHARP_DELIM "#"
-#define GMYTH_URI_QUESTION_DELIM "?"
-#define GMYTH_URI_E_DELIM "&"
-#define GMYTH_URI_ESCAPING_CHAR "%"
-
-#define GMYTH_URI_PROTOCOL_MYTH "myth"
-#define GMYTH_URI_PROTOCOL_HTTP "http"
-#define GMYTH_URI_PROTOCOL_FTP "ftp"
-
/****************************************
* Data Type
****************************************/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-10-24 17:41:42
|
Revision: 870
http://gmyth.svn.sourceforge.net/gmyth/?rev=870&view=rev
Author: renatofilho
Date: 2007-10-24 10:41:42 -0700 (Wed, 24 Oct 2007)
Log Message:
-----------
created function stop recording
Modified Paths:
--------------
trunk/gmyth/src/gmyth_backendinfo.h
trunk/gmyth/src/gmyth_scheduler.c
trunk/gmyth/src/gmyth_scheduler.h
Modified: trunk/gmyth/src/gmyth_backendinfo.h
===================================================================
--- trunk/gmyth/src/gmyth_backendinfo.h 2007-10-23 12:58:20 UTC (rev 869)
+++ trunk/gmyth/src/gmyth_backendinfo.h 2007-10-24 17:41:42 UTC (rev 870)
@@ -116,7 +116,6 @@
gboolean gmyth_backend_info_is_local_file (GMythBackendInfo *backend_info);
GMythSocket* gmyth_backend_info_get_connected_socket
(GMythBackendInfo *backend_info);
-
G_END_DECLS
#endif /* __GMYTH_BACKEND_INFO_H__ */
Modified: trunk/gmyth/src/gmyth_scheduler.c
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.c 2007-10-23 12:58:20 UTC (rev 869)
+++ trunk/gmyth/src/gmyth_scheduler.c 2007-10-24 17:41:42 UTC (rev 870)
@@ -738,7 +738,7 @@
*/
GMythProgramInfo*
gmyth_scheduler_get_recorded_on_time(GMythScheduler* scheduler,
- GString* channel)
+ guint channel_id)
{
MYSQL_RES *msql_res;
GMythProgramInfo *proginfo = NULL;
@@ -757,8 +757,8 @@
"category,findid,duplicate "
"FROM recorded " "LEFT JOIN channel "
"ON recorded.chanid = channel.chanid "
- "WHERE recorded.chanid = \"%s\" "
- "ORDER BY starttime DESC", channel->str);
+ "WHERE recorded.chanid = %d "
+ "ORDER BY starttime DESC", channel_id);
msql_res =
gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
@@ -980,6 +980,116 @@
return proginfo;
}
+gboolean
+gmyth_scheduler_stop_recording (GMythScheduler * scheduler,
+ gint channel_id,
+ time_t start)
+{
+ GMythProgramInfo *program;
+ GMythSocket *socket;
+ gboolean res = FALSE;
+ GMythStringList *slist;
+
+ socket = gmyth_backend_info_get_connected_socket (scheduler->backend_info);
+ program = gmyth_scheduler_get_recorded_on_time (scheduler, channel_id);
+
+ if (program) {
+ slist = gmyth_string_list_new();
+ gmyth_string_list_append_char_array(slist, "STOP_RECORDING");
+
+ gmyth_string_list_append_string(slist, program->title); /* 0 */
+ gmyth_string_list_append_string(slist, program->subtitle); /* 1 */
+ gmyth_string_list_append_string(slist, program->description); /* 2 */
+ gmyth_string_list_append_string(slist, program->category); /* 3 */
+ gmyth_string_list_append_string(slist, program->chanid); /* 4 */
+ gmyth_string_list_append_string(slist, program->chanstr); /* 5 */
+ gmyth_string_list_append_string(slist, program->chansign); /* 6 */
+ gmyth_string_list_append_string(slist, program->channame); /* 7 */
+ gmyth_string_list_append_string(slist, program->pathname); /* 8 */
+ gmyth_string_list_append_int64(slist, program->filesize); /* 9 */
+
+ if (program->startts)
+ gmyth_string_list_append_int(slist, program->startts->tv_sec); /* 10 */
+ else
+ gmyth_string_list_append_int(slist, 0);
+
+ if (program->endts)
+ gmyth_string_list_append_int(slist, program->endts->tv_sec); /* 11 */
+ else
+ gmyth_string_list_append_int(slist, 0);
+
+ gmyth_string_list_append_int(slist, program->duplicate); /* 12 */
+ gmyth_string_list_append_int(slist, program->shareable); /* 13 */
+ gmyth_string_list_append_int(slist, program->findid); /* 14 */
+ gmyth_string_list_append_string(slist, program->hostname); /* 15 */
+ gmyth_string_list_append_int(slist, program->sourceid); /* 16 */
+ gmyth_string_list_append_int(slist, program->cardid); /* 17 */
+ gmyth_string_list_append_int(slist, program->inputid); /* 18 */
+ gmyth_string_list_append_int(slist, program->recpriority); /* 19 */
+
+ // recstatus == recording
+ gmyth_string_list_append_int(slist, -3); /* 20 */
+
+ gmyth_string_list_append_int(slist, program->recordid); /* 21 */
+ gmyth_string_list_append_int(slist, program->rectype); /* 22 */
+ gmyth_string_list_append_int(slist, program->dupin); /* 23 */
+ gmyth_string_list_append_int(slist, program->dupmethod); /* 24 */
+
+
+ //fixme
+ program->recstartts->tv_sec -= (60*60);
+
+ gmyth_string_list_append_int(slist,
+ program->recstartts != NULL ?
+ program->recstartts->tv_sec : 0); /* 26 */
+
+ gmyth_string_list_append_int(slist,
+ program->recendts != NULL ?
+ program->recendts->tv_sec : 0); /* 27 */
+
+ gmyth_string_list_append_int(slist, program->repeat); /* 28 */
+ gmyth_string_list_append_int(slist, program->programflags); /* 29 */
+
+ gmyth_string_list_append_char_array(slist,
+ program->recgroup != NULL ?
+ program->recgroup->str : "Default"); /* 30 */
+
+ gmyth_string_list_append_int(slist, program->chancommfree); /* 31 */
+ gmyth_string_list_append_string(slist, program->chanOutputFilters); /* 32 */
+ gmyth_string_list_append_string(slist, program->seriesid); /* 33 */
+ gmyth_string_list_append_string(slist, program->programid); /* 34 */
+
+ gmyth_string_list_append_int(slist,
+ program->lastmodified != NULL ?
+ program->lastmodified->tv_sec : 0); /* 35 */
+
+ gmyth_string_list_append_float(slist, program->stars); /* 36 */
+
+ gmyth_string_list_append_int(slist,
+ program->originalAirDate != NULL ?
+ program->originalAirDate->tv_sec : 0); /* 37 */
+
+ gmyth_string_list_append_int(slist, program->hasAirDate); /* 38 */
+
+ gmyth_string_list_append_char_array(slist,
+ program->playgroup != NULL ?
+ program->playgroup->str : "Default"); /* 39 */
+
+ gmyth_string_list_append_int(slist, program->recpriority2); /* 40 */
+ gmyth_string_list_append_int(slist, program->recpriority2); /* 40 */
+
+ gmyth_socket_sendreceive_stringlist(socket, slist);
+ res = (gmyth_string_list_get_int(slist, 0) == 1);
+
+ g_object_unref (program);
+ g_object_unref (slist);
+ }
+
+ g_object_unref (socket);
+ return res;
+}
+
+
/** Notifies the backend of an update in the db.
*
* @param record_id the id of the modified recording.
Modified: trunk/gmyth/src/gmyth_scheduler.h
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.h 2007-10-23 12:58:20 UTC (rev 869)
+++ trunk/gmyth/src/gmyth_scheduler.h 2007-10-24 17:41:42 UTC (rev 870)
@@ -136,52 +136,55 @@
} RecordedInfo;
-GType gmyth_scheduler_get_type (void);
+GType gmyth_scheduler_get_type (void);
-GMythScheduler *gmyth_scheduler_new (void);
-gboolean gmyth_scheduler_connect (GMythScheduler * scheduler,
- GMythBackendInfo * backend_info);
-gboolean gmyth_scheduler_connect_with_timeout(GMythScheduler * scheduler,
- GMythBackendInfo * backend_info,
- guint timeout);
-gboolean gmyth_scheduler_disconnect (GMythScheduler * scheduler);
-gint gmyth_scheduler_get_schedule_list (GMythScheduler * scheduler,
- GList ** sched_list);
-gint gmyth_scheduler_get_recorded_list (GMythScheduler * scheduler,
- GList ** rec_list);
-RecordedInfo* gmyth_scheduler_get_recorded_info (GMythScheduler *scheduler,
- const char *basename);
+GMythScheduler* gmyth_scheduler_new (void);
+gboolean gmyth_scheduler_connect (GMythScheduler * scheduler,
+ GMythBackendInfo * backend_info);
+gboolean gmyth_scheduler_connect_with_timeout (GMythScheduler * scheduler,
+ GMythBackendInfo * backend_info,
+ guint timeout);
+gboolean gmyth_scheduler_disconnect (GMythScheduler * scheduler);
+gint gmyth_scheduler_get_schedule_list (GMythScheduler * scheduler,
+ GList ** sched_list);
+gint gmyth_scheduler_get_recorded_list (GMythScheduler * scheduler,
+ GList ** rec_list);
+RecordedInfo* gmyth_scheduler_get_recorded_info (GMythScheduler *scheduler,
+ const char *basename);
+gboolean gmyth_scheduler_was_recorded_before (GMythScheduler* scheduler,
+ gint channel_id,
+ time_t start_time);
+gboolean gmyth_scheduler_reactivate_schedule (GMythScheduler* scheduler,
+ gint channel_id,
+ time_t start_time);
+GMythProgramInfo* gmyth_scheduler_get_recorded_on_time (GMythScheduler* scheduler,
+ guint channel_id);
+GMythProgramInfo* gmyth_scheduler_get_recorded (GMythScheduler * scheduler,
+ GString * channel,
+ GTimeVal * starttime);
+gint gmyth_scheduler_add_schedule (GMythScheduler * scheduler,
+ ScheduleInfo * schedule_info);
+gboolean gmyth_scheduler_add_schedule_full (GMythScheduler * scheduler,
+ ScheduleInfo * schedule_info,
+ GMythScheduleType type);
+gboolean gmyth_scheduler_add_exception (GMythScheduler *scheduler,
+ gint schedule_id,
+ ScheduleInfo *exception_info);
+gint gmyth_scheduler_delete_schedule (GMythScheduler * scheduler,
+ gint record_id);
+gint gmyth_scheduler_delete_recorded (GMythScheduler * scheduler,
+ gint record_id);
+gboolean gmyth_scheduler_stop_recording (GMythScheduler * scheduler,
+ gint channel_id,
+ time_t start);
+void gmyth_scheduler_recorded_info_get_preview(RecordedInfo * info,
+ GByteArray * data);
-gboolean gmyth_scheduler_was_recorded_before(GMythScheduler* scheduler, gint channel_id,
- time_t start_time);
-gboolean gmyth_scheduler_reactivate_schedule(GMythScheduler* scheduler, gint channel_id,
- time_t start_time);
-GMythProgramInfo*
-gmyth_scheduler_get_recorded_on_time(GMythScheduler* scheduler,
- GString* channel);
-GMythProgramInfo *gmyth_scheduler_get_recorded (GMythScheduler * scheduler,
- GString * channel,
- GTimeVal * starttime);
-gint gmyth_scheduler_add_schedule (GMythScheduler * scheduler,
- ScheduleInfo * schedule_info);
-gboolean gmyth_scheduler_add_schedule_full (GMythScheduler * scheduler,
- ScheduleInfo * schedule_info, GMythScheduleType type);
-gboolean gmyth_scheduler_add_exception (GMythScheduler *scheduler, gint schedule_id,
- ScheduleInfo *exception_info);
+void gmyth_recorded_info_free (RecordedInfo * info);
+void gmyth_schedule_info_free (ScheduleInfo * info);
+void gmyth_recorded_info_list_free (GList * list);
+void gmyth_schedule_info_list_free (GList * list);
-
-gint gmyth_scheduler_delete_schedule (GMythScheduler * scheduler,
- gint record_id);
-gint gmyth_scheduler_delete_recorded (GMythScheduler * scheduler,
- gint record_id);
-void gmyth_scheduler_recorded_info_get_preview
- (RecordedInfo * info,
- GByteArray * data);
-void gmyth_recorded_info_free (RecordedInfo * info);
-void gmyth_schedule_info_free (ScheduleInfo * info);
-void gmyth_recorded_info_list_free (GList * list);
-void gmyth_schedule_info_list_free (GList * list);
-
G_END_DECLS
#endif /* __GMYTH_SCHEDULER_H__ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-11-21 15:06:28
|
Revision: 890
http://gmyth.svn.sourceforge.net/gmyth/?rev=890&view=rev
Author: renatofilho
Date: 2007-11-21 07:06:32 -0800 (Wed, 21 Nov 2007)
Log Message:
-----------
fixed dbname on backendinfo constructor; fixed uri livetv detect
Modified Paths:
--------------
trunk/gmyth/src/gmyth_backendinfo.c
trunk/gmyth/src/gmyth_uri.c
Modified: trunk/gmyth/src/gmyth_backendinfo.c
===================================================================
--- trunk/gmyth/src/gmyth_backendinfo.c 2007-11-21 13:10:19 UTC (rev 889)
+++ trunk/gmyth/src/gmyth_backendinfo.c 2007-11-21 15:06:32 UTC (rev 890)
@@ -155,6 +155,7 @@
GMythBackendInfo *backend_info;
GMythURI *uri;
gchar **path_parts;
+ gchar *db;
backend_info = GMYTH_BACKEND_INFO(g_object_new(GMYTH_BACKEND_INFO_TYPE, NULL));
uri = gmyth_uri_new_with_value (uri_str);
@@ -168,13 +169,17 @@
* gets the path info to database name, from the URI, and removes the
* trash chars
*/
- gmyth_backend_info_set_db_name(backend_info, path_parts != NULL &&
- strlen(path_parts[0]) > 0 ?
- g_strstrip(g_strdelimit
- (path_parts[0], "/?",
- ' ')) :
- gmyth_uri_get_path(uri));
+ if ((path_parts != NULL) && (strlen (path_parts[0]) > 0))
+ {
+ db = path_parts[0]+2;
+ }
+ else
+ {
+ db = gmyth_uri_get_path(uri);
+ }
+ gmyth_backend_info_set_db_name(backend_info, db);
+
gmyth_backend_info_set_port(backend_info, gmyth_uri_get_port(uri));
g_object_unref(uri);
Modified: trunk/gmyth/src/gmyth_uri.c
===================================================================
--- trunk/gmyth/src/gmyth_uri.c 2007-11-21 13:10:19 UTC (rev 889)
+++ trunk/gmyth/src/gmyth_uri.c 2007-11-21 15:06:32 UTC (rev 890)
@@ -472,7 +472,7 @@
g_return_val_if_fail(uri->uri != NULL, FALSE);
g_return_val_if_fail(uri->uri->str != NULL, FALSE);
- if ((strstr(uri->uri->str, "channel") == NULL) ||
+ if ((strstr(uri->uri->str, "channel=") == NULL) &&
(strstr(uri->uri->str, "livetv") == NULL))
ret = FALSE;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2008-01-23 20:04:18
|
Revision: 896
http://gmyth.svn.sourceforge.net/gmyth/?rev=896&view=rev
Author: renatofilho
Date: 2008-01-23 12:04:22 -0800 (Wed, 23 Jan 2008)
Log Message:
-----------
fixed channel_id, program_id types
Modified Paths:
--------------
trunk/gmyth/src/gmyth_epg.c
trunk/gmyth/src/gmyth_programinfo.c
trunk/gmyth/src/gmyth_programinfo.h
trunk/gmyth/src/gmyth_recorder.c
trunk/gmyth/src/gmyth_scheduler.c
trunk/gmyth/src/gmyth_scheduler.h
Modified: trunk/gmyth/src/gmyth_epg.c
===================================================================
--- trunk/gmyth/src/gmyth_epg.c 2008-01-15 17:44:34 UTC (rev 895)
+++ trunk/gmyth/src/gmyth_epg.c 2008-01-23 20:04:22 UTC (rev 896)
@@ -311,7 +311,7 @@
GMythProgramInfo *p = gmyth_program_info_new();
- p->chanid = g_string_new(row[0]);
+ p->xx_channel_id = (int) g_ascii_strtoull (row[0], NULL, 10);
p->startts = gmyth_util_string_to_time_val(row[1]);
p->endts = gmyth_util_string_to_time_val(row[2]);
@@ -340,7 +340,7 @@
p->chancommfree = g_ascii_strtoull(row[11], NULL, 10);
p->chanOutputFilters = g_string_new(row[12]);
p->seriesid = g_string_new(row[13]);
- p->programid = g_string_new(row[14]);
+ p->xx_program_id = g_string_new(row[14]);
p->year = g_string_new(row[15]);
p->stars = g_ascii_strtod(row[16], NULL);
Modified: trunk/gmyth/src/gmyth_programinfo.c
===================================================================
--- trunk/gmyth/src/gmyth_programinfo.c 2008-01-15 17:44:34 UTC (rev 895)
+++ trunk/gmyth/src/gmyth_programinfo.c 2008-01-23 20:04:22 UTC (rev 896)
@@ -107,11 +107,6 @@
{
GMythProgramInfo *gmyth_program_info = GMYTH_PROGRAM_INFO(object);
- if (gmyth_program_info->chanid != NULL) {
- g_string_free(gmyth_program_info->chanid, TRUE);
- gmyth_program_info->chanid = NULL;
- }
-
/** The program start time. */
g_free(gmyth_program_info->startts);
@@ -175,9 +170,9 @@
}
/** The program unique id. */
- if (gmyth_program_info->programid != NULL) {
- g_string_free(gmyth_program_info->programid, TRUE);
- gmyth_program_info->programid = NULL;
+ if (gmyth_program_info->xx_program_id != NULL) {
+ g_string_free (gmyth_program_info->xx_program_id, TRUE);
+ gmyth_program_info->xx_program_id = NULL;
}
if (gmyth_program_info->catType != NULL) {
@@ -273,7 +268,7 @@
gmyth_string_list_append_string(slist, prog->subtitle); /* 1 */
gmyth_string_list_append_string(slist, prog->description); /* 2 */
gmyth_string_list_append_string(slist, prog->category); /* 3 */
- gmyth_string_list_append_string(slist, prog->chanid); /* 4 */
+ gmyth_string_list_append_int (slist, prog->xx_channel_id); /* 4 */
gmyth_string_list_append_string(slist, prog->chanstr); /* 5 */
gmyth_string_list_append_string(slist, prog->chansign); /* 6 */
gmyth_string_list_append_string(slist, prog->channame); /* 7 */
@@ -326,7 +321,7 @@
gmyth_string_list_append_string(slist, prog->chanOutputFilters); /* 32
*/
gmyth_string_list_append_string(slist, prog->seriesid); /* 33 */
- gmyth_string_list_append_string(slist, prog->programid); /* 34 */
+ gmyth_string_list_append_string(slist, prog->xx_program_id); /* 34 */
gmyth_string_list_append_char_array(slist, ""); /* 35 */
gmyth_string_list_append_int(slist, prog->lastmodified != NULL ? prog->lastmodified->tv_sec : 0); /* 36
*/// DATETIME_TO_LIST(lastmodified)
@@ -367,7 +362,7 @@
prog->subtitle = gmyth_string_list_get_string(slist, pos + 1);
prog->description = gmyth_string_list_get_string(slist, pos + 2);
prog->category = gmyth_string_list_get_string(slist, pos + 3);
- prog->chanid = gmyth_string_list_get_string(slist, pos + 4);
+ prog->xx_channel_id = gmyth_string_list_get_int (slist, pos + 4);
prog->channame = gmyth_string_list_get_string(slist, pos + 5);
prog->chanstr = gmyth_string_list_get_string(slist, pos + 6);
prog->chansign = gmyth_string_list_get_string(slist, pos + 7);
@@ -375,12 +370,11 @@
prog->filesize = gmyth_string_list_get_int64(slist, pos + 9);
- gmyth_debug("Prog info: [ %s, %s, %s, %s, %s, %s, %s, %s, %s, %d ]\n",
+ gmyth_debug("Prog info: [ %s, %s, %s, %s, %s, %s, %s, %s, %d ]\n",
gmyth_program_info_non_null_value(prog->title),
gmyth_program_info_non_null_value(prog->subtitle),
gmyth_program_info_non_null_value(prog->description),
gmyth_program_info_non_null_value(prog->category),
- gmyth_program_info_non_null_value(prog->chanid),
gmyth_program_info_non_null_value(prog->channame),
gmyth_program_info_non_null_value(prog->chanstr),
gmyth_program_info_non_null_value(prog->chansign),
@@ -419,7 +413,7 @@
prog->chanOutputFilters =
gmyth_string_list_get_string(slist, pos + 32);
prog->seriesid = gmyth_string_list_get_string(slist, pos + 33);
- prog->programid = gmyth_string_list_get_string(slist, pos + 34);
+ prog->xx_program_id = gmyth_string_list_get_string(slist, pos + 34);
gmyth_string_list_get_string(slist, pos + 35);
prog->lastmodified = gmyth_util_string_to_time_val((gmyth_util_time_to_isoformat((time_t) gmyth_string_list_get_int(slist, pos + 36)))->str); // DATETIME_TO_LIST(lastmodified)
gmyth_string_list_get_int(slist, pos + 37); // FLOAT_TO_LIST(stars)
@@ -490,16 +484,15 @@
prog->channame = gmyth_string_list_get_string(slist, 6);
prog->chansign = gmyth_string_list_get_string(slist, 7);
prog->chanstr = gmyth_string_list_get_string(slist, 8);
- prog->chanid = gmyth_string_list_get_string(slist, 9);
+ prog->xx_channel_id = gmyth_string_list_get_int (slist, 9);
prog->filesize = gmyth_string_list_get_int64(slist, 10);
gmyth_debug
- ("NEXT program info: [ %s, %s, %s, %s, %s, %s, %s, %s, %s ]\n",
+ ("NEXT program info: [ %s, %s, %s, %s, %s, %s, %s, %s ]\n",
gmyth_program_info_non_null_value(prog->title),
gmyth_program_info_non_null_value(prog->subtitle),
gmyth_program_info_non_null_value(prog->description),
gmyth_program_info_non_null_value(prog->category),
- gmyth_program_info_non_null_value(prog->chanid),
gmyth_program_info_non_null_value(prog->channame),
gmyth_program_info_non_null_value(prog->chanstr),
gmyth_program_info_non_null_value(prog->chansign),
@@ -527,7 +520,7 @@
{
return
g_strdup_printf
- ("Title: %s, Subtitle: %s, Description: %s, Category: %s, Channel ID: %s, "
+ ("Title: %s, Subtitle: %s, Description: %s, Category: %s, Channel ID: %d, "
"Channel Name: %s, Chan str: %s, Channel Sign: %s, Path Name: %s, File Size: %lld, \n"
"Start TS: %s, End TS: %s, Duplicate: %d, Shareable: %d, Find ID: %d, Hostname: %s, "
"Source ID: %d, Vard ID: %d, Input ID: %d, Rec Priority: %d, Reactivate: %d, \n"
@@ -539,7 +532,7 @@
gmyth_program_info_non_null_value(prog->subtitle),
gmyth_program_info_non_null_value(prog->description),
gmyth_program_info_non_null_value(prog->category),
- gmyth_program_info_non_null_value(prog->chanid),
+ prog->xx_channel_id,
gmyth_program_info_non_null_value(prog->channame),
gmyth_program_info_non_null_value(prog->chanstr),
gmyth_program_info_non_null_value(prog->chansign),
@@ -557,7 +550,7 @@
prog->chancommfree,
gmyth_program_info_non_null_value(prog->chanOutputFilters),
gmyth_program_info_non_null_value(prog->seriesid),
- gmyth_program_info_non_null_value(prog->programid),
+ gmyth_program_info_non_null_value(prog->xx_program_id),
gmyth_util_time_to_string_from_time_val(prog->lastmodified),
gmyth_util_time_to_string_from_time_val(prog->originalAirDate),
prog->hasAirDate,
Modified: trunk/gmyth/src/gmyth_programinfo.h
===================================================================
--- trunk/gmyth/src/gmyth_programinfo.h 2008-01-15 17:44:34 UTC (rev 895)
+++ trunk/gmyth/src/gmyth_programinfo.h 2008-01-23 20:04:22 UTC (rev 896)
@@ -62,7 +62,7 @@
GObject parent;
/** The channel unique ID. */
- GString *chanid;
+ gint xx_channel_id;
/** The program start time. */
GTimeVal *startts;
/** The program end time. */
@@ -90,7 +90,7 @@
GString *seriesid;
/** The program unique id. */
- GString *programid;
+ GString *xx_program_id;
GString *catType;
GString *sortTitle;
Modified: trunk/gmyth/src/gmyth_recorder.c
===================================================================
--- trunk/gmyth/src/gmyth_recorder.c 2008-01-15 17:44:34 UTC (rev 895)
+++ trunk/gmyth/src/gmyth_recorder.c 2008-01-23 20:04:22 UTC (rev 896)
@@ -917,7 +917,7 @@
gmyth_string_list_append_string(str_list, tmp_str);
gmyth_string_list_append_char_array(str_list, "GET_NEXT_PROGRAM_INFO");
gmyth_string_list_append_string(str_list, actual_proginfo->channame);
- gmyth_string_list_append_string(str_list, actual_proginfo->chanid);
+ gmyth_string_list_append_int(str_list, actual_proginfo->xx_channel_id);
gmyth_string_list_append_int(str_list, direction);
gmyth_string_list_append_char_array(str_list, date);
Modified: trunk/gmyth/src/gmyth_scheduler.c
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.c 2008-01-15 17:44:34 UTC (rev 895)
+++ trunk/gmyth/src/gmyth_scheduler.c 2008-01-23 20:04:22 UTC (rev 896)
@@ -31,6 +31,7 @@
#include <assert.h>
+#include <glib.h>
#include <glib/gprintf.h>
#include "gmyth_scheduler.h"
@@ -244,8 +245,8 @@
schedule->schedule_id =
(guint) g_ascii_strtoull(row[0], NULL, 10);
- schedule->program_id = g_string_new (row[1]);
- schedule->channel_id = g_string_new (row[2]);
+ schedule->xx_program_id = g_string_new (row[1]);
+ schedule->xx_channel_id = (gint) g_ascii_strtoull (row[2], NULL, 10);
/*
* generate a time_t from a time and a date db field
@@ -331,9 +332,8 @@
record = g_new0(RecordedInfo, 1);
record->record_id = (guint) g_ascii_strtoull(row[0], NULL, 10);
- record->program_id =
- (guint) g_ascii_strtoull(row[1], NULL, 10);
- record->channel_id = g_string_new (row[2]);
+ record->xx_program_id = g_string_new (row[1]);
+ record->xx_channel_id = (gint) g_ascii_strtoull(row[2], NULL, 10);
record->start_time = gmyth_util_string_to_time_val(row[3]);
record->end_time = gmyth_util_string_to_time_val(row[5]);
@@ -390,8 +390,8 @@
if (row != NULL) {
record = g_new0(RecordedInfo, 1);
record->record_id = (guint) g_ascii_strtoull(row[0], NULL, 10);
- record->program_id = (guint) g_ascii_strtoull(row[1], NULL, 10);
- record->channel_id = g_string_new (row[2]);
+ record->xx_program_id = g_string_new (row[1]);
+ record->xx_channel_id = (gint) g_ascii_strtoull(row[2], NULL, 10);
record->start_time = gmyth_util_string_to_time_val(row[3]);
record->end_time = gmyth_util_string_to_time_val(row[5]);
record->title = g_string_new(row[7]);
@@ -442,8 +442,8 @@
ScheduleInfo *info;
info = g_new0 (ScheduleInfo, 1);
- info->program_id = g_string_new (program->programid->str);
- info->channel_id = g_string_new (program->chanid->str);
+ info->xx_program_id = g_string_new (program->xx_program_id->str);
+ info->xx_channel_id = program->xx_channel_id;
info->start_time = g_new0 (GTimeVal, 1);
*info->start_time = *program->startts;
info->end_time = g_new0 (GTimeVal, 1);
@@ -483,7 +483,7 @@
gchar *station = NULL;
gulong rec_id;
- assert(scheduler);
+ g_return_val_if_fail (IS_GMYTH_SCHEDULER (scheduler), FALSE);
if (scheduler->msqlquery == NULL) {
g_warning("[%s] Scheduler db connection not initialized",
@@ -499,8 +499,8 @@
// Retrieves the station info
query_str =
g_strdup_printf
- ("SELECT callsign FROM channel WHERE chanid = \"%s\";",
- schedule_info->channel_id->str);
+ ("SELECT callsign FROM channel WHERE chanid = %d;",
+ schedule_info->xx_channel_id);
msql_res =
gmyth_query_process_statement(scheduler->msqlquery, query_str);
if (msql_res == NULL) {
@@ -517,8 +517,8 @@
g_free(query_str);
// _set_value (field, value, id);
- _set_value(scheduler->msqlquery, "chanid",
- schedule_info->channel_id->str, rec_id);
+ _set_int_value(scheduler->msqlquery, "chanid",
+ schedule_info->xx_channel_id, rec_id);
_set_value(scheduler->msqlquery, "station", station, rec_id);
_set_value(scheduler->msqlquery, "title", schedule_info->title->str,
rec_id);
@@ -546,8 +546,10 @@
// (gint)(schedule_info->start_time->tv_sec/60/60/24 + 719528),
// rec_id);
- _set_value(scheduler->msqlquery, "seriesid",
- schedule_info->seriesid->str, rec_id);
+ if (schedule_info->seriesid)
+ _set_value(scheduler->msqlquery, "seriesid",
+ schedule_info->seriesid->str, rec_id);
+
_set_value(scheduler->msqlquery, "parentid", "0", rec_id);
_set_value(scheduler->msqlquery, "search", "0", rec_id);
@@ -811,7 +813,7 @@
if (msql_row) {
proginfo = gmyth_program_info_new();
- proginfo->chanid = g_string_new(msql_row[0]);
+ proginfo->xx_channel_id = (gint) g_ascii_strtoull (msql_row[0], NULL, 10);
proginfo->recstartts = gmyth_util_string_to_time_val(msql_row[1]);
proginfo->recendts = gmyth_util_string_to_time_val(msql_row[2]);
@@ -825,7 +827,7 @@
proginfo->chancommfree = (gint) g_ascii_strtoull(msql_row[9], NULL, 10);
proginfo->chanOutputFilters = g_string_new(msql_row[10]);
proginfo->seriesid = g_string_new(msql_row[11]);
- proginfo->programid = g_string_new(msql_row[12]);
+ proginfo->xx_program_id = g_string_new(msql_row[12]);
proginfo->filesize = g_ascii_strtoull(msql_row[13], NULL, 10);
proginfo->lastmodified = gmyth_util_string_to_time_val(msql_row[14]);
@@ -959,7 +961,7 @@
if (msql_row) {
proginfo = gmyth_program_info_new();
- proginfo->chanid = g_string_new(msql_row[0]);
+ proginfo->xx_channel_id = (gint) g_ascii_strtoull (msql_row[0], NULL, 10);
proginfo->startts =
gmyth_util_string_to_time_val(msql_row[23]);
proginfo->endts = gmyth_util_string_to_time_val(msql_row[24]);
@@ -978,7 +980,7 @@
(gint) g_ascii_strtoull(msql_row[9], NULL, 10);
proginfo->chanOutputFilters = g_string_new(msql_row[10]);
proginfo->seriesid = g_string_new(msql_row[11]);
- proginfo->programid = g_string_new(msql_row[12]);
+ proginfo->xx_program_id = g_string_new(msql_row[12]);
proginfo->filesize = g_ascii_strtoull(msql_row[13], NULL, 10);
proginfo->lastmodified =
@@ -1042,7 +1044,7 @@
gmyth_string_list_append_string(slist, program->subtitle); /* 1 */
gmyth_string_list_append_string(slist, program->description); /* 2 */
gmyth_string_list_append_string(slist, program->category); /* 3 */
- gmyth_string_list_append_string(slist, program->chanid); /* 4 */
+ gmyth_string_list_append_int(slist, program->xx_channel_id); /* 4 */
gmyth_string_list_append_string(slist, program->chanstr); /* 5 */
gmyth_string_list_append_string(slist, program->chansign); /* 6 */
gmyth_string_list_append_string(slist, program->channame); /* 7 */
@@ -1098,7 +1100,7 @@
gmyth_string_list_append_int(slist, program->chancommfree); /* 31 */
gmyth_string_list_append_string(slist, program->chanOutputFilters); /* 32 */
gmyth_string_list_append_string(slist, program->seriesid); /* 33 */
- gmyth_string_list_append_string(slist, program->programid); /* 34 */
+ gmyth_string_list_append_string(slist, program->xx_program_id); /* 34 */
gmyth_string_list_append_int(slist,
program->lastmodified != NULL ?
@@ -1170,9 +1172,11 @@
void
gmyth_recorded_info_free(RecordedInfo * info)
{
- if (info->channel_id)
- g_string_free (info->channel_id, TRUE);
+ g_return_if_fail (info != NULL);
+ if (info->xx_program_id)
+ g_string_free (info->xx_program_id, TRUE);
+
if (info->title != NULL)
g_string_free(info->title, TRUE);
@@ -1220,8 +1224,8 @@
g_return_if_fail(info != NULL);
- if (info->channel_id)
- g_string_free (info->channel_id, TRUE);
+ if (info->xx_program_id)
+ g_string_free (info->xx_program_id, TRUE);
if (info->title != NULL)
g_string_free(info->title, TRUE);
Modified: trunk/gmyth/src/gmyth_scheduler.h
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.h 2008-01-15 17:44:34 UTC (rev 895)
+++ trunk/gmyth/src/gmyth_scheduler.h 2008-01-23 20:04:22 UTC (rev 896)
@@ -99,8 +99,8 @@
typedef struct {
guint schedule_id;
- GString *program_id;
- GString *channel_id;
+ gint xx_channel_id;
+ GString *xx_program_id;
GTimeVal *start_time;
GTimeVal *end_time;
@@ -119,8 +119,8 @@
typedef struct {
guint record_id;
- guint program_id;
- GString *channel_id;
+ gint xx_channel_id;
+ GString *xx_program_id;
GTimeVal *start_time;
GTimeVal *end_time;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2008-01-29 18:40:15
|
Revision: 901
http://gmyth.svn.sourceforge.net/gmyth/?rev=901&view=rev
Author: renatofilho
Date: 2008-01-29 10:40:18 -0800 (Tue, 29 Jan 2008)
Log Message:
-----------
fixed var names
Modified Paths:
--------------
trunk/gmyth/src/gmyth_epg.c
trunk/gmyth/src/gmyth_programinfo.c
trunk/gmyth/src/gmyth_programinfo.h
trunk/gmyth/src/gmyth_recorder.c
trunk/gmyth/src/gmyth_scheduler.c
trunk/gmyth/src/gmyth_scheduler.h
Modified: trunk/gmyth/src/gmyth_epg.c
===================================================================
--- trunk/gmyth/src/gmyth_epg.c 2008-01-28 19:39:14 UTC (rev 900)
+++ trunk/gmyth/src/gmyth_epg.c 2008-01-29 18:40:18 UTC (rev 901)
@@ -311,7 +311,7 @@
GMythProgramInfo *p = gmyth_program_info_new();
- p->xx_channel_id = (int) g_ascii_strtoull (row[0], NULL, 10);
+ p->channel_id = (int) g_ascii_strtoull (row[0], NULL, 10);
p->startts = gmyth_util_string_to_time_val(row[1]);
p->endts = gmyth_util_string_to_time_val(row[2]);
@@ -340,7 +340,7 @@
p->chancommfree = g_ascii_strtoull(row[11], NULL, 10);
p->chanOutputFilters = g_string_new(row[12]);
p->seriesid = g_string_new(row[13]);
- p->xx_program_id = g_string_new(row[14]);
+ p->program_id = g_string_new(row[14]);
p->year = g_string_new(row[15]);
p->stars = g_ascii_strtod(row[16], NULL);
Modified: trunk/gmyth/src/gmyth_programinfo.c
===================================================================
--- trunk/gmyth/src/gmyth_programinfo.c 2008-01-28 19:39:14 UTC (rev 900)
+++ trunk/gmyth/src/gmyth_programinfo.c 2008-01-29 18:40:18 UTC (rev 901)
@@ -170,9 +170,9 @@
}
/** The program unique id. */
- if (gmyth_program_info->xx_program_id != NULL) {
- g_string_free (gmyth_program_info->xx_program_id, TRUE);
- gmyth_program_info->xx_program_id = NULL;
+ if (gmyth_program_info->program_id != NULL) {
+ g_string_free (gmyth_program_info->program_id, TRUE);
+ gmyth_program_info->program_id = NULL;
}
if (gmyth_program_info->catType != NULL) {
@@ -268,7 +268,7 @@
gmyth_string_list_append_string(slist, prog->subtitle); /* 1 */
gmyth_string_list_append_string(slist, prog->description); /* 2 */
gmyth_string_list_append_string(slist, prog->category); /* 3 */
- gmyth_string_list_append_int (slist, prog->xx_channel_id); /* 4 */
+ gmyth_string_list_append_int (slist, prog->channel_id); /* 4 */
gmyth_string_list_append_string(slist, prog->chanstr); /* 5 */
gmyth_string_list_append_string(slist, prog->chansign); /* 6 */
gmyth_string_list_append_string(slist, prog->channame); /* 7 */
@@ -321,7 +321,7 @@
gmyth_string_list_append_string(slist, prog->chanOutputFilters); /* 32
*/
gmyth_string_list_append_string(slist, prog->seriesid); /* 33 */
- gmyth_string_list_append_string(slist, prog->xx_program_id); /* 34 */
+ gmyth_string_list_append_string(slist, prog->program_id); /* 34 */
gmyth_string_list_append_char_array(slist, ""); /* 35 */
gmyth_string_list_append_int(slist, prog->lastmodified != NULL ? prog->lastmodified->tv_sec : 0); /* 36
*/// DATETIME_TO_LIST(lastmodified)
@@ -362,7 +362,7 @@
prog->subtitle = gmyth_string_list_get_string(slist, pos + 1);
prog->description = gmyth_string_list_get_string(slist, pos + 2);
prog->category = gmyth_string_list_get_string(slist, pos + 3);
- prog->xx_channel_id = gmyth_string_list_get_int (slist, pos + 4);
+ prog->channel_id = gmyth_string_list_get_int (slist, pos + 4);
prog->channame = gmyth_string_list_get_string(slist, pos + 5);
prog->chanstr = gmyth_string_list_get_string(slist, pos + 6);
prog->chansign = gmyth_string_list_get_string(slist, pos + 7);
@@ -413,7 +413,7 @@
prog->chanOutputFilters =
gmyth_string_list_get_string(slist, pos + 32);
prog->seriesid = gmyth_string_list_get_string(slist, pos + 33);
- prog->xx_program_id = gmyth_string_list_get_string(slist, pos + 34);
+ prog->program_id = gmyth_string_list_get_string(slist, pos + 34);
gmyth_string_list_get_string(slist, pos + 35);
prog->lastmodified = gmyth_util_string_to_time_val((gmyth_util_time_to_isoformat((time_t) gmyth_string_list_get_int(slist, pos + 36)))->str); // DATETIME_TO_LIST(lastmodified)
gmyth_string_list_get_int(slist, pos + 37); // FLOAT_TO_LIST(stars)
@@ -484,7 +484,7 @@
prog->channame = gmyth_string_list_get_string(slist, 6);
prog->chansign = gmyth_string_list_get_string(slist, 7);
prog->chanstr = gmyth_string_list_get_string(slist, 8);
- prog->xx_channel_id = gmyth_string_list_get_int (slist, 9);
+ prog->channel_id = gmyth_string_list_get_int (slist, 9);
prog->filesize = gmyth_string_list_get_int64(slist, 10);
gmyth_debug
@@ -532,7 +532,7 @@
gmyth_program_info_non_null_value(prog->subtitle),
gmyth_program_info_non_null_value(prog->description),
gmyth_program_info_non_null_value(prog->category),
- prog->xx_channel_id,
+ prog->channel_id,
gmyth_program_info_non_null_value(prog->channame),
gmyth_program_info_non_null_value(prog->chanstr),
gmyth_program_info_non_null_value(prog->chansign),
@@ -550,7 +550,7 @@
prog->chancommfree,
gmyth_program_info_non_null_value(prog->chanOutputFilters),
gmyth_program_info_non_null_value(prog->seriesid),
- gmyth_program_info_non_null_value(prog->xx_program_id),
+ gmyth_program_info_non_null_value(prog->program_id),
gmyth_util_time_to_string_from_time_val(prog->lastmodified),
gmyth_util_time_to_string_from_time_val(prog->originalAirDate),
prog->hasAirDate,
Modified: trunk/gmyth/src/gmyth_programinfo.h
===================================================================
--- trunk/gmyth/src/gmyth_programinfo.h 2008-01-28 19:39:14 UTC (rev 900)
+++ trunk/gmyth/src/gmyth_programinfo.h 2008-01-29 18:40:18 UTC (rev 901)
@@ -62,7 +62,7 @@
GObject parent;
/** The channel unique ID. */
- gint xx_channel_id;
+ gint channel_id;
/** The program start time. */
GTimeVal *startts;
/** The program end time. */
@@ -90,7 +90,7 @@
GString *seriesid;
/** The program unique id. */
- GString *xx_program_id;
+ GString *program_id;
GString *catType;
GString *sortTitle;
Modified: trunk/gmyth/src/gmyth_recorder.c
===================================================================
--- trunk/gmyth/src/gmyth_recorder.c 2008-01-28 19:39:14 UTC (rev 900)
+++ trunk/gmyth/src/gmyth_recorder.c 2008-01-29 18:40:18 UTC (rev 901)
@@ -917,7 +917,7 @@
gmyth_string_list_append_string(str_list, tmp_str);
gmyth_string_list_append_char_array(str_list, "GET_NEXT_PROGRAM_INFO");
gmyth_string_list_append_string(str_list, actual_proginfo->channame);
- gmyth_string_list_append_int(str_list, actual_proginfo->xx_channel_id);
+ gmyth_string_list_append_int(str_list, actual_proginfo->channel_id);
gmyth_string_list_append_int(str_list, direction);
gmyth_string_list_append_char_array(str_list, date);
Modified: trunk/gmyth/src/gmyth_scheduler.c
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.c 2008-01-28 19:39:14 UTC (rev 900)
+++ trunk/gmyth/src/gmyth_scheduler.c 2008-01-29 18:40:18 UTC (rev 901)
@@ -245,8 +245,8 @@
schedule->schedule_id =
(guint) g_ascii_strtoull(row[0], NULL, 10);
- schedule->xx_program_id = g_string_new (row[1]);
- schedule->xx_channel_id = (gint) g_ascii_strtoull (row[2], NULL, 10);
+ schedule->program_id = g_string_new (row[1]);
+ schedule->channel_id = (gint) g_ascii_strtoull (row[2], NULL, 10);
/*
* generate a time_t from a time and a date db field
@@ -332,8 +332,8 @@
record = g_new0(RecordedInfo, 1);
record->record_id = (guint) g_ascii_strtoull(row[0], NULL, 10);
- record->xx_program_id = g_string_new (row[1]);
- record->xx_channel_id = (gint) g_ascii_strtoull(row[2], NULL, 10);
+ record->program_id = g_string_new (row[1]);
+ record->channel_id = (gint) g_ascii_strtoull(row[2], NULL, 10);
record->start_time = gmyth_util_string_to_time_val(row[3]);
record->end_time = gmyth_util_string_to_time_val(row[5]);
@@ -390,8 +390,8 @@
if (row != NULL) {
record = g_new0(RecordedInfo, 1);
record->record_id = (guint) g_ascii_strtoull(row[0], NULL, 10);
- record->xx_program_id = g_string_new (row[1]);
- record->xx_channel_id = (gint) g_ascii_strtoull(row[2], NULL, 10);
+ record->program_id = g_string_new (row[1]);
+ record->channel_id = (gint) g_ascii_strtoull(row[2], NULL, 10);
record->start_time = gmyth_util_string_to_time_val(row[3]);
record->end_time = gmyth_util_string_to_time_val(row[5]);
record->title = g_string_new(row[7]);
@@ -442,8 +442,8 @@
ScheduleInfo *info;
info = g_new0 (ScheduleInfo, 1);
- info->xx_program_id = g_string_new (program->xx_program_id->str);
- info->xx_channel_id = program->xx_channel_id;
+ info->program_id = g_string_new (program->program_id->str);
+ info->channel_id = program->channel_id;
info->start_time = g_new0 (GTimeVal, 1);
*info->start_time = *program->startts;
info->end_time = g_new0 (GTimeVal, 1);
@@ -500,7 +500,7 @@
query_str =
g_strdup_printf
("SELECT callsign FROM channel WHERE chanid = %d;",
- schedule_info->xx_channel_id);
+ schedule_info->channel_id);
msql_res =
gmyth_query_process_statement(scheduler->msqlquery, query_str);
if (msql_res == NULL) {
@@ -518,7 +518,7 @@
// _set_value (field, value, id);
_set_int_value(scheduler->msqlquery, "chanid",
- schedule_info->xx_channel_id, rec_id);
+ schedule_info->channel_id, rec_id);
_set_value(scheduler->msqlquery, "station", station, rec_id);
_set_value(scheduler->msqlquery, "title", schedule_info->title->str,
rec_id);
@@ -813,7 +813,7 @@
if (msql_row) {
proginfo = gmyth_program_info_new();
- proginfo->xx_channel_id = (gint) g_ascii_strtoull (msql_row[0], NULL, 10);
+ proginfo->channel_id = (gint) g_ascii_strtoull (msql_row[0], NULL, 10);
proginfo->recstartts = gmyth_util_string_to_time_val(msql_row[1]);
proginfo->recendts = gmyth_util_string_to_time_val(msql_row[2]);
@@ -827,7 +827,7 @@
proginfo->chancommfree = (gint) g_ascii_strtoull(msql_row[9], NULL, 10);
proginfo->chanOutputFilters = g_string_new(msql_row[10]);
proginfo->seriesid = g_string_new(msql_row[11]);
- proginfo->xx_program_id = g_string_new(msql_row[12]);
+ proginfo->program_id = g_string_new(msql_row[12]);
proginfo->filesize = g_ascii_strtoull(msql_row[13], NULL, 10);
proginfo->lastmodified = gmyth_util_string_to_time_val(msql_row[14]);
@@ -961,7 +961,7 @@
if (msql_row) {
proginfo = gmyth_program_info_new();
- proginfo->xx_channel_id = (gint) g_ascii_strtoull (msql_row[0], NULL, 10);
+ proginfo->channel_id = (gint) g_ascii_strtoull (msql_row[0], NULL, 10);
proginfo->startts =
gmyth_util_string_to_time_val(msql_row[23]);
proginfo->endts = gmyth_util_string_to_time_val(msql_row[24]);
@@ -980,7 +980,7 @@
(gint) g_ascii_strtoull(msql_row[9], NULL, 10);
proginfo->chanOutputFilters = g_string_new(msql_row[10]);
proginfo->seriesid = g_string_new(msql_row[11]);
- proginfo->xx_program_id = g_string_new(msql_row[12]);
+ proginfo->program_id = g_string_new(msql_row[12]);
proginfo->filesize = g_ascii_strtoull(msql_row[13], NULL, 10);
proginfo->lastmodified =
@@ -1044,7 +1044,7 @@
gmyth_string_list_append_string(slist, program->subtitle); /* 1 */
gmyth_string_list_append_string(slist, program->description); /* 2 */
gmyth_string_list_append_string(slist, program->category); /* 3 */
- gmyth_string_list_append_int(slist, program->xx_channel_id); /* 4 */
+ gmyth_string_list_append_int(slist, program->channel_id); /* 4 */
gmyth_string_list_append_string(slist, program->chanstr); /* 5 */
gmyth_string_list_append_string(slist, program->chansign); /* 6 */
gmyth_string_list_append_string(slist, program->channame); /* 7 */
@@ -1100,7 +1100,7 @@
gmyth_string_list_append_int(slist, program->chancommfree); /* 31 */
gmyth_string_list_append_string(slist, program->chanOutputFilters); /* 32 */
gmyth_string_list_append_string(slist, program->seriesid); /* 33 */
- gmyth_string_list_append_string(slist, program->xx_program_id); /* 34 */
+ gmyth_string_list_append_string(slist, program->program_id); /* 34 */
gmyth_string_list_append_int(slist,
program->lastmodified != NULL ?
@@ -1174,8 +1174,8 @@
{
g_return_if_fail (info != NULL);
- if (info->xx_program_id)
- g_string_free (info->xx_program_id, TRUE);
+ if (info->program_id)
+ g_string_free (info->program_id, TRUE);
if (info->title != NULL)
g_string_free(info->title, TRUE);
@@ -1224,8 +1224,8 @@
g_return_if_fail(info != NULL);
- if (info->xx_program_id)
- g_string_free (info->xx_program_id, TRUE);
+ if (info->program_id)
+ g_string_free (info->program_id, TRUE);
if (info->title != NULL)
g_string_free(info->title, TRUE);
Modified: trunk/gmyth/src/gmyth_scheduler.h
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.h 2008-01-28 19:39:14 UTC (rev 900)
+++ trunk/gmyth/src/gmyth_scheduler.h 2008-01-29 18:40:18 UTC (rev 901)
@@ -99,8 +99,8 @@
typedef struct {
guint schedule_id;
- gint xx_channel_id;
- GString *xx_program_id;
+ gint channel_id;
+ GString *program_id;
GTimeVal *start_time;
GTimeVal *end_time;
@@ -119,8 +119,8 @@
typedef struct {
guint record_id;
- gint xx_channel_id;
- GString *xx_program_id;
+ gint channel_id;
+ GString *program_id;
GTimeVal *start_time;
GTimeVal *end_time;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|