def _side_and_size(self): self.m_lRES = list(self.m_lResolutionXY) p_iSide = get_side() self.m_iText_fst = 30 self.m_iText_spc = 14 self.m_iText_lft = 37 self.m_iText_rgt = 285 self.m_iTitl_Pos = self.m_iText_fst self.m_iMenu_pos = self.m_iText_fst + (2 * self.m_iText_spc) self.m_iSect_pos = self.m_iText_fst + (12 * self.m_iText_spc) self.m_iInfo_pos = self.m_iText_fst + (13 * self.m_iText_spc + 6) self.m_iInfo_lft = 30 self.m_iInfo_rgt = 292 self.m_iMax_Lines = 9 if p_iSide != 0: self.m_lRES[0] = self.m_lResolutionXY[1] self.m_lRES[1] = self.m_lResolutionXY[0] self.m_iText_fst = 30 self.m_iText_spc = 14 self.m_iText_lft = 31 self.m_iText_rgt = 214 self.m_iTitl_Pos = self.m_iText_fst self.m_iMenu_pos = self.m_iText_fst + (2 * self.m_iText_spc) self.m_iSect_pos = self.m_iText_fst + (18 * self.m_iText_spc) - 5 self.m_iInfo_pos = self.m_iText_fst + (19 * self.m_iText_spc) self.m_iInfo_lft = 21 self.m_iInfo_rgt = 219 self.m_iMax_Lines = 15 self.m_lScreenCenter = tuple(map(lambda x: x / 2, self.m_lRES)) self.m_iSide = p_iSide
def get_config(): global opt # create configuration file if not exists if not os.path.exists(CRT_UTILITY_FILE): os.system('echo %s > %s' % \ (DEFAULT_CONFIG, CRT_UTILITY_FILE)) # get configuration values opt[0][2] = int(ini_get(CRT_UTILITY_FILE, "game_rotation")) opt[2][2] = int(ini_get(CRT_UTILITY_FILE, "handheld_bezel")) opt[3][2] = int(ini_get(CRT_UTILITY_FILE, "freq_selector")) opt[6][2] = int(ini_get(CRT_UTILITY_FILE, "integer_scale")) opt[7][2] = int(ini_get(CRT_UTILITY_FILE, "scummvm_arc")) # get current emulationstation side iCurSide = get_side() opt[1][2] = 0 opt[1][3] = 0 if iCurSide == 1: opt[1][2] = 90 opt[1][3] = 90 opt[0][2] = 0 elif iCurSide == 3: opt[1][2] = -90 opt[1][3] = -90 opt[0][2] = 0
def get_themes(): p_lList = [] path = ES_THEMES_PRI_PATH if get_side() != 0: path = ES_THEMES_SEC_PATH try: content = os.listdir(path) for item in content: if os.path.isdir(os.path.join(path, item)): p_lList.append(item) except Exception as e: logging.info("ERROR: %s" % str(e)) if p_lList: p_lList.sort() return p_lList
def opt4_datas(self): p_lLines = { 'text': "ES Rotation", 'options': ["-90 Degrees", "Horizontal", "90 Degrees"], 'color_val': "type_color_1", 'es_restart': True } value = get_side() if value == 1: p_lLines.update({'value': "90 Degrees"}) elif value == 3: p_lLines.update({'value': "-90 Degrees"}) else: p_lLines.update({'value': "Horizontal"}) return p_lLines
def screen_prepare(self): self.m_iSide = get_side() self.core_round_checks()
def __init__(self): self.m_iCurSide = get_side()
def _pre_configure(self): self._check_current_base_res() self.iCurSide = get_side()
# clean system def __clean(self): """ Clean all side file triggers """ os.system('rm %s >> /dev/null 2>&1' % ROTMODES_TATE1_FILE) os.system('rm %s >> /dev/null 2>&1' % ROTMODES_TATE3_FILE) os.system('rm %s >> /dev/null 2>&1' % ROTMODES_YOKO_FILE) if __name__ == '__main__': iCurSide = 0 sTitRot = "ROTATE SCREEN" lOptRot = [("ROTATE 90", "90"), ("ROTATE -90", "-90"), ("CANCEL", "CANCEL")] iCurSide = get_side() if iCurSide in (1, 3): lOptRot = [("HORIZONTAL", "0"), ("ROTATE 180", "180"), ("CANCEL", "CANCEL")] sChoice = menu_options(lOptRot, sTitRot) try: sChoice = int(sChoice) except: sys.exit(0) if sChoice == 180 and iCurSide == 1: sChoice = -90 elif sChoice == 180 and iCurSide == 3: sChoice = 90 frontend_rotation(sChoice, True) sys.exit(0)
def rotate(self, p_iToMode=0): self.iCurSide = get_side() if not self._check_rotation_mode(p_iToMode): return False self._prepare_theme_configuration() self._frontend_rotation() return True