cmyth_proginfo_host
cmyth_proginfo_card_id
cmyth_proginfo_recgroup
- cmyth_proginfo_prodyear
+ cmyth_proginfo_year
cmyth_get_delete_list
cmyth_proglist_create
cmyth_proglist_get_item
/**
* Retrieve the production year for this program info
* \param prog proginfo handle
- * \return null-terminated string
+ * \return production year
*/
-extern char *cmyth_proginfo_prodyear(cmyth_proginfo_t prog);
+extern unsigned short cmyth_proginfo_year(cmyth_proginfo_t prog);
/*
* -----------------------------------------------------------------
unsigned long proginfo_audioproperties; /* new in v35 */
unsigned long proginfo_videoproperties; /* new in v35 */
unsigned long proginfo_subtitletype; /* new in v35 */
- char *proginfo_prodyear; /* new in v41 */
+ unsigned short proginfo_year; /* new in v43 */
};
struct cmyth_proglist {
if (p->proginfo_recpriority_2) {
ref_release(p->proginfo_recpriority_2);
}
- if (p->proginfo_prodyear) {
- ref_release(p->proginfo_prodyear);
- }
cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__);
}
ret->proginfo_audioproperties = 0;
ret->proginfo_videoproperties = 0;
ret->proginfo_subtitletype = 0;
- ret->proginfo_prodyear = NULL;
+ ret->proginfo_year = 0;
cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__);
return ret;
ret->proginfo_audioproperties = p->proginfo_audioproperties;
ret->proginfo_videoproperties = p->proginfo_videoproperties;
ret->proginfo_subtitletype = p->proginfo_subtitletype;
- ret->proginfo_prodyear = ref_hold(p->proginfo_prodyear);
+ ret->proginfo_year = p->proginfo_year;
cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__);
return ret;
}
len += strlen(S(prog->proginfo_inetref));
len += strlen(S(prog->proginfo_recpriority_2));
len += strlen(S(prog->proginfo_storagegroup));
- len += strlen(S(prog->proginfo_prodyear));
buf = alloca(len + 1+2048);
if (!buf) {
sprintf(buf + strlen(buf), "%ld[]:[]", prog->proginfo_videoproperties);
sprintf(buf + strlen(buf), "%ld[]:[]", prog->proginfo_subtitletype);
}
- if (control->conn_version >= 41) {
- sprintf(buf + strlen(buf), "%s[]:[]", S(prog->proginfo_prodyear));
+ if (control->conn_version >= 43) {
+ sprintf(buf + strlen(buf), "%d[]:[]", prog->proginfo_year);
}
#undef S
}
/*
- * cmyth_proginfo_prodyear(cmyth_proginfo_t prog)
+ * cmyth_proginfo_year(cmyth_proginfo_t prog)
*
*
* Scope: PUBLIC
*
* Description
*
- * Retrieves the 'proginfo_prodyear' field of a program info
+ * Retrieves the 'proginfo_year' field of a program info
* structure.
*
- * The returned string is a pointer to the string within the program
- * info structure, so it should not be modified by the caller. The
- * return value is a 'char *' for this reason.
- *
* Return Value:
*
- * Success: A pointer to a 'char *' pointing to the field.
+ * Success: the production year for the program
*
- * Failure: NULL
+ * Failure: 0
*/
-char *
-cmyth_proginfo_prodyear(cmyth_proginfo_t prog)
+unsigned short
+cmyth_proginfo_year(cmyth_proginfo_t prog)
{
if (!prog) {
- return NULL;
+ return 0;
}
- return ref_hold(prog->proginfo_prodyear);
+ return prog->proginfo_year;
}
static int
len += strlen(S(prog->proginfo_inetref));
len += strlen(S(prog->proginfo_recpriority_2));
len += strlen(S(prog->proginfo_storagegroup));
- len += strlen(S(prog->proginfo_prodyear));
buf = alloca(len + 1+2048);
if (!buf) {
sprintf(buf + strlen(buf), "%ld[]:[]", prog->proginfo_videoproperties);
sprintf(buf + strlen(buf), "%ld[]:[]", prog->proginfo_subtitletype);
}
- if (control->conn_version >= 41) {
- sprintf(buf + strlen(buf), "%s[]:[]", S(prog->proginfo_prodyear));
+ if (control->conn_version >= 43) {
+ sprintf(buf + strlen(buf), "%d[]:[]", prog->proginfo_year);
}
#undef S
failed = "cmyth_rcv_ulong subtitletype";
goto fail;
}
- }
- if (buf->proginfo_version >= 41) {
- /*
- * Get proginfo_prodyear (string)
- */
- consumed = cmyth_rcv_string(conn, err,
- tmp_str, sizeof(tmp_str) - 1, count);
+ }
+
+ /*
+ * Get Year
+ */
+ if (buf->proginfo_version >= 43) {
+ consumed = cmyth_rcv_ushort(conn, err, &buf->proginfo_year,
+ count);
count -= consumed;
total += consumed;
if (*err) {
- failed = "cmyth_rcv_string";
+ failed = "cmyth_rcv_ushort proginfo_year";
goto fail;
}
- if (buf->proginfo_prodyear)
- ref_release(buf->proginfo_prodyear);
- buf->proginfo_prodyear = ref_strdup(tmp_str);
- }
+ }
+
cmyth_dbg(CMYTH_DBG_INFO, "%s: got recording info\n", __FUNCTION__);
cmyth_proginfo_parse_url(buf);
virtual cmyth_timestamp_t proginfo_rec_start (cmyth_proginfo_t prog)=0;
virtual cmyth_timestamp_t proginfo_rec_end (cmyth_proginfo_t prog)=0;
virtual cmyth_proginfo_rec_status_t proginfo_rec_status(cmyth_proginfo_t prog)=0;
- virtual char* proginfo_prodyear (cmyth_proginfo_t prog)=0;
+ virtual unsigned short proginfo_year (cmyth_proginfo_t prog)=0;
virtual cmyth_proginfo_t proginfo_get_from_basename (cmyth_conn_t control, const char* basename)=0;
virtual int proginfo_delete_recording(cmyth_conn_t control, cmyth_proginfo_t prog)=0;
virtual int proginfo_stop_recording(cmyth_conn_t control, cmyth_proginfo_t prog)=0;
DEFINE_METHOD1(cmyth_timestamp_t, proginfo_rec_end, (cmyth_proginfo_t p1))
DEFINE_METHOD1(cmyth_proginfo_rec_status_t, proginfo_rec_status, (cmyth_proginfo_t p1))
DEFINE_METHOD1(unsigned long, proginfo_flags, (cmyth_proginfo_t p1))
- DEFINE_METHOD1(char*, proginfo_prodyear, (cmyth_proginfo_t p1))
+ DEFINE_METHOD1(unsigned short, proginfo_year, (cmyth_proginfo_t p1))
DEFINE_METHOD2(cmyth_proginfo_t, proginfo_get_from_basename, (cmyth_conn_t p1, const char* p2))
DEFINE_METHOD2(int, proginfo_delete_recording, (cmyth_conn_t p1, cmyth_proginfo_t p2))
DEFINE_METHOD2(int, proginfo_stop_recording, (cmyth_conn_t p1, cmyth_proginfo_t p2))
RESOLVE_METHOD_RENAME(cmyth_proginfo_rec_end, proginfo_rec_end)
RESOLVE_METHOD_RENAME(cmyth_proginfo_rec_status, proginfo_rec_status)
RESOLVE_METHOD_RENAME(cmyth_proginfo_flags, proginfo_flags)
- RESOLVE_METHOD_RENAME(cmyth_proginfo_prodyear, proginfo_prodyear)
+ RESOLVE_METHOD_RENAME(cmyth_proginfo_year, proginfo_year)
RESOLVE_METHOD_RENAME(cmyth_proginfo_get_from_basename, proginfo_get_from_basename)
RESOLVE_METHOD_RENAME(cmyth_proginfo_delete_recording, proginfo_delete_recording)
RESOLVE_METHOD_RENAME(cmyth_proginfo_stop_recording, proginfo_stop_recording)
* lookups.
*/
CStdString label(item->m_strTitle);
- CStdString prodyear = GetValue(m_dll->proginfo_prodyear(program));
- if (!prodyear.IsEmpty())
- label += " (" + prodyear + ")";
+ unsigned short year = m_dll->proginfo_year(program);
+ if (year > 0)
+ label.AppendFormat(" (%d)", year);
item->SetLabel(label);
item->SetLabelPreformated(true);
}