0
0

Obviously not enough to demand its own forum… (Shame)

I have searched 17 Pages for help on getting builder to compile fmod test to no avail ๐Ÿ˜ฅ I know its my own fault for not knowing enough… but any help would be appreciated.

Last august I asked if any one could help with this error:

Error returned = Can’t find prototype for Reverbe_Close + others..

If anyone out there has managed to get it working could you please give me some guidance.

Many (Thanks)x 10n-1

[b:3cqag2my]Just got notice of reply… ๐Ÿ˜ณ Will ask a question in this thread.[/b:3cqag2my]

  • You must to post comments
0
0

Have managed to get a little further down the road.
Errors now only 8 instead of hundreds.
My project file seems to have been a little screwed up don’t know why possibly something to do with the need for cpp extension.

Quite a few errors were resolved with type casting…

[C++ Error] Main.cpp(815): E2034 Cannot convert ‘void *’ to ‘signed char *’

The code:
LowPassBuffer = calloc(FSOUND_DSP_GetBufferLength()+256, 4);
calloc returns a void pointer
LowPassBuffer is defined as signed char
Simple Fix (type casting):
LowPassBuffer = (char *)calloc(FSOUND_DSP_GetBufferLength()+256, 4);

//– the next errors are a different story, I have no idea what to do. –//
//– Note each 2034 error is followed by 2342 error –//
//– I think we can assume the first one causes the second one… –//
//– So any ideas I’m lost. Some info from borland help below –//

[C++ Error] Main.cpp(978): E2034 Cannot convert ‘long (__stdcall *)(void *,unsigned int,unsigned int,long)’ to ‘int (__stdcall *)()’
[C++ Error] Main.cpp(978): E2342 Type mismatch in parameter ‘lpPrevWndFunc’ (wanted ‘int (__stdcall *)()’, got ‘long (__stdcall *)(void *,unsigned int,unsigned int,long)’)
[C++ Error] Main.cpp(1009): E2034 Cannot convert ‘long (__stdcall *)(void *,unsigned int,unsigned int,long)’ to ‘int (__stdcall *)()’
[C++ Error] Main.cpp(1009): E2342 Type mismatch in parameter ‘lpPrevWndFunc’ (wanted ‘int (__stdcall *)()’, got ‘long (__stdcall *)(void *,unsigned int,unsigned int,long)’)
[C++ Error] Main.cpp(2205): E2034 Cannot convert ‘int (__stdcall *)(void *,unsigned int,unsigned int,long)’ to ‘int (__stdcall *)()’
[C++ Error] Main.cpp(2205): E2342 Type mismatch in parameter ‘lpDialogFunc’ (wanted ‘int (__stdcall *)()’, got ‘int (__stdcall *)(void *,unsigned int,unsigned int,long)’)
[C++ Error] Main.cpp(2207): E2034 Cannot convert ‘int (__stdcall *)(void *,unsigned int,unsigned int,long)’ to ‘int (__stdcall *)()’
[C++ Error] Main.cpp(2207): E2342 Type mismatch in parameter ‘lpDialogFunc’ (wanted ‘int (__stdcall *)()’, got ‘int (__stdcall *)(void *,unsigned int,unsigned int,long)’)

ERROR 2342
Your source file declared the function called via a function pointer with a prototype.
However, the named parameter could not be converted to the declared parameter type.
When compiling C++ programs, this message is always preceded by another message that explains the exact reason for the type mismatch.
That other message is usually “Cannot convert ‘type1’ to ‘type2′” but the mismatch might be due to many other reasons.

ERROR 2034
An assignment, initialisation, or expression requires the specified type conversion to be performed, but the conversion is not legal.
In C++, the compiler will convert one function pointer to another only if the signature for the functions are the same. Signature refers to the arguments and return type of the function. For example:
myex( int );
typedef int ( *ffp )( float );
test()
{
ffp fp = myex; //error
}
Seeing that myex takes an int for its argument, and fp is a pointer to a function which takes a float as argument, the compiler will not convert it for you.
In cases where this is what is intended, performing a typecast is necessary:
myex( int );
typedef int ( *ffp )( float );
test()
{
ffp fp = (ffp)myex; //ok
}

?? How do I type cast these ??

Have managed to get a player working. Found more borland source and with a bit of work it was not dificult. ๐Ÿ˜›

  • You must to post comments
0
0

Quick answer is… Yes

When building any of the samples provided I add the libs and the include directories to the project (Directories/Conditions)

Should I do anything else (apart from stop annoying you) ?

I can compile and build the Simple example no problem.

When I compile the individual files from fmod sample, I get only one error in main.c (not to mention the prototype warnings) The CallWindowProc function results in:

[C++ Error] Main.c(2027): E2342 Type mismatch in parameter ‘lpPrevWndFunc’ (wanted ‘int (__stdcall *)()’, got ‘long (__stdcall *)(void *,unsigned int,unsigned int,long)’)

As I said before i added all files and included the lib/include bits I still get errors telling me the system can’t find prototypes. Will read the help info again and try to fix the problem.

Thanks again.

Mike

  • You must to post comments
0
0

I was hoping to build a player based on fmod… using Builder.

I want to incorporate some of my own ideas in a player.
Simple things like:
Pressing the Delete key deletes the file and removes it from my playlist.
Having several playlist open so I can drag files the master to the desired playlist.
Schedule stuffโ€ฆ
Add a monitoring facility (Head phones and 2nd sound card)

Basically I like the challenge and builder lets me do things quickly.

PS if any Builder user out there has managed to compile the fmod sample could you please assist ๐Ÿ˜ฅ
In the mean time I will try again.

Once again, Thanks for the Help

  • You must to post comments
0
0

I have loads of stuff using Borland C++ Builder 4

Here’s my BCB compiled player: http://tunesplayer.com

If you wanna you may have parts of the source.

  • You must to post comments
0
0

Many many thanks

Could you let me have your project file and any tips I might need to compile the fmod sample. Am downloading mp3t2demo at the minute. Will message you later.

Have installed delphi 7… but never used delphi before and besides would prefer Builder…. I have Builder 1, 4 and 6… got to get it working ๐Ÿ˜ฅ

Mike

Added/Edited…

Delphi work perfectly ๐Ÿ˜› but as I said before I would prefer Builder.

  • You must to post comments
0
0

Ok here is the component source.
[b:1rhecjiy]Be aware there are classes which i made so use it as reference![/b:1rhecjiy]
Sorry it’s not very whell commented

[b:1rhecjiy]fmodclass.cpp[/b:1rhecjiy]
[code:1rhecjiy]//—————————————————————————

include <vcl.h>

pragma hdrstop

include "FMODJingle.h"

include <math.h>

include <stdio.h>

pragma package(smart_init)

