Nicolas___
Messages postés
992
Date d'inscription
jeudi 2 novembre 2000
Statut
Membre
Dernière intervention
24 avril 2013
1
4 juin 2009 à 22:14
oui, c'est ca :)
ou l'as tu trouvé ?
moi je l'ai mais en version dynamique (mais c'est une vieille version ) :
unit cst_Dynamic_Bassvst;
interface
uses
Windows;
const
BASS_VST_PARAM_CHANGED = 1;
BASS_VST_EDITOR_RESIZED = 2;
BASS_VST_AUDIO_MASTER = 3;
BASS_VST_ERROR_NOINPUTS = 3000;
// the given effect has no inputs and is probably a VST instrument and no effect
BASS_VST_ERROR_NOOUTPUTS = 3001; // the given effect has no outputs
BASS_VST_ERROR_NOREALTIME = 3002; // the given effect does not support realtime processing
BASS_VST_KEEP_CHANS = 1; (*By default, mono effects assigned to stereo channels
are mixed down before processing and converted back
to stereo afterwards. Set this flag to avoid this
behaviour in which case only the first channel is
affected by processing.*)
type
BASS_VST_PARAM_INFO = record
name: array[0..15] of Char; // examples: Time, Gain, RoomType
FUnit: array[0..15] of Char; // examples: sec, dB, type
Display: array[0..15] of Char;
// the current value in a readable format, examples: 0.5, -3, PLATE
defaultValue: single; // the default value
end;
BASS_VST_INFO = record
ChannelHandle: DWORD; // the channelHandle as given to BASS_VST_ChannelSetDSP()
uniqueID: DWORD; // a unique ID for the effect (the IDs are registered at Steinberg)
effectName: array[0..79] of Char; // the effect name
effectVersion: DWORD; // the effect version
effectVstVersion: DWORD; // the VST version, the effect was written for
hostVstVersion: DWORD; // the VST version supported by BASS_VST, currently 2.4
productName: array[0..79] of Char; // the product name, may be empty
vendorName: array[0..79] of Char; // the vendor name, may be empty
vendorVersion: DWORD; // vendor-specific version number
chansIn: DWORD; // max. number of possible input channels
chansOut: DWORD; // max. number of possible output channels
initialDelay: DWORD; // for algorithms which need input in the first place, in milliseconds
hasEditor: DWORD; // can the BASS_VST_EmbedEditor() function be called?
editorWidth: DWORD; // initial/current width of the editor, also note BASS_VST_EDITOR_RESIZED
editorHeight: DWORD; // initial/current height of the editor, also note BASS_VST_EDITOR_RESIZED
aeffect: Pointer; // the underlying AEffect object (see the VST SDK)
isInstrument : DWORD; //1=the VST plugin is an instrument, 0=the VST plugin is an effect *)
dspHandle : DWORD;
end;
VSTPROC = procedure(vstHandle: DWORD; Action: DWORD; Param1, Param2, User: DWORD); stdcall;
var
BASS_VST_ChannelSetDSP: function(ChanHandle: DWORD; const DLLFile: PChar; flags: DWORD; priority:
Integer): DWORD; stdcall;
BASS_VST_ChannelRemoveDSP: function(ChanHandle: DWORD; vstHandle: DWORD): BOOL; stdcall;
BASS_VST_EmbedEditor: function(vstHandle: DWORD; ParentWindow: hwnd): BOOL; stdcall;
BASS_VST_GetInfo: function(vstHandle: DWORD; pInfo: pointer): BOOL; stdcall;
BASS_VST_GetParam: function(vstHandle: DWORD; paramIndex: integer): single; stdcall;
BASS_VST_SetParam: function(vstHandle: DWORD; paramIndex: integer; value: single): BOOL; stdcall;
BASS_VST_GetParamCount: function(vstHandle: DWORD): integer; stdcall;
BASS_VST_GetParamInfo: function(vstHandle: DWORD; paramIndex: Integer; var Info:
BASS_VST_PARAM_INFO): boolean; stdcall;
BASS_VST_Resume: function(vstHandle: DWORD): BOOL; stdcall;
BASS_VST_SetCallback: function(vstHandle: DWORD; PROC: Pointer; user: DWORD): BOOL; stdcall;
BASS_VST_SetLanguage: function(const Lang: PChar): BOOL; stdcall;
BASS_VST_GetBypass: function(vstHandle: DWORD): DWORD; stdcall;
BASS_VST_SetBypass: function(vstHandle: DWORD; state: boolean): BOOL; stdcall;
BASS_VST_GetProgramParam: function(vstHandle: DWORD; programIndex: Integer): PSingle; stdcall;
BASS_VST_SetProgramParam: function(vstHandle: DWORD; programIndex: Integer; const param:
PSingle): BOOL; stdcall;
BASS_VST_GetProgramCount: function(vstHandle: DWORD): Integer; stdcall;
BASS_VST_GetProgram: function(vstHandle: DWORD): Integer; stdcall;
BASS_VST_SetProgram: function(vstHandle: DWORD; programIndex: Integer): BOOL; stdcall;
BASS_VST_GetProgramName: function(vstHandle: DWORD; programIndex: Integer): PChar; stdcall;
BASS_VST_SetProgramName: function(vstHandle: DWORD; programIndex: Integer; const name: PChar):
BOOL; stdcall;
var
BASSVST_Handle: Thandle = 0;
function Load_BASSVST(const dllfilename: string): boolean;
procedure Unload_BASSVST;
implementation
function Load_BASSVST(const dllfilename: string): boolean;
var
oldmode: integer;
begin
if BASSVST_Handle <> 0 then
result := true
else
begin
oldmode := SetErrorMode($8001);
BASSVST_Handle := LoadLibrary(pchar(dllfilename));
SetErrorMode(oldmode);
if BASSVST_Handle <> 0 then
begin
@BASS_VST_ChannelSetDSP := GetProcAddress(BASSVST_Handle, 'BASS_VST_ChannelSetDSP');
@BASS_VST_ChannelRemoveDSP := GetProcAddress(BASSVST_Handle, 'BASS_VST_ChannelRemoveDSP');
@BASS_VST_EmbedEditor := GetProcAddress(BASSVST_Handle, 'BASS_VST_EmbedEditor');
@BASS_VST_GetInfo := GetProcAddress(BASSVST_Handle, 'BASS_VST_GetInfo');
@BASS_VST_GetParam := GetProcAddress(BASSVST_Handle, 'BASS_VST_GetParam');
@BASS_VST_SetParam := GetProcAddress(BASSVST_Handle, 'BASS_VST_SetParam');
@BASS_VST_GetParamCount := GetProcAddress(BASSVST_Handle, 'BASS_VST_GetParamCount');
@BASS_VST_GetParamInfo := GetProcAddress(BASSVST_Handle, 'BASS_VST_GetParamInfo');
@BASS_VST_Resume := GetProcAddress(BASSVST_Handle, 'BASS_VST_Resume');
@BASS_VST_SetCallback := GetProcAddress(BASSVST_Handle, 'BASS_VST_SetCallback');
@BASS_VST_SetLanguage := GetProcAddress(BASSVST_Handle, 'BASS_VST_SetLanguage');
@BASS_VST_GetBypass := GetProcAddress(BASSVST_Handle, 'BASS_VST_GetBypass');
@BASS_VST_SetBypass := GetProcAddress(BASSVST_Handle, 'BASS_VST_SetBypass');
@BASS_VST_GetProgramParam := GetProcAddress(BASSVST_Handle, 'BASS_VST_GetProgramParam');
@BASS_VST_SetProgramParam := GetProcAddress(BASSVST_Handle, 'BASS_VST_SetProgramParam');
@BASS_VST_GetProgramCount := GetProcAddress(BASSVST_Handle, 'BASS_VST_GetProgramCount');
@BASS_VST_GetProgram := GetProcAddress(BASSVST_Handle, 'BASS_VST_GetProgram');
@BASS_VST_SetProgram := GetProcAddress(BASSVST_Handle, 'BASS_VST_SetProgram');
@BASS_VST_GetProgramName := GetProcAddress(BASSVST_Handle, 'BASS_VST_GetProgramName');
@BASS_VST_SetProgramName := GetProcAddress(BASSVST_Handle, 'BASS_VST_SetProgramName');
if (@BASS_VST_ChannelSetDSP = nil) or
(@BASS_VST_ChannelRemoveDSP = nil) or
(@BASS_VST_EmbedEditor = nil) or
(@BASS_VST_GetInfo = nil) or
(@BASS_VST_GetParam = nil) or
(@BASS_VST_SetParam = nil) or
(@BASS_VST_GetParamCount = nil) or
(@BASS_VST_GetParamInfo = nil) or
(@BASS_VST_Resume = nil) or
(@BASS_VST_SetCallback = nil) or
(@BASS_VST_SetLanguage = nil) or
(@BASS_VST_GetBypass = nil) or
(@BASS_VST_SetBypass = nil) or
(@BASS_VST_GetProgramParam = nil) or
(@BASS_VST_SetProgramParam = nil) or
(@BASS_VST_GetProgramCount = nil) or
(@BASS_VST_GetProgram = nil) or
(@BASS_VST_SetProgram = nil) or
(@BASS_VST_GetProgramName = nil) or
(@BASS_VST_SetProgramName = nil) then
begin
MessageBox(0, PChar('Error'), PChar('Error'), 16);
FreeLibrary(BASSVST_Handle);
BASSVST_Handle := 0;
end;
end;
result := (BASSVST_Handle <> 0);
end;
end;
procedure Unload_BASSVST;
begin
if BASSVST_Handle <> 0 then
FreeLibrary(BASSVST_Handle);
BASSVST_Handle := 0;
end;
end.
(si ca peux t'être utile ... )