⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 window.c

📁 LCDTV的source code,含周邊ic的driver code ,scaler ,
💻 C
📖 第 1 页 / 共 2 页
字号:
/*******************************************************************************
  WINDOW.C
  Copyright (c) SmartASIC, Inc. All rights reserved.
*******************************************************************************/
#include <MTV230.H>
#include <DEFINE.H>
#include <FONT.H>
/*==============================================================================
  (Main Page) Page=1
==============================================================================*/
code unsigned char **PAGE1[]={E_V_PAGE1};

void Video_Page1(void) {

  code unsigned int ICON_PAGE1[]={0xa0,0xa2,0xa4,0xa6,0xa8};
  unsigned char **StrPtr;
  unsigned char i;

  Clear_Screen();
  OSD_Position(OSD_VPosition, OSD_HPosition);

  Window_Control(3, 0, 9, 0, 28, BLACK);

  StrPtr=PAGE1[Language];

  Print_String(0, (29-StringLength(*(StrPtr+0)))/2, *(StrPtr+0), RED);
  for(i=0;i<5;i++) {
    Print_Icon(2+i, 2, ICON_PAGE1[i]+0, CYAN);
    Print_Icon(2+i, 3, ICON_PAGE1[i]+1, CYAN);
    Print_String(2+i, 5, *(StrPtr+1+i), CYAN);
    }
  Print_String(8, 1, *(StrPtr+6), WHITE);
  Print_String(9, 1, *(StrPtr+7), WHITE);

  if(Source!=TV)
    Line_Attribute(4, 0, 28, RED);

  if(Sleep==0)
    Print_String(5, 25, "OFF", CYAN);
  else
    Print_Char(5, 25, SleepCountDown, CYAN);
  
  }


/*==============================================================================
  Select in (Main Page) Page=1
==============================================================================*/
void Video_Page1_Sel(void) {

  unsigned char pre, next;

  pre=(Item+4)%5;
  next=(Item+1)%5;

  if(pre==2)//Skip TV Page if not TV Mode
    if(Source!=TV)
      pre=1;
  if(next==2)//Skip TV Page if not TV Mode
    if(Source!=TV)
      next=3;
      

  Line_Attribute(pre+2, 0, 28, CYAN);
  Line_Attribute(next+2, 0, 28, CYAN);
  Line_Attribute(Item+2, 0, 28, YELLOW);
  Print_Icon(pre+2, 1, 0, CYAN);
  Print_Icon(next+2, 1, 0, CYAN);
  Print_Icon(Item+2, 1, 0x95, YELLOW);

  }


/*==============================================================================
  (Main Page -> Video) Page=2
==============================================================================*/
code unsigned char **PAGE2[]={E_V_PAGE2};

void Video_Page2(void) {

  code unsigned int ICON_PAGE2[]={0xaa,0xac,0xae,0xb0,0xb2,0xb4,0xb6,0xba,0xbc};
  unsigned char **StrPtr;
  unsigned char i;

  Clear_Screen();
  OSD_Position(OSD_VPosition, OSD_HPosition);
  
  Window_Control(3, 0, 13, 0, 28, BLACK);

  StrPtr=PAGE2[Language];

  Print_String(0, (29-StringLength(*(StrPtr+0)))/2, *(StrPtr+0), RED);
  for(i=0; i<9; i++) {
    Print_Icon(2+i, 2, ICON_PAGE2[i]+0, CYAN);
    Print_Icon(2+i, 3, ICON_PAGE2[i]+1, CYAN);
    Print_String(2+i, 5, *(StrPtr+1+i), CYAN);
    }
  Print_String(12, 1, *(StrPtr+10), WHITE);
  Print_String(13, 1, *(StrPtr+11), WHITE);

  Print_Char(2, 25, Contrast, CYAN);
  Print_Char(3, 25, Brightness, CYAN);
  Print_Char(4, 25, Saturation, CYAN);
  Print_Char(5, 25, Hue, CYAN);
  Print_Char(6, 25, Sharpness, CYAN);
  StrPtr=COLOR_TMP[Language];
  Print_String(7, 28-StringLength(*(StrPtr+Color_Temp)), *(StrPtr+Color_Temp), CYAN);
  StrPtr=CAPTION_OPT[Language];
  Print_String(8, 28-StringLength(*(StrPtr+Caption)), *(StrPtr+Caption), CYAN);
  StrPtr=OFFON[Language];
  Print_String(9, 28-StringLength(*(StrPtr+OSD_Disp)), *(StrPtr+OSD_Disp), CYAN);
  
  }


