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

📄 audioplayermainscreen.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
    audply_main_repeat.x = skin_p->repeat_x;
    audply_main_repeat.y = skin_p->repeat_y;
    audply_main_repeat.off_up_img = (PU8) GetImage(skin_p->repeat_off_up_image_id);
    audply_main_repeat.all_up_img = (PU8) GetImage(skin_p->repeat_all_up_image_id);
    audply_main_repeat.one_up_img = (PU8) GetImage(skin_p->repeat_one_up_image_id);
#ifdef __MMI_TOUCH_SCREEN__
    audply_main_repeat.off_down_img = (PU8) GetImage(skin_p->repeat_off_down_image_id);
    audply_main_repeat.all_down_img = (PU8) GetImage(skin_p->repeat_all_down_image_id);
    audply_main_repeat.one_down_img = (PU8) GetImage(skin_p->repeat_one_down_image_id);
    audply_main_repeat.down = FALSE;
#endif /*__MMI_TOUCH_SCREEN__*/
    gui_measure_image(audply_main_repeat.off_up_img, &w, &h);
    audply_main_repeat.w = (S16) w;
    audply_main_repeat.h = (S16) h;
    /* shuffle */
    audply_main_shuffle.x = skin_p->shuffle_x;
    audply_main_shuffle.y = skin_p->shuffle_y;
    audply_main_shuffle.off_up_img = (PU8) GetImage(skin_p->shuffle_off_up_image_id);
    audply_main_shuffle.on_up_img = (PU8) GetImage(skin_p->shuffle_on_up_image_id);    
#ifdef __MMI_TOUCH_SCREEN__
    audply_main_shuffle.off_down_img = (PU8) GetImage(skin_p->shuffle_off_down_image_id);
    audply_main_shuffle.on_down_img = (PU8) GetImage(skin_p->shuffle_on_down_image_id);
    audply_main_shuffle.down = FALSE;
#endif /*__MMI_TOUCH_SCREEN__*/
    gui_measure_image(audply_main_shuffle.off_up_img, &w, &h);
    audply_main_shuffle.w = (S16) w;
    audply_main_shuffle.h = (S16) h;
#endif /* __MMI_AUDIO_PLAYER_SKIN_SHOW_REPEAT_SHUFFLE__ */ 

#ifdef __MMI_AUDIO_SPECTRUM_DISPLAY__
    g_aud_ply_spectrum.target_lcd = GDI_LCD_MAIN_LCD_HANDLE;
    g_aud_ply_spectrum.start_x = skin_p->spectrum_display_x;
    g_aud_ply_spectrum.start_y = skin_p->spectrum_display_y;
    g_aud_ply_spectrum.width = skin_p->spectrum_display_w;
    g_aud_ply_spectrum.height = skin_p->spectrum_display_h;
    
    //lrj add begin 2060829
      #ifdef _LYRIC_SYNCHRONIZE_DISPLAY_  
            lyric_init(g_aud_ply_spectrum.start_x,g_aud_ply_spectrum.start_y,g_aud_ply_spectrum.width,g_aud_ply_spectrum.height) ;
      #endif
      //lrj add end
    if(g_aud_ply_spectrum.start_x >= 0)
    {
        g_audply_spectrum_valid = TRUE ;
    }
    else
    {
        g_audply_spectrum_valid = FALSE ;
    }
#endif /* __MMI_AUDIO_SPECTRUM_DISPLAY__ */ 

#ifdef __MMI_AUDIO_PLAYER_LYRIC_DISPLAY__
    audply_lyric_print.start_x = skin_p->lyric_display_x;
    audply_lyric_print.start_y = skin_p->lyric_display_y;
    audply_lyric_print.width = skin_p->lyric_display_w;
    audply_lyric_print.height = skin_p->lyric_display_h;

    audply_lyric_print.lyric_fg_color = gui_color(skin_p->lyric_fg_color_r, skin_p->lyric_fg_color_g, skin_p->lyric_fg_color_b);

    if(audply_lyric_print.start_x >= 0)
    {
        g_audply_lyrics_valid = TRUE ;
    }
    else
    {
        g_audply_lyrics_valid = FALSE ;
//        g_audply.lyrics_display = 0;
    }

    audply_lyric_print.lyric_border_color = gui_color(skin_p->lyric_border_color_r, skin_p->lyric_border_color_g, skin_p->lyric_border_color_b);

#endif /* __MMI_AUDIO_PLAYER_LYRIC_DISPLAY__ */ 