//—————————————————————————
int Devide(int A, int B, int C) {
if (B != 0) A /= B;
if (A != 0) C /= A;
return C;
}
//—————————————————————————
signed char endcallback(FSOUND_STREAM *stream, void *buff, int len, int param)
{
// Dit werkt maar te laat :(
// FMOD_File *File = (FMOD_File *)param;
// TFMODJingle *Owner = (TFMODJingle *)File->Owner;
// if (File && Owner->OnNotifyPlaying) Owner->OnNotifyPlaying(Owner, false);
// SetFileState(END, File);
return true;
}
//—————————————————————————
// These static objects are shared by all instances of the fmod class.
//—————————————————————————
int TFMODJingle::UseCnt = 0;
int TFMODJingle::DriverCnt = 0;
TStringList * TFMODJingle::fDrivers_WINMM = NULL;
TStringList * TFMODJingle::fDrivers_DSOUND = NULL;
TStringList * TFMODJingle::fDrivers_ASIO = NULL;
TStringList * TFMODJingle::fDrivers_RECORD = NULL;
TList * TFMODJingle::Files = NULL;
TTimer * TFMODJingle::NotifyTimer = NULL;
bool timerbusy = false;
//—————————————————————————
static inline void ValidCtrCheck(TFMODJingle *)
{
new TFMODJingle(NULL);
}
//—————————————————————————
__fastcall TFMODJingle::TFMODJingle(TComponent* Owner)
: TComponent(Owner)
{
//constructor
if (UseCnt++ == 0) {
fDrivers_WINMM = new TStringList;
fDrivers_DSOUND = new TStringList;
fDrivers_ASIO = new TStringList;
fDrivers_RECORD = new TStringList;
Files = new TList;
NotifyTimer = new TTimer(this);
NotifyTimer->Interval = 10;
NotifyTimer->OnTimer = NotifyTimerTime;
}

BufferSize = 0;
fMaxChannels = 20;
fHW2D = false;
fBlockOpen = true;
fOutputDriver = 0;
fOutputType = DIRECTSOUND;
fSpeakers = STEREO;
}
//—————————————————————————
__fastcall TFMODJingle::~TFMODJingle(void)
{
//destructor
FMOD_File *File;
for (int i=0; i < Files->Count; i++) {
File = (FMOD_File *)Files->Items[i];
if (File) if (File->Owner == this) {
Files->Items[i] = NULL;
EmptyFileEntry(i);
CloseFile(i);
delete File;
}
}

if (–UseCnt == 0) {
NotifyTimer->Enabled = false;
delete NotifyTimer;
Files->Clear();
delete fDrivers_WINMM;
delete fDrivers_DSOUND;
delete fDrivers_ASIO;
delete fDrivers_RECORD;
delete Files;
}

if(FMOD) {
FMOD->FSOUND_Close();
FMOD_FreeInstance(FMOD);
}
}
/**********************************************************************


*** ***
*** ***
*** private functions ***
*** ***
*** ***


**********************************************************************/
void __fastcall TFMODJingle::ErrMsg(int errnr, String extra)
{
String errtxt = this->Name + " ERROR! ";
if (errnr == 1) errtxt += "Couldn’t load \"" + extra + "\"";
else if (errnr == 2) errtxt += "Couldn’t initialize decoder";
errtxt += ".\n\nPlayback of audio not possible!";
ShowMessage(errtxt.c_str());
}
//—————————————————————————
void __fastcall TFMODJingle::SetPosition(int ms, FMOD_File *File)
{
if (File) if (File->Stream) {
FMOD->FSOUND_Stream_SetTime(File->Stream, ms);
SendNotifyTime(ms, File);
}
}
//———————————————————————
void __fastcall TFMODJingle::NotifyTimerTime(TObject *Sender)
{
// NotifyTimer->Enabled = false;
if (timerbusy) return;
FMOD_File *File;
for (int i=0; i < Files->Count; i++) {
timerbusy = true;
File = (FMOD_File *)Files->Items[i];
if (File) {
if (File->FileState == OPENING) { // get opening info
switch (File->Owner->FMOD->FSOUND_Stream_GetOpenState(File->Stream)) {
case 0 : {
// File opened succesfull
File->Duration = File->Owner->FMOD->FSOUND_Stream_GetLengthMs(File->Stream);
if (File->CueSlider) {
File->CueSlider->MaxValue = File->Duration;
File->CueSlider->Value = 0;}
File->CuePoint = 0;
SendNotifyTime(0, File);
File->Owner->SetFileState(LOADED, File);
if (File->Owner->OnNotifyOpened) File->Owner->OnNotifyOpened(File, LOADED, 0);
break;
}
case -1 : {
// stream handle passed in is invalid
File->FileState = AERROR;
if (File->Owner->OnNotifyOpened) File->Owner->OnNotifyOpened(File, AERROR, -1);
break;
}
case -2 :
// stream is still opening
break;
case -3 : {
// stream failed to open. (file not found, out of memory or other error).
File->FileState = AERROR;
if (File->Owner->OnNotifyOpened) File->Owner->OnNotifyOpened(File, AERROR, -3);
break;
}
}
} // end loading
else { // not loading
if (File->PlayButton || File->StopButton) {
if (File->FileState == 2 || File->FileState == 4 || File->FileState == 7) {
gettime(&t);
if (File->FileState == 2 || File->FileState == 7 && File->PlayButton)
File->PlayButton->ButtonOn = (t.ti_hund > 50);
else if (File->FileState == 4 && File->StopButton)
File->StopButton->ButtonOn = (t.ti_hund > 50);
}
}
if (File->FileState == PLAYING || File->FileState == CUESTOP || File->FileState == CUEING || File->FileState == FADEING) {
if (File->Owner->FMOD->FSOUND_IsPlaying(File->Channel)) {
if (File->VinylStop) {
int freq = File->Owner->FMOD->FSOUND_GetFrequency(File->Channel);
freq -= File->VinylFreq;
if (freq > 0) File->Owner->FMOD->FSOUND_SetFrequency(File->Channel, freq);
else {
File->VinylStop = false;
File->Owner->FMOD->FSOUND_SetPaused(File->Channel, true);
File->Owner->ToCuePoint(File->Index);
File->Owner->SetFrequency(File->PitchSlider->Value, File->Index);
}
}
File->Owner->SendNotifyTime(File->Owner->FMOD->FSOUND_Stream_GetTime(File->Stream), File);
if (File->VULeft || File->VURight) {
float left, right;
File->Owner->FMOD->FSOUND_GetCurrentLevels(File->Channel, &left, &right);
if (File->Owner->Speakers != STEREO) {
left *= 141;
right *= 141;
}
else {
left *= 100;
right *= 100;
}
if (Speakers == MONO_LEFT) right = left;
else if (Speakers == MONO_RIGHT) left = right;
if (File->VULeft) File->VULeft->Position = left;
if (File->VURight) File->VURight->Position = right;
}
}
else File->Owner->SetFileState(END, File);
}
if (File->FileState == PAUSED) {
if (File->VULeft) File->VULeft->Position = 0;
if (File->VURight) File->VURight->Position = 0;
}
} // end not loading
}
timerbusy = false;
}
// NotifyTimer->Enabled = true;
}
//———————————————————————
void __fastcall TFMODJingle::SendNotifyTime(int ms, FMOD_File *File)
{
if (File->CurrTime == ms) {
// no need to do again
return;
}
File->CurrTime = ms;

// Calculate exact time (pitching)
int ems = (ms * File->PercExactTime);
int eDuration = (File->PercExactTime * File->Duration);

// Set new volume when fading
if (File->VolSlider && (File->FadeingOut || File->FadeingIn)) {
int volume = (File->FadeTime * 1000);
int newpos = (ems – File->FadePoint);
if (File->FadeingOut) {
if (newpos >= volume) {
File->FadeingOut = false;
Pause(File->Index);
File->VolSlider->Value = 0;
return;}
else if (File->BeforeFadeVolume > 0) {
volume = Devide(volume, File->BeforeFadeVolume, newpos);
File->VolSlider->Value = File->BeforeFadeVolume – volume;}
}
else if (File->FadeingIn) {
if (newpos >= volume) {
File->FadeingIn = false;
SetFileState(PLAYING, File);
return;}
else if (File->VolSlider->Value < 255) {
volume = Devide(volume, 255 – File->BeforeFadeVolume, newpos);
File->VolSlider->Value = File->BeforeFadeVolume + volume;
} } }

// if setting cuepoint loopback after 250 milliseconds
if (File->FileState == CUEING) {
if (ms > File->CuePoint + 250)
File->Owner->FMOD->FSOUND_Stream_SetTime(File->Stream, File->CuePoint);
ms = File->CuePoint;
}

if (OnNotifyPosition) OnNotifyPosition(File, ems, eDuration, File->Index);
if (File->PosMeter) {
if (eDuration == 0) eDuration = 120000;
if (File->PosMeter->MaxValue != eDuration) {
int pos = 100 / File->PosMeter->LedCount;
File->PosMeter->PeakPos = 100(eDuration-30000)/eDuration – pos;
File->PosMeter->MidPos = 100
(eDuration-60000)/eDuration – pos;
File->PosMeter->MaxValue = eDuration;
}
File->PosMeter->Position = ems;
}
if (File->IntroLabel) {
int I = File->Intro – (ms/1000), Min, Sec;
if (I >= 0 && File->IntroLabel->Visible) {
Min = I/60;
Sec = I-(Min*60);
TVarRec args[2] = {Min, Sec};
File->IntroLabel->Caption = Format("%.d:%.2d", args, 1);}
else if (File->IntroLabel->Caption != "0:00")
File->IntroLabel->Caption = "0:00";
}
if (OnNotifyTime || File->LCDmin || File->LCDsec || File->LCDms) {
bool blink = false;
if (File->BlinkTime) blink = (ms > File->Duration-30000);
if (File->RemainTime && ms <= File->Duration) ms = File->Duration – ms;
if (fExactTime) ms *= File->PercExactTime;
int m = ms / 60000;
ms -= (60000 * m);
int s = ms / 1000;
ms -= (1000 * s);
if (File->LCDmin) {
String min = m;
if (min.Length() == 1) min = " " + min;
if (File->RemainTime) min = "-" + min;
else min = " " + min;
if (blink && ms < 500) File->LCDmin->Value = " ";
else File->LCDmin->Value = min;
}
if (File->LCDsec) {
if (blink && ms < 500) File->LCDsec->Value = " ";
else File->LCDsec->Value = s;
}
if (File->LCDms) File->LCDms->Value = ms;
if (OnNotifyTime) OnNotifyTime(File, 0, m, s, ms, File->Index);
}
}
//———————————————————————
void __fastcall TFMODJingle::NotifyZero(FMOD_File *File)
{
SendNotifyTime(0, File);
if (File->VULeft) File->VULeft->Position = 0;
if (File->VURight) File->VURight->Position = 0;
}
//———————————————————————
void __fastcall TFMODJingle::SetFileState(TFileState State, FMOD_File *File)
{
if (File->PlayButton && File->StopButton) {
bool BtnOn = !(State == STOPPED || State == END || State == CUESTOP || State == LOADED);
File->PlayButton->ButtonOn = BtnOn;
File->StopButton->ButtonOn = !BtnOn;
}
if (State == END) {
FMOD->FSOUND_Stream_Stop(File->Stream);
// SetPosition(0, File);
// NotifyZero(File);
}
if (State != FADEING) {
File->FadeingOut = false;
File->FadeingIn = false;
}
if (File->FileState != State) {
File->FileState = State;
if (OnNotifyFileState) OnNotifyFileState(File, State, File->Index);
}
}
//———————————————————————
void __fastcall TFMODJingle::SetOutputType(FSOUND_OUTPUTTYPES value)
{
fOutputType = value;
}
//———————————————————————
void __fastcall TFMODJingle::SetVolume(int volume, FMOD_File *File)
{
if (File->Channel > -1) {
volume *= File->PercCrossFader;
FMOD->FSOUND_SetVolume(File->Channel, volume);
}
}
//———————————————————————
void __fastcall TFMODJingle::ResetFile(FMOD_File *File)
{
File->FileState = STOPPED;
File->Channel = -1;
File->Frequency = 44100;
File->FadeTime = 5;
File->Stream = NULL;
File->FileName = "";
File->Duration = 0;
File->CurrTime = -1;
File->CuePoint = 0;
File->Intro = 0;
File->PercExactTime = 1;
File->FadeingOut = false;
File->FadeingIn = false;
File->Pitching = false;
File->VinylStop = false;
File->Start = false;
File->PitchVal = 100000;
}
/**********************************************************************


*** ***
*** ***
*** Main component setup functions ***
*** ***
*** ***


**********************************************************************/
bool __fastcall TFMODJingle::Init(String DLLName)
{
//load specified fmod dll and get audio drivers
if (FMOD) return true;

FMODLog("\r\n———————————————————");
String log = "\r\nInitializing ";
log += DLLName;
log += " for ";
log += Name;
FMODLog(log);
try {
FMOD = FMOD_CreateInstance(DLLName.c_str());
if (FMOD) {
FMODLog("\r\n Loaded");
int nrD;
#define GetFMODOutputs(output, list) \
FMOD->FSOUND_SetOutput(output); \
nrD = FMOD->FSOUND_GetNumDrivers(); \
for (int i=0;i<nrD;i++) { \
FMODLog("\r\n "); \
FMODLog(PChar(FMOD->FSOUND_GetDriverName(i))); \
list->Append(PChar(FMOD->FSOUND_GetDriverName(i))); \
}

  if (DriverCnt++ == 0) {
    FMODLog(&quot;\r\n    Setting output&quot;);
    FMODLog(&quot;\r\n        Get WINMM outputs:&quot;);
    GetFMODOutputs(WINMM, fDrivers_WINMM);
    FMODLog(&quot;\r\n        Get DIRECTSOUND outputs:&quot;);
    GetFMODOutputs(DIRECTSOUND, fDrivers_DSOUND);
    FMODLog(&quot;\r\n        Get ASIO outputs:&quot;);
    GetFMODOutputs(ASIO, fDrivers_ASIO);

    FMODLog(&quot;\r\n        Get DIRECTSOUND inputs:&quot;);
    FMOD-&gt;FSOUND_SetOutput(DIRECTSOUND);
    nrD = FMOD-&gt;FSOUND_Record_GetNumDrivers();
    for (int i=0;i&lt;nrD;i++) {
      FMODLog(&quot;\r\n            &quot;);
      FMODLog(PChar(FMOD-&gt;FSOUND_Record_GetDriverName(i)));
      fDrivers_RECORD-&gt;Append(PChar(FMOD-&gt;FSOUND_Record_GetDriverName(i)));
    }
  }

  FSOUND_OUTPUTTYPES OutType = fOutputType;
  fOutputType = NOSOUND;
  SetOutputType(OutType);
}
else {
  FMODLog(&quot;\r\n    NOT Loaded&quot;);
  ErrMsg(1, DLLName);
}

}
catch ( ... ) {
FMODLog("\r\n A error occured");
}
return (FMOD != NULL);
}
//———————————————————————
void __fastcall TFMODJingle::SetOutput(void)
{
//initialize fmod
if (FMOD) {
FMODLog("\r\n———————————————————");
FMODLog("\r\nOutputType : ");
FMODLog(fOutputType);
FMODLog("\r\nOutputDriver: ");
FMODLog(fOutputDriver);
FMODLog("\r\nSetOutput ");
FMODLog(Name);
if (FMOD_Initialized) {
FMOD_File *File;
for (int i=0; i < Files->Count; i++) {
File = (FMOD_File *)Files->Items[i];
if (File) if (File->Owner == this) CloseFile(i);
}
FMOD->FSOUND_Close();
FMOD_Initialized = false;
}
FMOD->FSOUND_SetOutput(fOutputType);
FMOD->FSOUND_SetDriver(fOutputDriver);
FMOD->FSOUND_SetMixer(FSOUND_MIXER_QUALITY_AUTODETECT);
if (BufferSize > 0) FMOD->FSOUND_SetBufferSize(BufferSize);
if (fOutputType == DIRECTSOUND)
FMOD_Initialized = FMOD->FSOUND_Init(44100, fMaxChannels, FSOUND_INIT_GLOBALFOCUS);
else
FMOD_Initialized = FMOD->FSOUND_Init(44100, fMaxChannels, 0);

if (FMOD_Initialized) FMODLog(&quot; succeeded&quot;);
else {
  FMODLog(&quot; error occured&quot;);
  ErrMsg(2, &quot;&quot;);
}
FMODLog(&quot;\r\nFSOUND_MIXER: &quot;+IntToStr(FMOD-&gt;FSOUND_GetMixer()));

}
}
//———————————————————————
int __fastcall TFMODJingle::AddFileEntry(TRLed* VULeft, TRLed* VURight, TRLed* PosMeter,
TEMLCD* LCDmin, TEMLCD* LCDsec, TEMLCD* LCDms,
TEMSlider* CueSlider, TEMSlider* PitchSlider, TEMSlider* VolSlider,
TEMButton* PlayButton, TEMButton* StopButton, TEMButton* SetCueButton,
TEMButton* ToCueButton, TEMButton* CueBackButton, TEMButton* CueForwButton,
TEMButton* FadeButton, TEMButton* PitchBUp, TEMButton* PitchBDown,
TLabel* PitchLabel, TLabel* IntroLabel)
{
//add a FMOD_File structure to Files list
FMOD_File *File = new FMOD_File;
ResetFile(File);
File->PercCrossFader = 1;
File->BlinkTime = false;
File->RemainTime = true;
File->Owner = this;
File->PitchLabel = PitchLabel;
File->IntroLabel = IntroLabel;
File->VULeft = VULeft;
File->VURight = VURight;
File->PosMeter = PosMeter;
File->LCDmin = LCDmin;
File->LCDsec = LCDsec;
File->LCDms = LCDms;
File->CueSlider = CueSlider;
File->PitchSlider = PitchSlider;
File->VolSlider = VolSlider;
File->PlayButton = PlayButton;
File->StopButton = StopButton;
File->FadeButton = FadeButton;
File->SetCueBtn = SetCueButton;
File->ToCueBtn = ToCueButton;
File->CueBackBtn = CueBackButton;
File->CueForwBtn = CueForwButton;
File->PitchBUp = PitchBUp;
File->PitchBDown = PitchBDown;

int FileIndex = Files->Add(File);
File->Index = FileIndex;

#define SetOnClick(object, event) \
if (object) { \
object->Tag = FileIndex; \
if (!object->OnClick) object->OnClick = event; \
}
SetOnClick(LCDmin, LCDClick);
SetOnClick(LCDsec, LCDClick);
SetOnClick(LCDms, LCDClick);
SetOnClick(PlayButton, PlayClick);
SetOnClick(StopButton, StopClick);
SetOnClick(FadeButton, FadeClick);
#undef SetOnClick

#define SetOnChange(object, event) \
if (object) { \
object->Tag = FileIndex; \
if (!object->OnChange) object->OnChange = event; \
}
if (CueSlider) {
CueSlider->Tag = FileIndex;
if (!CueSlider->OnChanged)
CueSlider->OnChanged = CueSliderChanged;
}
SetOnChange(PitchSlider, PitchSliderChange);
SetOnChange(VolSlider, VolSliderChange);
#undef SetOnChange

#define SetOnMouseD(object, event) \
if (object) { \
object->Tag = FileIndex; \
object->OnMouseDown = event; \
}
SetOnMouseD(SetCueButton, SetCueMouseDown);
SetOnMouseD(ToCueButton, ToCueMouseDown);
#undef SetOnMouseD

#define SetOnPress(object, event) \
if (object) { \
object->Tag = FileIndex; \
object->OnMousePress = event; \
}
SetOnPress(CueBackButton, SearchPressBack);
SetOnPress(CueForwButton, SearchPressForw);
SetOnPress(PitchBDown, PitchBendDown);
SetOnPress(PitchBUp, PitchBendUp);
#undef SetOnPress

#define SetOnMouseU(object, event) \
if (object) object->OnMouseUp = event;
SetOnMouseU(PitchBDown, PitchBendMouse);
SetOnMouseU(PitchBUp, PitchBendMouse);
#undef SetOnMouseD

if (PosMeter) {
PosMeter->Tag = FileIndex;
PosMeter->OnClickPosition = ClickPosition;
}

return File->Index;
}
//———————————————————————
bool __fastcall TFMODJingle::EmptyFileEntry(int FileIndex)
{
//remove a FMOD_File structure from Files list
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
if (File->LCDmin) File->LCDmin->OnClick = NULL;
if (File->LCDsec) File->LCDsec->OnClick = NULL;
if (File->LCDms) File->LCDms->OnClick = NULL;
if (File->CueSlider) File->CueSlider->OnChanged = NULL;
if (File->PitchSlider) File->PitchSlider->OnChange = NULL;
if (File->VolSlider) File->VolSlider->OnChange = NULL;
if (File->PlayButton) File->PlayButton->OnClick = NULL;
if (File->StopButton) File->StopButton->OnClick = NULL;
if (File->SetCueBtn) File->SetCueBtn->OnMouseDown = NULL;
if (File->ToCueBtn) File->ToCueBtn->OnMouseDown = NULL;
if (File->CueBackBtn) File->CueBackBtn->OnMousePress = NULL;
if (File->CueForwBtn) File->CueForwBtn->OnMousePress = NULL;
if (File->PosMeter) File->PosMeter->OnClickPosition = NULL;
if (File->PitchBUp) {
File->PitchBUp->OnMousePress = NULL;
File->PitchBUp->OnMouseUp = NULL;}
if (File->PitchBDown) {
File->PitchBDown->OnMousePress = NULL;
File->PitchBDown->OnMouseUp = NULL;}
return true;
}
return false;
}
//———————————————————————

