mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-10 11:59:58 -05:00
Initial community commit
This commit is contained in:
45
Src/Plugins/Input/in_wmvdrm/AudioFormat.h
Normal file
45
Src/Plugins/Input/in_wmvdrm/AudioFormat.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef NULLSOFT_IN_WMVDRM_AUDIOFORMAT_H
|
||||
#define NULLSOFT_IN_WMVDRM_AUDIOFORMAT_H
|
||||
|
||||
#include <mmreg.h>
|
||||
#include <wmsdk.h>
|
||||
|
||||
class AudioFormat
|
||||
{
|
||||
public:
|
||||
AudioFormat() : waveFormat(0)
|
||||
{
|
||||
}
|
||||
~AudioFormat()
|
||||
{
|
||||
delete [] waveFormat;
|
||||
}
|
||||
unsigned long AudioBytesToSamples(unsigned long bytes);
|
||||
unsigned long AudioSamplesToBytes(unsigned long samples);
|
||||
unsigned long AudioBytesToMilliseconds(unsigned long bytes);
|
||||
unsigned long AudioMillisecondsToBytes(DWORD milliseconds);
|
||||
unsigned long AudioDurationToBytes(QWORD duration);
|
||||
unsigned long AudioSamplesToMilliseconds(unsigned long samples);
|
||||
long Channels();
|
||||
long ValidBits();
|
||||
long BitSize();
|
||||
long SampleRate();
|
||||
//protected:
|
||||
void Open(WM_MEDIA_TYPE *mediaType)
|
||||
{
|
||||
delete[] waveFormat;
|
||||
waveFormat = (WAVEFORMATEXTENSIBLE *) new unsigned char[mediaType->cbFormat];
|
||||
memcpy(waveFormat, mediaType->pbFormat, mediaType->cbFormat);
|
||||
}
|
||||
|
||||
void Close()
|
||||
{
|
||||
delete [] waveFormat;
|
||||
waveFormat=0;
|
||||
}
|
||||
|
||||
private:
|
||||
WAVEFORMATEXTENSIBLE *waveFormat;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user