package com.fongmi.android.tv; import android.content.Intent; import android.provider.Settings; import com.fongmi.android.tv.player.Players; import com.github.catvod.utils.Prefers; public class Setting { public static String getDoh() { return Prefers.getString("doh"); } public static void putDoh(String doh) { Prefers.put("doh", doh); } public static String getProxy() { return Prefers.getString("proxy"); } public static void putProxy(String proxy) { Prefers.put("proxy", proxy); } public static String getKeep() { return Prefers.getString("keep"); } public static void putKeep(String keep) { Prefers.put("keep", keep); } public static String getKeyword() { return Prefers.getString("keyword"); } public static void putKeyword(String keyword) { Prefers.put("keyword", keyword); } public static String getHot() { return Prefers.getString("hot"); } public static void putHot(String hot) { Prefers.put("hot", hot); } public static String getUa() { return Prefers.getString("ua"); } public static void putUa(String ua) { Prefers.put("ua", ua); } public static int getWall() { return Prefers.getInt("wall", 1); } public static void putWall(int wall) { Prefers.put("wall", wall); } public static int getReset() { return Prefers.getInt("reset", 0); } public static void putReset(int reset) { Prefers.put("reset", reset); } public static int getDecode() { return Prefers.getInt("decode", Players.HARD); } public static void putDecode(int decode) { Prefers.put("decode", decode); } public static int getRender() { return Prefers.getInt("render", 0); } public static void putRender(int render) { Prefers.put("render", render); } public static int getQuality() { return Prefers.getInt("quality", 2); } public static void putQuality(int quality) { Prefers.put("quality", quality); } public static int getSize() { return Prefers.getInt("size", 2); } public static void putSize(int size) { Prefers.put("size", size); } public static int getViewType(int viewType) { return Prefers.getInt("viewType", viewType); } public static void putViewType(int viewType) { Prefers.put("viewType", viewType); } public static int getScale() { return Prefers.getInt("scale"); } public static void putScale(int scale) { Prefers.put("scale", scale); } public static int getLiveScale() { return Prefers.getInt("scale_live", getScale()); } public static void putLiveScale(int scale) { Prefers.put("scale_live", scale); } public static int getSubtitle() { return Math.min(Math.max(Prefers.getInt("subtitle", 16), 14), 48); } public static void putSubtitle(int subtitle) { Prefers.put("subtitle", subtitle); } public static int getBuffer() { return Math.min(Math.max(Prefers.getInt("buffer"), 1), 10); } public static void putBuffer(int buffer) { Prefers.put("buffer", buffer); } public static int getBackground() { return Prefers.getInt("background", 2); } public static void putBackground(int background) { Prefers.put("background", background); } public static int getRtsp() { return Prefers.getInt("rtsp"); } public static void putRtsp(int rtsp) { Prefers.put("rtsp", rtsp); } public static int getSiteMode() { return Prefers.getInt("site_mode"); } public static void putSiteMode(int mode) { Prefers.put("site_mode", mode); } public static int getSyncMode() { return Prefers.getInt("sync_mode"); } public static void putSyncMode(int mode) { Prefers.put("sync_mode", mode); } public static int getBackupMode() { return Prefers.getInt("backup_mode"); } public static void putBackupMode(int auto) { Prefers.put("backup_mode", auto); } public static boolean isIncognito() { return Prefers.getBoolean("incognito"); } public static void putIncognito(boolean incognito) { Prefers.put("incognito", incognito); } public static boolean isBootLive() { return Prefers.getBoolean("boot_live"); } public static void putBootLive(boolean boot) { Prefers.put("boot_live", boot); } public static boolean isInvert() { return Prefers.getBoolean("invert"); } public static void putInvert(boolean invert) { Prefers.put("invert", invert); } public static boolean isAcross() { return Prefers.getBoolean("across", true); } public static void putAcross(boolean across) { Prefers.put("across", across); } public static boolean isChange() { return Prefers.getBoolean("change", true); } public static void putChange(boolean change) { Prefers.put("change", change); } public static boolean getUpdate() { return Prefers.getBoolean("update", true); } public static void putUpdate(boolean update) { Prefers.put("update", update); } public static boolean isCaption() { return Prefers.getBoolean("caption"); } public static void putCaption(boolean caption) { Prefers.put("caption", caption); } public static boolean isTunnel() { return Prefers.getBoolean("tunnel"); } public static void putTunnel(boolean tunnel) { Prefers.put("tunnel", tunnel); } public static boolean isZhuyin() { return Prefers.getBoolean("zhuyin"); } public static void putZhuyin(boolean zhuyin) { Prefers.put("zhuyin", zhuyin); } public static float getSpeed() { return Math.min(Math.max(Prefers.getFloat("speed", 3), 2), 5); } public static void putSpeed(float speed) { Prefers.put("speed", speed); } public static float getThumbnail() { return 0.3f * getQuality() + 0.4f; } public static boolean isBackgroundOff() { return getBackground() == 0; } public static boolean isBackgroundOn() { return getBackground() == 1 || getBackground() == 2; } public static boolean isBackgroundPiP() { return getBackground() == 2; } public static boolean hasCaption() { return new Intent(Settings.ACTION_CAPTIONING_SETTINGS).resolveActivity(App.get().getPackageManager()) != null; } }