FMOD_File* __fastcall TFMODJingle::GetFileEntry(int FileIndex)
{
if (Files->Count <= FileIndex) return NULL;
else return (FMOD_File *)Files->Items[FileIndex];
}
/**********************************************************************


*** ***
*** ***
*** Main filestream controls ***
*** ***
*** ***


**********************************************************************/
int __fastcall TFMODJingle::OpenFile(String file, int FileIndex)
{
FMOD_File File = GetFileEntry(FileIndex);
if (File) {
if (File->FileState == OPENING) return -3;
if (file.Length() > 4) {
// if (File->FileName != file) {
CloseFile(FileIndex);
unsigned int flags = FSOUND_NORMAL;
if (File->Owner->Speakers != STEREO)
flags = FSOUND_16BITS | FSOUND_SIGNED | FSOUND_FORCEMONO;
if (File->Owner->AccurateTime) flags |= FSOUND_MPEGACCURATE;
if (File->Owner->HW2D) flags |= FSOUND_HW2D;
else flags |= FSOUND_2D;
if (!File->Owner->BlockAtOpening) flags |= FSOUND_NONBLOCKING;
File->Stream = File->Owner->FMOD->FSOUND_Stream_Open(file.c_str(), flags, 0, 0);
// File->Stream = File->Owner->FMOD->FSOUND_Stream_OpenFile(file.c_str(), flags, 0);
if (File->Stream) {
File->FileName = file;
if (!File->Owner->BlockAtOpening) {
File->Owner->SetFileState(OPENING, File);
NotifyTimer->Enabled = true;
return 1;
}
File->Duration = File->Owner->FMOD->FSOUND_Stream_GetLengthMs(File->Stream);
if (File->CueSlider) {
File->CueSlider->MaxValue = File->Duration;
File->CueSlider->Value = 0;
}
File->CuePoint = 0;
File->Owner->SendNotifyTime(0, File);
File->Owner->SetFileState(LOADED, File);
return File->Duration;
}
else return -1; // couldn’t open file
/
}
else { // Same File
StopClick(File->StopButton);
if (File->CueSlider) File->CueSlider->Value = 0;
File->CuePoint = 0;
File->Owner->SendNotifyTime(0, File);
File->Owner->SetFileState(LOADED, File);
return File->Duration;
}*/
}
else return 0; // Not a file
}
else return -2; // FMOD not initialized
}
//———————————————————————
void __fastcall TFMODJingle::CloseFile(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
if (File->Stream != NULL) {
Stop(FileIndex);
if (File->Owner->FMOD->FSOUND_Stream_Close(File->Stream)) {
ResetFile(File);
if (File->CueSlider) File->CueSlider->Value = File->CuePoint;
if (File->LCDmin) {
if (File->RemainTime) File->LCDmin->Value = "- 0";
else File->LCDmin->Value = " 0";}
if (File->LCDsec) File->LCDsec->Value = "00";
if (File->LCDms) File->LCDms->Value = "000";
}
}
}
}
//———————————————————————
bool __fastcall TFMODJingle::Play(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
if (File->Stream) {
File->Channel = File->Owner->FMOD->FSOUND_Stream_Play(FSOUND_FREE, File->Stream);
if (File->Channel > -1) {
// File->Owner->FMOD->FSOUND_SetPaused(File->Channel, true);
if (File->VolSlider) File->Owner->SetVolume(File->VolSlider->Value, File);
if (File->Owner->Speakers == STEREO) File->Owner->FMOD->FSOUND_SetPan(File->Channel, FSOUND_STEREOPAN);
else if (File->Owner->Speakers == MONO_LEFT) File->Owner->FMOD->FSOUND_SetPan(File->Channel, 0);
else File->Owner->FMOD->FSOUND_SetPan(File->Channel, 255);

    File-&gt;Frequency = File-&gt;Owner-&gt;FMOD-&gt;FSOUND_GetFrequency(File-&gt;Channel);
    if (File-&gt;PitchSlider) SetFrequency(File-&gt;PitchSlider-&gt;Value, File-&gt;Index);

    File-&gt;Owner-&gt;NotifyTimer-&gt;Enabled = true;
    File-&gt;Owner-&gt;SetFileState(PLAYING, File);

// File->Owner->FMOD->FSOUND_SetPaused(File->Channel, false);
return true;
}
}
}
return false;
}
//———————————————————————
void __fastcall TFMODJingle::Pause(int FileIndex)
{
FMOD_File File = GetFileEntry(FileIndex);
if (File) {
if (File->Channel > -1) {
if (File->Owner->FMOD->FSOUND_GetPaused(File->Channel)) {
File->Owner->FMOD->FSOUND_SetPaused(File->Channel, false);
File->Owner->SetFileState(PLAYING, File);
}
else {
File->Owner->FMOD->FSOUND_SetPaused(File->Channel, true);
if (File->FileState == CUEING)
File->Owner->FMOD->FSOUND_Stream_SetTime(File->Stream, File->CuePoint);
File->Owner->SetFileState(PAUSED, File);
}
}
}
}
//———————————————————————
void __fastcall TFMODJingle::Stop(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
if (File->Stream) {
File->Owner->SetFileState(STOPPED, File);
File->Owner->FMOD->FSOUND_Stream_Stop(File->Stream);
File->Owner->NotifyZero(File);
}
}
}
//———————————————————————
void __fastcall TFMODJingle::Fade(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
if (File->FileState == FADEING) {
File->FadeingOut = false;
File->FadeingIn = false;
File->Owner->SetFileState(PLAYING, File);
}
else if (File->FileState == PLAYING || File->FileState == PAUSED) {
File->FadePoint = File->CurrTime * File->PercExactTime;
File->BeforeFadeVolume = 255;
if (File->VolSlider) File->BeforeFadeVolume = File->VolSlider->Value;
if (File->FileState == PLAYING) File->FadeingOut = true;
else if (File->FileState == PAUSED) {
if (File->BeforeFadeVolume == 255) File->BeforeFadeVolume = 0;
Pause(FileIndex);
File->FadeingIn = true;
}
File->Owner->SetFileState(FADEING, File);
}
}
}
//———————————————————————
void __fastcall TFMODJingle::SetBlinkTime(bool Blink, int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) File->BlinkTime = Blink;
}
//———————————————————————
void __fastcall TFMODJingle::SetFadeTime(int Seconds, int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) File->FadeTime = Seconds;
}
//———————————————————————
void __fastcall TFMODJingle::SetMixTime(int ms, int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) File->MixTime = ms;
}
//———————————————————————
void __fastcall TFMODJingle::SetRemainTime(bool Remain, int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
if (File->RemainTime != Remain) {
File->RemainTime = Remain;
if (File->FileState != PLAYING)
File->Owner->SendNotifyTime(File->CurrTime, File);
}
}
}
//———————————————————————
void __fastcall TFMODJingle::SetFrequency(float percentage, int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
percentage /= 1000;
if (File->PitchLabel)
File->PitchLabel->Caption = FloatToStrF(percentage – 100, ffFixed, 7, 3);
if (File->Channel > -1 && File->Frequency > 0) {
percentage /= 100;
percentage *= File->Frequency;
int freq = percentage;
File->Owner->FMOD->FSOUND_SetFrequency(File->Channel, freq);
File->PercExactTime = 1;
File->PercExactTime /= File->Owner->FMOD->FSOUND_GetFrequency(File->Channel);
File->PercExactTime *= File->Frequency;
}
}
}
//———————————————————————
void __fastcall TFMODJingle::SetCuePoint(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
File->CuePoint = File->CurrTime;
if (File->CueSlider) File->CueSlider->Value = File->CuePoint;
}
}
//———————————————————————
void __fastcall TFMODJingle::ToCuePoint(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) File->Owner->SetPosition(File->CuePoint, File);
}
//—————————————————————————
void __fastcall TFMODJingle::SetCrossFader(int value, int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
float perc = 1;
perc /= 100;
perc *= value;
if (perc > 1) perc = 1;
else if (perc < 0) perc = 0;
if (perc != File->PercCrossFader) {
File->PercCrossFader = perc;
File->Owner->SetVolume(File->VolSlider->Value, File);
}
}
}
//—————————————————————————
void __fastcall TFMODJingle::SearchPress(int Value, int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
if (File->CueSlider) {
if ((File->CueSlider->Value == 0 && Value < 0) ||
(File->CueSlider->Value == File->CueSlider->MaxValue && Value > 0)) return;
File->CuePoint += Value;
File->CueSlider->Value = File->CuePoint;
SetPosition(File->CuePoint, File);
if (File->FileState == PAUSED)
File->Owner->FMOD->FSOUND_SetPaused(File->Channel, false);
File->Owner->SetFileState(CUEING, File);
}
}
}
//—————————————————————————
void __fastcall TFMODJingle::PitchBend(int Value, int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
if (File->PitchSlider && File->Channel > -1) {
if (!File->Pitching) {
File->PitchVal = File->PitchSlider->Value;
File->Pitching = true;
File->PitchVal += (Value
5);}
else if ( File->PitchVal < File->PitchSlider->Value + 5000 &&
File->PitchVal > File->PitchSlider->Value – 5000 )
File->PitchVal += Value;
if (File->Pitching) File->Owner->SetFrequency(File->PitchVal, FileIndex);
}
}
}
//—————————————————————————
void __fastcall TFMODJingle::ReleasePitchBend(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
if (File->PitchSlider && File->Pitching) {
File->Owner->SetFrequency(File->PitchSlider->Value, FileIndex);
File->Pitching = false;
}
}
}
//—————————————————————————
void __fastcall TFMODJingle::VinylStop(int FileIndex, int Frequency)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) {
File->VinylFreq = Frequency;
File->VinylStop = true;
File->Owner->SetFileState(CUESTOP, File);
}
}
/**********************************************************************


*** ***
*** ***
*** Object controls ***
*** ***
*** ***


**********************************************************************/
void __fastcall TFMODJingle::PlayClick(TObject Sender)
{
int i = ((TLabel *)Sender)->Tag;
FMOD_File *File = GetFileEntry(i);
if (File) {
if (File->FileState == 1 || File->FileState == 2 || File->FileState == 6)
Pause(i);
else Play(i);
}
}
//———————————————————————
void __fastcall TFMODJingle::StopClick(TObject *Sender)
{
int i = ((TLabel *)Sender)->Tag;
FMOD_File *File = GetFileEntry(i);
if (File) {
if (File->FileState == PLAYING) {
File->Owner->FMOD->FSOUND_SetPaused(File->Channel, true);
File->Owner->SetFileState(CUESTOP, File);
ToCuePoint(i);
}
}
}
//———————————————————————
void __fastcall TFMODJingle::FadeClick(TObject *Sender)
{
Fade(((TLabel *)Sender)->Tag);
}
//———————————————————————
void __fastcall TFMODJingle::LCDClick(TObject *Sender)
{
FMOD_File *File = GetFileEntry(((TLabel *)Sender)->Tag);
SetRemainTime(!File->RemainTime, File->Index);
}
//———————————————————————
void __fastcall TFMODJingle::VolSliderChange(TObject *Sender)
{
int i = ((TLabel *)Sender)->Tag;
FMOD_File *File = GetFileEntry(i);
if (File) if (File->VolSlider) SetVolume(File->VolSlider->Value, File);
}
//—————————————————————————
void __fastcall TFMODJingle::PitchSliderChange(TObject *Sender)
{
int i = ((TLabel *)Sender)->Tag;
FMOD_File *File = GetFileEntry(i);
if (File) if (File->PitchSlider) SetFrequency(File->PitchSlider->Value, i);
}
//—————————————————————————
void __fastcall TFMODJingle::CueSliderChanged(TObject *Sender)
{
int i = ((TLabel *)Sender)->Tag;
FMOD_File *File = GetFileEntry(i);
if (File) {
if (File->CueSlider && File->Duration > 0) {
if (File->Duration <= File->CueSlider->Value) SetFileState(END, File);
else {
File->CuePoint = File->CueSlider->Value;
SetPosition(File->CuePoint, File);
}
}
}
}
//—————————————————————————
void __fastcall TFMODJingle::SetCueMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
SetCuePoint(((TLabel *)Sender)->Tag);
}
//—————————————————————————
void __fastcall TFMODJingle::ToCueMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
ToCuePoint(((TLabel *)Sender)->Tag);
}
//—————————————————————————
void __fastcall TFMODJingle::SearchPressForw(TObject *Sender)
{
SearchPress(10, ((TLabel *)Sender)->Tag);
}
//—————————————————————————
void __fastcall TFMODJingle::SearchPressBack(TObject *Sender)
{
SearchPress(-9, ((TLabel *)Sender)->Tag);
}
//—————————————————————————
void __fastcall TFMODJingle::PitchBendUp(TObject *Sender)
{
PitchBend(200, ((TLabel *)Sender)->Tag);
}
//—————————————————————————
void __fastcall TFMODJingle::PitchBendDown(TObject *Sender)
{
PitchBend(-200, ((TLabel *)Sender)->Tag);
}
//—————————————————————————
void __fastcall TFMODJingle::PitchBendMouse(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
ReleasePitchBend(((TLabel *)Sender)->Tag);
}
//—————————————————————————
void __fastcall TFMODJingle::ClickPosition(TObject *Sender, int Position)
{
FMOD_File *File = GetFileEntry(((TLabel *)Sender)->Tag);
if (File) SetPosition(Position
(1/File->PercExactTime), File);
}
/**********************************************************************


*** ***
*** ***
*** Get fileinfo controls ***
*** ***
*** ***


**********************************************************************/
TFileState __fastcall TFMODJingle::GetFileState(int FileIndex)
{
FMOD_File File = GetFileEntry(FileIndex);
if (File) return File->FileState;
else return STOPPED;
}
//—————————————————————————
String __fastcall TFMODJingle::GetFileName(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) return File->FileName;
else return "";
}
//———————————————————————
bool __fastcall TFMODJingle::GetBlinkTime(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) return File->BlinkTime;
else return false;
}
//———————————————————————
int __fastcall TFMODJingle::GetFadeTime(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) return File->FadeTime;
else return -1;
}
//———————————————————————
int __fastcall TFMODJingle::GetDuration(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) return File->Duration;
else return -1;
}
//———————————————————————
bool __fastcall TFMODJingle::GetRemainTime(int FileIndex)
{
FMOD_File *File = GetFileEntry(FileIndex);
if (File) return File->RemainTime;
else return false;
}
//———————————————————————
TStringList
__fastcall TFMODJingle::ReturnInputs(void)
{
return fDrivers_RECORD;
}
//———————————————————————
TStringList* __fastcall TFMODJingle::ReturnOutputs(int Type)
{
if (Type == 2) return fDrivers_ASIO;
else if (Type == 1) return fDrivers_DSOUND;
else return fDrivers_WINMM;
}
//———————————————————————
void TFMODJingle::FMODLog(String input)
{
/* Open file */
FILE *stream = fopen("c:\fmodlog.txt", "a+t");

fseek(stream, 0L, SEEK_END);
long length = ftell(stream);
if (length > 102400) {
fclose(stream);
stream = fopen("c:\fmodlog.txt", "wt");
}

if (stream) {
/* write to file /
fprintf(stream, input.c_str());
/
close the file */
fclose(stream);
}
}
//—————————————————————————
namespace Fmodjingle
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TFMODJingle)};
RegisterComponents("EM Controls", classes, 0);
}
}
//—————————————————————————[/code:1rhecjiy]

  • You must to post comments