#if defined(__MMI_AUDIO_SPECTRUM_DISPLAY__) && defined(__MMI_AUDIO_PLAYER_LYRIC_DISPLAY__)
    audply_spectrum_lyrics_exclusive = skin_p->spectrum_lyrics_exclusive ;
    /*error checking*/
    if(audply_spectrum_lyrics_exclusive > 0)
    {
        audply_spectrum_lyrics_exclusive = 1;
    }
    else
    {
        audply_spectrum_lyrics_exclusive = 0;
    }
    if(!g_audply_lyrics_valid || !g_audply_spectrum_valid)
    {
        audply_spectrum_lyrics_exclusive = 0;
    }
    /*if both lyircs and spec are valid and initially are both turned on and they shall be mutually exclusive
      force lyrics_display to be turned off*/
    if(g_audply_lyrics_valid && g_audply_spectrum_valid && audply_spectrum_lyrics_exclusive && g_audply.spectrum_style && g_audply.lyrics_display)
    {
        g_audply.lyrics_display = 0 ;
    }
#endif
}


/*****************************************************************************
 * FUNCTION
 *  mmi_audply_redraw_subLCD_background
 * DESCRIPTION
 *  
 * PARAMETERS
 *  x1      [IN]        
 *  y1      [IN]        
 *  x2      [IN]        
 *  y2      [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_audply_redraw_subLCD_background(S32 x1, S32 y1, S32 x2, S32 y2)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    color c = gui_color(255, 255, 255);

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gui_fill_rectangle(x1, y1, x2, y2, c);
#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_audply_subLCD_text_scroll_handler
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_audply_subLCD_text_scroll_handler(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __MMI_SUBLCD__
    gui_handle_scrolling_text(&audply_sub_LCD_scrolling_title);
#endif 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_audply_redraw_subLCD
 * DESCRIPTION
 *  
 * PARAMETERS
 *  is_show     [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_audply_redraw_subLCD(BOOL is_show)
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
#ifdef __MMI_SUB_WALLPAPER__
    color border_color = gui_color(0, 0, 0);
    color text_color = gui_color(255, 255, 255);
#else /* __MMI_SUB_WALLPAPER__ */ 
    color text_color = gui_color(0, 0, 0);