/*==============================================================================
  Select in (Main Page -> Video) Page=2
==============================================================================*/
void Video_Page2_Sel(void) {

  unsigned char pre, next;

  pre=(Item+8)%9;
  next=(Item+1)%9;

  Line_Attribute(pre+2, 0, 28, CYAN);
  Line_Attribute(next+2, 0, 28, CYAN);
  Line_Attribute(Item+2, 0, 28, YELLOW);
  Print_Icon(pre+2, 1, 0, CYAN);
  Print_Icon(next+2, 1, 0, CYAN);
  Print_Icon(Item+2, 1, 0x95, YELLOW);

  }


/*==============================================================================
  (Main Page -> Audio) Page=3
==============================================================================*/
code unsigned char **PAGE3[]={E_V_PAGE3};

void Video_Page3(void) {

  code unsigned int ICON_PAGE3[]={0xa2,0xbe,0xc0,0xc2,0xd2,0xbc};
  unsigned char **StrPtr;
  unsigned char i;

  Clear_Screen();
  OSD_Position(OSD_VPosition, OSD_HPosition);
  
  Window_Control(3, 0, 10, 0, 28, BLACK);

  StrPtr=PAGE3[Language];

  Print_String(0, (29-StringLength(*(StrPtr+0)))/2, *(StrPtr+0), RED);
  for(i=0; i<6; i++) {
    Print_Icon(2+i, 2, ICON_PAGE3[i]+0, CYAN);
    Print_Icon(2+i, 3, ICON_PAGE3[i]+1, CYAN);
    Print_String(2+i, 5, *(StrPtr+1+i), CYAN);
    }
  Print_String(9, 1, *(StrPtr+7), WHITE);
  Print_String(10, 1, *(StrPtr+8), WHITE);

  Print_Char(2, 25, Volume, CYAN);
  Print_Char(3, 25, Treble, CYAN);
  Print_Char(4, 25, Bass, CYAN);
  Print_Char(5, 25, Balance, CYAN);
  StrPtr=OFFON[Language];
  if(Mute)
    Print_String(6, 28-StringLength(*(StrPtr+0)), *(StrPtr+0), CYAN);
  else
    Print_String(6, 28-StringLength(*(StrPtr+1)), *(StrPtr+1), CYAN);
  
  }


/*==============================================================================
  Select in (Main Page -> Audio) Page=3
==============================================================================*/
void Video_Page3_Sel(void) {

  unsigned char pre, next;

  pre=(Item+5)%6;
  next=(Item+1)%6;

  Line_Attribute(pre+2, 0, 28, CYAN);
  Line_Attribute(next+2, 0, 28, CYAN);
  Line_Attribute(Item+2, 0, 28, YELLOW);
  Print_Icon(pre+2, 1, 0, CYAN);
  Print_Icon(next+2, 1, 0, CYAN);
  Print_Icon(Item+2, 1, 0x95, YELLOW);

  }


/*==============================================================================
  (Main Page -> TV) Page=4
==============================================================================*/
code unsigned char **PAGE4[]={E_V_PAGE4};