0
0

[b:3uzpj1kq]fmodclass.h[/b:3uzpj1kq]
[code:3uzpj1kq]//—————————————————————————

ifndef FMODJINGLEH

define FMODJINGLEH

//—————————————————————————

include <SysUtils.hpp>

include <Controls.hpp>

include <Classes.hpp>

include <Forms.hpp>

include <ExtCtrls.hpp> // only for TTimer

include <StdCtrls.hpp> // for pitch label and combobox

include "RLed.hpp" // for VU and Position meters

include "EMLcd.hpp" // for time LCD’s

include "EMSlider.hpp" // for Cue slider

include "EMButton.hpp" // for Stop and Play buttons

include <winbase.h>

include <shellapi.h>

include <dos.h>

include "fmoddyn.h"

enum TFileState {
STOPPED,
PLAYING,
PAUSED,
END,
CUEING,
FADEING,
CUESTOP,
LOADED,
OPENING,
AERROR
};

enum TOutputType {
MONO_LEFT=0,
STEREO,
MONO_RIGHT
};

class TFMODJingle;
//—————————————————————————
typedef struct {
String FileName;
FSOUND_STREAM *Stream;
TFMODJingle *Owner;
TFileState FileState;
int Index;
int Frequency;
int Duration;
int Channel;

int CurrTime;
int CuePoint;
int FadePoint;
int FadeTime;
int BeforeFadeVolume;
int MixTime;
bool FadeingOut;
bool FadeingIn;
bool BlinkTime;
bool RemainTime;
bool VinylStop;
bool Start;
int VinylFreq;
float PercExactTime; // 1 = 100%
float PercCrossFader; // 1 = 100%

bool Pitching;
int PitchVal;
int Intro;
TLabel* PitchLabel;
TLabel* IntroLabel;
TRLed* VULeft;
TRLed* VURight;
TRLed* PosMeter;
TEMLCD* LCDmin;
TEMLCD* LCDsec;
TEMLCD* LCDms;
TEMSlider* CueSlider;
TEMSlider* PitchSlider;
TEMSlider* VolSlider;
TEMButton* PlayButton;
TEMButton* StopButton;
TEMButton* FadeButton;
TEMButton* SetCueBtn;
TEMButton* ToCueBtn;
TEMButton* CueBackBtn;
TEMButton* CueForwBtn;
TEMButton* PitchBUp;
TEMButton* PitchBDown;
} FMOD_File;

typedef void __fastcall (__closure *TNotifyFileEvent) (FMOD_File *File);
typedef void __fastcall (__closure *TNotifyFileStateEvent) (FMOD_File *File, TFileState State, int Index);
typedef void __fastcall (__closure *TNotifyFilePositionEvent) (FMOD_File *File, int Position, int Range, int Index);
typedef void __fastcall (__closure *TNotifyFileTimeEvent) (FMOD_File *File, int Hours, int Minutes, int Seconds, int Fractions, int Index);
//—————————————————————————
class PACKAGE TFMODJingle : public TComponent
{
private:
FMOD_INSTANCE *fFMOD;
static TList *Files;

bool FMOD_Initialized;
FSOUND_OUTPUTTYPES fOutputType;
static TStringList *fDrivers_WINMM;
static TStringList *fDrivers_DSOUND;
static TStringList *fDrivers_ASIO;
static TStringList *fDrivers_RECORD;
static int UseCnt; // Number of users of static objects.
static int DriverCnt; // Number of users of static objects.

static TTimer *NotifyTimer;
int fOutputDriver;
TOutputType fSpeakers;
bool fAccurateTime;
int fBufferSize;
int fMaxChannels;

bool fDontChange;
bool fExactTime;
bool fHW2D;
bool fBlockOpen;
struct time t;

TNotifyFileStateEvent fOnNotifyFileState;
TNotifyFilePositionEvent fOnNotifyPosition;
TNotifyFileTimeEvent fOnNotifyTime;
TNotifyFileStateEvent fOnNotifyOpened;
void __fastcall ErrMsg(int errnr, String extra);
void __fastcall NotifyTimerTime(TObject Sender);
void __fastcall SendNotifyTime(int ms, FMOD_File *File);
void __fastcall NotifyZero(FMOD_File *File);
void __fastcall SetFileState(TFileState State, FMOD_File *File);
void __fastcall SetPosition(int ms, FMOD_File *File);
void __fastcall SetOutputType(FSOUND_OUTPUTTYPES value);
void __fastcall SetVolume(int volume, FMOD_File *File);
void __fastcall ResetFile(FMOD_File *File);
void FMODLog(String input);
protected:
public:
__fastcall TFMODJingle(TComponent
Owner);
__fastcall ~TFMODJingle(void);
__property FMOD_INSTANCE FMOD ={read=fFMOD, write=fFMOD};
TStringList
__fastcall ReturnInputs(void);
TStringList* __fastcall ReturnOutputs(int Type);
__published:
bool __fastcall Init(String DLLName);
void __fastcall SetOutput(void);
int __fastcall AddFileEntry(TRLed* VULeft, TRLed* VURight, TRLed* PosMeter,
TEMLCD* LCDmin, TEMLCD* LCDsec, TEMLCD* LCDms,
TEMSlider* CueSlider, TEMSlider* PitchSlider, TEMSlider* VolSlider,
TEMButton* PlayButton, TEMButton* StopButton, TEMButton* SetCueButton,
TEMButton* ToCueButton, TEMButton* CueBackButton, TEMButton* CueForwButton,
TEMButton* FadeButton, TEMButton* PitchBUp, TEMButton* PitchBDown,
TLabel* PitchLabel, TLabel* IntroLabel);
bool __fastcall EmptyFileEntry(int FileIndex);
FMOD_File* __fastcall GetFileEntry(int FileIndex);

int __fastcall OpenFile(String file, int FileIndex);
void __fastcall CloseFile(int FileIndex);
bool __fastcall Play(int FileIndex);
void __fastcall Pause(int FileIndex);
void __fastcall Stop(int FileIndex);
void __fastcall Fade(int FileIndex);
void __fastcall SetBlinkTime(bool Blink, int FileIndex);
void __fastcall SetFadeTime(int Seconds, int FileIndex);
void __fastcall SetMixTime(int ms, int FileIndex);
void __fastcall SetRemainTime(bool Remain, int FileIndex);
void __fastcall SetFrequency(float percentage, int FileIndex);
void __fastcall SetCuePoint(int FileIndex);
void __fastcall SearchPress(int Value, int FileIndex);
void __fastcall ToCuePoint(int FileIndex);
void __fastcall SetCrossFader(int value, int FileIndex);
void __fastcall PitchBend(int Value, int FileIndex);
void __fastcall ReleasePitchBend(int FileIndex);
void __fastcall VinylStop(int FileIndex, int Frequency);

void __fastcall PlayClick(TObject *Sender);
void __fastcall StopClick(TObject *Sender);
void __fastcall FadeClick(TObject *Sender);
void __fastcall LCDClick(TObject *Sender);
void __fastcall VolSliderChange(TObject *Sender);
void __fastcall PitchSliderChange(TObject *Sender);
void __fastcall CueSliderChanged(TObject *Sender);
void __fastcall SetCueMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall ToCueMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall SearchPressBack(TObject *Sender);
void __fastcall SearchPressForw(TObject *Sender);
void __fastcall PitchBendUp(TObject *Sender);
void __fastcall PitchBendDown(TObject *Sender);
void __fastcall PitchBendMouse(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y);
void __fastcall ClickPosition(TObject *Sender, int Position);

TFileState __fastcall GetFileState(int FileIndex);
String __fastcall GetFileName(int FileIndex);
bool __fastcall GetBlinkTime(int FileIndex);
int __fastcall GetFadeTime(int FileIndex);
int __fastcall GetDuration(int FileIndex);
bool __fastcall GetRemainTime(int FileIndex);

__property bool BlockAtOpening ={read=fBlockOpen, write=fBlockOpen, default=true};
__property int MaxChannels ={read=fMaxChannels, write=fMaxChannels, default=20};
__property int OutputDriver ={read=fOutputDriver, write=fOutputDriver, default=0};
__property int BufferSize ={read=fBufferSize, write=fBufferSize, default=0};
__property TOutputType Speakers ={read=fSpeakers, write=fSpeakers, default=STEREO};
__property FSOUND_OUTPUTTYPES OutputType ={read=fOutputType, write=SetOutputType, default=DIRECTSOUND};
__property bool AccurateTime ={read=fAccurateTime, write=fAccurateTime, default=false};
__property bool DisplayExactTime ={read=fExactTime, write=fExactTime, default=false};
__property bool HW2D ={read=fHW2D, write=fHW2D, default=false};
__property TNotifyFileStateEvent OnNotifyFileState ={read=fOnNotifyFileState, write=fOnNotifyFileState};
__property TNotifyFilePositionEvent OnNotifyPosition ={read=fOnNotifyPosition, write=fOnNotifyPosition};
__property TNotifyFileTimeEvent OnNotifyTime ={read=fOnNotifyTime, write=fOnNotifyTime};
__property TNotifyFileStateEvent OnNotifyOpened ={read=fOnNotifyOpened, write=fOnNotifyOpened};
};
//—————————————————————————

