mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 08:09:19 +02:00
replaced char parameters in sound system with stl string
This commit is contained in:
38
Sound.h
38
Sound.h
@@ -7,56 +7,44 @@ obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifndef SoundH
|
||||
#define SoundH
|
||||
#pragma once
|
||||
|
||||
#include <stack>
|
||||
#include <dsound.h>
|
||||
|
||||
typedef LPDIRECTSOUNDBUFFER PSound;
|
||||
|
||||
// inline Playing(PSound Sound)
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
class TSoundContainer
|
||||
{
|
||||
public:
|
||||
public:
|
||||
int Concurrent;
|
||||
int Oldest;
|
||||
char Name[80];
|
||||
std::string m_name;
|
||||
LPDIRECTSOUNDBUFFER DSBuffer;
|
||||
float fSamplingRate; // częstotliwość odczytana z pliku
|
||||
int iBitsPerSample; // ile bitów na próbkę
|
||||
TSoundContainer *Next;
|
||||
std::stack<LPDIRECTSOUNDBUFFER> DSBuffers;
|
||||
LPDIRECTSOUNDBUFFER GetUnique(LPDIRECTSOUND pDS);
|
||||
TSoundContainer(LPDIRECTSOUND pDS, const char *Directory, const char *strFileName, int NConcurrent);
|
||||
|
||||
TSoundContainer(LPDIRECTSOUND pDS, std::string const &Directory, std::string const &Filename, int NConcurrent);
|
||||
~TSoundContainer();
|
||||
LPDIRECTSOUNDBUFFER GetUnique( LPDIRECTSOUND pDS );
|
||||
};
|
||||
|
||||
class TSoundsManager
|
||||
{
|
||||
private:
|
||||
private:
|
||||
static LPDIRECTSOUND pDS;
|
||||
static LPDIRECTSOUNDNOTIFY pDSNotify;
|
||||
// static char Directory[80];
|
||||
static int Count;
|
||||
static TSoundContainer *First;
|
||||
static TSoundContainer * LoadFromFile(const char *Dir, const char *Name, int Concurrent);
|
||||
static int Count;
|
||||
|
||||
public:
|
||||
// TSoundsManager(HWND hWnd);
|
||||
// static void Init(HWND hWnd, char *NDirectory);
|
||||
static void Init(HWND hWnd);
|
||||
static TSoundContainer * LoadFromFile( std::string const &Directory, std::string const &FileName, int Concurrent);
|
||||
|
||||
public:
|
||||
~TSoundsManager();
|
||||
static void Init( HWND hWnd );
|
||||
static void Free();
|
||||
static void Init(char *Name, int Concurrent);
|
||||
static void LoadSounds(char *Directory);
|
||||
static LPDIRECTSOUNDBUFFER GetFromName(const char *Name, bool Dynamic, float *fSamplingRate = NULL);
|
||||
static LPDIRECTSOUNDBUFFER GetFromName( std::string const &Name, bool Dynamic, float *fSamplingRate = NULL );
|
||||
static void RestoreAll();
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user