波形相关的类 |
// PasteFromTo modes |
0: insert |
1: replace |
2: mix |
--- |
// NormalizeFormat Mode flags (combine as needed) |
NF_NumChannels: normalize the number of channels |
NF_Format: normalize the sample format |
NF_Samplerate: normalize the samplerate |
NF_All: normalize all (combines all flags) |
--- |
// region |
TRegion = class |
constructor Create; |
procedure Copy(Source: TRegion); |
property SampleStart: integer; |
property SampleEnd: integer; |
property Name: string; |
property Info: string; |
property Time: single; |
property KeyNum: integer; |
end; |
--- |
// sample |
TSample = class |
constructor Create; |
function GetSampleAt(Position, Channel: integer): single; |
procedure SetSampleAt(Position, Channel: integer; Value: single); |
procedure CenterFromTo(x1, x2: integer); |
function NormalizeFromTo(x1, x2: integer; Vol: single; OnlyIfAbove: boolean = FALSE): single; |
procedure AmpFromTo(x1, x2: integer; Vol: single); |
procedure ReverseFromTo(x1, x2: integer); |
procedure ReversePolarityFromTo(x1, x2: integer); |
procedure SwapChannelsFromTo(x1, x2: integer); |
procedure InsertSilence(x1, x2: integer); |
procedure SilenceFromTo(x1, x2: integer); |
procedure NoiseFromTo(x1, x2: integer; Mode: integer = 1; Vol: single = 1); |
procedure SineFromTo(x1, x2: integer; Freq, Phase: double; Vol: single = 1); |
procedure PasteFromTo(aSample: TSample; var x1, x2: integer; Mode: integer = 0); |
procedure LoadFromClipboard; |
procedure DeleteFromTo(x1, x2: integer; Copy: boolean = FALSE); |
procedure TrimFromTo(x1, x2: integer); |
function MsToSamples(Time: double): double; |
function SamplesToMS(Time: double): double; |
procedure LoadFromFile(const Filename: string); // loads a full filename (use ScriptPath to complete it) |
procedure LoadFromFile_Ask; // shows open dialog |
procedure NormalizeFormat(Source: TSample; Mode: integer = nfAll); |
function GetRegion(Index: integer): TRegion; |
function AddRegion(const SetName: string; SampleStart: integer; SampleEnd: integer = MaxInt): integer; |
procedure DeleteRegion(Index: integer); |
property Length: integer; |
property NumChans: integer; |
property Samplerate: integer; |
property RegionCount: integer; |
end; |
--- |
// editor |
TEditor = class |
function GetSelectionS(var x1, x2: integer): boolean; |
function GetSelectionMS(var x1, x2: double): boolean; |
property Sample: TSample; |
end; |
对话框类和函数 |
TInput = class |
property DefaultValue: single; |
property ValueAsInt: integer; |
property Min: single; |
property Max: single; |
end; |
--- |
TScriptDialog = class |
constructor Create; |
function AddInput(const aName: string; Value: single): TInput; |
function AddInputKnob(const aName: string; Value, Min, Max: single): TInput; |
function AddInputCombo(const aName, ValueList: string; Value: integer): TInput; |
function GetInput(const aName: string): TInput; |
function GetInputValue(const aName: string): single; |
function GetInputValueAsInt(const aName: string): integer; |
function Execute: boolean; |
end; |
--- |
function CreateScriptDialog(const Title, Description: string): TScriptDialog; |