mmisounds.c

来自「是一个手机功能的模拟程序」· C语言 代码 · 共 2,146 行 · 第 1/5 页

C
2,146
字号
{

}

/*******************************************************************************

 $Function:     displayRingerVolume

 $Description:  shows the volume setting determined by cVolume

 $Returns:    None

 $Arguments:  None

*******************************************************************************/

static void displayRingerVolume( void )
{
}

/*******************************************************************************

 $Function:     displayOnOffList

 $Description:  show the On Off (3rd) list, determined by item.

 $Returns:    None

 $Arguments:  None

*******************************************************************************/

static void displayOnOffList( void )
{
}
/*******************************************************************************

 $Function:     buildLanguageMenu

 $Description:  builds the dynamenu for the RES_LANGUAGE resource type

 $Returns:    None

 $Arguments:  None

*******************************************************************************/

static void buildLanguageMenu(void)
{

}

/*******************************************************************************

 $Function:     delayThenPlayMelody

 $Description:  play selected ringer melody after short delay

 $Returns:    None

 $Arguments:  None

*******************************************************************************/

static void delayThenPlayMelody( void )
{

    MMI_TRACE_EVENT(("glowing: delayThenPlayMelody - enter")); 

    //if (melody_status==MELODY_BUSY)
    StopPlayingMelody2( );
    //StopMelody2(oldringstr);      

    curMelodyId = FIRST_RING_MELODY;
    //memset(currentringstr, '\0', 20);
    //strncpy(currentringstr,MelodyTablestr[0],strlen(MelodyTablestr[0]));

    // start timer for half a second and on timeout start everlasting play  
    timStart( hRingerStartTimer );
}

/*******************************************************************************

 $Function:     playCurrentSound

 $Description:  play tune which is temporarily selected, this event handler
        is invoked when the hRingerStartTimer event completes

 $Returns:    MFW_EVENT_CONSUMED always

 $Arguments:  e, event, tc timer context

*******************************************************************************/

static int playCurrentSound( MfwEvt e, MfwTim *tc )
{
    uint8 volume;

    if( soundReason == SettingAlarm )  //xsf add 2003.04.14
        volume = FlashEnvironmentData.EnviroProfile[Gu8_Envio_num].alarmvolume;
    else
        volume = FlashEnvironmentData.EnviroProfile[Gu8_Envio_num].ringvolume;

    SetMVol_DownLinkPGA(volume);


    //if(!strcmp(currentringstr, MelodyTablestr[0]))
    //	StartMelody2_aloud(currentringstr,0);  
    //else
    // StartMelody2(currentringstr,0);  
    StartPlayingMelody2(curMelodyId, 0);



    // stop running timer (One shot mode only)
    if( hRingerStartTimer != NULL )
    {
        timStop(hRingerStartTimer);
    }

    return MFW_EVENT_CONSUMED;
}
#endif

/*******************************************************************************

 $Function:     setSelection

 $Description:  reactivates calling menu after confirming setting

 $Returns:    MFW_EVENT_PASSED always

 $Arguments:  e, event, m, window handle

*******************************************************************************/

static int setSelection( MfwEvt e, MfwWin *m )
{
    int UpdatePCM = 0;
    int SoundToPlay = -1;

    TRACE_FUNCTION("setSelection");

    /* This implements a state machine, the next setting depends
       on the reason we have been invoked
  
       Note the following is still pending implementation
       USSD TONE, SVC TONE, MANPLMN TONE
    */
    switch( soundReason )
    {
    case MelodySelect:
        {
            //      stopPlayingMelody();
            //      current.ringer = menu_Select( &dynamenu );
            //      UpdatePCM = 1;
        }
        break;

    case SettingVolume:
        {
            //      stopPlayingMelody();
            //      current.volumeSetting = menu_Select( &volume_menu );
            //      UpdatePCM = 1;
        }
        break;

    default:
        {
            /* No action required
            */
        }
        break;
    }

    /* Update the PCM if we need to
    */
    //nm  if ( UpdatePCM )
    //nm    writeSettingsToPCM( NO_FLUSH );

    /* And play the requested sound if we need to
    */
    //nm  if ( SoundToPlay != -1 )
    //nm    audio_PlaySoundID ( AUDIO_BUZZER, SoundToPlay, 0, AUDIO_PLAY_ONCE );

    /* redisplay sub menu showing changed position of active marker.
    */
    winShow( win );
    //JVJE  soundExec( SoundsDone, 0 );

    return MFW_EVENT_PASSED;
}







