http://www.websound.ru/articles/technol/3dsound.htm (22.05.2006).
http://www.websound.ru/articles/processing/effects.htm (22.05.2006).
http://www.ixbt.com/multimedia/theory-of-reverb.shtml (22.05.2006).
http://www.websound.ru/articles/theory/sound-theory.htm (22.05.2006).
http://www.websound.ru/articles/theory/sound-theory.htm (22.05.2006).
http://www.websound.ru/articles/theory/sound-theory.htm (22.05.2006).
31.Мандел Т. Разработка пользовательского интерфейса. ДМК Пресс, 2001.
32.Э. Гамма, Р. Хелм, Р. Джонсон, Дж. Влиссидес. Приемы объектно-ориентированного проектирования. Паттерны проектирования. – С-Пб.: Питер, 2001.
33.ГОСТ 19.505-79 ЕСПД. Руководство оператора. Требования к содержанию и оформлению. – М.: Издательство стандартов, 1979.
35.ГОСТ 19.701-90 ЕСПД. Схемы алгоритмов и программ. Правила выполнения. – М.: Издательство стандартов, 1991.
36.ГОСТ 12.0.002-80 ССБТ. Термины и определения. – М.: Издательство стандартов, 1980.
37.Соболева В.П. Методические указания по оформлению курсовых работ, курсовых и дипломных проектов. – Ижевск: Издательство ИМИ, 2003.
38.Почерняев С.В., Килин И.В. Методические указания по дипломному проектированию. – Ижевск: Издательство ИжГТУ, 1994.
39.Технико-экономическое обоснование дипломных проектов при разработке приборов и методов контроля качества. – Ижевск: Издательство ИжГТУ, 2001.
П. 1.1. ТЕКСТ МОДУЛЯ MAIN.PAS
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, ComCtrls, Spin,
MMSystem, ShellApi, FileUtils, AudioFormat,
PCM_Format, MP3_Format, EM1_Format, Menus, Help, AudioForm, MP3Form, EffectsForm;
type
TMainForm = class(TForm)
OutDeviceComboBox: TComboBox;
InDeviceComboBox: TComboBox;
TrackBar: TTrackBar;
PlayButton: TSpeedButton;
PauseButton: TSpeedButton;
RecordButton: TSpeedButton;
OpenButton: TSpeedButton;
SaveButton: TSpeedButton;
TimePosition: TStaticText;
PositionSpinEdit: TSpinEdit;
OpenDialog: TOpenDialog;
Marker1: TBitBtn;
Marker2: TBitBtn;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
SetMarkerButton: TButton;
DeleteMarkersButton: TButton;
CopyButton: TBitBtn;
CutButton: TBitBtn;
ClearButton: TBitBtn;
PasteButton: TBitBtn;
PasteFileButton: TBitBtn;
DeleteButton: TBitBtn;
TabSheet3: TTabSheet;
SetSpeedText: TStaticText;
SetVolumeText: TStaticText;
EffectButton: TButton;
EffectBox: TComboBox;
PaintBox1: TPaintBox;
WaveOutButton: TSpeedButton;
WaveInButton: TSpeedButton;
PasteSilenceButton: TButton;
CopyToFileButton: TBitBtn;
UndoButton: TBitBtn;
HelpButton: TBitBtn;
SaveDialog: TSaveDialog;
TabSheet9: TTabSheet;
BrainWaveButton: TButton;
BWFreqEdit1: TSpinEdit;
StaticText15: TStaticText;
BWFreqEdit2: TSpinEdit;
StaticText16: TStaticText;
SSelButton: TBitBtn;
FSelButton: TBitBtn;
StaticText4: TStaticText;
UndoCheckBox: TCheckBox;
EMailButton: TSpeedButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
BitBtn1: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
BitBtn2: TBitBtn;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
BitBtn7: TBitBtn;
BitBtn8: TBitBtn;
BitBtn9: TBitBtn;
BitBtn10: TBitBtn;
Button1: TBitBtn;
Button2: TBitBtn;
Button6: TBitBtn;
BitBtn13: TBitBtn;
BitBtn14: TBitBtn;
BitBtn15: TBitBtn;
BitBtn16: TBitBtn;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N11: TMenuItem;
N12: TMenuItem;
N13: TMenuItem;
N14: TMenuItem;
N15: TMenuItem;
N31: TMenuItem;
N30: TMenuItem;
N16: TMenuItem;
N17: TMenuItem;
N18: TMenuItem;
N19: TMenuItem;
N24: TMenuItem;
N20: TMenuItem;
N21: TMenuItem;
N22: TMenuItem;
N23: TMenuItem;
N25: TMenuItem;
N26: TMenuItem;
N27: TMenuItem;
N28: TMenuItem;
N29: TMenuItem;
N32: TMenuItem;
N33: TMenuItem;
N34: TMenuItem;
N35: TMenuItem;
N36: TMenuItem;
N37: TMenuItem;
N38: TMenuItem;
N39: TMenuItem;
N40: TMenuItem;
N41: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N42: TMenuItem;
SilenceTime: TSpinEdit;
Memo1: TMemo;
PasteModeComboBox: TComboBox;
PasteModeText: TStaticText;
Left10Button: TButton;
StaticText17: TStaticText;
Right10Button: TButton;
SpeedEdit: TSpinEdit;
VolumeEdit: TSpinEdit;
ChangeVolumeBitBtn: TBitBtn;
ChangeSpeedButton: TBitBtn;
SetSpeedBitBtn: TBitBtn;
SetVolumeBitBtn: TBitBtn;
ReverseButton: TBitBtn;
NormalizeBitBtn: TBitBtn;
PageControl2: TPageControl;
TabSheet4: TTabSheet;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
nSamplesPerSecText: TStaticText;
nSamplesPerSecButton: TButton;
nSamplesBox: TComboBox;
nBitsBox: TComboBox;
nBitsPerSampleButton: TButton;
nBitsPerSampleText: TStaticText;
nChannelsText: TStaticText;
nChannelsButton: TButton;
nChannelsBox: TComboBox;
TabSheet5: TTabSheet;
ConstantBitrateComboBox: TComboBox;
StaticText1: TStaticText;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
AverageBitrateComboBox: TComboBox;
VariableBitRateComboBox: TComboBox;
StaticText2: TStaticText;
StaticText3: TStaticText;
StereoModeComboBox: TComboBox;
TabSheet6: TTabSheet;
PageControl3: TPageControl;
TabSheet7: TTabSheet;
StaticText5: TStaticText;
nResponsesEdit: TSpinEdit;
ResponseTimeEdit: TSpinEdit;
ResponseVolumeEdit: TSpinEdit;
StaticText6: TStaticText;
StaticText7: TStaticText;
StaticText8: TStaticText;
StaticText9: TStaticText;
TabSheet8: TTabSheet;
nEchosEdit: TSpinEdit;
DelayEdit: TSpinEdit;
EchoVolumeEdit: TSpinEdit;
StaticText10: TStaticText;
StaticText11: TStaticText;
StaticText12: TStaticText;
StaticText13: TStaticText;
StaticText14: TStaticText;
N43: TMenuItem;
MP31: TMenuItem;
N44: TMenuItem;
ButtonZoomIn: TBitBtn;
ButtonZoomOut: TBitBtn;
AudioOptionsButton: TBitBtn;
MP3OptionsButton: TBitBtn;
EffOptionsButton: TBitBtn;
procedure FormCreate(Sender: TObject);
procedure OpenButtonClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure PlayButtonClick(Sender: TObject);
procedure PauseButtonClick(Sender: TObject);
procedure RecordButtonClick(Sender: TObject);
procedure TrackBarChange(Sender: TObject);
procedure PositionSpinEditChange(Sender: TObject);
procedure SaveButtonClick(Sender: TObject);
procedure SetMarkerButtonClick(Sender: TObject);
procedure DeleteMarkersButtonClick(Sender: TObject);
procedure CopyButtonClick(Sender: TObject);
procedure CutButtonClick(Sender: TObject);
procedure ClearButtonClick(Sender: TObject);
procedure PasteButtonClick(Sender: TObject);
procedure ReverseButtonClick(Sender: TObject);
procedure SetSpeedButtonClick(Sender: TObject);
procedure ChangePropertie(Sender: TObject);
procedure AboutButtonClick(Sender: TObject);
procedure HomePageLinkClick(Sender: TObject);
procedure SetVolumeButtonClick(Sender: TObject);
procedure DeleteButtonClick(Sender: TObject);
procedure NormalizeButtonClick(Sender: TObject);
procedure PasteSilenceButtonClick(Sender: TObject);
procedure SetSpeedBitBtnClick(Sender: TObject);
procedure ChangeSpeedButtonClick(Sender: TObject);
procedure SetVolumeBitBtnClick(Sender: TObject);
procedure ChangeVolumeBitBtnClick(Sender: TObject);
procedure NormalizeBitBtnClick(Sender: TObject);
procedure EffectButtonClick(Sender: TObject);
procedure PaintBox1Paint(Sender: TObject);
procedure WaveOutButtonClick(Sender: TObject);
procedure WaveInButtonClick(Sender: TObject);
procedure CopyToFileButtonClick(Sender: TObject);
procedure UndoButtonClick(Sender: TObject);
procedure EMailButtonClick(Sender: TObject);
procedure BrainWaveButtonClick(Sender: TObject);
procedure Left10ButtonClick(Sender: TObject);
procedure SSelButtonClick(Sender: TObject);
procedure HelpButtonClick(Sender: TObject);
procedure UndoCheckBoxClick(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N43Click(Sender: TObject);
procedure MP31Click(Sender: TObject);
procedure N44Click(Sender: TObject);
procedure ButtonZoomInClick(Sender: TObject);
procedure ButtonZoomOutClick(Sender: TObject);
procedure AudioOptionsButtonClick(Sender: TObject);
procedure MP3OptionsButtonClick(Sender: TObject);
procedure EffOptionsButtonClick(Sender: TObject);
private
{ Private declarations }
public
procedure SetAudioPosition;
procedure SetMarker;
procedure DeleteMarkers;
procedure PaintAudioGraph;
procedure SaveUndoInfo;
end;
type
TPlayThread = class(TThread)
public
WaveOut: HWaveOut;
procedure Execute; override;
end;
TRecordThread = class(TThread)
public
WaveIn: HWaveIn;
procedure Execute; override;
end;
var
MainForm: TMainForm;
SamplesPerPoint: Cardinal;
Status: String;
AudioPosition: Cardinal;
AudioData: TAudioData;
AudioClipBoard: TAudioData;
PlayThread: TPlayThread;
RecordThread: TRecordThread;
Selection: record
Start: Cardinal;
Finish: Cardinal;
StartExists: Boolean;
FinishExists: Boolean;
end;
UndoInfo: record
Selection: record
Start: Cardinal;
Finish: Cardinal;
StartExists: Boolean;
FinishExists: Boolean;
end;
AudioPosition: Cardinal;
AudioData: TAudioData;
end;
implementation
{$R *.dfm}
procedure TMainForm.FormCreate(Sender: TObject);
var
WaveOutCaps: TWaveOutCaps;
WaveInCaps: TWaveInCaps;
i: Cardinal;
begin
SamplesPerPoint := 16;
BorderIcons := BorderIcons - [biMaximize];
AudioData := TAudioData.Create;
AudioClipBoard := TAudioData.Create;
with AudioData do
begin
nChannels := 2;
nBitsPerSample := 16;
nSamplesPerSec := 44100;
Calculate_nBlockAlign;
end;
AudioPosition := 0;
if WaveOutGetNumDevs<>0 then
begin
for i := 0 to WaveOutGetNumDevs-1 do
begin
WaveOutGetDevCaps(i, @WaveOutCaps, SizeOf(TWaveOutCaps));
OutDeviceComboBox.Items.Add(PChar(@WaveOutCaps.szPname));
end;
OutDeviceComboBox.ItemIndex := 0;
end;
if WaveInGetNumDevs<>0 then
begin
for i := 0 to WaveInGetNumDevs-1 do
begin
WaveInGetDevCaps(i, @WaveInCaps, SizeOf(TWaveInCaps));
InDeviceComboBox.Items.Add(PChar(@WaveInCaps.szPname));
end;
InDeviceComboBox.ItemIndex := 0;
end;
AudioData.Calculate_nBlockAlign;
UndoInfo.AudioData := TAudioData.Create;
Status := 'starting';
end;
procedure TMainForm.SetAudioPosition;
var
AudioSize, Long: Cardinal;
S, S2: String;
begin
PaintBox1.Repaint;
with AudioData do AudioSize := Data.Size div nBlockAlign;
if AudioSize = 0 then Exit;
if AudioSize<TrackBar.Width then TrackBar.Max := AudioSize else TrackBar.Max := TrackBar.Width;
with PositionSpinEdit do
begin
Value := AudioPosition;
MinValue := 0;
MaxValue := AudioSize;
end;
if TrackBar.Position <> Round(AudioPosition*TrackBar.Max/AudioSize) then TrackBar.Position := Round(AudioPosition*TrackBar.Max/AudioSize);
S2 := '';
Long := Trunc(AudioPosition/AudioData.nSamplesPerSec);
Str(Trunc(Long/3600), S);
Long := Long - Trunc(Long/3600)*3600;
S2 := S2 + S +':';
Str(Trunc(Long/60), S);
Long := Long - Trunc(Long/60)*60;
if Length(S)=1 then S2 := S2 + '0';
S2 := S2 + S +':';
Str(Long, S);
if Length(S)=1 then S2 := S2 + '0';
S2 := S2 + S +' / ';
Long := Trunc(AudioSize/AudioData.nSamplesPerSec);
Str(Trunc(Long/3600), S);
Long := Long - Trunc(Long/3600)*3600;
S2 := S2 + S +':';
Str(Trunc(Long/60), S);
Long := Long - Trunc(Long/60)*60;
if Length(S)=1 then S2 := S2 + '0';
S2 := S2 + S +':';
Str(Long, S);
if Length(S)=1 then S2 := S2 + '0';
S2 := S2 + S + ' ';
if TimePosition.Caption<>S2 then TimePosition.Caption := S2;
{PaintBox1.Repaint;}
PaintAudioGraph;
end;
procedure TMainForm.SetMarker;
var
AudioSize: Cardinal;
begin
if (Status = 'starting') then Exit;
with AudioData do AudioSize := Data.Size div nBlockAlign;
with Selection do
begin
if (AudioPosition=Start)and(StartExists) or (AudioPosition=Finish)and(FinishExists) then Exit;
if not StartExists then
begin
Start := AudioPosition;
StartExists := True;
Marker1.Left := 8+Round(Start*(TrackBar.Max-20)/AudioSize);
Marker1.Visible := True;
Exit;
end;
if (StartExists) and (not FinishExists) then
begin
if AudioPosition>Start then
Finish := AudioPosition
else
begin
Finish := Start;
Start := AudioPosition;
end;
FinishExists := True;
TrackBar.SelStart := Round(Start*TrackBar.Max/AudioSize);