interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls, ToolWin,
ActnMan, ActnCtrls, ActnMenus, XPStyleActnCtrls, Buttons, Grids, ValEdit,
ActnList, ShellCtrls, ImgList, Bass, BASS_FX, inifiles, ShellAPI, Menus;
const
cDefaultDevice = -1;
// Default Device Identifier
cSampleRate = 44100;
// PCM-Audio
cNumChannels = 2;
// Stereo
cBlockLength = 4;
// 2*2 Bytes pro Speicherblock im Buffer
cRecordingTime = 200;
// Millisekunden (10 - 500 ms / Default 100 ms)
c16BitAudio = 0;
// Flag für 16 Bit Audio
cMaxAudio = 32768;
// maximaler Pegel bei 16 Bit
cDefaultUser = 0;
// UserIdentifier (not used)
cDirectXPointer =
nil;
// Default-Pointer für DirectX Class Identifier
Le = 0;
// Left Channel
Ri = 1;
// Right Channel
type
WAVHDR =
packed record
riff:
array[0..3]
of Char;
len: DWord;
cWavFmt:
array[0..7]
of Char;
dwHdrLen: DWord;
wFormat: Word;
wNumChannels: Word;
dwSampleRate: DWord;
dwBytesPerSec: DWord;
wBlockAlign: Word;
wBitsPerSample: Word;
cData:
array[0..3]
of Char;
dwDataLen: DWord;
end;
type
TRecordForm =
class(TForm)
RecordControlBar: TControlBar;
RecordMainMenu: TActionMainMenuBar;
ListPnl: TPanel;
RecordSplitter: TSplitter;
RecorderPnl: TPanel;
RecordTimer: TTimer;
RecActionList: TActionList;
Rec: TAction;
Stop: TAction;
Play: TAction;
Start: TAction;
Previous: TAction;
Next: TAction;
Ende: TAction;
DiktatListView2: TShellListView;
ToolActionManager: TActionManager;
ActionToolBar1: TActionToolBar;
RecImageList: TImageList;
Save: TAction;
RecSaveDialog: TSaveDialog;
Open: TAction;
OpenDialog1: TOpenDialog;
RecImageList2: TImageList;
MenuActionManager: TActionManager;
VisualTimer: TTimer;
RecGroupBox: TGroupBox;
AufnahmeRadioGroup: TRadioGroup;
EndRadioButton: TRadioButton;
InsertRadioButton: TRadioButton;
OverWriteRadioButton: TRadioButton;
SettingsGroupBox: TGroupBox;
InputLbl: TLabel;
VolumeLbl: TLabel;
VolumePegelBar: TTrackBar;
RecordPegelBar: TTrackBar;
VisPanel: TPanel;
ProgressBar: TTrackBar;
VisPaintBox: TPaintBox;
SaveSend: TAction;
SendAs: TAction;
ShellPUM: TPopupMenu;
DictSendAs: TMenuItem;
DeletePrev: TAction;
DeleteFollowing: TAction;
InsPassage: TAction;
procedure SyncProc(
Handle: HSync; Channel, Data: DWORD; User: DWORD);
stdcall;
procedure FormActivate(Sender: TObject);
procedure SaveSendExecute(Sender: TObject);
procedure SendAsExecute(Sender: TObject);
procedure DiktatListView2DblClick(Sender: TObject);
procedure VisualTimerTimer(Sender: TObject);
procedure OpenExecute(Sender: TObject);
procedure SaveExecute(Sender: TObject);
procedure EndeExecute(Sender: TObject);
procedure StartExecute(Sender: TObject);
procedure PlayExecute(Sender: TObject);
procedure StopExecute(Sender: TObject);
procedure RecExecute(Sender: TObject);
procedure ProgressBarChange(Sender: TObject);
procedure VolumePegelBarChange(Sender: TObject);
procedure RecordPegelBarChange(Sender: TObject);
procedure RecordTimerTimer(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure StartRecording;
procedure StopRecording;
const
um_MusicEnd = wm_User + 400;
private
EndSync: HSync;
WaveStream: TMemoryStream;
BufStream: TMemoryStream;
ChannelVol: Integer;
procedure ToggleStatus(
const Status: Integer);
procedure ReadConfig;
protected
procedure MusicEnd(
var Msg: TMessage);
message um_MusicEnd;
public
FRecordingsPath, User:
string;
AnhangDir:
String;
end;
var
RecordForm: TRecordForm;
WaveHdr: WAVHDR;
// WAV header
rchan: HRECORD;
// Aufnahmekanal
chan: HSTREAM;
// Wiedergabekanal
mic: integer;
volume: Float;
input: Float;