void Video_Page4(void) {

  code unsigned int ICON_PAGE4[]={0xc4,0xc6,0xc8,0xca,0xcc,0xce,0xbc};
  unsigned char **StrPtr;
  unsigned char i;

  Clear_Screen();
  OSD_Position(OSD_VPosition, OSD_HPosition);
  
  Window_Control(3, 0, 11, 0, 28, BLACK);

  StrPtr=PAGE4[Language];

  Print_String(0, (29-StringLength(*(StrPtr+0)))/2, *(StrPtr+0), RED);
  for(i=0; i<7; i++) {
    Print_Icon(2+i, 2, ICON_PAGE4[i]+0, CYAN);
    Print_Icon(2+i, 3, ICON_PAGE4[i]+1, CYAN);
    Print_String(2+i, 5, *(StrPtr+1+i), CYAN);
    }
  Print_String(10, 1, *(StrPtr+8), WHITE);
  Print_String(11, 1, *(StrPtr+9), WHITE);

  switch(TV_Mode) {
    case(TV_AIR):
      Print_String(2, 20, "  TV(AIR)", CYAN);
    break;
    case(CATV_STD):
      Print_String(2, 20, "CATV(STD)", CYAN);
    break;
    case(CATV_IRC):
      Print_String(2, 20, "CATV(IRC)", CYAN);
    break;
    case(CATV_HRC):
      Print_String(2, 20, "CATV(HRC)", CYAN);
    break;
    }

  StrPtr=MTSMODE[Language];
  switch(MTS_Mode) {
    case(0):
      Print_String(3, 28-StringLength(*(StrPtr+0)), *(StrPtr+0), CYAN);
    break;
    case(1):
      Print_String(3, 28-StringLength(*(StrPtr+1)), *(StrPtr+1), CYAN);
    break;
    case(2):
    case(3):
      Print_String(3, 28-StringLength(*(StrPtr+2)), *(StrPtr+2), CYAN);
    break;
    }
  
  }


/*==============================================================================
  Select in (Main Page -> TV) Page=4
==============================================================================*/
void Video_Page4_Sel(void) {

  unsigned char pre, next;

  pre=(Item+6)%7;
  next=(Item+1)%7;

  Line_Attribute(pre+2, 0, 28, CYAN);
  Line_Attribute(next+2, 0, 28, CYAN);
  Line_Attribute(Item+2, 0, 28, YELLOW);
  Print_Icon(pre+2, 1, 0, CYAN);
  Print_Icon(next+2, 1, 0, CYAN);
  Print_Icon(Item+2, 1, 0x95, YELLOW);

  }


/*==============================================================================
  (Adjustment Window) Page=? badjust=1
==============================================================================*/
code unsigned char **COLOR_TMP[]={E_COLOR_TEMP};
code unsigned char **CAPTION_OPT[]={E_CAPTION_OPT};
code unsigned char **OFFON[]={E_OFFON};
code unsigned char **CHADDERASE[]={E_CHADD};
code unsigned char **CHLOCK[]={E_CHLOCK};
code unsigned char **MTSMODE[]={E_MTS};