endif[/code:3uzpj1kq]

  • You must to post comments
0
0

[b:22yk9gg5]fmoddyn.h[/b:22yk9gg5]
[code:22yk9gg5]/* ========================================================================================== /
/
FMOD Dynamic DLL loading header. Copyright (c), Firelight Technologies Pty, Ltd 1999-2003. /
/
========================================================================================== */

ifndef FMODDYN_H

define FMODDYN_H

include <windows.h>

include <stdlib.h>

include "fmod370.h"

typedef struct
{
void *module;

signed char       (F_API *FSOUND_SetOutput)(int outputtype);
signed char       (F_API *FSOUND_SetDriver)(int driver);
signed char       (F_API *FSOUND_SetMixer)(int mixer);
signed char       (F_API *FSOUND_SetBufferSize)(int len_ms);
signed char       (F_API *FSOUND_SetHWND)(void *hwnd);
signed char       (F_API *FSOUND_SetMinHardwareChannels)(int min);
signed char       (F_API *FSOUND_SetMaxHardwareChannels)(int max);
signed char       (F_API *FSOUND_SetMemorySystem)(void *pool, int poollen, FSOUND_ALLOCCALLBACK useralloc, FSOUND_REALLOCCALLBACK userrealloc, FSOUND_FREECALLBACK userfree);
signed char       (F_API *FSOUND_Init)(int mixrate, int maxsoftwarechannels, unsigned int flags);
void              (F_API *FSOUND_Close)();
void              (F_API *FSOUND_SetSpeakerMode)(unsigned int speakermode);
void              (F_API *FSOUND_SetSFXMasterVolume)(int volume);
void              (F_API *FSOUND_SetPanSeperation)(float pansep);
void              (F_API *FSOUND_File_SetCallbacks)(FSOUND_OPENCALLBACK  useropen, FSOUND_CLOSECALLBACK userclose, FSOUND_READCALLBACK userread, FSOUND_SEEKCALLBACK  userseek, FSOUND_TELLCALLBACK  usertell);
int               (F_API *FSOUND_GetError)();
float             (F_API *FSOUND_GetVersion)();
int               (F_API *FSOUND_GetOutput)();
void *            (F_API *FSOUND_GetOutputHandle)();
int               (F_API *FSOUND_GetDriver)();
int               (F_API *FSOUND_GetMixer)();
int               (F_API *FSOUND_GetNumDrivers)();
signed char *     (F_API *FSOUND_GetDriverName)(int id);
signed char       (F_API *FSOUND_GetDriverCaps)(int id, unsigned int *caps);
int               (F_API *FSOUND_GetOutputRate)();
int               (F_API *FSOUND_GetMaxChannels)();
int               (F_API *FSOUND_GetMaxSamples)();
int               (F_API *FSOUND_GetSFXMasterVolume)();
int               (F_API *FSOUND_GetNumHardwareChannels)();
int               (F_API *FSOUND_GetChannelsPlaying)();
float             (F_API *FSOUND_GetCPUUsage)();
void              (F_API *FSOUND_GetMemoryStats)(unsigned int *currentalloced, unsigned int *maxalloced);
FSOUND_SAMPLE *   (F_API *FSOUND_Sample_Load)(int index, const char *name_or_data, unsigned int mode, int offset, int length);
FSOUND_SAMPLE *   (F_API *FSOUND_Sample_Alloc)(int index, int length, unsigned int mode, int deffreq, int defvol, int defpan, int defpri);
void              (F_API *FSOUND_Sample_Free)(FSOUND_SAMPLE *sptr);
signed char       (F_API *FSOUND_Sample_Upload)(FSOUND_SAMPLE *sptr, void *srcdata, unsigned int mode);
signed char       (F_API *FSOUND_Sample_Lock)(FSOUND_SAMPLE *sptr, int offset, int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);
signed char       (F_API *FSOUND_Sample_Unlock)(FSOUND_SAMPLE *sptr, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);
signed char       (F_API *FSOUND_Sample_SetMode)(FSOUND_SAMPLE *sptr, unsigned int mode);
signed char       (F_API *FSOUND_Sample_SetLoopPoints)(FSOUND_SAMPLE *sptr, int loopstart, int loopend);
signed char       (F_API *FSOUND_Sample_SetDefaults)(FSOUND_SAMPLE *sptr, int deffreq, int defvol, int defpan, int defpri);
signed char       (F_API *FSOUND_Sample_SetMinMaxDistance)(FSOUND_SAMPLE *sptr, float min, float max);
signed char       (F_API *FSOUND_Sample_SetMaxPlaybacks)(FSOUND_SAMPLE *sptr, int max);
FSOUND_SAMPLE *   (F_API *FSOUND_Sample_Get)(int sampno);
char *            (F_API *FSOUND_Sample_GetName)(FSOUND_SAMPLE *sptr);
unsigned int      (F_API *FSOUND_Sample_GetLength)(FSOUND_SAMPLE *sptr);
signed char       (F_API *FSOUND_Sample_GetLoopPoints)(FSOUND_SAMPLE *sptr, int *loopstart, int *loopend);
signed char       (F_API *FSOUND_Sample_GetDefaults)(FSOUND_SAMPLE *sptr, int *deffreq, int *defvol, int *defpan, int *defpri);
unsigned int      (F_API *FSOUND_Sample_GetMode)(FSOUND_SAMPLE *sptr);
int               (F_API *FSOUND_PlaySound)(int channel, FSOUND_SAMPLE *sptr);
int               (F_API *FSOUND_PlaySoundEx)(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);
signed char       (F_API *FSOUND_StopSound)(int channel);
signed char       (F_API *FSOUND_SetFrequency)(int channel, int freq);
signed char       (F_API *FSOUND_SetVolume)(int channel, int vol);
signed char       (F_API *FSOUND_SetVolumeAbsolute)(int channel, int vol);
signed char       (F_API *FSOUND_SetPan)(int channel, int pan);
signed char       (F_API *FSOUND_SetSurround)(int channel, signed char surround);
signed char       (F_API *FSOUND_SetMute)(int channel, signed char mute);
signed char       (F_API *FSOUND_SetPriority)(int channel, int priority);
signed char       (F_API *FSOUND_SetReserved)(int channel, signed char reserved);
signed char       (F_API *FSOUND_SetPaused)(int channel, signed char paused);
signed char       (F_API *FSOUND_SetLoopMode)(int channel, unsigned int loopmode);
signed char       (F_API *FSOUND_SetCurrentPosition)(int channel, unsigned int offset);
signed char       (F_API *FSOUND_IsPlaying)(int channel);
int               (F_API *FSOUND_GetFrequency)(int channel);
int               (F_API *FSOUND_GetVolume)(int channel);
int               (F_API *FSOUND_GetPan)(int channel);
signed char       (F_API *FSOUND_GetSurround)(int channel);
signed char       (F_API *FSOUND_GetMute)(int channel);
int               (F_API *FSOUND_GetPriority)(int channel);
signed char       (F_API *FSOUND_GetReserved)(int channel);
signed char       (F_API *FSOUND_GetPaused)(int channel);
unsigned int      (F_API *FSOUND_GetLoopMode)(int channel);
unsigned int      (F_API *FSOUND_GetCurrentPosition)(int channel);
FSOUND_SAMPLE *   (F_API *FSOUND_GetCurrentSample)(int channel);
signed char       (F_API *FSOUND_GetCurrentLevels)(int channel, float *l, float *r);
int               (F_API *FSOUND_FX_Enable)(int channel, unsigned int fx);    /* See FSOUND_FX_MODES */
signed char       (F_API *FSOUND_FX_Disable)(int channel);    
signed char       (F_API *FSOUND_FX_SetChorus)(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase);
signed char       (F_API *FSOUND_FX_SetCompressor)(int fxid, float Gain, float Attack, float Release, float Threshold, float Ratio, float Predelay);
signed char       (F_API *FSOUND_FX_SetDistortion)(int fxid, float Gain, float Edge, float PostEQCenterFrequency, float PostEQBandwidth, float PreLowpassCutoff);
signed char       (F_API *FSOUND_FX_SetEcho)(int fxid, float WetDryMix, float Feedback, float LeftDelay, float RightDelay, int PanDelay);
signed char       (F_API *FSOUND_FX_SetFlanger)(int fxid, float WetDryMix, float Depth, float Feedback, float Frequency, int Waveform, float Delay, int Phase);
signed char       (F_API *FSOUND_FX_SetGargle)(int fxid, int RateHz, int WaveShape);
signed char       (F_API *FSOUND_FX_SetI3DL2Reverb)(int fxid, int Room, int RoomHF, float RoomRolloffFactor, float DecayTime, float DecayHFRatio, int Reflections, float ReflectionsDelay, int Reverb, float ReverbDelay, float Diffusion, float Density, float HFReference);
signed char       (F_API *FSOUND_FX_SetParamEQ)(int fxid, float Center, float Bandwidth, float Gain);
signed char       (F_API *FSOUND_FX_SetWavesReverb)(int fxid, float InGain, float ReverbMix, float ReverbTime, float HighFreqRTRatio);  
void              (F_API *FSOUND_Update)();   /* you must call this once a frame */
void              (F_API *FSOUND_3D_SetDopplerFactor)(float scale);
void              (F_API *FSOUND_3D_SetDistanceFactor)(float scale);
void              (F_API *FSOUND_3D_SetRolloffFactor)(float scale);
signed char       (F_API *FSOUND_3D_SetAttributes)(int channel, float *pos, float *vel);
signed char       (F_API *FSOUND_3D_GetAttributes)(int channel, float *pos, float *vel);
void              (F_API *FSOUND_3D_Listener_SetCurrent)(int current, int numlisteners);  /* use this if you use multiple listeners / splitscreen */
void              (F_API *FSOUND_3D_Listener_SetAttributes)(float *pos, float *vel, float fx, float fy, float fz, float tx, float ty, float tz);
void              (F_API *FSOUND_3D_Listener_GetAttributes)(float *pos, float *vel, float *fx, float *fy, float *fz, float *tx, float *ty, float *tz);
signed char       (F_API *FSOUND_Stream_SetBufferSize)(int ms);      /* call this before opening streams, not after */
FSOUND_STREAM *   (F_API *FSOUND_Stream_Open)(const char *name_or_data, unsigned int mode, int offset, int length);
FSOUND_STREAM *   (F_API *FSOUND_Stream_Create)(FSOUND_STREAMCALLBACK callback, int length, unsigned int mode, int samplerate, int userdata);
signed char       (F_API *FSOUND_Stream_Close)(FSOUND_STREAM *stream);
int               (F_API *FSOUND_Stream_Play)(int channel, FSOUND_STREAM *stream);
int               (F_API *FSOUND_Stream_PlayEx)(int channel, FSOUND_STREAM *stream, FSOUND_DSPUNIT *dsp, signed char startpaused);
signed char       (F_API *FSOUND_Stream_Stop)(FSOUND_STREAM *stream);
signed char       (F_API *FSOUND_Stream_SetPosition)(FSOUND_STREAM *stream, unsigned int position);
unsigned int      (F_API *FSOUND_Stream_GetPosition)(FSOUND_STREAM *stream);
signed char       (F_API *FSOUND_Stream_SetTime)(FSOUND_STREAM *stream, int ms);
int               (F_API *FSOUND_Stream_GetTime)(FSOUND_STREAM *stream);
int               (F_API *FSOUND_Stream_GetLength)(FSOUND_STREAM *stream);
int               (F_API *FSOUND_Stream_GetLengthMs)(FSOUND_STREAM *stream);
signed char       (F_API *FSOUND_Stream_SetMode)(FSOUND_STREAM *stream, unsigned int mode);
unsigned int      (F_API *FSOUND_Stream_GetMode)(FSOUND_STREAM *stream);
signed char       (F_API *FSOUND_Stream_SetLoopPoints)(FSOUND_STREAM *stream, unsigned int loopstartpcm, unsigned int loopendpcm);
signed char       (F_API *FSOUND_Stream_SetLoopCount)(FSOUND_STREAM *stream, int count);
int               (F_API *FSOUND_Stream_GetOpenState)(FSOUND_STREAM *stream);
FSOUND_SAMPLE *   (F_API *FSOUND_Stream_GetSample)(FSOUND_STREAM *stream);   /* every stream contains a sample to playback on */
FSOUND_DSPUNIT *  (F_API *FSOUND_Stream_CreateDSP)(FSOUND_STREAM *stream, FSOUND_DSPCALLBACK callback, int priority, int param);
signed char       (F_API *FSOUND_Stream_SetEndCallback)(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, int userdata);
signed char       (F_API *FSOUND_Stream_SetSyncCallback)(FSOUND_STREAM *stream, FSOUND_STREAMCALLBACK callback, int userdata);
FSOUND_SYNCPOINT *(F_API *FSOUND_Stream_AddSyncPoint)(FSOUND_STREAM *stream, unsigned int pcmoffset, int userdata);
signed char       (F_API *FSOUND_Stream_DeleteSyncPoint)(FSOUND_SYNCPOINT *point);
int               (F_API *FSOUND_Stream_GetNumSyncPoints)(FSOUND_STREAM *stream);
FSOUND_SYNCPOINT *(F_API *FSOUND_Stream_GetSyncPoint)(FSOUND_STREAM *stream, int index);
char *            (F_API *FSOUND_Stream_GetSyncPointInfo)(FSOUND_SYNCPOINT *point, unsigned int *pcmoffset);
signed char       (F_API *FSOUND_Stream_SetSubStream)(FSOUND_STREAM *stream, int index);
int               (F_API *FSOUND_Stream_GetNumSubStreams)(FSOUND_STREAM *stream);
signed char       (F_API *FSOUND_Stream_SetSubStreamSentence)(FSOUND_STREAM *stream, int *sentencelist, int numitems);
signed char       (F_API *FSOUND_Stream_GetNumTagFields)(FSOUND_STREAM *stream, int *num);
signed char       (F_API *FSOUND_Stream_GetTagField)(FSOUND_STREAM *stream, int num, int *type, char **name, void **value, int *length);
signed char       (F_API *FSOUND_Stream_FindTagField)(FSOUND_STREAM *stream, int type, const char *name, void **value, int *length);
signed char       (F_API *FSOUND_Stream_Net_SetProxy)(const char *proxy);
char *            (F_API *FSOUND_Stream_Net_GetLastServerStatus)();
signed char       (F_API *FSOUND_Stream_Net_SetBufferProperties)(int buffersize, int prebuffer_percent, int rebuffer_percent);
signed char       (F_API *FSOUND_Stream_Net_GetBufferProperties)(int *buffersize, int *prebuffer_percent, int *rebuffer_percent);
signed char       (F_API *FSOUND_Stream_Net_SetMetadataCallback)(FSOUND_STREAM *stream, FSOUND_METADATACALLBACK callback, int userdata);
signed char       (F_API *FSOUND_Stream_Net_GetStatus)(FSOUND_STREAM *stream, int *status, int *bufferpercentused, int *bitrate, unsigned int *flags);
signed char       (F_API *FSOUND_CD_Play)(char drive, int track);
void              (F_API *FSOUND_CD_SetPlayMode)(char drive, signed char mode);
signed char       (F_API *FSOUND_CD_Stop)(char drive);
signed char       (F_API *FSOUND_CD_SetPaused)(char drive, signed char paused);
signed char       (F_API *FSOUND_CD_SetVolume)(char drive, int volume);
signed char       (F_API *FSOUND_CD_SetTrackTime)(char drive, unsigned int ms);
signed char       (F_API *FSOUND_CD_Eject)(char drive);
signed char       (F_API *FSOUND_CD_GetPaused)(char drive);
int               (F_API *FSOUND_CD_GetTrack)(char drive);
int               (F_API *FSOUND_CD_GetNumTracks)(char drive);
int               (F_API *FSOUND_CD_GetVolume)(char drive);
int               (F_API *FSOUND_CD_GetTrackLength)(char drive, int track); 
int               (F_API *FSOUND_CD_GetTrackTime)(char drive);
FSOUND_DSPUNIT *  (F_API *FSOUND_DSP_Create)(FSOUND_DSPCALLBACK callback, int priority, int param);
void              (F_API *FSOUND_DSP_Free)(FSOUND_DSPUNIT *unit);
void              (F_API *FSOUND_DSP_SetPriority)(FSOUND_DSPUNIT *unit, int priority);
int               (F_API *FSOUND_DSP_GetPriority)(FSOUND_DSPUNIT *unit);
void              (F_API *FSOUND_DSP_SetActive)(FSOUND_DSPUNIT *unit, signed char active);
signed char       (F_API *FSOUND_DSP_GetActive)(FSOUND_DSPUNIT *unit);
FSOUND_DSPUNIT *  (F_API *FSOUND_DSP_GetClearUnit)();
FSOUND_DSPUNIT *  (F_API *FSOUND_DSP_GetSFXUnit)();
FSOUND_DSPUNIT *  (F_API *FSOUND_DSP_GetMusicUnit)();
FSOUND_DSPUNIT *  (F_API *FSOUND_DSP_GetFFTUnit)();
FSOUND_DSPUNIT *  (F_API *FSOUND_DSP_GetClipAndCopyUnit)();
signed char       (F_API *FSOUND_DSP_MixBuffers)(void *destbuffer, void *srcbuffer, int len, int freq, int vol, int pan, unsigned int mode);
void              (F_API *FSOUND_DSP_ClearMixBuffer)();
int               (F_API *FSOUND_DSP_GetBufferLength)();      /* Length of each DSP update */
int               (F_API *FSOUND_DSP_GetBufferLengthTotal)(); /* Total buffer length due to FSOUND_SetBufferSize */
float *           (F_API *FSOUND_DSP_GetSpectrum)();          /* Array of 512 floats - call FSOUND_DSP_SetActive(FSOUND_DSP_GetFFTUnit(), TRUE)) for this to work. */
signed char       (F_API *FSOUND_Reverb_SetProperties)(FSOUND_REVERB_PROPERTIES *prop);
signed char       (F_API *FSOUND_Reverb_GetProperties)(FSOUND_REVERB_PROPERTIES *prop);
signed char       (F_API *FSOUND_Reverb_SetChannelProperties)(int channel, FSOUND_REVERB_CHANNELPROPERTIES *prop);
signed char       (F_API *FSOUND_Reverb_GetChannelProperties)(int channel, FSOUND_REVERB_CHANNELPROPERTIES *prop);
signed char       (F_API *FSOUND_Record_SetDriver)(int outputtype);
int               (F_API *FSOUND_Record_GetNumDrivers)();
signed char *     (F_API *FSOUND_Record_GetDriverName)(int id);
int               (F_API *FSOUND_Record_GetDriver)();
signed char       (F_API *FSOUND_Record_StartSample)(FSOUND_SAMPLE *sptr, signed char loop);
signed char       (F_API *FSOUND_Record_Stop)();
int               (F_API *FSOUND_Record_GetPosition)();  
FMUSIC_MODULE *   (F_API *FMUSIC_LoadSong)(const char *name);
FMUSIC_MODULE *   (F_API *FMUSIC_LoadSongEx)(const char *name_or_data, int offset, int length, unsigned int mode, int *samplelist, int samplelistnum);
int               (F_API *FMUSIC_GetOpenState)(FMUSIC_MODULE *mod);
signed char       (F_API *FMUSIC_FreeSong)(FMUSIC_MODULE *mod);
signed char       (F_API *FMUSIC_PlaySong)(FMUSIC_MODULE *mod);
signed char       (F_API *FMUSIC_StopSong)(FMUSIC_MODULE *mod);
void              (F_API *FMUSIC_StopAllSongs)();
signed char       (F_API *FMUSIC_SetZxxCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback);
signed char       (F_API *FMUSIC_SetRowCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int rowstep);
signed char       (F_API *FMUSIC_SetOrderCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int orderstep);
signed char       (F_API *FMUSIC_SetInstCallback)(FMUSIC_MODULE *mod, FMUSIC_CALLBACK callback, int instrument);
signed char       (F_API *FMUSIC_SetSample)(FMUSIC_MODULE *mod, int sampno, FSOUND_SAMPLE *sptr);
signed char       (F_API *FMUSIC_SetUserData)(FMUSIC_MODULE *mod, unsigned int userdata);
signed char       (F_API *FMUSIC_OptimizeChannels)(FMUSIC_MODULE *mod, int maxchannels, int minvolume);
signed char       (F_API *FMUSIC_SetReverb)(signed char reverb);             /* MIDI only */
signed char       (F_API *FMUSIC_SetLooping)(FMUSIC_MODULE *mod, signed char looping);
signed char       (F_API *FMUSIC_SetOrder)(FMUSIC_MODULE *mod, int order);
signed char       (F_API *FMUSIC_SetPaused)(FMUSIC_MODULE *mod, signed char pause);
signed char       (F_API *FMUSIC_SetMasterVolume)(FMUSIC_MODULE *mod, int volume);
signed char       (F_API *FMUSIC_SetMasterSpeed)(FMUSIC_MODULE *mode, float speed);
signed char       (F_API *FMUSIC_SetPanSeperation)(FMUSIC_MODULE *mod, float pansep);
char *            (F_API *FMUSIC_GetName)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetType)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetNumOrders)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetNumPatterns)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetNumInstruments)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetNumSamples)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetNumChannels)(FMUSIC_MODULE *mod);
FSOUND_SAMPLE *   (F_API *FMUSIC_GetSample)(FMUSIC_MODULE *mod, int sampno);
int               (F_API *FMUSIC_GetPatternLength)(FMUSIC_MODULE *mod, int orderno);
signed char       (F_API *FMUSIC_IsFinished)(FMUSIC_MODULE *mod);
signed char       (F_API *FMUSIC_IsPlaying)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetMasterVolume)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetGlobalVolume)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetOrder)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetPattern)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetSpeed)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetBPM)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetRow)(FMUSIC_MODULE *mod);
signed char       (F_API *FMUSIC_GetPaused)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetTime)(FMUSIC_MODULE *mod);
int               (F_API *FMUSIC_GetRealChannel)(FMUSIC_MODULE *mod, int modchannel);
unsigned int      (F_API *FMUSIC_GetUserData)(FMUSIC_MODULE *mod);

} FMOD_INSTANCE;

