bool TWPartition::Mount(bool Display_Error) { if (Is_Mounted()) { return true; } else if (!Can_Be_Mounted) { return false; } Find_Actual_Block_Device(); // Check the current file system before mounting Check_FS_Type(); if (mount(Actual_Block_Device.c_str(), Mount_Point.c_str(), Current_File_System.c_str(), 0, NULL) != 0) { if (Display_Error) LOGE("Unable to mount '%s'\n", Mount_Point.c_str()); else LOGI("Unable to mount '%s'\n", Mount_Point.c_str()); LOGI("Actual block device: '%s', current file system: '%s'\n", Actual_Block_Device.c_str(), Current_File_System.c_str()); return false; } else { if (Removable) Update_Size(Display_Error); if (!Symlink_Mount_Point.empty()) { string Command; Command = "mount " + Symlink_Path + " " + Symlink_Mount_Point; system(Command.c_str()); } return true; } return true; }
void CRegion_GUI::Set_Track_SizeY(tint32 iSize_Y) { miSize_Y = iSize_Y; Update_Size(); Draw_Fade_In(); Draw_Fade_Out(); Draw_Region_Volume(); Redraw_Pane_Rect(); }
void CRegion_GUI::Update_Graphic() { Set_Size_X(); Set_Pos_X(); Update_Size(); mpPane->SetSize(ge::SSize(miSize_X, miSize_Y ? giTrack_Size_Big-1: giTrack_Size_Small-1)); mpPane->SetPos(ge::SPos(miPos_X, 0)); tfloat32 fSizeY = miSize_Y ? giTrack_Size_Big - 6 : giTrack_Size_Small - 6; muiRegion_Volume_Pixel = Float2Int( fSizeY - (mfRegion_Volume * fSizeY)); Draw_Fade_In(); Draw_Fade_Out(); Draw_Region_Volume(); }
/** * @brief Configures and gets Touch screen position. * @param None * @retval None */ static void GetPosition(void) { static uint32_t color_width; static uint32_t color; uint16_t x, y; color_width = 35; /* Get Touch screen position */ BSP_TS_GetState(&TS_State); if(TS_State.touchDetected) { /* A touch occured, read the touch coordinates */ /* Get X and Y position of the first touch post calibrated */ x = TouchScreen_Get_Calibrated_X(TS_State.touchX[0]); y = TouchScreen_Get_Calibrated_Y(TS_State.touchY[0]); if((x > (90 + Radius)) & (y > (7 + Radius) ) & ( x < (BSP_LCD_GetXSize() - (7 + Radius ))) & (y < (BSP_LCD_GetYSize() - (95 + Radius )))) { BSP_LCD_FillCircle((x), (y), Radius); } else if((x > 0 ) & ( x < 90 )) { if((y > 0 ) & (y < color_width )) { BSP_LCD_SetTextColor(LCD_COLOR_WHITE); Update_Size(Radius); } else if((y > color_width ) & (y < (2 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_YELLOW); Update_Size(Radius); } else if((y > (2 * color_width)) & (y < (3 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_ORANGE); Update_Size(Radius); } else if((y > (3 * color_width)) & (y < (4 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_LIGHTMAGENTA); Update_Size(Radius); } else if((y > (4 * color_width)) & (y < (5 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_DARKGREEN); Update_Size(Radius); } else if((y > (5 * color_width)) &(y < (6 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_GREEN); Update_Size(Radius); } else if((y > (6 * color_width)) &(y < (7 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_BROWN); Update_Size(Radius); } else if((y > (7 * color_width)) & (y < (8 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_RED); Update_Size(Radius); } else if((y > (8 * color_width)) & (y < (9 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_DARKMAGENTA); Update_Size(Radius); } else if((y > (9 * color_width)) & (y < (10 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_CYAN); Update_Size(Radius); } else if((y > (10 * color_width)) & (y < (11 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE); Update_Size(Radius); } else if((y > (11 * color_width)) & (y < (12 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_BLACK); Update_Size(Radius); } else if((y > (12 * color_width)) & (y < (14 * color_width))) { /* Get the current text color */ color = BSP_LCD_GetTextColor(); BSP_LCD_SetTextColor(LCD_COLOR_WHITE); /* Clear the working window */ BSP_LCD_FillRect(97, 8, 694, 374); BSP_LCD_SetTextColor(color); } else { x = 0; y = 0; } Update_Color(); } else if((x > 100) & (y > (BSP_LCD_GetYSize() - 90)) & (y < (BSP_LCD_GetYSize()) ) & ( x < 170)) { Radius = 15; Update_Size(Radius); } else if((x > 170) & (y > (BSP_LCD_GetYSize() - 90)) & (y < (BSP_LCD_GetYSize()) ) & ( x < 240)) { Radius = 10; Update_Size(Radius); } else if((x > 240) & (y > (BSP_LCD_GetYSize() - 90)) & (y < (BSP_LCD_GetYSize()) ) & ( x < 310)) { Radius = 5; Update_Size(Radius); } else if(((x > (BSP_LCD_GetXSize()-5) ) & (y > (14 * color_width)) & (y < (15 * color_width))) | ((x < 90) & (y < 5))) { TS_State.touchX[0] = 0; TS_State.touchY[0] = 0; } else if((x > 320) & (y > (BSP_LCD_GetYSize() - 90)) & (x < 410) & (y < BSP_LCD_GetYSize() - 5)) { Save_Picture(); } } }
/** * @brief Configures and gets Touch screen position. * @param None * @retval None */ static void GetPosition(void) { static uint32_t color_width; static uint32_t color; if (BSP_LCD_GetXSize() == 640) { color_width = 36; } else { color_width = 19; } /* Get Touch screen position */ BSP_TS_GetState(&TS_State); /* Read the coordinate */ x = Calibration_GetX(TS_State.x); y = Calibration_GetX(TS_State.y); if ((TS_State.TouchDetected) & (x > (67 + Radius)) & (y > (7 + Radius) ) & ( x < (BSP_LCD_GetXSize()-(7 + Radius )) ) & (y < (BSP_LCD_GetYSize()-(67 + Radius )) )) { BSP_LCD_FillCircle((x), (y), Radius); } else if ((TS_State.TouchDetected) & (x > 0 ) & ( x < 50 )) { if ((TS_State.TouchDetected) & ( y > 0 ) & ( y < color_width )) { BSP_LCD_SetTextColor(LCD_COLOR_WHITE); Update_Size(Radius); } else if ((TS_State.TouchDetected) & ( y > color_width ) & (y < (2 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_YELLOW); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (2 * color_width)) & (y < (3 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_ORANGE); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (3 * color_width)) & (y < (4 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_LIGHTMAGENTA); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (4 * color_width)) & (y < (5 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_DARKGREEN); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (5 * color_width)) &(y < (6 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_GREEN); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (6 * color_width)) &(y < (7 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_BROWN); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (7 * color_width)) & (y < (8 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_RED); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (8 * color_width)) & (y < (9 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_DARKMAGENTA); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (9 * color_width)) & (y < (10 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_CYAN); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (10 * color_width)) & (y < (11 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_DARKBLUE); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (11 * color_width)) & (y < (12 * color_width))) { BSP_LCD_SetTextColor(LCD_COLOR_BLACK); Update_Size(Radius); } else if ((TS_State.TouchDetected) & (y > (12 * color_width)) & (y < (13 * color_width))) { /* Get the current text color */ color = BSP_LCD_GetTextColor(); BSP_LCD_SetTextColor(LCD_COLOR_WHITE); /* Clear the working window */ BSP_LCD_FillRect(68, 8, (BSP_LCD_GetXSize() - 75), (BSP_LCD_GetYSize() - 75)); BSP_LCD_SetTextColor(color); } else { x = 0; y = 0; } Update_Color(); } else if ((TS_State.TouchDetected) & (x > 70 ) & (y > (12 * color_width)) & (y < (13 * color_width)) & ( x < 120 )) { Radius = 20; Update_Size(Radius); } else if ((TS_State.TouchDetected) & (x > 120 ) & (y > (12 * color_width)) & (y < (13 * color_width)) & ( x < 170 )) { Radius = 15; Update_Size(Radius); } else if ((TS_State.TouchDetected) & (x > 170 ) & (y > (12 * color_width)) & (y < (13 * color_width)) & ( x < 220 )) { Radius = 10; Update_Size(Radius); } else if ((TS_State.TouchDetected) & (x > 220 ) & (y > (12 * color_width)) & (y < (13 * color_width)) & ( x < 270 )) { Radius = 5; Update_Size(Radius); } else if ((TS_State.TouchDetected) & (x > 270 ) & (y > (12 * color_width)) & (y < (13 * color_width)) & ( x < 320 )) { Radius = 2; Update_Size(Radius); } else if ((TS_State.TouchDetected) & (((x > (BSP_LCD_GetXSize()-5) ) & (y > (12 * color_width)) & (y < (13 * color_width))) | (( x < 55 ) & ( y < 5 )))) { TS_State.x = 0; TS_State.y = 0; } else if ((TS_State.TouchDetected) & (x > 320) & (y > (BSP_LCD_GetYSize() - 50)) & (x < 370) & (y < BSP_LCD_GetYSize() )) { Save_Picture(); } }