void Adjustment_Win(void) {

  unsigned char **StrPtr;
  unsigned char length, pos0, pos1, pos2;
  
  Clear_Screen();
  OSD_Position(136, 49);
                
  Window_Control(3, 0, 1, 0, 28, BLACK);

  switch(Page) {
    case(1)://(Main Page)
      StrPtr=PAGE1[Language];
      switch(Item) {
        case(3)://Sleep
          Print_String(0, 1, "OFF  30   40   50   60   70", WHITE);
          Print_String(1, 1, "     80   90  100  110  120", WHITE);
          if(Sleep==0) {
            pos0=0;
            pos1=1;
            Print_String(1, 1, "OFF", CYAN);
            }
          else {
            pos0=(Sleep-1)/5;
            pos1=(Sleep-1)%5;
            pos1=pos1*5+5;
            Print_Char(1, 1, SleepCountDown, CYAN);
            }
          Line_Attribute(pos0, pos1, pos1+2, RED);
        break;
        }
    break;
    case(2)://(Main Page -> Video)
      StrPtr=PAGE2[Language];
      length=StringLength(*(StrPtr+1+Item));
      Print_String(0, (29-length)/2, *(StrPtr+1+Item), YELLOW);
      switch(Item) {
        case(0)://Contrast
          Print_String(1, 0, VALUE_BAR, WHITE);
          Paint_Bar(1, 2, CONTRAST_MIN, CONTRAST_MAX, Contrast);
          Print_Char(1, 25, Contrast, WHITE);
        break;
        case(1)://Brightness
          Print_String(1, 0, VALUE_BAR, WHITE);
          Paint_Bar(1, 2, BRIGHTNESS_MIN, BRIGHTNESS_MAX, Brightness);
          Print_Char(1, 25, Brightness, WHITE);
        break;
        case(2)://Color
          Print_String(1, 0, VALUE_BAR, WHITE);
          Paint_Bar(1, 2, SATURATION_MIN, SATURATION_MAX, Saturation);
          Print_Char(1, 25, Saturation, WHITE);
        break;
        case(3)://Tint
          Print_String(1, 0, VALUE_BAR, WHITE);
          Paint_Bar(1, 2, HUE_MIN, HUE_MAX, Hue);
          Print_Char(1, 25, Hue, WHITE);
        break;
        case(4)://Sharpness
          Print_String(1, 0, VALUE_BAR, WHITE);
          Paint_Bar(1, 2, SHARPNESS_MIN, SHARPNESS_MAX, Sharpness);
          Print_Char(1, 25, Sharpness, WHITE);
        break;
        case(5)://Color Temp.
          StrPtr=COLOR_TMP[Language];
          length=StringLength(*(StrPtr+0))+StringLength(*(StrPtr+1))+StringLength(*(StrPtr+2));
          length=(29-length)/4;
          pos0=length;
          pos1=pos0+StringLength(*(StrPtr+0))+length;
          pos2=pos1+StringLength(*(StrPtr+1))+length;
          Print_String(1, pos0, *(StrPtr+0), WHITE);
          Print_String(1, pos1, *(StrPtr+1), WHITE);
          Print_String(1, pos2, *(StrPtr+2), WHITE);
          switch(Color_Temp) {
            case(0):
              Line_Attribute(1, pos0, pos0+StringLength(*(StrPtr+0))-1, RED);
            break;
            case(1):
              Line_Attribute(1, pos1, pos1+StringLength(*(StrPtr+1))-1, RED);
            break;
            case(2):
              Line_Attribute(1, pos2, pos2+StringLength(*(StrPtr+2))-1, RED);
            break;
            }
        break;
        case(6)://Caption
          StrPtr=CAPTION_OPT[Language];
          for(length=0; length<9; length++)
            Print_String(1, 1+length*3, *(StrPtr+length), WHITE);
          length=1+3*Caption;
          Line_Attribute(1, length, length+2, RED);
        break;
        case(7)://OSD Display
          StrPtr=OFFON[Language];
          Print_String(1, (15-StringLength(*(StrPtr+0)))/2, *(StrPtr+0), WHITE);
          Print_String(1, 15+(15-StringLength(*(StrPtr+1)))/2, *(StrPtr+1), WHITE);
          if(OSD_Disp)
            Line_Attribute(1, 16, 29, RED);
          else
            Line_Attribute(1, 0, 15, RED);
        break;
        }
    break;
    case(3)://(Main Page -> Audio)
      StrPtr=PAGE3[Language];
      length=StringLength(*(StrPtr+1+Item));
      Print_String(0, (29-length)/2, *(StrPtr+1+Item), YELLOW);
      switch(Item) {
        case(0)://Volume
          Print_String(1, 0, VALUE_BAR, WHITE);
          Paint_Bar(1, 2, VOLUME_MIN, VOLUME_MAX, Volume);
          Print_Char(1, 25, Volume, WHITE);
        break;
        case(1)://Treble
          Print_String(1, 0, VALUE_BAR, WHITE);
          Paint_Bar(1, 2, TREBLE_MIN, TREBLE_MAX, Treble);
          Print_Char(1, 25, Treble, WHITE);
        break;
        case(2)://Bass
          Print_String(1, 0, VALUE_BAR, WHITE);
          Paint_Bar(1, 2, BASS_MIN, BASS_MAX, Bass);
          Print_Char(1, 25, Bass, WHITE);
        break;
        case(3)://Balance
          Print_String(1, 0, VALUE_BAR, WHITE);
          Paint_Bar(1, 2, BALANCE_MIN, BALANCE_MAX, Balance);
          Print_Char(1, 25, Balance, WHITE);
        break;
        case(4)://Speaker
          StrPtr=OFFON[Language];
          Print_String(1, (15-StringLength(*(StrPtr+0)))/2, *(StrPtr+0), WHITE);
          Print_String(1, 15+(15-StringLength(*(StrPtr+1)))/2, *(StrPtr+1), WHITE);
          if(Mute)
            Line_Attribute(1, 0, 15, RED);
          else
            Line_Attribute(1, 16, 29, RED);
        break;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -