int de_pri;
int de_dont_reschedule;
int de_dont_rerecord;
- int de_mc;
uint32_t de_retention;
uint32_t de_removal;
dvr_autorec_entry_t *dae = (dvr_autorec_entry_t *)o;
if (dae && dae->dae_id.in_access &&
!access_verify2(dae->dae_id.in_access, ACCESS_ADMIN))
- return 0;
- return PO_RDONLY;
+ return PO_ADVANCED;
+ return PO_RDONLY | PO_ADVANCED;
}
const idclass_t dvr_autorec_entry_class = {
.get = dvr_autorec_entry_class_tag_get,
.rend = dvr_autorec_entry_class_tag_rend,
.list = channel_tag_class_get_list,
+ .opts = PO_ADVANCED
},
{
.type = PT_STR,
.name = N_("Extra start time"),
.off = offsetof(dvr_autorec_entry_t, dae_start_extra),
.list = dvr_autorec_entry_class_extra_list,
- .opts = PO_DURATION | PO_SORTKEY
+ .opts = PO_DURATION | PO_SORTKEY | PO_ADVANCED
},
{
.type = PT_TIME,
.name = N_("Extra stop time"),
.off = offsetof(dvr_autorec_entry_t, dae_stop_extra),
.list = dvr_autorec_entry_class_extra_list,
- .opts = PO_DURATION | PO_SORTKEY
+ .opts = PO_DURATION | PO_SORTKEY | PO_ADVANCED
},
{
.type = PT_U32,
.name = N_("Minimum duration"),
.list = dvr_autorec_entry_class_minduration_list,
.off = offsetof(dvr_autorec_entry_t, dae_minduration),
+ .opts = PO_ADVANCED
},
{
.type = PT_INT,
.name = N_("Maximum duration"),
.list = dvr_autorec_entry_class_maxduration_list,
.off = offsetof(dvr_autorec_entry_t, dae_maxduration),
+ .opts = PO_ADVANCED
},
{
.type = PT_U32,
.name = N_("Content type"),
.list = dvr_autorec_entry_class_content_type_list,
.off = offsetof(dvr_autorec_entry_t, dae_content_type),
+ .opts = PO_ADVANCED
},
{
.type = PT_U32,
.list = dvr_entry_class_pri_list,
.def.i = DVR_PRIO_NORMAL,
.off = offsetof(dvr_autorec_entry_t, dae_pri),
+ .opts = PO_ADVANCED
},
{
.type = PT_U32,
.def.i = DVR_AUTOREC_RECORD_ALL,
.off = offsetof(dvr_autorec_entry_t, dae_record),
.list = dvr_autorec_entry_class_dedup_list,
+ .opts = PO_ADVANCED
},
{
.type = PT_U32,
.id = "retention",
.name = N_("DVR log retention (days)"),
.off = offsetof(dvr_autorec_entry_t, dae_retention),
- .opts = PO_HIDDEN,
+ .opts = PO_HIDDEN | PO_EXPERT,
},
{
.type = PT_U32,
.id = "removal",
.name = N_("DVR file retention period (days)"),
.off = offsetof(dvr_autorec_entry_t, dae_removal),
- .opts = PO_HIDDEN,
+ .opts = PO_HIDDEN | PO_EXPERT,
},
{
.type = PT_U32,
.id = "maxcount",
.name = N_("Maximum count (0=default)"),
.off = offsetof(dvr_autorec_entry_t, dae_max_count),
- .opts = PO_HIDDEN,
+ .opts = PO_HIDDEN | PO_EXPERT,
},
{
.type = PT_U32,
.id = "maxsched",
.name = N_("Maximum schedules limit (0=default)"),
.off = offsetof(dvr_autorec_entry_t, dae_max_sched_count),
- .opts = PO_HIDDEN,
+ .opts = PO_HIDDEN | PO_EXPERT,
},
{
.type = PT_STR,
.get = dvr_autorec_entry_class_config_name_get,
.rend = dvr_autorec_entry_class_config_name_rend,
.list = dvr_entry_class_config_name_list,
+ .opts = PO_ADVANCED
},
{
.type = PT_STR,
.name = N_("Brand"),
.set = dvr_autorec_entry_class_brand_set,
.get = dvr_autorec_entry_class_brand_get,
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_ADVANCED,
},
{
.type = PT_STR,
.name = N_("Season"),
.set = dvr_autorec_entry_class_season_set,
.get = dvr_autorec_entry_class_season_get,
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_ADVANCED,
},
{
.type = PT_STR,
.name = N_("Series link"),
.set = dvr_autorec_entry_class_series_link_set,
.get = dvr_autorec_entry_class_series_link_get,
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_ADVANCED,
},
{
.type = PT_STR,
return extra;
}
-int
-dvr_entry_get_mc( dvr_entry_t *de )
-{
- if (de->de_mc >= 0)
- return de->de_mc;
- return profile_get_mc(de->de_config->dvr_profile);
-}
-
uint32_t
dvr_entry_get_retention_days( dvr_entry_t *de )
{
}
de->de_enabled = 1;
- de->de_mc = -1;
de->de_config = dvr_config_find_by_name_default(NULL);
if (de->de_config)
LIST_INSERT_HEAD(&de->de_config->dvr_entries, de, de_config_link);
{
dvr_entry_t *de = (dvr_entry_t *)o;
if (de && !dvr_entry_is_editable(de))
- return PO_RDONLY;
- return 0;
+ return PO_RDONLY | PO_ADVANCED;
+ return PO_ADVANCED;
}
static uint32_t
dvr_entry_t *de = (dvr_entry_t *)o;
if (de && de->de_id.in_access &&
!access_verify2(de->de_id.in_access, ACCESS_ADMIN))
- return 0;
- return PO_RDONLY;
+ return PO_ADVANCED;
+ return PO_RDONLY | PO_ADVANCED;
}
static uint32_t
return dvr_entry_class_int_set(de, (int *)&de->de_removal, *(int *)v);
}
-static int
-dvr_entry_class_mc_set(void *o, const void *v)
-{
- dvr_entry_t *de = (dvr_entry_t *)o;
- return dvr_entry_class_int_set(de, &de->de_mc, *(int *)v);
-}
-
-htsmsg_t *
-dvr_entry_class_mc_list ( void *o, const char *lang )
-{
- static const struct strtab tab[] = {
- { N_("Not set"), -1 },
- { N_("Matroska (mkv)"), MC_MATROSKA, },
- { N_("Same as source (pass through)"), MC_PASS, },
-#if ENABLE_LIBAV
- { N_("MPEG-TS"), MC_MPEGTS },
- { N_("MPEG-PS (DVD)"), MC_MPEGPS },
-#endif
- };
- return strtab2htsmsg(tab, 1, lang);
-}
-
static int
dvr_entry_class_autorec_set(void *o, const void *v)
{
.id = "enabled",
.name = N_("Enabled"),
.off = offsetof(dvr_entry_t, de_enabled),
+ .opts = PO_ADVANCED
},
{
.type = PT_TIME,
.set = dvr_entry_class_start_extra_set,
.list = dvr_entry_class_extra_list,
.get_opts = dvr_entry_class_start_extra_opts,
- .opts = PO_SORTKEY,
+ .opts = PO_SORTKEY | PO_ADVANCED,
},
{
.type = PT_TIME,
.name = N_("Post-recording padding"),
.off = offsetof(dvr_entry_t, de_stop_extra),
.list = dvr_entry_class_extra_list,
- .opts = PO_SORTKEY,
+ .opts = PO_SORTKEY | PO_ADVANCED,
},
{
.type = PT_TIME,
.id = "channel_icon",
.name = N_("Channel icon"),
.get = dvr_entry_class_channel_icon_url_get,
- .opts = PO_HIDDEN | PO_RDONLY | PO_NOSAVE,
+ .opts = PO_HIDDEN | PO_RDONLY | PO_NOSAVE | PO_NOUI,
},
{
.type = PT_STR,
.name = N_("DVR log retention (days)"),
.off = offsetof(dvr_entry_t, de_retention),
.set = dvr_entry_class_retention_set,
- .opts = PO_HIDDEN
+ .opts = PO_HIDDEN | PO_ADVANCED
},
{
.type = PT_U32,
.name = N_("DVR file retention period (days)"),
.off = offsetof(dvr_entry_t, de_removal),
.set = dvr_entry_class_removal_set,
- .opts = PO_HIDDEN
- },
- {
- .type = PT_INT,
- .id = "container",
- .name = N_("Container"),
- .off = offsetof(dvr_entry_t, de_mc),
- .def.i = MC_MATROSKA,
- .set = dvr_entry_class_mc_set,
- .list = dvr_entry_class_mc_list,
- .opts = PO_RDONLY
+ .opts = PO_HIDDEN | PO_ADVANCED
},
{
.type = PT_STR,
.id = "filename",
.name = N_("Filename"),
.get = dvr_entry_class_filename_get,
- .opts = PO_RDONLY | PO_NOSAVE,
+ .opts = PO_RDONLY | PO_NOSAVE | PO_NOUI,
},
{
.type = PT_STR,
.id = "directory",
.name = N_("Directory"),
.off = offsetof(dvr_entry_t, de_directory),
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_NOUI,
},
{
.type = PT_U32,
.id = "errorcode",
.name = N_("Error code"),
.off = offsetof(dvr_entry_t, de_last_error),
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_NOUI,
},
{
.type = PT_U32,
.id = "errors",
.name = N_("Errors"),
.off = offsetof(dvr_entry_t, de_errors),
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_ADVANCED,
},
{
.type = PT_U32,
.id = "data_errors",
.name = N_("Data errors"),
.off = offsetof(dvr_entry_t, de_data_errors),
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_ADVANCED,
},
{
.type = PT_U16,
.id = "dvb_eid",
.name = N_("DVB EPG ID"),
.off = offsetof(dvr_entry_t, de_dvb_eid),
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_EXPERT,
},
{
.type = PT_BOOL,
.id = "noresched",
.name = N_("Don't reschedule"),
.off = offsetof(dvr_entry_t, de_dont_reschedule),
- .opts = PO_HIDDEN,
+ .opts = PO_HIDDEN | PO_NOUI,
},
{
.type = PT_BOOL,
.id = "norerecord",
.name = N_("Don't re-record"),
.off = offsetof(dvr_entry_t, de_dont_rerecord),
- .opts = PO_HIDDEN,
+ .opts = PO_HIDDEN | PO_ADVANCED,
},
{
.type = PT_STR,
.name = N_("Auto record"),
.set = dvr_entry_class_autorec_set,
.get = dvr_entry_class_autorec_get,
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_NOUI,
},
{
.type = PT_STR,
.id = "autorec_caption",
.name = N_("Auto record caption"),
.get = dvr_entry_class_autorec_caption_get,
- .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
+ .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN | PO_NOUI,
},
{
.type = PT_STR,
.name = N_("Auto time record"),
.set = dvr_entry_class_timerec_set,
.get = dvr_entry_class_timerec_get,
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_EXPERT,
},
{
.type = PT_STR,
.id = "timerec_caption",
.name = N_("Time record caption"),
.get = dvr_entry_class_timerec_caption_get,
- .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
+ .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN | PO_NOUI,
},
{
.type = PT_STR,
.name = N_("Parent entry"),
.set = dvr_entry_class_parent_set,
.get = dvr_entry_class_parent_get,
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_NOUI,
},
{
.type = PT_STR,
.name = N_("Slave entry"),
.set = dvr_entry_class_child_set,
.get = dvr_entry_class_child_get,
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_NOUI,
},
{
.type = PT_U32,
.name = N_("Broadcast"),
.set = dvr_entry_class_broadcast_set,
.get = dvr_entry_class_broadcast_get,
- .opts = PO_RDONLY,
+ .opts = PO_RDONLY | PO_NOUI,
},
{
.type = PT_STR,
.id = "url",
.name = N_("URL"),
.get = dvr_entry_class_url_get,
- .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
+ .opts = PO_RDONLY | PO_NOSAVE | PO_NOUI,
},
{
.type = PT_S64,
.id = "sched_status",
.name = N_("Schedule status"),
.get = dvr_entry_class_sched_status_get,
- .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
+ .opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN | PO_NOUI,
},
{
.type = PT_TIME,
.id = "duplicate",
.name = N_("Rerun of"),
.get = dvr_entry_class_duplicate_get,
- .opts = PO_RDONLY | PO_NOSAVE,
+ .opts = PO_RDONLY | PO_NOSAVE | PO_ADVANCED,
},
{
.type = PT_STR,
dvr_timerec_entry_t *dte = (dvr_timerec_entry_t *)o;
if (dte && dte->dte_id.in_access &&
!access_verify2(dte->dte_id.in_access, ACCESS_ADMIN))
- return 0;
- return PO_RDONLY;
+ return PO_ADVANCED;
+ return PO_RDONLY | PO_ADVANCED;
}
const idclass_t dvr_timerec_entry_class = {
.id = "directory",
.name = N_("Directory"),
.off = offsetof(dvr_timerec_entry_t, dte_directory),
+ .opts = PO_EXPERT
},
{
.type = PT_STR,
.list = dvr_entry_class_pri_list,
.def.i = DVR_PRIO_NORMAL,
.off = offsetof(dvr_timerec_entry_t, dte_pri),
- .opts = PO_SORTKEY,
+ .opts = PO_SORTKEY | PO_ADVANCED,
},
{
.type = PT_U32,
.id = "retention",
.name = N_("DVR log retention (days)"),
.off = offsetof(dvr_timerec_entry_t, dte_retention),
+ .opts = PO_EXPERT
},
{
.type = PT_U32,
.id = "removal",
.name = N_("DVR file retention period (days)"),
.off = offsetof(dvr_timerec_entry_t, dte_removal),
+ .opts = PO_EXPERT
},
{
.type = PT_STR,
.get = dvr_timerec_entry_class_config_name_get,
.rend = dvr_timerec_entry_class_config_name_rend,
.list = dvr_entry_class_config_name_list,
+ .opts = PO_ADVANCED
},
{
.type = PT_STR,
}
+/**
+ * Get the mime type for a filename
+ */
+const char*
+muxer_container_filename2mime(const char *filename, int video)
+{
+ int mc = MC_UNKNOWN;
+ const char *suffix;
+
+ if(filename) {
+ suffix = strrchr(filename, '.');
+ if (suffix == NULL)
+ suffix = filename;
+ else
+ suffix++;
+ if(video)
+ mc = str2val(suffix, container_video_file_suffix);
+ else
+ mc = str2val(suffix, container_audio_file_suffix);
+ }
+
+ return muxer_container_type2mime(mc, 1);
+}
+
+
/**
* Get the suffix used in file names
*/
/* type <==> string converters */
const char * muxer_container_type2txt (muxer_container_type_t mc);
const char* muxer_container_type2mime (muxer_container_type_t mc, int video);
+const char* muxer_container_filename2mime (const char *filename, int video);
muxer_container_type_t muxer_container_txt2type (const char *str);
muxer_container_type_t muxer_container_mime2type (const char *str);
htsmsg_add_bool(m, "expert", 1);
else if (opts & PO_ADVANCED)
htsmsg_add_bool(m, "advanced", 1);
+ if (opts & PO_NOUI)
+ htsmsg_add_bool(m, "noui", 1);
if (opts & PO_HIDDEN)
htsmsg_add_bool(m, "hidden", 1);
if (opts & PO_PASSWORD)
#define PO_WRONCE (1<<3) // Property is write-once (i.e. on creation)
#define PO_ADVANCED (1<<4) // Property is advanced
#define PO_EXPERT (1<<5) // Property is for experts
-#define PO_HIDDEN (1<<6) // Property is hidden (by default)
-#define PO_USERAW (1<<7) // Only save the RAW (off) value if it exists
-#define PO_SORTKEY (1<<8) // Sort using key (not display value)
-#define PO_PASSWORD (1<<9) // String is a password
-#define PO_DURATION (1<<10) // For PT_TIME - differentiate between duration and datetime
-#define PO_HEXA (1<<11) // Hexadecimal value
-#define PO_DATE (1<<12) // Show date only
-#define PO_LOCALE (1<<13) // Call tvh_locale_lang on string
-#define PO_LORDER (1<<14) // Manage order in lists
-#define PO_MULTILINE (1<<15) // Multiline string
+#define PO_NOUI (1<<6) // Property should not be presented in the user interface
+#define PO_HIDDEN (1<<7) // Property is hidden (by default)
+#define PO_USERAW (1<<8) // Only save the RAW (off) value if it exists
+#define PO_SORTKEY (1<<9) // Sort using key (not display value)
+#define PO_PASSWORD (1<<10) // String is a password
+#define PO_DURATION (1<<11) // For PT_TIME - differentiate between duration and datetime
+#define PO_HEXA (1<<12) // Hexadecimal value
+#define PO_DATE (1<<13) // Show date only
+#define PO_LOCALE (1<<14) // Call tvh_locale_lang on string
+#define PO_LORDER (1<<15) // Manage order in lists
+#define PO_MULTILINE (1<<16) // Multiline string
/*
* Property definition
this.rdonly = conf.rdonly;
this.wronly = conf.wronly;
this.wronce = conf.wronce;
+ this.noui = conf.noui;
this.hidden = conf.hidden;
this.uilevel = conf.expert ? 'expert' : (conf.advanced ? 'advanced' : 'basic');
this.password = conf.showpwd ? false : conf.password;
}
this.get_hidden = function(uilevel) {
- var hidden = this.hidden;
+ var hidden = this.hidden || this.noui;
if (uilevel !== 'expert') {
if (uilevel === 'advanced' && this.uilevel === 'expert')
hidden = true;
var p = d[i];
if (conf.uuids && p.rdonly)
continue;
+ if (conf.noui)
+ continue;
var f = tvheadend.idnode_editor_field(p, conf);
if (!f)
continue;
for (var i = 0; i < idnode.length(); i++) {
var f = idnode.field(i);
var c = f.column(uilevel, conf.columns);
- fields.push(f.id);
- ifields.push(f);
- c['tooltip'] = f.text;
- columns.push(c);
- if (c.filter)
- filters.push(c.filter);
- f.onrefresh(update2);
+ if (!f.noui) {
+ fields.push(f.id);
+ ifields.push(f);
+ c['tooltip'] = f.text;
+ columns.push(c);
+ if (c.filter)
+ filters.push(c.filter);
+ f.onrefresh(update2);
+ }
}
/* Right-hand columns */
}
fname = tvh_strdupa(filename);
- content = muxer_container_type2mime(de->de_mc, 1);
+ content = muxer_container_filename2mime(fname, 1);
charset = de->de_config ? de->de_config->dvr_charset_id : NULL;
pthread_mutex_unlock(&global_lock);