資源簡介
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¥¥¥¥¥¥¥¥\SoundStudio\FFT.hpp
?????文件????????3187??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\MemDC.h
?????文件????????6662??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\MixerDevice.cpp
?????文件????????3344??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\MixerDevice.hpp
?????文件???????11780??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\MultimediaStream.cpp
?????文件????????2637??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\MultimediaStream.hpp
?????文件???????21027??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\PeakMeterCtrl.cpp
?????文件????????4597??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\PeakMeterCtrl.h
?????文件????????6864??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\ReadMe.txt
?????目錄???????????0??2013-07-23?17:56??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\Release\
?????文件??????364544??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\Release\SoundStudio.exe
?????文件????????2323??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudio.cpp
?????文件?????????534??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudio.h
?????文件????????5824??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudio.rc
?????文件????63852544??2013-05-16?17:16??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudio.sdf
?????文件????????3584??2013-05-16?17:16??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudio.suo
?????文件????????6406??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudio.vcproj
?????文件????????8288??2013-05-16?17:14??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudio.vcxproj
?????文件????????3220??2013-05-16?17:14??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudio.vcxproj.filters
?????文件?????????143??2013-05-16?17:14??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudio.vcxproj.user
?????文件???????21636??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudioDlg.cpp
?????文件????????2309??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\SoundStudioDlg.h
?????文件????????2856??2013-05-16?17:14??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\UpgradeLog.xm
?????文件????????5108??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\Waveba
?????文件????????8801??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\WaveInDevice.cpp
?????文件????????2315??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\WaveInDevice.hpp
?????文件????????9942??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\WaveOutDevice.cpp
?????文件????????2444??2011-11-30?00:00??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\WaveOutDevice.hpp
?????目錄???????????0??2013-07-23?17:56??Multimedia?PeakMeter?Control¥¥¥¥¥¥¥¥\SoundStudio\_UpgradeReport_Files\
............此處省略13個文件信息
評論
共有 條評論