Стартовый пул
This commit is contained in:
361
acs/Demos/Mixer/mixer.lpi
Normal file
361
acs/Demos/Mixer/mixer.lpi
Normal file
@@ -0,0 +1,361 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="5"/>
|
||||
<General>
|
||||
<MainUnit Value="0"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
<ActiveEditorIndexAtStart Value="0"/>
|
||||
</General>
|
||||
<LazDoc Paths=""/>
|
||||
<Units Count="39">
|
||||
<Unit0>
|
||||
<CursorPos X="33" Y="9"/>
|
||||
<Filename Value="mixer.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="Mixer"/>
|
||||
<UsageCount Value="88"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<CursorPos X="14" Y="96"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<Filename Value="umixer.pas"/>
|
||||
<ComponentName Value="fMixer"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<Loaded Value="True"/>
|
||||
<ResourceFilename Value="umixer.lrs"/>
|
||||
<TopLine Value="78"/>
|
||||
<UnitName Value="uMixer"/>
|
||||
<UsageCount Value="88"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<CursorPos X="1" Y="168"/>
|
||||
<Filename Value="D:\LKomponenten\acs\Src\Common\ACS_Mixer.pas"/>
|
||||
<TopLine Value="138"/>
|
||||
<UnitName Value="ACS_Mixer"/>
|
||||
<UsageCount Value="20"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<CursorPos X="21" Y="889"/>
|
||||
<Filename Value="D:\lazarus\lcl\ExtCtrls.pp"/>
|
||||
<TopLine Value="875"/>
|
||||
<UnitName Value="ExtCtrls"/>
|
||||
<UsageCount Value="6"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<CursorPos X="29" Y="126"/>
|
||||
<Filename Value="D:\lazarus\lcl\Controls.pp"/>
|
||||
<TopLine Value="109"/>
|
||||
<UnitName Value="Controls"/>
|
||||
<UsageCount Value="6"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<CursorPos X="3" Y="41"/>
|
||||
<Filename Value="D:\lazarus\lcl\GraphType.pp"/>
|
||||
<TopLine Value="24"/>
|
||||
<UnitName Value="GraphType"/>
|
||||
<UsageCount Value="6"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<CursorPos X="15" Y="575"/>
|
||||
<Filename Value="D:\lazarus\lcl\LCLProc.pas"/>
|
||||
<TopLine Value="569"/>
|
||||
<UnitName Value="LCLProc"/>
|
||||
<UsageCount Value="12"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<CursorPos X="1" Y="249"/>
|
||||
<Filename Value="D:\LKomponenten\acs\Src\Common\include\windows\ACS_Mixer.inc"/>
|
||||
<TopLine Value="232"/>
|
||||
<UsageCount Value="12"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<CursorPos X="1" Y="3139"/>
|
||||
<Filename Value="D:\lazarus\lcl\include\wincontrol.inc"/>
|
||||
<TopLine Value="3122"/>
|
||||
<UsageCount Value="6"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<CursorPos X="1" Y="3122"/>
|
||||
<Filename Value="D:\lazarus\lcl\include\control.inc"/>
|
||||
<TopLine Value="3105"/>
|
||||
<UsageCount Value="6"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<CursorPos X="1" Y="422"/>
|
||||
<Filename Value="F:\mixer\cmpMidiMixer.pas"/>
|
||||
<TopLine Value="415"/>
|
||||
<UnitName Value="cmpMidiMixer"/>
|
||||
<UsageCount Value="6"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<CursorPos X="1" Y="171"/>
|
||||
<Filename Value="D:\lazarus\lcl\include\trackbar.inc"/>
|
||||
<TopLine Value="154"/>
|
||||
<UsageCount Value="6"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<CursorPos X="47" Y="64"/>
|
||||
<Filename Value="F:\mixer\mixer.txt"/>
|
||||
<SyntaxHighlighter Value="None"/>
|
||||
<TopLine Value="40"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<CursorPos X="21" Y="705"/>
|
||||
<Filename Value="F:\mixer\AMixer.pas"/>
|
||||
<TopLine Value="671"/>
|
||||
<UnitName Value="AMixer"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit13>
|
||||
<Unit14>
|
||||
<CursorPos X="7" Y="95"/>
|
||||
<Filename Value="D:\fpc\packages\extra\winunits\mmsystem.pp"/>
|
||||
<TopLine Value="78"/>
|
||||
<UnitName Value="mmsystem"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit14>
|
||||
<Unit15>
|
||||
<CursorPos X="1" Y="158"/>
|
||||
<Filename Value="windows\D\src\LKomponenten\acs\Src\Common\include\linux\ACS_Mixer.inc"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit15>
|
||||
<Unit16>
|
||||
<CursorPos X="1" Y="171"/>
|
||||
<Filename Value="windows\D\src\lazarus\lcl\include\trackbar.inc"/>
|
||||
<TopLine Value="147"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit16>
|
||||
<Unit17>
|
||||
<CursorPos X="31" Y="1714"/>
|
||||
<Filename Value="D:\MixAbstrmain.pas"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="MixAbstrmain"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit17>
|
||||
<Unit18>
|
||||
<CursorPos X="31" Y="80"/>
|
||||
<Filename Value="D:\SRC\LKomponenten\acs\Src\Common\ACS_Mixer.pas"/>
|
||||
<TopLine Value="43"/>
|
||||
<UnitName Value="ACS_Mixer"/>
|
||||
<UsageCount Value="9"/>
|
||||
</Unit18>
|
||||
<Unit19>
|
||||
<CursorPos X="51" Y="146"/>
|
||||
<Filename Value="D:\SRC\LKomponenten\acs\Src\Common\include\windows\ACS_Mixer.inc"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit19>
|
||||
<Unit20>
|
||||
<CursorPos X="57" Y="300"/>
|
||||
<Filename Value="D:\mixer\AMixer.pas"/>
|
||||
<TopLine Value="1011"/>
|
||||
<UnitName Value="AMixer"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit20>
|
||||
<Unit21>
|
||||
<CursorPos X="157" Y="164"/>
|
||||
<Filename Value="D:\test\unit1.pas"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<TopLine Value="144"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit21>
|
||||
<Unit22>
|
||||
<CursorPos X="23" Y="566"/>
|
||||
<Filename Value="D:\SRC\lazarus\lcl\LCLProc.pas"/>
|
||||
<TopLine Value="73"/>
|
||||
<UnitName Value="LCLProc"/>
|
||||
<UsageCount Value="9"/>
|
||||
</Unit22>
|
||||
<Unit23>
|
||||
<CursorPos X="5" Y="294"/>
|
||||
<Filename Value="D:\SRC\LKomponenten\acs\Src\Common\ACS_Classes.pas"/>
|
||||
<TopLine Value="271"/>
|
||||
<UnitName Value="ACS_Classes"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit23>
|
||||
<Unit24>
|
||||
<CursorPos X="1" Y="220"/>
|
||||
<Filename Value="D:\SRC\LKomponenten\acs\Src\Common\include\linux\ACS_Mixer.inc"/>
|
||||
<TopLine Value="180"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit24>
|
||||
<Unit25>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<Filename Value="D:\SRC\LKomponenten\acs\Src\Common\include\linux\Soundcard.pas"/>
|
||||
<TopLine Value="459"/>
|
||||
<UnitName Value="Soundcard"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit25>
|
||||
<Unit26>
|
||||
<CursorPos X="34" Y="278"/>
|
||||
<Filename Value="D:\SRC\fpc\packages\extra\winunits\mmsystem.pp"/>
|
||||
<TopLine Value="270"/>
|
||||
<UnitName Value="mmsystem"/>
|
||||
<UsageCount Value="9"/>
|
||||
</Unit26>
|
||||
<Unit27>
|
||||
<CursorPos X="35" Y="460"/>
|
||||
<Filename Value="D:\SRC\LKomponenten\acs\Src\Common\ACS_Converters.pas"/>
|
||||
<TopLine Value="460"/>
|
||||
<UnitName Value="ACS_Converters"/>
|
||||
<UsageCount Value="8"/>
|
||||
</Unit27>
|
||||
<Unit28>
|
||||
<CursorPos X="1" Y="3131"/>
|
||||
<Filename Value="D:\SRC\lazarus\lcl\include\control.inc"/>
|
||||
<TopLine Value="2676"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit28>
|
||||
<Unit29>
|
||||
<CursorPos X="1" Y="70"/>
|
||||
<Filename Value="D:\LKomponenten\acs\Src\Common\ACS_Classes.pas"/>
|
||||
<TopLine Value="36"/>
|
||||
<UnitName Value="ACS_Classes"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit29>
|
||||
<Unit30>
|
||||
<CursorPos X="40" Y="44"/>
|
||||
<Filename Value="D:\LKomponenten\acs\Src\Common\ACS_MultiMix.pas"/>
|
||||
<TopLine Value="19"/>
|
||||
<UnitName Value="ACS_MultiMix"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit30>
|
||||
<Unit31>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<Filename Value="D:\LKomponenten\acs\Src\Win32\laz_acs.pas"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="LAZ_ACS"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit31>
|
||||
<Unit32>
|
||||
<CursorPos X="17" Y="122"/>
|
||||
<Filename Value="D:\LKomponenten\acs\Src\Common\ACS_CDROM.pas"/>
|
||||
<TopLine Value="121"/>
|
||||
<UnitName Value="ACS_CDROM"/>
|
||||
<UsageCount Value="26"/>
|
||||
</Unit32>
|
||||
<Unit33>
|
||||
<CursorPos X="6" Y="236"/>
|
||||
<Filename Value="D:\LKomponenten\acs\Src\Common\include\windows\ACS_CDROM.inc"/>
|
||||
<TopLine Value="225"/>
|
||||
<UsageCount Value="26"/>
|
||||
</Unit33>
|
||||
<Unit34>
|
||||
<CursorPos X="3" Y="292"/>
|
||||
<Filename Value="D:\LKomponenten\acs\Src\Common\include\windows\akrip32.pas"/>
|
||||
<TopLine Value="275"/>
|
||||
<UnitName Value="akrip32"/>
|
||||
<UsageCount Value="26"/>
|
||||
</Unit34>
|
||||
<Unit35>
|
||||
<CursorPos X="1" Y="18"/>
|
||||
<Filename Value="D:\LKomponenten\acs\Src\Common\include\windows\CDRip.pas"/>
|
||||
<TopLine Value="18"/>
|
||||
<UnitName Value="CDRip"/>
|
||||
<UsageCount Value="24"/>
|
||||
</Unit35>
|
||||
<Unit36>
|
||||
<CursorPos X="62" Y="133"/>
|
||||
<Filename Value="D:\SOMETHING\akrip\CDRip.pas"/>
|
||||
<TopLine Value="99"/>
|
||||
<UnitName Value="CDRip"/>
|
||||
<UsageCount Value="12"/>
|
||||
</Unit36>
|
||||
<Unit37>
|
||||
<CursorPos X="1" Y="226"/>
|
||||
<Filename Value="windows\D\src\LKomponenten\acs\Src\Common\ACS_Mixer.pas"/>
|
||||
<TopLine Value="198"/>
|
||||
<UnitName Value="ACS_Mixer"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit37>
|
||||
<Unit38>
|
||||
<CursorPos X="50" Y="361"/>
|
||||
<Filename Value="windows\D\src\LKomponenten\acs\Src\Common\ACS_Classes.pas"/>
|
||||
<TopLine Value="1"/>
|
||||
<UnitName Value="ACS_Classes"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit38>
|
||||
</Units>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LAZ_ACS"/>
|
||||
<MinVersion Major="2" Minor="3" Valid="True"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<JumpHistory Count="0" HistoryIndex="-1"/>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="5"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<Generate Value="Faster"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<BreakPoints Count="2">
|
||||
<Item1>
|
||||
<Source Value="D:\SRC\LKomponenten\Virtualtrees\Neuer Ordner\windows\D\src\LKomponenten\Virtualtrees\example\minimal\main.pas"/>
|
||||
<Line Value="58"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Source Value="D:\SRC\LKomponenten\Virtualtrees\Neuer Ordner\windows\D\src\LKomponenten\Virtualtrees\VirtualTrees.pas"/>
|
||||
<Line Value="7054"/>
|
||||
</Item2>
|
||||
</BreakPoints>
|
||||
<Watches Count="3">
|
||||
<Item1>
|
||||
<Expression Value="Input.TotalTime"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Expression Value="Input.FPosition"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Expression Value="tmp"/>
|
||||
</Item3>
|
||||
</Watches>
|
||||
<Exceptions Count="2">
|
||||
<Item1>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item2>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
68
acs/Demos/Mixer/umixer.lfm
Normal file
68
acs/Demos/Mixer/umixer.lfm
Normal file
@@ -0,0 +1,68 @@
|
||||
object fMixer: TfMixer
|
||||
ActiveControl = cbDevice
|
||||
Caption = 'Mixer'
|
||||
ClientHeight = 212
|
||||
ClientWidth = 400
|
||||
OnCreate = FormCreate
|
||||
OnHide = FormHide
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 75
|
||||
HorzScrollBar.Page = 399
|
||||
VertScrollBar.Page = 211
|
||||
Left = 379
|
||||
Height = 212
|
||||
Top = 347
|
||||
Width = 400
|
||||
object TopPanel: TPanel
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 32
|
||||
ClientWidth = 400
|
||||
FullRepaint = False
|
||||
TabOrder = 0
|
||||
Height = 32
|
||||
Width = 400
|
||||
object lDevice: TLabel
|
||||
Alignment = taCenter
|
||||
Caption = 'Ger<65>t'
|
||||
Color = clNone
|
||||
ParentColor = False
|
||||
Height = 13
|
||||
Top = 8
|
||||
Width = 21
|
||||
end
|
||||
object Label3: TLabel
|
||||
Align = alRight
|
||||
Alignment = taCenter
|
||||
Caption = 'Mixer'
|
||||
Color = clBtnFace
|
||||
Font.Color = clInactiveCaption
|
||||
Font.Height = -25
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
Left = 331
|
||||
Height = 32
|
||||
Width = 69
|
||||
end
|
||||
object cbDevice: TComboBox
|
||||
MaxLength = 0
|
||||
OnChange = cbDeviceChange
|
||||
Style = csDropDownList
|
||||
TabOrder = 0
|
||||
Left = 48
|
||||
Height = 21
|
||||
Top = 4
|
||||
Width = 136
|
||||
end
|
||||
end
|
||||
object Mixer: TACSMixer
|
||||
MixerName = 'ESS Technology ESS1988'
|
||||
top = 368
|
||||
end
|
||||
object Timer: TTimer
|
||||
Enabled = False
|
||||
Interval = 200
|
||||
OnTimer = TimerTimer
|
||||
top = 336
|
||||
end
|
||||
end
|
216
acs/Demos/Mixer/umixer.pas
Normal file
216
acs/Demos/Mixer/umixer.pas
Normal file
@@ -0,0 +1,216 @@
|
||||
unit uMixer;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls,
|
||||
ExtCtrls, StdCtrls,GraphType, ACS_Mixer, ACS_Converters;
|
||||
|
||||
type
|
||||
|
||||
{ TfMixer }
|
||||
|
||||
TfMixer = class(TForm)
|
||||
cbDevice: TComboBox;
|
||||
lDevice: TLabel;
|
||||
Label3: TLabel;
|
||||
Mixer: TACSMixer;
|
||||
Timer: TTimer;
|
||||
TopPanel: TPanel;
|
||||
procedure MuteChange(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormHide(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TimerTimer(Sender: TObject);
|
||||
procedure ChannelChange(Sender: TObject);
|
||||
procedure BalanceChange(Sender: TObject);
|
||||
procedure cbDeviceChange(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
Channels : array of TTrackBar;
|
||||
Balance : array of TTrackBar;
|
||||
Muting : array of TCheckBox;
|
||||
end;
|
||||
|
||||
var
|
||||
fMixer: TfMixer;
|
||||
|
||||
implementation
|
||||
|
||||
{ TfMixer }
|
||||
|
||||
procedure TfMixer.FormCreate(Sender: TObject);
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
cbDevice.Items.Clear;
|
||||
for i := 0 to Mixer.DevCount-1 do
|
||||
begin
|
||||
Mixer.DevNum := i;
|
||||
cbDevice.Items.Add(Mixer.MixerName);
|
||||
end;
|
||||
cbDevice.ItemIndex := 0;
|
||||
end;
|
||||
|
||||
procedure TfMixer.MuteChange(Sender: TObject);
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
for i := 0 to length(Muting)-1 do
|
||||
if Sender = Muting[i] then
|
||||
begin
|
||||
Mixer.Mute[i] := TCheckBox(Sender).Checked;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfMixer.FormHide(Sender: TObject);
|
||||
begin
|
||||
Timer.Enabled := False;
|
||||
end;
|
||||
|
||||
procedure TfMixer.FormShow(Sender: TObject);
|
||||
begin
|
||||
cbDeviceChange(nil);
|
||||
end;
|
||||
|
||||
procedure TfMixer.TimerTimer(Sender: TObject);
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
{ for i := 0 to length(Channels)-1 do
|
||||
begin
|
||||
if Mixer.IsStereo(i) then
|
||||
Channels[i].Position := 255-Mixer.Level[i].Left
|
||||
else
|
||||
Channels[i].Position := 255-Mixer.Level[i].Main;
|
||||
end;}
|
||||
end;
|
||||
|
||||
procedure TfMixer.ChannelChange(Sender: TObject);
|
||||
var
|
||||
i,tmp : Integer;
|
||||
outp : TACSMixerLevel;
|
||||
begin
|
||||
for i := 0 to length(Channels)-1 do
|
||||
if Sender = Channels[i] then
|
||||
begin
|
||||
if Mixer.IsStereo(i) then
|
||||
begin
|
||||
tmp := -Balance[i].Position;
|
||||
if tmp < 0 then tmp := 0;
|
||||
tmp := round(((tmp*255)/255)+(255-Channels[i].Position));
|
||||
if tmp > 255 then
|
||||
tmp := 255;
|
||||
Outp.Left := tmp;
|
||||
tmp := Balance[i].Position;
|
||||
if tmp < 0 then tmp := 0;
|
||||
tmp := round(((tmp*255)/255)+(255-Channels[i].Position));
|
||||
if tmp > 255 then
|
||||
tmp := 255;
|
||||
Outp.Right := tmp;
|
||||
end
|
||||
else
|
||||
Outp.Main := Channels[i].Position-255;
|
||||
Mixer.Level[i] := Outp;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfMixer.BalanceChange(Sender: TObject);
|
||||
var
|
||||
i : Integer;
|
||||
begin
|
||||
for i := 0 to length(Channels)-1 do
|
||||
begin
|
||||
if Mixer.IsStereo(i) then
|
||||
Channels[i].Position := 255-Mixer.Level[i].Left
|
||||
else
|
||||
Channels[i].Position := 255-Mixer.Level[i].Main;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfMixer.cbDeviceChange(Sender: TObject);
|
||||
var
|
||||
i : Integer;
|
||||
aComp : TControl;
|
||||
newPanel : TPanel;
|
||||
newTrackbar : TTrackbar;
|
||||
newBevel : TBevel;
|
||||
newCheckbox : TCheckbox;
|
||||
newLabel : TLabel;
|
||||
begin
|
||||
setlength(Channels,0);
|
||||
setlength(Balance,0);
|
||||
setlength(Muting,0);
|
||||
while fMixer.ControlCount > 1 do
|
||||
begin
|
||||
aComp := fMixer.Controls[1];
|
||||
fMixer.RemoveControl(aComp);
|
||||
aComp.Free;
|
||||
end;
|
||||
for i := 0 to Mixer.ChannelCount-1 do
|
||||
begin
|
||||
newPanel := TPanel.Create(nil);
|
||||
newPanel.Parent := fMixer;
|
||||
newPanel.Align := alLeft;
|
||||
newPanel.Width := 80;
|
||||
newPanel.BevelOuter := bvNone;
|
||||
newLabel := TLabel.Create(nil);
|
||||
newLabel.Parent := newPanel;
|
||||
newLabel.Align := alTop;
|
||||
newLabel.Alignment := taCenter;
|
||||
newLabel.Caption := Mixer.ChannelName[i];
|
||||
newLabel.Height := 30;
|
||||
newBevel := TBevel.Create(nil);
|
||||
newBevel.Parent := newPanel;
|
||||
newBevel.Shape := bsLeftLine;
|
||||
newBevel.Width := 1;
|
||||
newBevel.Align := alRight;
|
||||
newTrackbar := TTrackbar.Create(nil);
|
||||
newTrackbar.Parent := NewPanel;
|
||||
newTrackbar.Align := alClient;
|
||||
newTrackBar.Orientation := trVertical;
|
||||
newTrackbar.Max := 255;
|
||||
newTrackbar.Min := 0;
|
||||
setlength(Channels,i+1);
|
||||
Channels[i] := newTrackBar;
|
||||
newTrackBar.OnChange := @ChannelChange;
|
||||
setlength(Balance,i+1);
|
||||
Balance[i] := nil;
|
||||
if Mixer.IsStereo(i) then
|
||||
begin
|
||||
newTrackbar := TTrackbar.Create(nil);
|
||||
newTrackbar.Parent := NewPanel;
|
||||
newTrackbar.Align := alTop;
|
||||
newTrackBar.Orientation := trHorizontal;
|
||||
newTrackBar.Height := 15;
|
||||
newTrackbar.Max := 100;
|
||||
newTrackbar.Min := -100;
|
||||
newTrackBar.Position := 0;
|
||||
Balance[i] := newTrackBar;
|
||||
Balance[i].Max := 40;
|
||||
Channels[i].Position := 255-Mixer.Level[i].Left;
|
||||
end
|
||||
else
|
||||
Channels[i].Position := 255-Mixer.Level[i].Main;
|
||||
newCheckBox := TCheckBox.Create(nil);
|
||||
newCheckBox.Parent := newPanel;
|
||||
newCheckBox.Caption := 'Mute';
|
||||
newCheckBox.Align := alBottom;
|
||||
newCheckBox.Checked := Mixer.Mute[i];
|
||||
newCheckBox.OnChange := @MuteChange;
|
||||
setlength(Muting,i+1);
|
||||
Muting[i] := newCheckBox;
|
||||
end;
|
||||
Timer.Enabled := True;
|
||||
Width := Mixer.ChannelCount*80;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I umixer.lrs}
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user