Ejemplo n.º 1
0
/*******************************************************************************
* Function Scroll_Fill_Area()
* ------------------------------------------------------------------------------
* Overview:  Function fills Scroll area with text from File_List
* Input: Nothing
* Output: Nothing
*******************************************************************************/
void Scroll_Fill_Area(){
char *ptr, *dptr, i;
unsigned int temp, temp1;
  dptr = Scroll_text;
  i = 0;
  ptr = File_List[i].FileName;

  // write Text
  while (*ptr != 0xFF){
    while(*dptr++ = *ptr++)
      ;
    temp = i * (_FONT_HEIGHT + _FONT_VERTICAL_SPACING);
    ptr = File_List[i+1].FileName;
    if (temp < _SCROLL_LAST_LINE - _SCROLL_FIRST_LINE - _FONT_HEIGHT){
      if (File_List[i].FileType == 1)
        TFT_Image(_MP3_IMAGE_VLINE, _SCROLL_FIRST_LINE + temp, file_icon.Picture_Name, 1);
      if (File_List[i].FileType == 2)
        TFT_Image(_MP3_IMAGE_VLINE, _SCROLL_FIRST_LINE + temp, folder_icon.Picture_Name, 1);
      TFT_Set_Font(MP3_Font, _MP3_FONT_COLOR, FO_HORIZONTAL);
      TFT_Write_Text(Scroll_text, _MP3_TEXT_VLINE, _SCROLL_FIRST_LINE + temp);
      i ++;
      dptr = Scroll_text;
      temp1 = _SCROLL_FIRST_LINE + temp;
    }
    else{
      i ++;
      dptr = Scroll_text;
    }
  }
  Scroll_total_columns = temp + (_FONT_HEIGHT + _FONT_VERTICAL_SPACING);

  // if there is uncomplete text, write it too
  temp1 = temp1 + _FONT_HEIGHT + _FONT_VERTICAL_SPACING - 1;
  if (temp1 < _SCROLL_LAST_LINE)
    current_text_column = 1;
  if (temp1 <= temp){
    while (temp1 < _SCROLL_LAST_LINE){
      memset(pix_array, 0, 479);
      i = Scrool_Get_new_text(last_window_column / (_FONT_HEIGHT + _FONT_VERTICAL_SPACING));
      Scroll_Get_One_Text_Line(current_text_column, Scroll_text);
      
      if (File_List[i].FileType == 1)
        Scroll_Write_One_Line(temp1, &file_icon);
      if (File_List[i].FileType == 2)
        Scroll_Write_One_Line(temp1, &folder_icon);

      current_text_column ++;
      temp1 ++;
    }
  }
  
  TFT_Ext_Image(_MP3_BIGIMAGE_VLINE, _SCROLL_FIRST_LINE, mp3_player_note_bmp, 1);
}
void DrawImage(TImage *AImage) {
  if (AImage->Visible) {
    TFT_Ext_Image(AImage->Left, AImage->Top, AImage->Picture_Name, AImage->Picture_Ratio);
  }
}