c++实现的简单音乐播放器


c++实现的简单音乐播放器,并可以计算显示出显示音乐的频谱,有MFC界面
资源截图
代码片段和文件信息
///////////////////////////////////////////////////////////////////////////////
//  Copyright (c) 2006-2008 Ernest Laurentin (http://www.ernzo.com/)
//
//  This software is provided ‘as-is‘ without any express or implied
//  warranty. In no event will the authors be held liable for any damages
//  arising from the use of this software.
//
//  Permission is granted to anyone to use this software for any purpose
//  including commercial applications and to alter it and redistribute it
//  freely subject to the following restrictions:
//
//  1. The origin of this software must not be misrepresented; you must not
//  claim that you wrote the original software. If you use this software
//  in a product an acknowledgment in the product documentation would be
//  appreciated but is not required.
//
//  2. Altered source versions must be plainly marked as such and must not be
//  misrepresented as being the original software.
//
//  3. This notice may not be removed or altered from any source
//  distribution.
//
//  File:       MixerDevice.cpp
//  Version:    1.0
///////////////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “MixerDevice.hpp“


#pragma comment(lib “Winmm.lib“)

///////////////////////////////////////////////////////////////////////////////
const DWORD MIXER_TYPE_MASK = (MIXER_objectF_HANDLE|MIXER_objectF_MIXER|MIXER_objectF_WAVEOUT|
                               MIXER_objectF_WAVEIN|MIXER_objectF_MIDIOUT|MIXER_objectF_MIDIIN);


///////////////////////////////////////////////////////////////////////////////
MixerDevice::MixerDevice()
: _hMixer(NULL)
{
}

MixerDevice::~MixerDevice()
{
    Close();
}

bool MixerDevice::IsOpen() const
{
    return (_hMixer != NULL);
}

///////////////////////////////////////////////////////////////////////////////
// GetId
UINT MixerDevice::GetId() const
{
    UINT uMixerId = INVALID_MIXER_ID;
    if ( IsOpen() )
    {
        MMRESULT mmr = mixerGetID(reinterpret_cast(_hMixer) &uMixerId MIXER_objectF_HMIXER);
        (mmr);
    }
    return uMixerId;
}

///////////////////////////////////////////////////////////////////////////////
// Open
HRESULT MixerDevice::Open(UINT uMixerId DWORD fdwOpen HWND hWndCallback)
{
    HRESULT hr = HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED);
    if ( !IsOpen() )
    {
        MMRESULT mmr = mixerOpen(&_hMixer uMixerId reinterpret_cast(hWndCallback)
                                 NULL fdwOpen);
        hr = HRESULT_FROM_WIN32(mmr);
    }
    return hr;
}

///////////////////////////////////////////////////////////////////////////////
// Open
HRESULT MixerDevice::Close()
{
    HRESULT hr = S_FALSE;
    if ( IsOpen() )
    {
        MMRESULT mmr = mixerClose(_hMixer);
        if ( mmr == MMSYSERR_NOERROR )
        {
            _hMixer = NULL;
        }
        hr = HRESULT_FROM_WIN32(mmr);
    }
    re

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-07-23 17:55  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥
     目录           0  2013-07-23 17:56  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudio
     文件        8801  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioFFT.hpp
     文件        3187  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioMemDC.h
     文件        6662  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioMixerDevice.cpp
     文件        3344  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioMixerDevice.hpp
     文件       11780  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioMultimediaStream.cpp
     文件        2637  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioMultimediaStream.hpp
     文件       21027  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioPeakMeterCtrl.cpp
     文件        4597  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioPeakMeterCtrl.h
     文件        6864  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioReadMe.txt
     目录           0  2013-07-23 17:56  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioRelease
     文件      364544  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioReleaseSoundStudio.exe
     文件        2323  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudio.cpp
     文件         534  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudio.h
     文件        5824  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudio.rc
     文件    63852544  2013-05-16 17:16  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudio.sdf
     文件        3584  2013-05-16 17:16  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudio.suo
     文件        6406  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudio.vcproj
     文件        8288  2013-05-16 17:14  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudio.vcxproj
     文件        3220  2013-05-16 17:14  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudio.vcxproj.filters
     文件         143  2013-05-16 17:14  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudio.vcxproj.user
     文件       21636  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudioDlg.cpp
     文件        2309  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioSoundStudioDlg.h
     文件        2856  2013-05-16 17:14  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioUpgradeLog.xml
     文件        5108  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioWavebase.hpp
     文件        8801  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioWaveInDevice.cpp
     文件        2315  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioWaveInDevice.hpp
     文件        9942  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioWaveOutDevice.cpp
     文件        2444  2011-11-30 00:00  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudioWaveOutDevice.hpp
     目录           0  2013-07-23 17:56  Multimedia PeakMeter Control¥¥¥¥¥¥¥¥SoundStudio\_UpgradeReport_Files
............此处省略13个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)