Ejemplo n.º 1
0
void
runcontrol_init(void)
{
  prop_t *rc;

  rc = prop_create(prop_get_global(), "runcontrol");

  prop_set(rc, "canStandby",   PROP_SET_INT,  !!gconf.can_standby);
  prop_set(rc, "canPowerOff",  PROP_SET_INT,  !!gconf.can_poweroff);
  prop_set(rc, "canLogout",    PROP_SET_INT,  !!gconf.can_logout);
  prop_set(rc, "canOpenShell", PROP_SET_INT,  !!gconf.can_open_shell);
  prop_set(rc, "canRestart",   PROP_SET_INT,  !!gconf.can_restart);
  prop_set(rc, "canExit",      PROP_SET_INT,   !gconf.can_not_exit);

  if(!(gconf.can_standby ||
       gconf.can_poweroff ||
       gconf.can_logout ||
       gconf.can_open_shell ||
       gconf.can_restart ||
       !gconf.can_not_exit))
    return;

  settings_create_separator(gconf.settings_general,
			  _p("Starting and stopping"));

  if(gconf.can_standby) {
    init_autostandby();
    init_sleeptimer(rc);
    settings_create_action(gconf.settings_general, _p("Standby"),
			   do_standby, NULL, 0, NULL);
  }

  if(gconf.can_poweroff)
    settings_create_action(gconf.settings_general, _p("Power off system"),
			   do_power_off, NULL, 0, NULL);

  if(gconf.can_logout)
    settings_create_action(gconf.settings_general, _p("Logout"),
			   do_logout, NULL, 0, NULL);

  if(gconf.can_open_shell)
    settings_create_action(gconf.settings_general, _p("Open shell"),
			   do_open_shell, NULL, 0, NULL);

  if(!gconf.can_not_exit)
    settings_create_action(gconf.settings_general, _p("Quit"),
			   do_exit, NULL, 0, NULL);

  if(gconf.shell_fd > 0) {

    settings_create_separator(gconf.settings_network, _p("SSH server"));

    setting_create(SETTING_BOOL, gconf.settings_network,SETTINGS_INITIAL_UPDATE,
		   SETTING_TITLE(_p("Enable SSH server")),
		   SETTING_VALUE(0),
		   SETTING_CALLBACK(set_ssh_server, NULL),
		   SETTING_STORE("runcontrol", "sshserver"),
		   NULL);
  }
}
Ejemplo n.º 2
0
void
audio_test_init(prop_t *asettings)
{
  settings_create_separator(asettings, _p("Audio test"));

  setting_create(SETTING_BOOL, asettings, SETTINGS_INITIAL_UPDATE,
		 SETTING_TITLE(_p("Play test signal")),
                 SETTING_CALLBACK(enable_set_signal, NULL),
		 NULL);

  setting_create(SETTING_MULTIOPT, asettings, SETTINGS_INITIAL_UPDATE,
		 SETTING_TITLE(_p("Test signal type")),
		 SETTING_WRITE_INT(&signal_type),
		 SETTING_OPTION("0", _p("Speaker position")),
		 SETTING_OPTION("1", _p("Pink noise")),
		 SETTING_OPTION("2", _p("440Hz sinewave -12dB")),
		 NULL);

  add_ch_bool(_p("Front Left"),  0, 1, asettings);
  add_ch_bool(_p("Center"),      2, 0, asettings);
  add_ch_bool(_p("Front Right"), 1, 1, asettings);
  add_ch_bool(_p("LFE"),         3, 0, asettings);
  add_ch_bool(_p("Surround Left"),   4, 0, asettings);
  add_ch_bool(_p("Surround Right"),  5, 0, asettings);
  add_ch_bool(_p("Rear Left"),   6, 0, asettings);
  add_ch_bool(_p("Rear Right"),  7, 0, asettings);

}
Ejemplo n.º 3
0
void
opensub_init(void)
{
    prop_t *s;
    hts_mutex_init(&opensub_mutex);

    s = subtitle_settings_dir;

    settings_create_separator(s, _p("Settings for opensubtitles.org"));

    htsmsg_t *store = htsmsg_store_load("opensubtitles");
    if(store == NULL)
        store = htsmsg_create_map();

    settings_create_bool(s, "enable", _p("Use opensubtitles.org"), 0,
                         store, set_enable, NULL,
                         SETTINGS_INITIAL_UPDATE, NULL,
                         settings_generic_save_settings,
                         (void *)"opensubtitles");

    settings_create_string(s, "username", _p("Username"), NULL,
                           store, set_username, NULL,
                           SETTINGS_INITIAL_UPDATE,  NULL,
                           settings_generic_save_settings,
                           (void *)"opensubtitles");

    settings_create_string(s, "password", _p("Password"), NULL,
                           store, set_password, NULL,
                           SETTINGS_INITIAL_UPDATE | SETTINGS_PASSWORD, NULL,
                           settings_generic_save_settings,
                           (void *)"opensubtitles");
}
Ejemplo n.º 4
0
static JSBool 
js_createDivider(JSContext *cx, JSObject *obj, uintN argc, 
	      jsval *argv, jsval *rval)
{
  js_setting_group_t *jsg = JS_GetPrivate(cx, obj);
  const char *title;

  if(!JS_ConvertArguments(cx, argc, argv, "s", &title))
    return JS_FALSE;

  settings_create_separator(jsg->jsg_root, _p(title));
  return JS_TRUE;
}
Ejemplo n.º 5
0
int
glw_ps3_start(void)
{
  glw_ps3_t *gp = calloc(1, sizeof(glw_ps3_t));
  glwps3 = gp;
  prop_t *root = gp->gr.gr_prop_ui = prop_create(prop_get_global(), "ui");
  gp->gr.gr_prop_nav = nav_spawn();

  prop_set_int(prop_create(root, "fullscreen"), 1);

  if(glw_ps3_init(gp))
     return 1;

  gp->gr.gr_prop_maxtime = 10000;

  glw_root_t *gr = &gp->gr;

  if(glw_init2(gr,
               GLW_INIT_KEYBOARD_MODE |
               GLW_INIT_OVERSCAN |
               GLW_INIT_IN_FULLSCREEN))
    return 1;

  settings_create_separator(glw_settings.gs_settings, _p("Dual-Shock Remote"));

  setting_create(SETTING_MULTIOPT, glw_settings.gs_settings,
                 SETTINGS_INITIAL_UPDATE,
                 SETTING_TITLE(_p("Seek using L2 and R2 button")),
                 SETTING_OPTION("0", _p("Yes")),
                 SETTING_OPTION("1", _p("Yes with Select button")),
                 SETTING_OPTION("2", _p("No")),
                 SETTING_COURIER(gr->gr_courier),
                 SETTING_CALLBACK(set_seekmode, gp),
                 SETTING_STORE("glw", "analogseekmode"),
                 NULL);

  gr->gr_open_osk = osk_open;

  TRACE(TRACE_DEBUG, "GLW", "loading universe");

  glw_load_universe(gr);
  glw_ps3_mainloop(gp);
  glw_unload_universe(gr);
  glw_reap(gr);
  glw_reap(gr);
  return 0;
}
Ejemplo n.º 6
0
void
audio_init(void)
{
  htsmsg_t *store = htsmsg_store_load("audio2");
  if(store == NULL)
    store = htsmsg_create_map();

  prop_t *asettings =
    settings_add_dir(NULL, _p("Audio settings"), NULL, NULL,
                     _p("Setup audio output"),
                     "settings:audio");

  audio_mastervol_init();
  audio_class = audio_driver_init(asettings, store);

  settings_create_separator(asettings,
			    _p("Audio settings during video playback"));

  gconf.setting_av_volume =
    setting_create(SETTING_INT, asettings,
                   SETTINGS_INITIAL_UPDATE,
                   SETTING_TITLE(_p("Audio gain adjustment during video playback")),
                   SETTING_RANGE(-12, 12),
                   SETTING_UNIT_CSTR("dB"),
                   SETTING_HTSMSG("videovolume", store, "audio2"),
                   SETTING_VALUE_ORIGIN("global"),
                   NULL);

  gconf.setting_av_sync =
    setting_create(SETTING_INT, asettings,
                   SETTINGS_INITIAL_UPDATE,
                   SETTING_TITLE(_p("Audio delay")),
                   SETTING_RANGE(-5000, 5000),
                   SETTING_STEP(50),
                   SETTING_UNIT_CSTR("ms"),
                   SETTING_HTSMSG("avdelta", store, "audio2"),
                   SETTING_VALUE_ORIGIN("global"),
                   NULL);


#if CONFIG_AUDIOTEST
  audio_test_init(asettings);
#endif
}
Ejemplo n.º 7
0
void
torrent_settings_init(void)
{
  prop_t *dir = setting_get_dir("general:filebrowse");
  prop_t *s = settings_add_dir(dir, _p("BitTorrent"),
                               NULL, NULL, NULL, "settings:bittorrent");

  char defpath[1024];
  int freespace = 10;

#ifdef STOS
  freespace = 75;
#endif

  snprintf(defpath, sizeof(defpath), "%s/bittorrentcache", gconf.cache_path);

  setting_create(SETTING_BOOL, s, SETTINGS_INITIAL_UPDATE,
                 SETTING_TITLE(_p("Enable bittorrent")),
                 SETTING_MUTEX(&bittorrent_mutex),
                 SETTING_WRITE_BOOL(&btg.btg_enabled),
                 SETTING_VALUE(1),
                 SETTING_STORE("bittorrent", "enable"),
                 NULL);

  setting_create(SETTING_INT, s, SETTINGS_INITIAL_UPDATE,
                 SETTING_TITLE(_p("Max upload speed")),
                 SETTING_MUTEX(&bittorrent_mutex),
                 SETTING_CALLBACK(set_torrent_upload_speed, NULL),
                 SETTING_VALUE(5),
                 SETTING_RANGE(0, 100),
                 SETTING_UNIT_CSTR("Mbit/s"),
                 SETTING_STORE("bittorrent", "uploadspeed"),
                 NULL);

  setting_create(SETTING_INT, s, SETTINGS_INITIAL_UPDATE,
                 SETTING_TITLE(_p("Max usage of free space for caching torrents")),
                 SETTING_MUTEX(&bittorrent_mutex),
                 SETTING_CALLBACK(set_torrent_free_percentage, NULL),
                 SETTING_VALUE(freespace),
                 SETTING_RANGE(1, 90),
                 SETTING_UNIT_CSTR("%"),
                 SETTING_STORE("bittorrent", "freepercentage"),
                 NULL);

  setting_create(SETTING_STRING, s, SETTINGS_INITIAL_UPDATE | SETTINGS_DIR,
                 SETTING_TITLE(_p("Torrent cache path")),
                 SETTING_MUTEX(&bittorrent_mutex),
                 SETTING_CALLBACK(set_torrent_cache_path, NULL),
                 SETTING_VALUE(defpath),
                 SETTING_STORE("bittorrent", "path"),
                 NULL);

  setting_create(SETTING_ACTION, s, 0,
                 SETTING_TITLE(_p("Clear cache")),
                 SETTING_MUTEX(&bittorrent_mutex),
                 SETTING_CALLBACK(torrent_diskio_cache_clear, NULL),
                 NULL);


  settings_create_separator(s, _p("Status"));

  btg.btg_torrent_status = prop_create_root(NULL);
  settings_create_info(s, NULL, btg.btg_torrent_status);

  btg.btg_disk_status = prop_create_root(NULL);
  settings_create_info(s, NULL, btg.btg_disk_status);

  allow_update = 1;
  torrent_diskio_scan(0);
}