Ejemplo n.º 1
0
void
tvhdhomerun_device_save( tvhdhomerun_device_t *hd )
{
  tvhdhomerun_frontend_t *lfe;
  htsmsg_t *m, *l;

  m = htsmsg_create_map();
  idnode_save(&hd->th_id, m);

  l = htsmsg_create_map();
  TAILQ_FOREACH(lfe, &hd->hd_frontends, hf_link)
    tvhdhomerun_frontend_save(lfe, l);
  htsmsg_add_msg(m, "frontends", l);

  htsmsg_add_str(m, "fe_override", hd->hd_override_type);

  hts_settings_save(m, "input/tvhdhomerun/adapters/%s",
                    idnode_uuid_as_str(&hd->th_id));
  htsmsg_destroy(m);
}
Ejemplo n.º 2
0
static htsmsg_t *
tvhdhomerun_device_class_save ( idnode_t *in, char *filename, size_t fsize )
{
  tvhdhomerun_device_t *hd = (tvhdhomerun_device_t *)in;
  tvhdhomerun_frontend_t *lfe;
  htsmsg_t *m, *l;
  char ubuf[UUID_HEX_SIZE];

  m = htsmsg_create_map();
  idnode_save(&hd->th_id, m);

  if (filename) {
    l = htsmsg_create_map();
    TAILQ_FOREACH(lfe, &hd->hd_frontends, hf_link)
      tvhdhomerun_frontend_save(lfe, l);
    htsmsg_add_msg(m, "frontends", l);

    snprintf(filename, fsize, "input/tvhdhomerun/adapters/%s",
             idnode_uuid_as_str(&hd->th_id, ubuf));
  }

  htsmsg_add_str(m, "fe_override", hd->hd_override_type);
  return m;
}