static FMOD_INSTANCE *FMOD_CreateInstance(char *dllName)
{
FMOD_INSTANCE *instance;

instance = (FMOD_INSTANCE *)calloc(sizeof(FMOD_INSTANCE), 1);
if (!instance)
{
    return NULL;
}

instance-&gt;module = LoadLibrary(dllName);
if (!instance-&gt;module)
{
    free(instance);
    return NULL;
}

#define F_GETPROC(_x, _y)                                                                       \
{                                                                                             \
    *((unsigned int *)&amp;instance-&gt;_x) = (unsigned int)GetProcAddress((HMODULE)instance-&gt;module, _y);    \
    if (!instance-&gt;_x)                                                                        \
    {                                                                                         \
        FreeLibrary((HMODULE)instance-&gt;module);                                                        \
        free(instance);                                                                       \
        return NULL;                                                                          \
    }                                                                                         \
}

F_GETPROC(FSOUND_SetOutput, &quot;_FSOUND_SetOutput@4&quot;);
F_GETPROC(FSOUND_SetDriver, &quot;_FSOUND_SetDriver@4&quot;);
F_GETPROC(FSOUND_SetMixer, &quot;_FSOUND_SetMixer@4&quot;);
F_GETPROC(FSOUND_SetBufferSize, &quot;_FSOUND_SetBufferSize@4&quot;);
F_GETPROC(FSOUND_SetHWND, &quot;_FSOUND_SetHWND@4&quot;);
F_GETPROC(FSOUND_SetMinHardwareChannels, &quot;_FSOUND_SetMinHardwareChannels@4&quot;);
F_GETPROC(FSOUND_SetMaxHardwareChannels, &quot;_FSOUND_SetMaxHardwareChannels@4&quot;);
F_GETPROC(FSOUND_SetMemorySystem, &quot;_FSOUND_SetMemorySystem@20&quot;);
F_GETPROC(FSOUND_Init, &quot;_FSOUND_Init@12&quot;);
F_GETPROC(FSOUND_Close, &quot;_FSOUND_Close@0&quot;);
F_GETPROC(FSOUND_SetSFXMasterVolume, &quot;_FSOUND_SetSFXMasterVolume@4&quot;);
F_GETPROC(FSOUND_SetPanSeperation, &quot;_FSOUND_SetPanSeperation@4&quot;);
F_GETPROC(FSOUND_SetSpeakerMode, &quot;_FSOUND_SetSpeakerMode@4&quot;);
F_GETPROC(FSOUND_GetError, &quot;_FSOUND_GetError@0&quot;);
F_GETPROC(FSOUND_GetVersion, &quot;_FSOUND_GetVersion@0&quot;);
F_GETPROC(FSOUND_GetOutput, &quot;_FSOUND_GetOutput@0&quot;);
F_GETPROC(FSOUND_GetOutputHandle, &quot;_FSOUND_GetOutputHandle@0&quot;);
F_GETPROC(FSOUND_GetDriver, &quot;_FSOUND_GetDriver@0&quot;);
F_GETPROC(FSOUND_GetMixer, &quot;_FSOUND_GetMixer@0&quot;);
F_GETPROC(FSOUND_GetNumDrivers, &quot;_FSOUND_GetNumDrivers@0&quot;);
F_GETPROC(FSOUND_GetDriverName, &quot;_FSOUND_GetDriverName@4&quot;);
F_GETPROC(FSOUND_GetDriverCaps, &quot;_FSOUND_GetDriverCaps@8&quot;);
F_GETPROC(FSOUND_GetOutputRate, &quot;_FSOUND_GetOutputRate@0&quot;);
F_GETPROC(FSOUND_GetMaxChannels, &quot;_FSOUND_GetMaxChannels@0&quot;);
F_GETPROC(FSOUND_GetMaxSamples, &quot;_FSOUND_GetMaxSamples@0&quot;);
F_GETPROC(FSOUND_GetSFXMasterVolume, &quot;_FSOUND_GetSFXMasterVolume@0&quot;);
F_GETPROC(FSOUND_GetNumHardwareChannels, &quot;_FSOUND_GetNumHardwareChannels@0&quot;);
F_GETPROC(FSOUND_GetChannelsPlaying, &quot;_FSOUND_GetChannelsPlaying@0&quot;);
F_GETPROC(FSOUND_GetCPUUsage, &quot;_FSOUND_GetCPUUsage@0&quot;);
F_GETPROC(FSOUND_GetMemoryStats, &quot;_FSOUND_GetMemoryStats@8&quot;);
F_GETPROC(FSOUND_Sample_Load, &quot;_FSOUND_Sample_Load@20&quot;);
F_GETPROC(FSOUND_Sample_Alloc, &quot;_FSOUND_Sample_Alloc@28&quot;);
F_GETPROC(FSOUND_Sample_Free, &quot;_FSOUND_Sample_Free@4&quot;);
F_GETPROC(FSOUND_Sample_Upload, &quot;_FSOUND_Sample_Upload@12&quot;);
F_GETPROC(FSOUND_Sample_Lock, &quot;_FSOUND_Sample_Lock@28&quot;);
F_GETPROC(FSOUND_Sample_Unlock, &quot;_FSOUND_Sample_Unlock@20&quot;);
F_GETPROC(FSOUND_Sample_SetMode, &quot;_FSOUND_Sample_SetMode@8&quot;);
F_GETPROC(FSOUND_Sample_SetLoopPoints, &quot;_FSOUND_Sample_SetLoopPoints@12&quot;);
F_GETPROC(FSOUND_Sample_SetDefaults, &quot;_FSOUND_Sample_SetDefaults@20&quot;);
F_GETPROC(FSOUND_Sample_SetMinMaxDistance, &quot;_FSOUND_Sample_SetMinMaxDistance@12&quot;);
F_GETPROC(FSOUND_Sample_SetMaxPlaybacks, &quot;_FSOUND_Sample_SetMaxPlaybacks@8&quot;);
F_GETPROC(FSOUND_Sample_Get, &quot;_FSOUND_Sample_Get@4&quot;);
F_GETPROC(FSOUND_Sample_GetName, &quot;_FSOUND_Sample_GetName@4&quot;);
F_GETPROC(FSOUND_Sample_GetLength, &quot;_FSOUND_Sample_GetLength@4&quot;);
F_GETPROC(FSOUND_Sample_GetLoopPoints, &quot;_FSOUND_Sample_GetLoopPoints@12&quot;);
F_GETPROC(FSOUND_Sample_GetDefaults, &quot;_FSOUND_Sample_GetDefaults@20&quot;);
F_GETPROC(FSOUND_Sample_GetMode, &quot;_FSOUND_Sample_GetMode@4&quot;);
F_GETPROC(FSOUND_PlaySound, &quot;_FSOUND_PlaySound@8&quot;);
F_GETPROC(FSOUND_PlaySoundEx, &quot;_FSOUND_PlaySoundEx@16&quot;);
F_GETPROC(FSOUND_StopSound, &quot;_FSOUND_StopSound@4&quot;);
F_GETPROC(FSOUND_SetFrequency, &quot;_FSOUND_SetFrequency@8&quot;);
F_GETPROC(FSOUND_SetVolume, &quot;_FSOUND_SetVolume@8&quot;);
F_GETPROC(FSOUND_SetVolumeAbsolute, &quot;_FSOUND_SetVolumeAbsolute@8&quot;);
F_GETPROC(FSOUND_SetPan, &quot;_FSOUND_SetPan@8&quot;);
F_GETPROC(FSOUND_SetSurround, &quot;_FSOUND_SetSurround@8&quot;);
F_GETPROC(FSOUND_SetMute, &quot;_FSOUND_SetMute@8&quot;);
F_GETPROC(FSOUND_SetPriority, &quot;_FSOUND_SetPriority@8&quot;);
F_GETPROC(FSOUND_SetReserved, &quot;_FSOUND_SetReserved@8&quot;);
F_GETPROC(FSOUND_SetPaused, &quot;_FSOUND_SetPaused@8&quot;);
F_GETPROC(FSOUND_SetLoopMode, &quot;_FSOUND_SetLoopMode@8&quot;);
F_GETPROC(FSOUND_IsPlaying, &quot;_FSOUND_IsPlaying@4&quot;);
F_GETPROC(FSOUND_GetFrequency, &quot;_FSOUND_GetFrequency@4&quot;);
F_GETPROC(FSOUND_GetVolume, &quot;_FSOUND_GetVolume@4&quot;);
F_GETPROC(FSOUND_GetPan, &quot;_FSOUND_GetPan@4&quot;);
F_GETPROC(FSOUND_GetSurround, &quot;_FSOUND_GetSurround@4&quot;);
F_GETPROC(FSOUND_GetMute, &quot;_FSOUND_GetMute@4&quot;);
F_GETPROC(FSOUND_GetPriority, &quot;_FSOUND_GetPriority@4&quot;);
F_GETPROC(FSOUND_GetReserved, &quot;_FSOUND_GetReserved@4&quot;);
F_GETPROC(FSOUND_GetPaused, &quot;_FSOUND_GetPaused@4&quot;);
F_GETPROC(FSOUND_GetLoopMode, &quot;_FSOUND_GetLoopMode@4&quot;);
F_GETPROC(FSOUND_GetCurrentPosition, &quot;_FSOUND_GetCurrentPosition@4&quot;);
F_GETPROC(FSOUND_SetCurrentPosition, &quot;_FSOUND_SetCurrentPosition@8&quot;);
F_GETPROC(FSOUND_GetCurrentSample, &quot;_FSOUND_GetCurrentSample@4&quot;);
F_GETPROC(FSOUND_GetCurrentLevels, &quot;_FSOUND_GetCurrentLevels@12&quot;);
F_GETPROC(FSOUND_FX_Enable, &quot;_FSOUND_FX_Enable@8&quot;);
F_GETPROC(FSOUND_FX_Disable, &quot;_FSOUND_FX_Disable@4&quot;);
F_GETPROC(FSOUND_FX_SetChorus, &quot;_FSOUND_FX_SetChorus@32&quot;);
F_GETPROC(FSOUND_FX_SetCompressor, &quot;_FSOUND_FX_SetCompressor@28&quot;);
F_GETPROC(FSOUND_FX_SetDistortion, &quot;_FSOUND_FX_SetDistortion@24&quot;);
F_GETPROC(FSOUND_FX_SetEcho, &quot;_FSOUND_FX_SetEcho@24&quot;);
F_GETPROC(FSOUND_FX_SetFlanger, &quot;_FSOUND_FX_SetFlanger@32&quot;);
F_GETPROC(FSOUND_FX_SetGargle, &quot;_FSOUND_FX_SetGargle@12&quot;);
F_GETPROC(FSOUND_FX_SetI3DL2Reverb, &quot;_FSOUND_FX_SetI3DL2Reverb@52&quot;);
F_GETPROC(FSOUND_FX_SetParamEQ, &quot;_FSOUND_FX_SetParamEQ@16&quot;);
F_GETPROC(FSOUND_FX_SetWavesReverb, &quot;_FSOUND_FX_SetWavesReverb@20&quot;);
F_GETPROC(FSOUND_Update, &quot;_FSOUND_Update@0&quot;);
F_GETPROC(FSOUND_3D_SetAttributes, &quot;_FSOUND_3D_SetAttributes@12&quot;);
F_GETPROC(FSOUND_3D_GetAttributes, &quot;_FSOUND_3D_GetAttributes@12&quot;);
F_GETPROC(FSOUND_3D_Listener_SetCurrent, &quot;_FSOUND_3D_Listener_SetCurrent@8&quot;);
F_GETPROC(FSOUND_3D_Listener_SetAttributes, &quot;_FSOUND_3D_Listener_SetAttributes@32&quot;);
F_GETPROC(FSOUND_3D_Listener_GetAttributes, &quot;_FSOUND_3D_Listener_GetAttributes@32&quot;);
F_GETPROC(FSOUND_3D_SetDopplerFactor, &quot;_FSOUND_3D_SetDopplerFactor@4&quot;);
F_GETPROC(FSOUND_3D_SetDistanceFactor, &quot;_FSOUND_3D_SetDistanceFactor@4&quot;);
F_GETPROC(FSOUND_3D_SetRolloffFactor, &quot;_FSOUND_3D_SetRolloffFactor@4&quot;);
F_GETPROC(FSOUND_Stream_Open, &quot;_FSOUND_Stream_Open@16&quot;);
F_GETPROC(FSOUND_Stream_Create, &quot;_FSOUND_Stream_Create@20&quot;);
F_GETPROC(FSOUND_Stream_Play, &quot;_FSOUND_Stream_Play@8&quot;);
F_GETPROC(FSOUND_Stream_PlayEx, &quot;_FSOUND_Stream_PlayEx@16&quot;);
F_GETPROC(FSOUND_Stream_Stop, &quot;_FSOUND_Stream_Stop@4&quot;);
F_GETPROC(FSOUND_Stream_Close, &quot;_FSOUND_Stream_Close@4&quot;);
F_GETPROC(FSOUND_Stream_SetEndCallback, &quot;_FSOUND_Stream_SetEndCallback@12&quot;);
F_GETPROC(FSOUND_Stream_SetSyncCallback, &quot;_FSOUND_Stream_SetSyncCallback@12&quot;);
F_GETPROC(FSOUND_Stream_GetSample, &quot;_FSOUND_Stream_GetSample@4&quot;);
F_GETPROC(FSOUND_Stream_CreateDSP, &quot;_FSOUND_Stream_CreateDSP@16&quot;);
F_GETPROC(FSOUND_Stream_SetBufferSize, &quot;_FSOUND_Stream_SetBufferSize@4&quot;);
F_GETPROC(FSOUND_Stream_SetPosition, &quot;_FSOUND_Stream_SetPosition@8&quot;);
F_GETPROC(FSOUND_Stream_GetPosition, &quot;_FSOUND_Stream_GetPosition@4&quot;);
F_GETPROC(FSOUND_Stream_SetTime, &quot;_FSOUND_Stream_SetTime@8&quot;);
F_GETPROC(FSOUND_Stream_GetTime, &quot;_FSOUND_Stream_GetTime@4&quot;);
F_GETPROC(FSOUND_Stream_GetLength, &quot;_FSOUND_Stream_GetLength@4&quot;);
F_GETPROC(FSOUND_Stream_GetLengthMs, &quot;_FSOUND_Stream_GetLengthMs@4&quot;);
F_GETPROC(FSOUND_Stream_SetMode, &quot;_FSOUND_Stream_SetMode@8&quot;);
F_GETPROC(FSOUND_Stream_GetMode, &quot;_FSOUND_Stream_GetMode@4&quot;);
F_GETPROC(FSOUND_Stream_SetSubStream, &quot;_FSOUND_Stream_SetSubStream@8&quot;);
F_GETPROC(FSOUND_Stream_GetNumSubStreams, &quot;_FSOUND_Stream_GetNumSubStreams@4&quot;);
F_GETPROC(FSOUND_Stream_SetSubStreamSentence, &quot;_FSOUND_Stream_SetSubStreamSentence@12&quot;);
F_GETPROC(FSOUND_Stream_SetLoopPoints, &quot;_FSOUND_Stream_SetLoopPoints@12&quot;);
F_GETPROC(FSOUND_Stream_SetLoopCount, &quot;_FSOUND_Stream_SetLoopCount@8&quot;);
F_GETPROC(FSOUND_Stream_AddSyncPoint, &quot;_FSOUND_Stream_AddSyncPoint@12&quot;);
F_GETPROC(FSOUND_Stream_DeleteSyncPoint, &quot;_FSOUND_Stream_DeleteSyncPoint@4&quot;);
F_GETPROC(FSOUND_Stream_GetNumSyncPoints, &quot;_FSOUND_Stream_GetNumSyncPoints@4&quot;);
F_GETPROC(FSOUND_Stream_GetSyncPoint, &quot;_FSOUND_Stream_GetSyncPoint@8&quot;);
F_GETPROC(FSOUND_Stream_GetSyncPointInfo, &quot;_FSOUND_Stream_GetSyncPointInfo@8&quot;);
F_GETPROC(FSOUND_Stream_GetOpenState, &quot;_FSOUND_Stream_GetOpenState@4&quot;);
F_GETPROC(FSOUND_Stream_GetNumTagFields, &quot;_FSOUND_Stream_GetNumTagFields@8&quot;);
F_GETPROC(FSOUND_Stream_GetTagField, &quot;_FSOUND_Stream_GetTagField@24&quot;);
F_GETPROC(FSOUND_Stream_FindTagField, &quot;_FSOUND_Stream_FindTagField@20&quot;);
F_GETPROC(FSOUND_Stream_Net_SetProxy, &quot;_FSOUND_Stream_Net_SetProxy@4&quot;);
F_GETPROC(FSOUND_Stream_Net_GetLastServerStatus, &quot;_FSOUND_Stream_Net_GetLastServerStatus@0&quot;);
F_GETPROC(FSOUND_Stream_Net_SetBufferProperties, &quot;_FSOUND_Stream_Net_SetBufferProperties@12&quot;);
F_GETPROC(FSOUND_Stream_Net_GetBufferProperties, &quot;_FSOUND_Stream_Net_GetBufferProperties@12&quot;);
F_GETPROC(FSOUND_Stream_Net_SetMetadataCallback, &quot;_FSOUND_Stream_Net_SetMetadataCallback@12&quot;);
F_GETPROC(FSOUND_Stream_Net_GetStatus, &quot;_FSOUND_Stream_Net_GetStatus@20&quot;);
F_GETPROC(FSOUND_CD_Play, &quot;_FSOUND_CD_Play@8&quot;);
F_GETPROC(FSOUND_CD_SetPlayMode, &quot;_FSOUND_CD_SetPlayMode@8&quot;);
F_GETPROC(FSOUND_CD_Stop, &quot;_FSOUND_CD_Stop@4&quot;);
F_GETPROC(FSOUND_CD_SetPaused, &quot;_FSOUND_CD_SetPaused@8&quot;);
F_GETPROC(FSOUND_CD_SetVolume, &quot;_FSOUND_CD_SetVolume@8&quot;);
F_GETPROC(FSOUND_CD_SetTrackTime, &quot;_FSOUND_CD_SetTrackTime@8&quot;);
F_GETPROC(FSOUND_CD_Eject, &quot;_FSOUND_CD_Eject@4&quot;);
F_GETPROC(FSOUND_CD_GetPaused, &quot;_FSOUND_CD_GetPaused@4&quot;);
F_GETPROC(FSOUND_CD_GetTrack, &quot;_FSOUND_CD_GetTrack@4&quot;);
F_GETPROC(FSOUND_CD_GetNumTracks, &quot;_FSOUND_CD_GetNumTracks@4&quot;);
F_GETPROC(FSOUND_CD_GetVolume, &quot;_FSOUND_CD_GetVolume@4&quot;);
F_GETPROC(FSOUND_CD_GetTrackLength, &quot;_FSOUND_CD_GetTrackLength@8&quot;);
F_GETPROC(FSOUND_CD_GetTrackTime, &quot;_FSOUND_CD_GetTrackTime@4&quot;);
F_GETPROC(FSOUND_DSP_Create, &quot;_FSOUND_DSP_Create@12&quot;);
F_GETPROC(FSOUND_DSP_Free, &quot;_FSOUND_DSP_Free@4&quot;);
F_GETPROC(FSOUND_DSP_SetPriority, &quot;_FSOUND_DSP_SetPriority@8&quot;);
F_GETPROC(FSOUND_DSP_GetPriority, &quot;_FSOUND_DSP_GetPriority@4&quot;);
F_GETPROC(FSOUND_DSP_SetActive, &quot;_FSOUND_DSP_SetActive@8&quot;);
F_GETPROC(FSOUND_DSP_GetActive, &quot;_FSOUND_DSP_GetActive@4&quot;);
F_GETPROC(FSOUND_DSP_GetClearUnit, &quot;_FSOUND_DSP_GetClearUnit@0&quot;);
F_GETPROC(FSOUND_DSP_GetSFXUnit, &quot;_FSOUND_DSP_GetSFXUnit@0&quot;);
F_GETPROC(FSOUND_DSP_GetMusicUnit, &quot;_FSOUND_DSP_GetMusicUnit@0&quot;);
F_GETPROC(FSOUND_DSP_GetClipAndCopyUnit, &quot;_FSOUND_DSP_GetClipAndCopyUnit@0&quot;);
F_GETPROC(FSOUND_DSP_GetFFTUnit, &quot;_FSOUND_DSP_GetFFTUnit@0&quot;);
F_GETPROC(FSOUND_DSP_MixBuffers, &quot;_FSOUND_DSP_MixBuffers@28&quot;);
F_GETPROC(FSOUND_DSP_ClearMixBuffer, &quot;_FSOUND_DSP_ClearMixBuffer@0&quot;);
F_GETPROC(FSOUND_DSP_GetBufferLength, &quot;_FSOUND_DSP_GetBufferLength@0&quot;);
F_GETPROC(FSOUND_DSP_GetBufferLengthTotal, &quot;_FSOUND_DSP_GetBufferLengthTotal@0&quot;);
F_GETPROC(FSOUND_DSP_GetSpectrum, &quot;_FSOUND_DSP_GetSpectrum@0&quot;);
F_GETPROC(FSOUND_Reverb_SetProperties, &quot;_FSOUND_Reverb_SetProperties@4&quot;);
F_GETPROC(FSOUND_Reverb_GetProperties, &quot;_FSOUND_Reverb_GetProperties@4&quot;);
F_GETPROC(FSOUND_Reverb_SetChannelProperties, &quot;_FSOUND_Reverb_SetChannelProperties@8&quot;);
F_GETPROC(FSOUND_Reverb_GetChannelProperties, &quot;_FSOUND_Reverb_GetChannelProperties@8&quot;);
F_GETPROC(FSOUND_Record_SetDriver, &quot;_FSOUND_Record_SetDriver@4&quot;);
F_GETPROC(FSOUND_Record_GetNumDrivers, &quot;_FSOUND_Record_GetNumDrivers@0&quot;);
F_GETPROC(FSOUND_Record_GetDriverName, &quot;_FSOUND_Record_GetDriverName@4&quot;);
F_GETPROC(FSOUND_Record_GetDriver, &quot;_FSOUND_Record_GetDriver@0&quot;);
F_GETPROC(FSOUND_Record_StartSample, &quot;_FSOUND_Record_StartSample@8&quot;);
F_GETPROC(FSOUND_Record_Stop, &quot;_FSOUND_Record_Stop@0&quot;);
F_GETPROC(FSOUND_Record_GetPosition, &quot;_FSOUND_Record_GetPosition@0&quot;);
F_GETPROC(FSOUND_File_SetCallbacks, &quot;_FSOUND_File_SetCallbacks@20&quot;);
F_GETPROC(FMUSIC_LoadSong, &quot;_FMUSIC_LoadSong@4&quot;);
F_GETPROC(FMUSIC_LoadSongEx, &quot;_FMUSIC_LoadSongEx@24&quot;);
F_GETPROC(FMUSIC_GetOpenState, &quot;_FMUSIC_GetOpenState@4&quot;);
F_GETPROC(FMUSIC_FreeSong, &quot;_FMUSIC_FreeSong@4&quot;);
F_GETPROC(FMUSIC_PlaySong, &quot;_FMUSIC_PlaySong@4&quot;);
F_GETPROC(FMUSIC_StopSong, &quot;_FMUSIC_StopSong@4&quot;);
F_GETPROC(FMUSIC_StopAllSongs, &quot;_FMUSIC_StopAllSongs@0&quot;);
F_GETPROC(FMUSIC_SetZxxCallback, &quot;_FMUSIC_SetZxxCallback@8&quot;);
F_GETPROC(FMUSIC_SetRowCallback, &quot;_FMUSIC_SetRowCallback@12&quot;);
F_GETPROC(FMUSIC_SetOrderCallback, &quot;_FMUSIC_SetOrderCallback@12&quot;);
F_GETPROC(FMUSIC_SetInstCallback, &quot;_FMUSIC_SetInstCallback@12&quot;);
F_GETPROC(FMUSIC_SetSample, &quot;_FMUSIC_SetSample@12&quot;);
F_GETPROC(FMUSIC_SetUserData, &quot;_FMUSIC_SetUserData@8&quot;);
F_GETPROC(FMUSIC_OptimizeChannels, &quot;_FMUSIC_OptimizeChannels@12&quot;);
F_GETPROC(FMUSIC_SetReverb, &quot;_FMUSIC_SetReverb@4&quot;);
F_GETPROC(FMUSIC_SetLooping, &quot;_FMUSIC_SetLooping@8&quot;);
F_GETPROC(FMUSIC_SetOrder, &quot;_FMUSIC_SetOrder@8&quot;);
F_GETPROC(FMUSIC_SetPaused, &quot;_FMUSIC_SetPaused@8&quot;);
F_GETPROC(FMUSIC_SetMasterVolume, &quot;_FMUSIC_SetMasterVolume@8&quot;);
F_GETPROC(FMUSIC_SetMasterSpeed, &quot;_FMUSIC_SetMasterSpeed@8&quot;);
F_GETPROC(FMUSIC_SetPanSeperation, &quot;_FMUSIC_SetPanSeperation@8&quot;);
F_GETPROC(FMUSIC_GetName, &quot;_FMUSIC_GetName@4&quot;);
F_GETPROC(FMUSIC_GetType, &quot;_FMUSIC_GetType@4&quot;);
F_GETPROC(FMUSIC_GetNumOrders, &quot;_FMUSIC_GetNumOrders@4&quot;);
F_GETPROC(FMUSIC_GetNumPatterns, &quot;_FMUSIC_GetNumPatterns@4&quot;);
F_GETPROC(FMUSIC_GetNumInstruments, &quot;_FMUSIC_GetNumInstruments@4&quot;);
F_GETPROC(FMUSIC_GetNumSamples, &quot;_FMUSIC_GetNumSamples@4&quot;);
F_GETPROC(FMUSIC_GetNumChannels, &quot;_FMUSIC_GetNumChannels@4&quot;);
F_GETPROC(FMUSIC_GetSample, &quot;_FMUSIC_GetSample@8&quot;);
F_GETPROC(FMUSIC_GetPatternLength, &quot;_FMUSIC_GetPatternLength@8&quot;);
F_GETPROC(FMUSIC_IsFinished, &quot;_FMUSIC_IsFinished@4&quot;);
F_GETPROC(FMUSIC_IsPlaying, &quot;_FMUSIC_IsPlaying@4&quot;);
F_GETPROC(FMUSIC_GetMasterVolume, &quot;_FMUSIC_GetMasterVolume@4&quot;);
F_GETPROC(FMUSIC_GetGlobalVolume, &quot;_FMUSIC_GetGlobalVolume@4&quot;);
F_GETPROC(FMUSIC_GetOrder, &quot;_FMUSIC_GetOrder@4&quot;);
F_GETPROC(FMUSIC_GetPattern, &quot;_FMUSIC_GetPattern@4&quot;);
F_GETPROC(FMUSIC_GetSpeed, &quot;_FMUSIC_GetSpeed@4&quot;);
F_GETPROC(FMUSIC_GetBPM, &quot;_FMUSIC_GetBPM@4&quot;);
F_GETPROC(FMUSIC_GetRow, &quot;_FMUSIC_GetRow@4&quot;);
F_GETPROC(FMUSIC_GetPaused, &quot;_FMUSIC_GetPaused@4&quot;);
F_GETPROC(FMUSIC_GetTime, &quot;_FMUSIC_GetTime@4&quot;);
F_GETPROC(FMUSIC_GetRealChannel, &quot;_FMUSIC_GetRealChannel@8&quot;);
F_GETPROC(FMUSIC_GetUserData, &quot;_FMUSIC_GetUserData@4&quot;);

return instance;

}

static void FMOD_FreeInstance(FMOD_INSTANCE *instance)
{
if (instance)
{
if (instance->module)
{
FreeLibrary((HMODULE)instance->module);
}
free(instance);
}
}

endif[/code:22yk9gg5]

  • You must to post comments
0
0

Got It! ๐Ÿ˜ฎ

Will try to implement the code and see how we go.

Many Thanks. :) Talk Later

  • You must to post comments
Showing 9 results
Your Answer

Please first to submit.