BuildTools
Qt
Src
Agave
Components
Elevator
Mastering
Plugins
ReplayGainAnalysis
WAT
Wasabi
Wasabi2
Winamp
aacPlus
aacdec
aacdec-mft
adpcm
alac
albumart
apev2
auth
bmp
burnlib
codesign
config
devices
external_dependencies
f263
filereader
freetypewac
gif
gracenote
h264
h264dec
id3v2
ie_plugin
installer
jpeg
libvp6
corelibs
include
vp50
vp60
AC3.hpp
ACM.hpp
AVC.hpp
AVI.hpp
Aud.hpp
CPUIdLib.h
DRMInfo.hpp
FourCC.hpp
IntTypes.cpp
IntTypes.hpp
MP3.hpp
MediaInfo.hpp
Mp3Header.hpp
NSV.hpp
NSV_Reader.hpp
On2Crypt.h
On2Decrypt.h
PlayerModel.hpp
Rvd.hpp
VFWSetting.hpp
VP6VFWState.hpp
VPStreamData.hpp
Vid.hpp
WAV.hpp
cclib.h
codec_common_interface.h
dkpltfrm.h
duck_bmp.h
duck_dxa.h
duck_dxl.h
endian.hpp
littlend.h
on2cmp.h
on2vpplugin.h
type_aliases.h
vp50dversion.h
vp6.h
vp60dversion.h
vp60eversion.h
config_dlg.cpp
libvpShared
mp3-mpg123
mp4v
mpeg4dec
nde
nprt_plugin
ns-eel
ns-eel2
nsavi
nsmkv
nsutil
nsv
nsvdec_vp3
nsvdec_vp5
nsvdec_vp6
nswasabi
nu
omBrowser
pcm
pfc
playlist
plist
png
replicant
resources
tagz
tataki
theora
timer
vlb
vp32
vp6
vp8x
wbm
winampAll
winampa
xml
xspf
vcpkg-ports
.gitignore
LICENSE.md
README.md
automate-git.py
cef_x86.bat
install-packages.cmd
vcpkg_version_finder.py
winampAll_2019.sln
80 lines
1.4 KiB
C++
80 lines
1.4 KiB
C++
#ifndef AUD_HPP
|
|
#define AUD_HPP
|
|
|
|
#include <exception>
|
|
#include <string>
|
|
#include <io.h>
|
|
|
|
namespace Aud
|
|
{
|
|
class FileError : public exception
|
|
{
|
|
public:
|
|
explicit FileError(const char* message);
|
|
const char* what() const;
|
|
private:
|
|
const std::string message;
|
|
};
|
|
|
|
|
|
enum { samplesPerSec = 48000 };
|
|
|
|
enum { sampleSizeInBits = 16, sampleSizeInBytes = 2 };
|
|
|
|
enum { numberOfChannels = 2 };
|
|
|
|
enum { blockAlign = numberOfChannels * sampleSizeInBytes };
|
|
|
|
|
|
class File
|
|
{
|
|
public:
|
|
|
|
enum mode_t { in, out };
|
|
|
|
File();
|
|
File(const char* name, mode_t mode);
|
|
|
|
~File();
|
|
|
|
void open(const char* name, mode_t mode);
|
|
void close();
|
|
|
|
bool isOpen() const;
|
|
bool eof() const;
|
|
|
|
mode_t mode() const;
|
|
const char* name() const;
|
|
|
|
int sampleCount() const;
|
|
|
|
void seekSample(int sampleNum) const;
|
|
|
|
size_t read(void* buffer, size_t size) const;
|
|
|
|
void write(const void* buffer, size_t size);
|
|
|
|
typedef __int64 offset_t;
|
|
offset_t offset() const;
|
|
|
|
void seekOffset(offset_t) const;
|
|
|
|
private:
|
|
|
|
File(const File&);
|
|
File& operator=(const File&);
|
|
|
|
void init();
|
|
|
|
int handle_;
|
|
|
|
char name_[_MAX_PATH];
|
|
mode_t mode_;
|
|
|
|
int m_sampleCount;
|
|
};
|
|
|
|
} //end namespace Aud
|
|
|
|
#endif
|