/*******************************************************************************

 $Function:     writeSettingsToPCM

 $Description:  writes contents of global vars of sounds to PCM or
          sets default values

 $Returns:    None

 $Arguments:  flush, dictates whether or not flushing should be
        performed on the write operation

*******************************************************************************/
static void writeSettingsToPCM( U8 flush )
{
}
/*******************************************************************************

 $Function:     readSettingsFromPCM

 $Description:  inits global vars of sounds from PCM or
          sets default values

 $Returns:    None

 $Arguments:  None

*******************************************************************************/

static void readSettingsFromPCM(void)
{
}

/*******************************************************************************

 $Function:     soundsCreate

 $Description:  Create a sounds context, with a window, keyboards, timers
        etc.

 $Returns:    None

 $Arguments:  parent, handle of the parent window

*******************************************************************************/

static void soundsCreate(MfwHnd parent)
{

}


/*******************************************************************************

 $Function:     soundsDestroy

 $Description:  cleans up a context

 $Returns:    None

 $Arguments:  None

*******************************************************************************/

static void soundsDestroy(void)
{

}


/*******************************************************************************

 $Function:     getCallingMenu

 $Description:  handles transition to calling menu
          a) on timeout,
          b) during running timer when Clear, SoftKeyLeft
             or SoftKeyRight is pressed

 $Returns:    MFW_EVENT_PASSED

 $Arguments:  e, event, tc, timer context

*******************************************************************************/

static int getCallingMenu(MfwEvt e, MfwTim *tc)
{
    TRACE_FUNCTION( "BACK to invocating Menu" );

    return 0;
}

/*******************************************************************************

 $Function:     winEvent

 $Description:  window event handler, only deals with the win visible
        event, all others are ignored

 $Returns:    MFW_EVENT_PASSED or MFW_EVENT_CONSUMED depending on the
        event

 $Arguments:  e, event, w, window handle

*******************************************************************************/

static int winEvent (MfwEvt e, MfwWin *w)
{
    return MFW_EVENT_CONSUMED;
}


/*******************************************************************************

 $Function:     keyEventLong

 $Description:  keyboard event handler Long press

 $Returns:    MFW_EVENT_PASSED or MFW_EVENT_CONSUMED depending on the
        event

 $Arguments:  e, event, k, keyboard handle

*******************************************************************************/

static int keyEventLong (MfwEvt e, MfwKbd *k)
{
    //   PTRACE( sprintf( buf, "keycode in SOUND keyEvtLong %d", (int) k->code ); )
    //   PTRACE( sprintf( buf, "mfwEvt in SOUND Long 0x%10x", e ); )


    return MFW_EVENT_PASSED; /* give other handlers a chance */
}

/*******************************************************************************

 $Function:     keyEvent

 $Description:  keyboard event handler

 $Returns:    MFW_EVENT_PASSED or MFW_EVENT_CONSUMED depending on the
        event

 $Arguments:  e, event, k, keyboard handle

*******************************************************************************/

static int keyEvent (MfwEvt e, MfwKbd *k)
{

    //   PTRACE( sprintf( buf, "keycode in SOUND keyEvt %d", (int) k->code ); )
    //   PTRACE( sprintf( buf, "mfwEvt in SOUND 0x%10x", e ); )

    return MFW_EVENT_CONSUMED;
}

/*******************************************************************************

 $Function:     stepVibrator

 $Description:  Changes the state of the vibrator from vibrating to
                not vibrating and then restarts the vibration timer

 $Returns:    None

 $Arguments:  None

*******************************************************************************/

static void stepVibrator( void )
{
    //TRACE_FUNCTION("Vibrator Ringing");

}

/*******************************************************************************

 $Function:     ringVibrator

 $Description:  generates the ringing vibrations as configured

 $Returns:    New setting of the vibrator counter

 $Arguments:  c, pointer to a vibrator counter

*******************************************************************************/

static int ringVibrator( UBYTE *c )
{
    return 0;
}


/*******************************************************************************

 $Function:     VibratorTimerEvent

 $Description:  Vibrator timer event

 $Returns:    Event consumed, always

 $Arguments:  e, event, t, timer

*******************************************************************************/

static int VibratorTimerEvent ( MfwEvt e, MfwTim *t )
{

    return MFW_EVENT_CONSUMED;
}

/*******************************************************************************

 $Function:     volumeSettingTimeOut

 $Description:  The Ringer volume settings time out has occured and used has not selected
        a volume setting.

 $Returns:    MFW_EVENT_CONSUMED always

 $Arguments:  e, event, tc timer context

*******************************************************************************/
static int volumeSettingTimeOut( MfwEvt e, MfwTim *tc )
{
    T_MFW_HND win = mfw_parent(mfw_header());
 

⌨️ 快捷键说明

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