#endif /* __MMI_SUB_WALLPAPER__ */ 
    S32 x1, y1, x2, y2, x, y, str_w, str_h;
    bitmap *saved_graphics_context = current_LCD_device_bitmap;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (!g_mmi_audply_init_done)
    {
        return;
    }

    mmi_audply_set_subLCD_shown(TRUE);

    UI_set_sub_LCD_graphics_context();

    gui_lock_double_buffer();

    if (audply_sub_LCD_scrolling_title_p != NULL)
    {
        gui_scrolling_text_stop(audply_sub_LCD_scrolling_title_p);
        audply_sub_LCD_scrolling_title_p = NULL;
    }

    /* clear background */
    x1 = 0;
    y1 = 13;
    x2 = UI_device_width - 1;
    y2 = UI_device_height - 1;
    gui_push_clip();
    gui_set_clip(x1, y1, x2, y2);
    mmi_audply_redraw_subLCD_background(x1, y1, x2, y2);

    if (is_show)
    {
        /* draw song name */
        gui_set_font(&MMI_medium_font);
        gui_measure_string(g_audply.title, &str_w, &str_h);
    #ifdef __MMI_SUB_WALLPAPER__
        str_w += 1;
        str_h += 2;
    #endif /* __MMI_SUB_WALLPAPER__ */ 
        x = (UI_device_width - str_w) / 2;
    #ifdef __MMI_AUDIO_SPECTRUM_DISPLAY__
        if (g_audply.spectrum_style != 0 && g_audply_spectrum_valid && !g_audply_spectrum_blocked)
        {
            y = 15;
        }
        else
    #endif /* __MMI_AUDIO_SPECTRUM_DISPLAY__ */ 
            y = 12 + (UI_device_height - 12 - str_h) / 2;

        if (x >= 0)
        {
            gui_push_text_clip();
            gui_set_text_color(text_color);
        #ifdef __MMI_SUB_WALLPAPER__
            gui_set_text_border_color(border_color);
        #endif 
            if (r2lMMIFlag)
            {
                gui_move_text_cursor(UI_device_width - x - 2, y);
            }
            else
            {
                gui_move_text_cursor(x, y);
            }
        #ifdef __MMI_SUB_WALLPAPER__
            gui_set_text_clip(x, y - 1, x + str_w - 1, y + str_h - 1);
            gui_print_bordered_text(g_audply.title);
        #else /* __MMI_SUB_WALLPAPER__ */ 
            gui_set_text_clip(x, y, x + str_w - 1, y + str_h - 1);
            gui_print_text(g_audply.title);
        #endif /* __MMI_SUB_WALLPAPER__ */ 
            gui_pop_text_clip();
        }
        else
        {
            /* scroll */
            x = 0;
            audply_sub_LCD_scrolling_title_p = &audply_sub_LCD_scrolling_title;
            gui_create_scrolling_text(audply_sub_LCD_scrolling_title_p,
                                      x + 2, y, UI_device_width - 4, str_h, g_audply.title,
                                      mmi_audply_subLCD_text_scroll_handler, mmi_audply_redraw_subLCD_background,
                                      text_color,
        #ifdef __MMI_SUB_WALLPAPER__
                                      border_color
        #else 
                                      text_color
        #endif 
                );
            /* Leo start 20050906 */
        #ifdef __MMI_SUB_WALLPAPER__
            audply_sub_LCD_scrolling_title_p->flags |= UI_SCROLLING_TEXT_BORDERED_TEXT;
        #endif 
            /* Leo end */
            audply_sub_LCD_scrolling_title_p->text_font = MMI_medium_font;
            gui_show_scrolling_text(audply_sub_LCD_scrolling_title_p);
        }

    #ifdef __MMI_AUDIO_SPECTRUM_DISPLAY__
        if (g_audply.spectrum_style != 0 && !mmi_gpio_is_lcd_sleep() && g_audply_spectrum_valid && !g_audply_spectrum_blocked)
        {
            /* draw spectrum */
            g_aud_ply_spectrum_sub_lcd.target_layer = 0;
            g_aud_ply_spectrum_sub_lcd.target_lcd = GDI_LCD_SUB_LCD_HANDLE;
            g_aud_ply_spectrum_sub_lcd.start_x = 2;
            g_aud_ply_spectrum_sub_lcd.start_y = y + str_h + 2;
            g_aud_ply_spectrum_sub_lcd.height = UI_device_height - g_aud_ply_spectrum_sub_lcd.start_y - 4;
            g_aud_ply_spectrum_sub_lcd.width = UI_device_width - 4;
            g_aud_ply_spectrum_sub_lcd.style = g_audply.spectrum_style;
            switch (g_aud_ply_spectrum_sub_lcd.style)
            {
                case STYLE_BLOCKS:
                case STYLE_BARS:
                    g_aud_ply_spectrum_sub_lcd.number_of_bars = 16;
                    break;
                case STYLE_CIRCLES:
                    g_aud_ply_spectrum_sub_lcd.number_of_bars = 8;
                    break;
                default:
                    ASSERT(0);
            }

            mmi_audio_spectrum_init_display(&g_aud_ply_spectrum_sub_lcd);
            if (g_audply.state == STATE_PLAY)
            {
                mmi_audio_spectrum_start_display(&g_aud_ply_spectrum_sub_lcd);
            }
        }
    #endif /* __MMI_AUDIO_SPECTRUM_DISPLAY__ */ 
    }

    gui_unlock_double_buffer();
    gui_BLT_double_buffer(x1, y1, x2, y2);

    gui_pop_clip();

    if (saved_graphics_context == &main_LCD_device_bitmap)
    {
        UI_set_main_LCD_graphics_context();
    }
    else if (saved_graphics_context == &sub_LCD_device_bitmap)
    {
        UI_set_sub_LCD_graphics_context();
    }
#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_audply_exit_subLCD
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_audply_exit_subLCD()
{
#ifdef __MMI_SUBLCD__
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_audply.is_subLCD_shown)
    {
        bitmap *saved_graphics_context;

    #ifdef __MMI_AUDIO_SPECTRUM_DISPLAY__
        mmi_audio_spectrum_stop_display(&g_aud_ply_spectrum_sub_lcd);
    #endif 

        saved_graphics_context = current_LCD_device_bitmap;

        UI_set_sub_LCD_graphics_context();

        if (audply_sub_LCD_scrolling_title_p != NULL)
        {
            gui_scrolling_text_stop(audply_sub_LCD_scrolling_title_p);
            audply_sub_LCD_scrolling_title_p = NULL;
        }
        if (saved_graphics_context == &main_LCD_device_bitmap)
        {
            UI_set_main_LCD_graphics_context();
        }
        else if (saved_graphics_context == &sub_LCD_device_bitmap)
        {
            UI_set_sub_LCD_graphics_context();
        }

        mmi_audply_set_subLCD_shown(FALSE);
    }
#endif /* __MMI_SUBLCD__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_audply_show_mainscreen
 * DESCRIPTION
 *  show audio player main screen
 * PARAMETERS

⌨️ 快捷键说明

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