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

📄 output.c

📁 基于EP7312的MP3播放器源代码,包括MCU和PC端代码.
💻 C
📖 第 1 页 / 共 3 页
字号:
    }    //    // Remember the new volume setting.    //    sOutput.cVolume = lGain;    //    // If the output is enabled, then write this new setting immediately.    //    if(ulSystemFlags & SYSFLAG_OUTPUT_ENABLED)    {        TwoWireWrite((unsigned long *)(HwBaseAddress + HwPortABCD),                     (unsigned long *)(HwBaseAddress + HwDdrABCD),                     HwPortABCD_Clock, HwPortABCD_Data, ADDR_CS43L43, 0x04,                     ucVolumeMap[(unsigned long)sOutput.cVolume]);    }#endif}//****************************************************************************//// OutputVolumeEnable enables the software volume control.////****************************************************************************#ifdef SOFTWARE_VOLUME_CONTROLvoidOutputVolumeEnable(void){    //    // Enable the volume control.    //    VolumeEnable(&(sOutput.sVolume));}#endif//****************************************************************************//// OutputVolumeDisable disables the software volume control.////****************************************************************************#ifdef SOFTWARE_VOLUME_CONTROLvoidOutputVolumeDisable(void){    //    // Disable the volume control.    //    VolumeDisable(&(sOutput.sVolume));}#endif//****************************************************************************//// OutputGetSpectralBands gets the spectral intensities from the spectrum// analyzer.////****************************************************************************#ifdef SUPPORT_SPECTRUM_ANALYZERvoidOutputGetSpectralBands(long *plBands){    //    // Get the spectral intensities.    //    SpectrumGetBands(&(sOutput.sSpectrum), plBands);}#endif//****************************************************************************//// OutputSpectrumEnable enables the spectrum analyzer.////****************************************************************************#ifdef SUPPORT_SPECTRUM_ANALYZERvoidOutputSpectrumEnable(void){    //    // Enable the spectrum analyzer.    //    SpectrumEnable(&(sOutput.sSpectrum));}#endif//****************************************************************************//// OutputSpectrumDisable disables the spectrum analyzer.////****************************************************************************#ifdef SUPPORT_SPECTRUM_ANALYZERvoidOutputSpectrumDisable(void){    //    // Disable the spectrum analyzer.    //    SpectrumDisable(&(sOutput.sSpectrum));}#endif//****************************************************************************//// OutputSetSRSWidth sets the width of the stereo separation for the SRS// processing.////****************************************************************************#if defined(SUPPORT_WOW_FULL) || defined(SUPPORT_WOW_MINIMAL) || \    defined(SUPPORT_SRS_HEADPHONE)voidOutputSetSRSWidth(long lWidth){    //    // If the width is out of range, then adjust it.    //    if(lWidth < 0)    {        lWidth = 0;    }    else if(lWidth > 20)    {        lWidth = 20;    }    //    // Adjust the width of the SRS processing.    //    SRSAdjustWidth(&(sOutput.sSRS), 0x06666666 * lWidth);}#endif//****************************************************************************//// OutputSetSRSTruBass sets the amount of TruBass enhancement in the SRS// processing.////****************************************************************************#if defined(SUPPORT_WOW_FULL) || defined(SUPPORT_WOW_MINIMAL) || \    defined(SUPPORT_TRU_BASS)voidOutputSetSRSTruBass(long lBass){    //    // If the bass enhancement is out of range, then adjust it.    //    if(lBass < 0)    {        lBass = 0;    }    else if(lBass > 20)    {        lBass = 20;    }    //    // Adjust the TruBass enhancement in the SRS processing.    //    SRSAdjustTruBass(&(sOutput.sSRS), 0x06666666 * lBass);}#endif//****************************************************************************//// OutputSRSEnable enables the SRS processing.////****************************************************************************#ifdef SUPPORT_SRSvoidOutputSRSEnable(void){    //    // Enable the SRS processing.    //    SRSEnable(&(sOutput.sSRS));}#endif//****************************************************************************//// OutputSRSDisable disables the SRS processing.////****************************************************************************#ifdef SUPPORT_SRSvoidOutputSRSDisable(void){    //    // Disable the SRS processing.    //    SRSDisable(&(sOutput.sSRS));}#endif//****************************************************************************//// OutputSetQSoundWidth sets the width of the stereo separation for the QSound// processing.////****************************************************************************#ifdef SUPPORT_QSOUNDvoidOutputSetQSoundWidth(long lWidth){    //    // If the width is out of range, then adjust it.    //    if(lWidth < 0)    {        lWidth = 0;    }    else if(lWidth > 20)    {        lWidth = 20;    }    //    // Adjust the width of the QSound processing.    //    QSoundAdjustWidth(&(sOutput.sQSound), (0x7fff * lWidth) / 20);}#endif//****************************************************************************//// OutputSetQSoundMode sets the mode of the QSound processing.////****************************************************************************#ifdef SUPPORT_QSOUNDvoidOutputSetQSoundMode(long lMode){    //    // If the mode is invalid, then adjust it.    //    if(lMode < 0)    {        lMode = 0;    }    else if(lMode > 1)    {        lMode = 1;    }    //    // Set the mode of the QSound processing.    //    QSoundSetMode(&(sOutput.sQSound), lMode);}#endif//****************************************************************************//// OutputQSoundEnable enables the QSound processing.////****************************************************************************#ifdef SUPPORT_QSOUNDvoidOutputQSoundEnable(void){    //    // Enable the QSound processing.    //    QSoundEnable(&(sOutput.sQSound));}#endif//****************************************************************************//// OutputQSoundDisable disables the QSound processing.////****************************************************************************#ifdef SUPPORT_QSOUNDvoidOutputQSoundDisable(void){    //    // Disable the QSound processing.    //    QSoundDisable(&(sOutput.sQSound));}#endif//****************************************************************************//// OutputSetSpatializerBass sets the bass control in the Spatializer// processing.////****************************************************************************#ifdef SUPPORT_SPATIALIZERvoidOutputSetSpatializerBass(long lBass){    //    // If the bass is out of range, then adjust it.    //    if(lBass < 0)    {        lBass = 0;    }    else if(lBass > 20)    {        lBass = 20;    }    //    // Adjust the bass control of the Spatializer processing.    //    SpatializerAdjustBass(&(sOutput.sSpatializer), lBass * 5);}#endif//****************************************************************************//// OutputSetSpatializerVirtualBass sets the virtual bass control in the// Spatializer processing.////****************************************************************************#ifdef SUPPORT_SPATIALIZERvoidOutputSetSpatializerVirtualBass(long lBass){    //    // If the virtual bass is out of range, then adjust it.    //    if(lBass < 0)    {        lBass = 0;    }    else if(lBass > 20)    {        lBass = 20;    }    //    // Adjust the virtual bass control of the Spatializer processing.    //    SpatializerAdjustVirtualBass(&(sOutput.sSpatializer), lBass * 5);}#endif//****************************************************************************//// OutputSetSpatializerGain sets the gain control in the Spatializer// processing.////****************************************************************************#ifdef SUPPORT_SPATIALIZERvoidOutputSetSpatializerGain(long lGain){    //    // If the gain is out of range, then adjust it.    //    if(lGain < 0)    {        lGain = 0;    }    else if(lGain > 20)    {        lGain = 20;    }    //    // Adjust the gain control of the Spatializer processing.    //    SpatializerAdjustGain(&(sOutput.sSpatializer), (0x1000 * lGain) / 20);}#endif//****************************************************************************//// OutputSpatializerEnable enables the Spatializer processing.////****************************************************************************#ifdef SUPPORT_SPATIALIZERvoidOutputSpatializerEnable(void){    //    // Enable the Spatializer processing.    //    SpatializerEnable(&(sOutput.sSpatializer));}#endif//****************************************************************************//// OutputSpatializerDisable disables the Spatializer processing.////****************************************************************************#ifdef SUPPORT_SPATIALIZERvoidOutputSpatializerDisable(void){    //    // Disable the Spatializer processing.    //    SpatializerDisable(&(sOutput.sSpatializer));}#endif//****************************************************************************//// OutputFilter performs the actual output processing and queues the data to// be played.  This is called at a rate of 5ms.  We produce as much data as// can be held in the output buffer of the sample rate converter.////****************************************************************************voidOutputFilter(void){    short *psLeft, *psRight;    long lLength, lCount = 2;    //    // Process blocks until there is no space available.    //    while(BufferSpaceAvailable(sOutput.pBaseRateBuffer) && lCount--)    {        //        // Get the write pointer for the output buffer.        //        BufferGetWritePointer(sOutput.pBaseRateBuffer, &psLeft, &psRight,                              &lLength);        //        // Call the sample rate converter.        //        SRCFilter(&(sOutput.sSRC), psLeft, psRight, lLength);        //        // Update the write pointer for the output buffer.        //        BufferUpdateWritePointer(sOutput.pBaseRateBuffer, lLength);    }}

⌨️ 快捷键说明

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