/*****************************************************************************
 * FUNCTION
 *  mmi_fmsr_decrease_volume
 * DESCRIPTION
 *  Decrease the playing volume
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmsr_decrease_volume(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_fmsr_cntx.rec.volume > 0)
    {
        mdi_audio_set_volume(AUD_VOLUME_FMR, --g_fmsr_cntx.rec.volume);
    }
}
/*****************************************************************************
 * FUNCTION
 *  mmi_fmsr_increase_volume
 * DESCRIPTION
 *  Increase the playing volume
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmsr_increase_volume(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_fmsr_cntx.rec.volume < MAX_VOL_LEVEL - 1)
    {
        mdi_audio_set_volume(AUD_VOLUME_FMR, ++g_fmsr_cntx.rec.volume);
    }
}
/*****************************************************************************
 * FUNCTION
 *  mmi_fmsr_power_on
 * DESCRIPTION
 *  Power on the FM radio and playing
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmsr_power_on(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_fmsr_cntx.rec.state != FMSR_STATE_IDLE)
    {
        /* Enter error screen */
        return;
    }
#ifdef __MMI_BACKGROUND_CALL__
    if (srv_ucm_is_background_call())
    {
        return;
    }
#endif /* __MMI_BACKGROUND_CALL__ */ 

    if (!mdi_check_device_ownership())
    {
        /* Enter error screen */
        return;
    }
    else
    {
        /* Stop all aduo and begin to record */
        mdi_audio_stop_all();

        mdi_audio_set_volume(AUD_VOLUME_FMR, g_fmsr_cntx.rec.volume);
        mdi_fmr_power_on_with_path(
            MDI_DEVICE_SPEAKER_BOTH /* MDI_DEVICE_SPEAKER2 */ ,
            (mdi_ext_callback) mmi_fmsr_mdi_callback,
            NULL);
        mdi_fmr_set_freq(g_fmsr_cntx.rec.freqency);
        g_fmsr_cntx.rec.state = FMSR_STATE_READY;
    }
}
Exemplo n.º 4
0
void PlayIsSettingKeypadVolumeReq_fromIdle(U16 soundId, U8 style) //Added by jinzh:20070721
{
	aud_play_id_struct *myMsgPtr = (aud_play_id_struct*)OslConstructDataPtr(sizeof(aud_play_id_struct));
	TRACE_AUD_FUNCTION();
	ASSERT(NULL != myMsgPtr);
	memset(myMsgPtr, 0, sizeof(aud_play_id_struct));
	
	myMsgPtr->volume = volume_level_UI;
	myMsgPtr->audio_id = (U8)soundId;
	myMsgPtr->output_path = MDI_DEVICE_SPEAKER2;
	myMsgPtr->play_style = style;

#ifdef MMI_ON_HARDWARE_P				
	 mdi_result  result;						
	 //mdi_audio_set_volume(MDI_VOLUME_KEY  ,volume_level_UI);
	 if(GetHandsetInPhone()==1)
	 {
		mdi_audio_set_volume(MDI_VOLUME_KEY  ,volume_level_UI);
	 }
	 else
	 {
	 	DM_SetAudioVolume((volume_level_UI) );
	 }
   	 result=media_aud_play_id(MOD_MMI, myMsgPtr);		
#else									
	 {
	MYQUEUE Message;
	Message.oslSrcId = MOD_MMI;
	Message.oslDestId = MOD_L4C;
	Message.oslMsgId = MSG_ID_L4AUD_AUDIO_PLAY_REQ;
	Message.oslDataPtr = (oslParaType*)myMsgPtr;
	Message.oslPeerBuffPtr = NULL;
	OslMsgSendExtQueue(&Message);
	 }
#endif									
}
Exemplo n.º 5
0
/*****************************************************************************
 * FUNCTION
 *  mmi_sample_3dgame_entry_app_screen
 * DESCRIPTION
 *  enter dev3dgame screen - init an MMI  environment for 3D game
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_sample_3dgame_entry_app_screen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    PU8 gui_buffer;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    EntryNewScreen(SCR_ID_3D_GAME, mmi_sample_3dgame_exit_app_screen, mmi_sample_3dgame_entry_app_screen, NULL);

    gui_buffer = GetCurrGuiBuffer(SCR_ID_3D_GAME);

    /* reset clip */
    gdi_layer_reset_clip();
    gdi_layer_reset_text_clip();

    /* enable multilayer */
    gdi_layer_multi_layer_enable();

    /* entry full screen app - will force status bar update */
    entry_full_screen();

    /* force all playing keypad tone off */
    mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_DISABLED);

    /* set audio volumn */
    mdi_audio_set_volume(MDI_VOLUME_MEDIA, 4);  /* vol level : 0 - 6 */

    /* suspend background play */
    mdi_audio_suspend_background_play();

    /* stop MMI sleep */
    TurnOnBacklight(0);

    /* clear keys */
    ClearInputEventHandler(MMI_DEVICE_ALL);
    clear_category_screen_key_handlers();

    /* set RSK-up to exit */
    SetKeyHandler(GoBackHistory, KEY_RSK, KEY_EVENT_UP);

    /* clear background as black */
    gdi_layer_clear(GDI_COLOR_BLACK);
    gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);

#ifndef WIN32
    /* enable faster key handling */
    mmi_frm_set_key_handle_in_high_frequency(MMI_TRUE);
#endif /* WIN32 */ 

#ifdef __MMI_SUBLCD__
    /* draw game icon on sublcd */
    ForceSubLCDScreen(mmi_sample_3dgame_entry_sublcd);
#endif /* __MMI_SUBLCD__ */ 

    /* disalbe align timer, this will let timer more accurate */
    UI_disable_alignment_timers();

    /* start game */
    if (gui_buffer == NULL)
    {
        /* TODO: start new game here .. */

    }
    else
    {
        /* back from interrupt */
        /* TODO: resume a existing game here .. */
    }

}