-// ---------- XXX: pandora specific -----------
-
-static const char pnd_script_base[] = "sudo -n /usr/pandora/scripts";
-static char **pnd_filter_list;
-
-static void apply_filter(int which)
-{
- static int old = -1;
- char buf[128];
- int i;
-
- if (pnd_filter_list == NULL || which == old)
- return;
-
- for (i = 0; i < which; i++)
- if (pnd_filter_list[i] == NULL)
- return;
-
- if (pnd_filter_list[i] == NULL)
- return;
-
- snprintf(buf, sizeof(buf), "%s/op_videofir.sh %s", pnd_script_base, pnd_filter_list[i]);
- system(buf);
- old = which;
-}
-
-static void apply_lcdrate(int pal)
-{
- static int old = -1;
- char buf[128];
-
- if (pal == old)
- return;
-
- snprintf(buf, sizeof(buf), "%s/op_lcdrate.sh %d",
- pnd_script_base, pal ? 50 : 60);
- system(buf);
- old = pal;
-}
-
-static menu_entry e_menu_gfx_options[];
-
-static void pnd_menu_init(void)
-{
- struct dirent *ent;
- int i, count = 0;
- char **mfilters;
- char buff[64];
- DIR *dir;
-
- cpu_clock_st = cpu_clock = plat_cpu_clock_get();
-
- dir = opendir("/etc/pandora/conf/dss_fir");
- if (dir == NULL) {
- perror("filter opendir");
- return;
- }
-
- while (1) {
- errno = 0;
- ent = readdir(dir);
- if (ent == NULL) {
- if (errno != 0)
- perror("readdir");
- break;
- }
-
- if (ent->d_type != DT_REG && ent->d_type != DT_LNK)
- continue;
-
- count++;
- }
-
- if (count == 0)
- return;
-
- mfilters = calloc(count + 1, sizeof(mfilters[0]));
- if (mfilters == NULL)
- return;
-
- rewinddir(dir);
- for (i = 0; (ent = readdir(dir)); ) {
- size_t len;
-
- if (ent->d_type != DT_REG && ent->d_type != DT_LNK)
- continue;
-
- len = strlen(ent->d_name);
-
- // skip pre-HF5 extra files
- if (len >= 3 && strcmp(ent->d_name + len - 3, "_v3") == 0)
- continue;
- if (len >= 3 && strcmp(ent->d_name + len - 3, "_v5") == 0)
- continue;
-
- // have to cut "_up_h" for pre-HF5
- if (len > 5 && strcmp(ent->d_name + len - 5, "_up_h") == 0)
- len -= 5;
-
- if (len > sizeof(buff) - 1)
- continue;
-
- strncpy(buff, ent->d_name, len);
- buff[len] = 0;
- mfilters[i] = strdup(buff);
- if (mfilters[i] != NULL)
- i++;
- }
- closedir(dir);
-
- i = me_id2offset(e_menu_gfx_options, MA_OPT_FILTERING);
- e_menu_gfx_options[i].data = (void *)mfilters;
- pnd_filter_list = mfilters;
-}
-
-void menu_finish(void)
-{
- plat_cpu_clock_apply(cpu_clock_st);
-}
-