Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

361
acs/Demos/Mixer/mixer.lpi Normal file
View 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>

View 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
View 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.

View File

@@ -0,0 +1,197 @@
<?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="17">
<Unit0>
<Filename Value="cdripper.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="cdripper"/>
<UsageCount Value="22"/>
</Unit0>
<Unit1>
<CursorPos X="12" Y="9"/>
<EditorIndex Value="0"/>
<Filename Value="umain.pas"/>
<ComponentName Value="fMain"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<ResourceFilename Value="umain.lrs"/>
<TopLine Value="1"/>
<UnitName Value="uMain"/>
<UsageCount Value="22"/>
</Unit1>
<Unit2>
<CursorPos X="10" Y="190"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_CDROM.pas"/>
<TopLine Value="176"/>
<UnitName Value="ACS_CDROM"/>
<UsageCount Value="10"/>
</Unit2>
<Unit3>
<CursorPos X="1" Y="688"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_Classes.pas"/>
<TopLine Value="671"/>
<UnitName Value="ACS_Classes"/>
<UsageCount Value="10"/>
</Unit3>
<Unit4>
<CursorPos X="1" Y="2193"/>
<Filename Value="D:\lazarus\lcl\include\control.inc"/>
<TopLine Value="2176"/>
<UsageCount Value="10"/>
</Unit4>
<Unit5>
<CursorPos X="1" Y="55"/>
<Filename Value="D:\lazarus\lcl\include\listitems.inc"/>
<TopLine Value="38"/>
<UsageCount Value="10"/>
</Unit5>
<Unit6>
<CursorPos X="1" Y="461"/>
<Filename Value="D:\lazarus\lcl\include\listitem.inc"/>
<TopLine Value="444"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<CursorPos X="1" Y="508"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_File.pas"/>
<TopLine Value="491"/>
<UnitName Value="ACS_File"/>
<UsageCount Value="10"/>
</Unit7>
<Unit8>
<CursorPos X="1" Y="257"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\ACS_Vorbis.pas"/>
<TopLine Value="242"/>
<UnitName Value="ACS_Vorbis"/>
<UsageCount Value="10"/>
</Unit8>
<Unit9>
<CursorPos X="29" Y="255"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\general\VorbisFile.pas"/>
<TopLine Value="226"/>
<UnitName Value="VorbisFile"/>
<UsageCount Value="10"/>
</Unit9>
<Unit10>
<CursorPos X="19" Y="176"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_Audio.pas"/>
<TopLine Value="1"/>
<UnitName Value="ACS_Audio"/>
<UsageCount Value="10"/>
</Unit10>
<Unit11>
<CursorPos X="78" Y="27"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_Strings.pas"/>
<TopLine Value="12"/>
<UnitName Value="ACS_Strings"/>
<UsageCount Value="10"/>
</Unit11>
<Unit12>
<CursorPos X="31" Y="200"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\windows\ACS_CDROM.inc"/>
<TopLine Value="181"/>
<UsageCount Value="10"/>
</Unit12>
<Unit13>
<CursorPos X="1" Y="1428"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\ACS_Wave.pas"/>
<TopLine Value="1411"/>
<UnitName Value="ACS_Wave"/>
<UsageCount Value="10"/>
</Unit13>
<Unit14>
<CursorPos X="14" Y="1995"/>
<Filename Value="D:\lazarus\lcl\lresources.pp"/>
<TopLine Value="1986"/>
<UnitName Value="LResources"/>
<UsageCount Value="10"/>
</Unit14>
<Unit15>
<CursorPos X="1" Y="1490"/>
<Filename Value="D:\lazarus\lcl\include\application.inc"/>
<TopLine Value="1487"/>
<UsageCount Value="10"/>
</Unit15>
<Unit16>
<CursorPos X="20" Y="118"/>
<Filename Value="umain.lfm"/>
<SyntaxHighlighter Value="LFM"/>
<TopLine Value="86"/>
<UsageCount Value="10"/>
</Unit16>
</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="4" 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:\LKomponenten\acs\Src\classes\ACS_File.pas"/>
<Line Value="378"/>
</Item1>
<Item2>
<Source Value="D:\LKomponenten\acs\Src\classes\ACS_Classes.pas"/>
<Line Value="607"/>
</Item2>
</BreakPoints>
<Watches Count="2">
<Item1>
<Expression Value="HandleMultiSelect"/>
</Item1>
<Item2>
<Expression Value="FDelayMax"/>
</Item2>
</Watches>
</Debugging>
</CONFIG>

119
acs/Demos/Ripper/umain.lfm Normal file
View File

@@ -0,0 +1,119 @@
object fMain: TfMain
ActiveControl = lvTracks
Caption = 'CD Ripper'
ClientHeight = 300
ClientWidth = 400
OnCreate = FormCreate
PixelsPerInch = 75
HorzScrollBar.Page = 399
VertScrollBar.Page = 299
Left = 271
Height = 300
Top = 150
Width = 400
object Label1: TLabel
Caption = 'Drive'
Color = clNone
ParentColor = False
Left = 8
Height = 13
Top = 7
Width = 31
end
object Label2: TLabel
Caption = 'Output Format'
Color = clNone
ParentColor = False
Left = 265
Height = 13
Top = 7
Width = 80
end
object lvTracks: TListView
Anchors = [akTop, akLeft, akRight, akBottom]
Columns = <
item
Caption = 'Track'
Width = 10
end
item
Caption = 'Tracktitle'
Width = 10
end
item
Caption = 'Length'
Width = 10
end>
MultiSelect = True
RowSelect = True
ViewStyle = vsReport
Height = 250
Top = 34
Width = 400
end
object cbDrives: TComboBox
MaxLength = 0
OnChange = cbDrivesChange
Style = csDropDownList
TabOrder = 1
Left = 40
Height = 21
Top = 4
Width = 132
end
object bRip: TButton
BorderSpacing.InnerBorder = 2
Caption = 'Rip selected'
OnClick = Button1Click
TabOrder = 2
Left = 184
Height = 21
Top = 4
Width = 75
end
object cbFormat: TComboBox
ItemIndex = 2
Items.Strings = (
'ogg'
'mp3'
'wav'
)
MaxLength = 0
Style = csDropDownList
TabOrder = 3
Text = 'wav'
Left = 340
Height = 21
Top = 4
Width = 61
end
object ProgressBar: TProgressBar
Align = alBottom
Max = 100
Height = 12
Top = 288
Width = 400
end
object Timer: TTimer
OnTimer = TimerTimer
left = 76
top = 4
end
object SelectDirectoryDialog: TSelectDirectoryDialog
Title = 'Select Directory'
FilterIndex = 0
Title = 'Select Directory'
left = 144
top = 4
end
object FileOut: TACSFileOut
Input = CDIn
OnDone = FileOutDone
left = 112
top = 4
end
object CDIn: TACSCDIn
left = 44
top = 4
end
end

126
acs/Demos/Ripper/umain.pas Normal file
View File

@@ -0,0 +1,126 @@
unit uMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls, ACS_CDROM, ExtCtrls, Buttons,
ACS_File;
type
{ TfMain }
TfMain = class(TForm)
bRip: TButton;
cbDrives: TComboBox;
cbFormat: TComboBox;
CDIn: TACSCDIn;
FileOut: TACSFileOut;
Label1: TLabel;
Label2: TLabel;
lvTracks: TListView;
ProgressBar: TProgressBar;
SelectDirectoryDialog: TSelectDirectoryDialog;
Timer: TTimer;
procedure Button1Click(Sender: TObject);
procedure FileOutDone(Sender: TComponent);
procedure FormCreate(Sender: TObject);
procedure TimerTimer(Sender: TObject);
procedure cbDrivesChange(Sender: TObject);
procedure RipNextTrack;
private
{ private declarations }
FDirectory : string;
FTracksCount : Integer;
public
{ public declarations }
end;
var
fMain: TfMain;
implementation
{ TfMain }
procedure TfMain.FormCreate(Sender: TObject);
var
i : Integer;
begin
lvTracks.Column[0].Width := 60;
lvTracks.Column[1].Width := 260;
lvTracks.Column[2].Width := 120;
for i := 0 to CDIn.DrivesCount-1 do
begin
CDIn.CurrentDrive := i;
cbDrives.Items.Add(CDIn.DriveName);
end;
cbDrives.ItemIndex := 0;
end;
procedure TfMain.Button1Click(Sender: TObject);
begin
if SelectDirectoryDialog.Execute then
begin
FDirectory := SelectDirectoryDialog.FileName;
RipNextTrack;
end;
end;
procedure TfMain.FileOutDone(Sender: TComponent);
begin
RipNextTrack;
end;
procedure TfMain.TimerTimer(Sender: TObject);
var
new : TListItem;
i : Integer;
begin
if not ((CDIn.Status = cdsReady) and (CDIn.TracksCount <> FTracksCount)) then
exit;
lvTracks.Items.Clear;
for i := 0 to CDIn.Trackscount-1 do
begin
new := lvTracks.Items.Add;
new.Caption := IntToStr(i);
if CDIn.Tracks[i].TrackType = ttAudio then
new.SubItems.Add(Format('Track %d',[i+1]))
else
new.SubItems.Add(Format('Datatrack %d',[i+1]));
new.SubItems.Add(Format('%.2d:%.2d',[CDIn.Tracks[i].TrackLength.Minute,CDIn.Tracks[i].TrackLength.Second]));
end;
FTracksCount := CDIn.TracksCount;
end;
procedure TfMain.cbDrivesChange(Sender: TObject);
begin
CDIn.CurrentDrive := cbDrives.ItemIndex;
end;
procedure TfMain.RipNextTrack;
var
i : Integer;
begin
ProgressBar.Position := 0;
bRip.Enabled := True;
for i := 0 to lvTracks.Items.Count-1 do
if lvTracks.Items[i].Focused and (CDIn.Tracks[i].TrackType = ttAudio) then
begin
bRip.Enabled := False;
CDIn.StartTrack := i;
CDIn.EndTrack := i+1;
FileOut.FileName := FDirectory+DirectorySeparator+lvTracks.Items[i].SubItems[0]+'.'+cbFormat.Text;
FileOut.Run;
lvTracks.Items[i].Focused := False;
exit;
end;
end;
initialization
{$I umain.lrs}
end.

View File

@@ -0,0 +1,265 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="5"/>
<General>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<Title Value="project1"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<LazDoc Paths=""/>
<Units Count="27">
<Unit0>
<CursorPos X="36" Y="15"/>
<Filename Value="cdplayer.lpr"/>
<IsPartOfProject Value="True"/>
<TopLine Value="1"/>
<UnitName Value="cdplayer"/>
<UsageCount Value="42"/>
</Unit0>
<Unit1>
<CursorPos X="22" Y="73"/>
<EditorIndex Value="0"/>
<Filename Value="umain.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<ResourceFilename Value="umain.lrs"/>
<TopLine Value="57"/>
<UnitName Value="uMain"/>
<UsageCount Value="42"/>
</Unit1>
<Unit2>
<CursorPos X="1" Y="436"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_Audio.pas"/>
<TopLine Value="409"/>
<UnitName Value="ACS_Audio"/>
<UsageCount Value="20"/>
</Unit2>
<Unit3>
<CursorPos X="1" Y="241"/>
<Filename Value="D:\LKomponenten\acs\Src\drivers\windows\ACS_Audio.inc"/>
<TopLine Value="208"/>
<UsageCount Value="17"/>
</Unit3>
<Unit4>
<CursorPos X="1" Y="1823"/>
<Filename Value="D:\lazarus\lcl\include\control.inc"/>
<TopLine Value="1808"/>
<UsageCount Value="10"/>
</Unit4>
<Unit5>
<CursorPos X="1" Y="58"/>
<Filename Value="D:\lazarus\lcl\include\buttoncontrol.inc"/>
<TopLine Value="43"/>
<UsageCount Value="10"/>
</Unit5>
<Unit6>
<CursorPos X="1" Y="242"/>
<Filename Value="D:\lazarus\lcl\include\buttons.inc"/>
<TopLine Value="227"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<CursorPos X="27" Y="74"/>
<Filename Value="D:\LKomponenten\acs\Src\drivers\ACS_StdAudio.pas"/>
<TopLine Value="70"/>
<UnitName Value="ACS_StdAudio"/>
<UsageCount Value="18"/>
</Unit7>
<Unit8>
<CursorPos X="1" Y="231"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_File.pas"/>
<TopLine Value="214"/>
<UnitName Value="ACS_File"/>
<UsageCount Value="19"/>
</Unit8>
<Unit9>
<CursorPos X="68" Y="8"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\ACS_Allformats.pas"/>
<TopLine Value="1"/>
<UnitName Value="ACS_AllFormats"/>
<UsageCount Value="16"/>
</Unit9>
<Unit10>
<CursorPos X="18" Y="31"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\ACS_DSAudio.pas"/>
<TopLine Value="31"/>
<UnitName Value="ACS_DSAudio"/>
<UsageCount Value="9"/>
</Unit10>
<Unit11>
<CursorPos X="20" Y="318"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_dsfiles.pas"/>
<TopLine Value="298"/>
<UnitName Value="ACS_DSFiles"/>
<UsageCount Value="12"/>
</Unit11>
<Unit12>
<CursorPos X="1" Y="474"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\ACS_Vorbis.pas"/>
<TopLine Value="459"/>
<UnitName Value="ACS_Vorbis"/>
<UsageCount Value="16"/>
</Unit12>
<Unit13>
<CursorPos X="14" Y="204"/>
<EditorIndex Value="1"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_Classes.pas"/>
<Loaded Value="True"/>
<TopLine Value="190"/>
<UnitName Value="acs_classes"/>
<UsageCount Value="18"/>
</Unit13>
<Unit14>
<CursorPos X="54" Y="48"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_Strings.pas"/>
<TopLine Value="22"/>
<UnitName Value="ACS_Strings"/>
<UsageCount Value="16"/>
</Unit14>
<Unit15>
<CursorPos X="1" Y="424"/>
<Filename Value="D:\LKomponenten\acs\Src\drivers\ACS_DXAudio.pas"/>
<TopLine Value="410"/>
<UnitName Value="ACS_DXAudio"/>
<UsageCount Value="16"/>
</Unit15>
<Unit16>
<CursorPos X="25" Y="152"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\ACS_Wave.pas"/>
<TopLine Value="138"/>
<UnitName Value="ACS_Wave"/>
<UsageCount Value="10"/>
</Unit16>
<Unit17>
<CursorPos X="23" Y="2003"/>
<Filename Value="D:\lazarus\lcl\lresources.pp"/>
<TopLine Value="1986"/>
<UnitName Value="LResources"/>
<UsageCount Value="10"/>
</Unit17>
<Unit18>
<CursorPos X="1" Y="351"/>
<Filename Value="D:\LKomponenten\acs\Demos\Lazarus\Mediaplayer\uplayer.pas"/>
<HasResources Value="True"/>
<TopLine Value="329"/>
<UnitName Value="uPlayer"/>
<UsageCount Value="10"/>
</Unit18>
<Unit19>
<CursorPos X="13" Y="121"/>
<Filename Value="D:\LKomponenten\acs\Demos\Win32\CDPlayer\Main.pas"/>
<TopLine Value="98"/>
<UnitName Value="Main"/>
<UsageCount Value="10"/>
</Unit19>
<Unit20>
<CursorPos X="6" Y="104"/>
<Filename Value="D:\LKomponenten\acs\Demos\Win32\OggPlayer\Main.pas"/>
<TopLine Value="77"/>
<UnitName Value="Main"/>
<UsageCount Value="10"/>
</Unit20>
<Unit21>
<CursorPos X="13" Y="28"/>
<Filename Value="D:\LKomponenten\acs\Demos\Win32\AudioPlayer\Main.pas"/>
<TopLine Value="28"/>
<UnitName Value="Main"/>
<UsageCount Value="10"/>
</Unit21>
<Unit22>
<CursorPos X="5" Y="2678"/>
<Filename Value="D:\fpc\packages\extra\winunits\activex.pp"/>
<TopLine Value="2661"/>
<UnitName Value="activex"/>
<UsageCount Value="10"/>
</Unit22>
<Unit23>
<CursorPos X="1" Y="201"/>
<EditorIndex Value="2"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\windows\acs_cdrom.inc"/>
<Loaded Value="True"/>
<TopLine Value="187"/>
<UsageCount Value="10"/>
</Unit23>
<Unit24>
<CursorPos X="9" Y="61"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\ACS_CDROM.pas"/>
<TopLine Value="44"/>
<UnitName Value="ACS_CDROM"/>
<UsageCount Value="10"/>
</Unit24>
<Unit25>
<CursorPos X="1" Y="238"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\linux\ACS_CDROM.inc"/>
<TopLine Value="226"/>
<UsageCount Value="10"/>
</Unit25>
<Unit26>
<CursorPos X="3" Y="32"/>
<Filename Value="D:\lazarus\lcl\LCLClasses.pp"/>
<TopLine Value="15"/>
<UnitName Value="LCLClasses"/>
<UsageCount Value="10"/>
</Unit26>
</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"/>
</Item2>
</RequiredPackages>
<JumpHistory Count="1" HistoryIndex="0">
<Position1>
<Filename Value="D:\LKomponenten\acs\Src\classes\windows\ACS_CDROM.inc"/>
<Caret Line="201" Column="1" TopLine="187"/>
</Position1>
</JumpHistory>
</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>
<Watches Count="1">
<Item1>
<Expression Value="CDIn1.EndTrack"/>
</Item1>
</Watches>
</Debugging>
</CONFIG>

View File

View File

@@ -0,0 +1,466 @@
object Form1: TForm1
ActiveControl = btOpen
Caption = 'CD Player'
ClientHeight = 99
ClientWidth = 189
OnCreate = FormCreate
PixelsPerInch = 96
HorzScrollBar.Page = 188
VertScrollBar.Page = 98
Left = 298
Height = 99
Top = 268
Width = 189
object Panel1: TPanel
BevelOuter = bvLowered
ClientHeight = 64
ClientWidth = 182
FullRepaint = False
TabOrder = 0
Left = 4
Height = 64
Width = 182
object lTime: TLabel
AutoSize = False
Caption = '00:00:00'
Color = clNone
Font.Height = -25
ParentColor = False
Left = 68
Height = 29
Top = 24
Width = 108
end
object lTrack: TLabel
Caption = '01'
Color = clNone
Font.Height = -37
ParentColor = False
Left = 16
Height = 46
Top = 17
Width = 41
end
object Label1: TLabel
Caption = 'Track'
Color = clNone
Font.Height = -9
ParentColor = False
Left = 4
Height = 12
Top = 14
Width = 24
end
object Label2: TLabel
Caption = 'remain'
Color = clNone
Font.Height = -9
ParentColor = False
Left = 92
Height = 12
Top = 14
Width = 29
end
object Label3: TLabel
Caption = 'Tracks'
Color = clNone
Font.Height = -9
ParentColor = False
Left = 4
Height = 12
Top = 2
Width = 28
end
object lTracksCount: TLabel
Caption = '09'
Color = clNone
ParentColor = False
Left = 44
Height = 14
Top = 1
Width = 13
end
object Label5: TLabel
Caption = 'Time left'
Color = clNone
Font.Height = -9
ParentColor = False
Left = 60
Height = 12
Width = 38
end
object lLeft: TLabel
Alignment = taRightJustify
Caption = '00:00:00'
Color = clNone
Font.Height = -12
ParentColor = False
Left = 124
Height = 15
Top = 1
Width = 51
end
object Progress: TProgressBar
Align = alBottom
Max = 1000
Smooth = True
Left = 1
Height = 8
Top = 55
Width = 180
end
end
object btOpen: TBitBtn
BorderSpacing.InnerBorder = 2
Glyph.Data = {
970300002F2A2058504D202A2F0D0A7374617469632063686172202A5069786D
61705B5D203D207B0D0A2231362031362031362032222C0D0A22303020632023
303830383130222C0D0A22303120632023313831383231222C0D0A2230322063
20677261793136222C0D0A22303320632023443644364345222C0D0A22303420
632067726179313030222C0D0A22303520632067726179313030222C0D0A2230
3620632067726179313030222C0D0A22303720632067726179313030222C0D0A
22303820632067726179313030222C0D0A22303920632067726179313030222C
0D0A22313020632067726179313030222C0D0A22313120632067726179313030
222C0D0A22313220632067726179313030222C0D0A2231332063206772617931
3030222C0D0A22313420632067726179313030222C0D0A223135206320677261
79313030222C0D0A223033303330333033303330333033303330333033303330
333033303330333033222C0D0A22303330333033303330333033303330333033
3033303330333033303330333033222C0D0A2230333033303330333033303330
33303330333033303330333033303330333033222C0D0A223033303330333033
303330333033303030333033303330333033303330333033222C0D0A22303330
3330333033303330333030303130303033303330333033303330333033222C0D
0A22303330333033303330333030303130313031303030333033303330333033
3033222C0D0A2230333033303330333030303130313031303130313030303330
33303330333033222C0D0A223033303330333030303130313031303130313031
303130303033303330333033222C0D0A22303330333032303230323032303230
3230323032303230323032303330333033222C0D0A2230333033303330333033
30333033303330333033303330333033303330333033222C0D0A223033303330
303030303030303030303030303030303030303030303330333033222C0D0A22
3033303330303031303130313031303130313031303130313032303330333033
222C0D0A22303330333032303230323032303230323032303230323032303230
3330333033222C0D0A2230333033303330333033303330333033303330333033
30333033303330333033222C0D0A223033303330333033303330333033303330
333033303330333033303330333033222C0D0A22303330333033303330333033
3033303330333033303330333033303330333033220D0A7D3B0D0A
}
Layout = blGlyphTop
NumGlyphs = 0
OnClick = OpenClick
TabOrder = 1
Left = 4
Height = 26
Top = 67
Width = 28
end
object btRew: TBitBtn
BorderSpacing.InnerBorder = 2
Glyph.Data = {
970300002F2A2058504D202A2F0D0A7374617469632063686172202A5069786D
61705B5D203D207B0D0A2231362031362031362032222C0D0A22303020632023
303830383130222C0D0A22303120632023313831383231222C0D0A2230322063
20677261793136222C0D0A22303320632023443644364345222C0D0A22303420
632067726179313030222C0D0A22303520632067726179313030222C0D0A2230
3620632067726179313030222C0D0A22303720632067726179313030222C0D0A
22303820632067726179313030222C0D0A22303920632067726179313030222C
0D0A22313020632067726179313030222C0D0A22313120632067726179313030
222C0D0A22313220632067726179313030222C0D0A2231332063206772617931
3030222C0D0A22313420632067726179313030222C0D0A223135206320677261
79313030222C0D0A223033303330333033303330333033303330333033303330
333033303330333033222C0D0A22303330333033303330333033303330333033
3033303330333033303330333033222C0D0A2230333033303330333033303330
33303330333033303330333033303330333033222C0D0A223033303330333030
303030303033303330333033303330303030303330333033222C0D0A22303330
3330333030303130323033303330333033303030313032303330333033222C0D
0A22303330333033303030313032303330333033303030313031303230333033
3033222C0D0A2230333033303330303031303230333033303030313031303130
32303330333033222C0D0A223033303330333030303130323033303030313031
303130313032303330333033222C0D0A22303330333033303030313032303330
3230313031303130313032303330333033222C0D0A2230333033303330303031
30323033303330323031303130313032303330333033222C0D0A223033303330
333030303130323033303330333032303130313032303330333033222C0D0A22
3033303330333030303130323033303330333033303230313032303330333033
222C0D0A22303330333033303230323032303330333033303330333032303230
3330333033222C0D0A2230333033303330333033303330333033303330333033
30333033303330333033222C0D0A223033303330333033303330333033303330
333033303330333033303330333033222C0D0A22303330333033303330333033
3033303330333033303330333033303330333033220D0A7D3B0D0A
}
NumGlyphs = 0
OnClick = btRewClick
TabOrder = 2
Left = 32
Height = 26
Top = 67
Width = 28
end
object btFfw: TBitBtn
BorderSpacing.InnerBorder = 2
Glyph.Data = {
970300002F2A2058504D202A2F0D0A7374617469632063686172202A5069786D
61705B5D203D207B0D0A2231362031362031362032222C0D0A22303020632023
303830383130222C0D0A22303120632023313831383231222C0D0A2230322063
20677261793136222C0D0A22303320632023443644364345222C0D0A22303420
632067726179313030222C0D0A22303520632067726179313030222C0D0A2230
3620632067726179313030222C0D0A22303720632067726179313030222C0D0A
22303820632067726179313030222C0D0A22303920632067726179313030222C
0D0A22313020632067726179313030222C0D0A22313120632067726179313030
222C0D0A22313220632067726179313030222C0D0A2231332063206772617931
3030222C0D0A22313420632067726179313030222C0D0A223135206320677261
79313030222C0D0A223033303330333033303330333033303330333033303330
333033303330333033222C0D0A22303330333033303330333033303330333033
3033303330333033303330333033222C0D0A2230333033303330333033303330
33303330333033303330333033303330333033222C0D0A223033303330333030
303030333033303330333033303030303030303330333033222C0D0A22303330
3330333032303130303033303330333033303230313030303330333033222C0D
0A22303330333033303230313031303030333033303330323031303030333033
3033222C0D0A2230333033303330323031303130313030303330333032303130
30303330333033222C0D0A223033303330333032303130313031303130303033
303230313030303330333033222C0D0A22303330333033303230313031303130
3130323033303230313030303330333033222C0D0A2230333033303330323031
30313031303230333033303230313030303330333033222C0D0A223033303330
333032303130313032303330333033303230313030303330333033222C0D0A22
3033303330333032303130323033303330333033303230313030303330333033
222C0D0A22303330333033303230323033303330333033303330323032303230
3330333033222C0D0A2230333033303330333033303330333033303330333033
30333033303330333033222C0D0A223033303330333033303330333033303330
333033303330333033303330333033222C0D0A22303330333033303330333033
3033303330333033303330333033303330333033220D0A7D3B0D0A
}
Layout = blGlyphRight
NumGlyphs = 0
OnClick = btFfwClick
TabOrder = 3
Left = 60
Height = 26
Top = 67
Width = 28
end
object btPlay: TBitBtn
BorderSpacing.InnerBorder = 2
Glyph.Data = {
911300002F2A2058504D202A2F0D0A7374617469632063686172202A5069786D
61705B5D203D207B0D0A223136203136203235362033222C0D0A223030302063
2023304330463132222C0D0A2230303120632023314231443230222C0D0A2230
303220632023324132443244222C0D0A2230303320632023443444304338222C
0D0A22303034206320626C61636B222C0D0A22303035206320626C61636B222C
0D0A22303036206320626C61636B222C0D0A22303037206320626C61636B222C
0D0A22303038206320626C61636B222C0D0A22303039206320626C61636B222C
0D0A22303130206320626C61636B222C0D0A22303131206320626C61636B222C
0D0A22303132206320626C61636B222C0D0A22303133206320626C61636B222C
0D0A22303134206320626C61636B222C0D0A22303135206320626C61636B222C
0D0A22303136206320626C61636B222C0D0A22303137206320626C61636B222C
0D0A22303138206320626C61636B222C0D0A22303139206320626C61636B222C
0D0A22303230206320626C61636B222C0D0A22303231206320626C61636B222C
0D0A22303232206320626C61636B222C0D0A22303233206320626C61636B222C
0D0A22303234206320626C61636B222C0D0A22303235206320626C61636B222C
0D0A22303236206320626C61636B222C0D0A22303237206320626C61636B222C
0D0A22303238206320626C61636B222C0D0A22303239206320626C61636B222C
0D0A22303330206320626C61636B222C0D0A22303331206320626C61636B222C
0D0A22303332206320626C61636B222C0D0A22303333206320626C61636B222C
0D0A22303334206320626C61636B222C0D0A22303335206320626C61636B222C
0D0A22303336206320626C61636B222C0D0A22303337206320626C61636B222C
0D0A22303338206320626C61636B222C0D0A22303339206320626C61636B222C
0D0A22303430206320626C61636B222C0D0A22303431206320626C61636B222C
0D0A22303432206320626C61636B222C0D0A22303433206320626C61636B222C
0D0A22303434206320626C61636B222C0D0A22303435206320626C61636B222C
0D0A22303436206320626C61636B222C0D0A22303437206320626C61636B222C
0D0A22303438206320626C61636B222C0D0A22303439206320626C61636B222C
0D0A22303530206320626C61636B222C0D0A22303531206320626C61636B222C
0D0A22303532206320626C61636B222C0D0A22303533206320626C61636B222C
0D0A22303534206320626C61636B222C0D0A22303535206320626C61636B222C
0D0A22303536206320626C61636B222C0D0A22303537206320626C61636B222C
0D0A22303538206320626C61636B222C0D0A22303539206320626C61636B222C
0D0A22303630206320626C61636B222C0D0A22303631206320626C61636B222C
0D0A22303632206320626C61636B222C0D0A22303633206320626C61636B222C
0D0A22303634206320626C61636B222C0D0A22303635206320626C61636B222C
0D0A22303636206320626C61636B222C0D0A22303637206320626C61636B222C
0D0A22303638206320626C61636B222C0D0A22303639206320626C61636B222C
0D0A22303730206320626C61636B222C0D0A22303731206320626C61636B222C
0D0A22303732206320626C61636B222C0D0A22303733206320626C61636B222C
0D0A22303734206320626C61636B222C0D0A22303735206320626C61636B222C
0D0A22303736206320626C61636B222C0D0A22303737206320626C61636B222C
0D0A22303738206320626C61636B222C0D0A22303739206320626C61636B222C
0D0A22303830206320626C61636B222C0D0A22303831206320626C61636B222C
0D0A22303832206320626C61636B222C0D0A22303833206320626C61636B222C
0D0A22303834206320626C61636B222C0D0A22303835206320626C61636B222C
0D0A22303836206320626C61636B222C0D0A22303837206320626C61636B222C
0D0A22303838206320626C61636B222C0D0A22303839206320626C61636B222C
0D0A22303930206320626C61636B222C0D0A22303931206320626C61636B222C
0D0A22303932206320626C61636B222C0D0A22303933206320626C61636B222C
0D0A22303934206320626C61636B222C0D0A22303935206320626C61636B222C
0D0A22303936206320626C61636B222C0D0A22303937206320626C61636B222C
0D0A22303938206320626C61636B222C0D0A22303939206320626C61636B222C
0D0A22313030206320626C61636B222C0D0A22313031206320626C61636B222C
0D0A22313032206320626C61636B222C0D0A22313033206320626C61636B222C
0D0A22313034206320626C61636B222C0D0A22313035206320626C61636B222C
0D0A22313036206320626C61636B222C0D0A22313037206320626C61636B222C
0D0A22313038206320626C61636B222C0D0A22313039206320626C61636B222C
0D0A22313130206320626C61636B222C0D0A22313131206320626C61636B222C
0D0A22313132206320626C61636B222C0D0A22313133206320626C61636B222C
0D0A22313134206320626C61636B222C0D0A22313135206320626C61636B222C
0D0A22313136206320626C61636B222C0D0A22313137206320626C61636B222C
0D0A22313138206320626C61636B222C0D0A22313139206320626C61636B222C
0D0A22313230206320626C61636B222C0D0A22313231206320626C61636B222C
0D0A22313232206320626C61636B222C0D0A22313233206320626C61636B222C
0D0A22313234206320626C61636B222C0D0A22313235206320626C61636B222C
0D0A22313236206320626C61636B222C0D0A22313237206320626C61636B222C
0D0A22313238206320626C61636B222C0D0A22313239206320626C61636B222C
0D0A22313330206320626C61636B222C0D0A22313331206320626C61636B222C
0D0A22313332206320626C61636B222C0D0A22313333206320626C61636B222C
0D0A22313334206320626C61636B222C0D0A22313335206320626C61636B222C
0D0A22313336206320626C61636B222C0D0A22313337206320626C61636B222C
0D0A22313338206320626C61636B222C0D0A22313339206320626C61636B222C
0D0A22313430206320626C61636B222C0D0A22313431206320626C61636B222C
0D0A22313432206320626C61636B222C0D0A22313433206320626C61636B222C
0D0A22313434206320626C61636B222C0D0A22313435206320626C61636B222C
0D0A22313436206320626C61636B222C0D0A22313437206320626C61636B222C
0D0A22313438206320626C61636B222C0D0A22313439206320626C61636B222C
0D0A22313530206320626C61636B222C0D0A22313531206320626C61636B222C
0D0A22313532206320626C61636B222C0D0A22313533206320626C61636B222C
0D0A22313534206320626C61636B222C0D0A22313535206320626C61636B222C
0D0A22313536206320626C61636B222C0D0A22313537206320626C61636B222C
0D0A22313538206320626C61636B222C0D0A22313539206320626C61636B222C
0D0A22313630206320626C61636B222C0D0A22313631206320626C61636B222C
0D0A22313632206320626C61636B222C0D0A22313633206320626C61636B222C
0D0A22313634206320626C61636B222C0D0A22313635206320626C61636B222C
0D0A22313636206320626C61636B222C0D0A22313637206320626C61636B222C
0D0A22313638206320626C61636B222C0D0A22313639206320626C61636B222C
0D0A22313730206320626C61636B222C0D0A22313731206320626C61636B222C
0D0A22313732206320626C61636B222C0D0A22313733206320626C61636B222C
0D0A22313734206320626C61636B222C0D0A22313735206320626C61636B222C
0D0A22313736206320626C61636B222C0D0A22313737206320626C61636B222C
0D0A22313738206320626C61636B222C0D0A22313739206320626C61636B222C
0D0A22313830206320626C61636B222C0D0A22313831206320626C61636B222C
0D0A22313832206320626C61636B222C0D0A22313833206320626C61636B222C
0D0A22313834206320626C61636B222C0D0A22313835206320626C61636B222C
0D0A22313836206320626C61636B222C0D0A22313837206320626C61636B222C
0D0A22313838206320626C61636B222C0D0A22313839206320626C61636B222C
0D0A22313930206320626C61636B222C0D0A22313931206320626C61636B222C
0D0A22313932206320626C61636B222C0D0A22313933206320626C61636B222C
0D0A22313934206320626C61636B222C0D0A22313935206320626C61636B222C
0D0A22313936206320626C61636B222C0D0A22313937206320626C61636B222C
0D0A22313938206320626C61636B222C0D0A22313939206320626C61636B222C
0D0A22323030206320626C61636B222C0D0A22323031206320626C61636B222C
0D0A22323032206320626C61636B222C0D0A22323033206320626C61636B222C
0D0A22323034206320626C61636B222C0D0A22323035206320626C61636B222C
0D0A22323036206320626C61636B222C0D0A22323037206320626C61636B222C
0D0A22323038206320626C61636B222C0D0A22323039206320626C61636B222C
0D0A22323130206320626C61636B222C0D0A22323131206320626C61636B222C
0D0A22323132206320626C61636B222C0D0A22323133206320626C61636B222C
0D0A22323134206320626C61636B222C0D0A22323135206320626C61636B222C
0D0A22323136206320626C61636B222C0D0A22323137206320626C61636B222C
0D0A22323138206320626C61636B222C0D0A22323139206320626C61636B222C
0D0A22323230206320626C61636B222C0D0A22323231206320626C61636B222C
0D0A22323232206320626C61636B222C0D0A22323233206320626C61636B222C
0D0A22323234206320626C61636B222C0D0A22323235206320626C61636B222C
0D0A22323236206320626C61636B222C0D0A22323237206320626C61636B222C
0D0A22323238206320626C61636B222C0D0A22323239206320626C61636B222C
0D0A22323330206320626C61636B222C0D0A22323331206320626C61636B222C
0D0A22323332206320626C61636B222C0D0A22323333206320626C61636B222C
0D0A22323334206320626C61636B222C0D0A22323335206320626C61636B222C
0D0A22323336206320626C61636B222C0D0A22323337206320626C61636B222C
0D0A22323338206320626C61636B222C0D0A22323339206320626C61636B222C
0D0A22323430206320626C61636B222C0D0A22323431206320626C61636B222C
0D0A22323432206320626C61636B222C0D0A22323433206320626C61636B222C
0D0A22323434206320626C61636B222C0D0A22323435206320626C61636B222C
0D0A22323436206320626C61636B222C0D0A22323437206320626C61636B222C
0D0A22323438206320626C61636B222C0D0A22323439206320626C61636B222C
0D0A22323530206320626C61636B222C0D0A22323531206320626C61636B222C
0D0A22323532206320626C61636B222C0D0A22323533206320626C61636B222C
0D0A22323534206320626C61636B222C0D0A22323535206320626C61636B222C
0D0A223030333030333030333030333030333030333030333030333030333030
33303033303033303033303033303033303033222C0D0A223030333030333030
3330303330303330303330303330303330303330303330303330303330303330
3033303033303033222C0D0A2230303330303330303330303330303330303330
3033303033303033303033303033303033303033303033303033303033222C0D
0A22303033303033303033303030303030303033303033303033303033303033
303033303033303033303033303033303033222C0D0A22303033303033303033
3030303030313030303030303030333030333030333030333030333030333030
33303033303033222C0D0A223030333030333030333030303030313030313030
31303030303030303033303033303033303033303033303033303033222C0D0A
2230303330303330303330303030303130303130303130303130303130303030
3030303033303033303033303033303033222C0D0A2230303330303330303330
3030303031303031303031303031303031303031303031303030303030303033
303033303033222C0D0A22303033303033303033303030303031303031303031
303031303031303031303031303032303032303033303033303033222C0D0A22
3030333030333030333030303030313030313030313030313030313030323030
32303033303033303033303033303033222C0D0A223030333030333030333030
3030303130303130303130303230303230303330303330303330303330303330
3033303033222C0D0A2230303330303330303330303030303130303230303230
3033303033303033303033303033303033303033303033303033222C0D0A2230
3033303033303033303032303032303033303033303033303033303033303033
303033303033303033303033303033222C0D0A22303033303033303033303033
3030333030333030333030333030333030333030333030333030333030333030
33303033222C0D0A223030333030333030333030333030333030333030333030
33303033303033303033303033303033303033303033303033222C0D0A223030
3330303330303330303330303330303330303330303330303330303330303330
3033303033303033303033303033220D0A7D3B0D0A
}
NumGlyphs = 0
OnClick = PlayClick
TabOrder = 4
Left = 88
Height = 26
Top = 67
Width = 28
end
object btStop: TBitBtn
BorderSpacing.InnerBorder = 2
Glyph.Data = {
970300002F2A2058504D202A2F0D0A7374617469632063686172202A5069786D
61705B5D203D207B0D0A2231362031362031362032222C0D0A22303020632023
303830383130222C0D0A22303120632023313831383231222C0D0A2230322063
20677261793136222C0D0A22303320632023443644364345222C0D0A22303420
632067726179313030222C0D0A22303520632067726179313030222C0D0A2230
3620632067726179313030222C0D0A22303720632067726179313030222C0D0A
22303820632067726179313030222C0D0A22303920632067726179313030222C
0D0A22313020632067726179313030222C0D0A22313120632067726179313030
222C0D0A22313220632067726179313030222C0D0A2231332063206772617931
3030222C0D0A22313420632067726179313030222C0D0A223135206320677261
79313030222C0D0A223033303330333033303330333033303330333033303330
333033303330333033222C0D0A22303330333033303330333033303330333033
3033303330333033303330333033222C0D0A2230333033303330333033303330
33303330333033303330333033303330333033222C0D0A223033303330333030
303030303030303030303030303030303030303330333033222C0D0A22303330
3330333030303130313031303130313031303130313032303330333033222C0D
0A22303330333033303030313031303130313031303130313031303230333033
3033222C0D0A2230333033303330303031303130313031303130313031303130
32303330333033222C0D0A223033303330333030303130313031303130313031
303130313032303330333033222C0D0A22303330333033303030313031303130
3130313031303130313032303330333033222C0D0A2230333033303330303031
30313031303130313031303130313032303330333033222C0D0A223033303330
333030303130313031303130313031303130313032303330333033222C0D0A22
3033303330333030303130313031303130313031303130313032303330333033
222C0D0A22303330333033303230323032303230323032303230323032303230
3330333033222C0D0A2230333033303330333033303330333033303330333033
30333033303330333033222C0D0A223033303330333033303330333033303330
333033303330333033303330333033222C0D0A22303330333033303330333033
3033303330333033303330333033303330333033220D0A7D3B0D0A
}
NumGlyphs = 0
OnClick = StopClick
TabOrder = 5
Left = 116
Height = 26
Top = 67
Width = 28
end
object PlayTimer: TTimer
Enabled = False
Interval = 150
OnTimer = Timer1Timer
top = 152
end
object CDIn1: TACSCDIn
top = 8
end
object AudioOut1: TACSAudioOut
Driver = 'Wavemapper'
Input = CDIn1
Delay = 6
SuspendWhenIdle = True
OnDone = AudioOut1Done
OnProgress = AudioOut1Progress
top = 40
end
end

View File

@@ -0,0 +1,143 @@
unit uMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
ACS_Audio,ACS_File,ACS_Classes,ACS_Allformats, ExtCtrls, StdCtrls, ComCtrls, ACS_CDROM;
type
{ TForm1 }
TForm1 = class(TForm)
AudioOut1: TACSAudioOut;
CDIn1: TACSCDIn;
btRew: TBitBtn;
btFfw: TBitBtn;
btPlay: TBitBtn;
btStop: TBitBtn;
btOpen: TBitBtn;
lTrack: TLabel;
lTime: TLabel;
Panel1: TPanel;
Progress: TProgressBar;
PlayTimer: TTimer;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
lTracksCount: TLabel;
Label5: TLabel;
lLeft: TLabel;
procedure AudioOut1Done(Sender: TComponent);
procedure AudioOut1Progress(Sender: TComponent);
procedure AudioOut1ThreadException(Sender: TComponent; E: Exception);
procedure PlayClick(Sender: TObject);
procedure StopClick(Sender: TObject);
procedure OpenClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure btFfwClick(Sender: TObject);
procedure btRewClick(Sender: TObject);
procedure FormCreate(Sender : TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.PlayClick(Sender: TObject);
begin
AudioOut1.Run;
btPlay.Enabled := False;
btStop.Enabled := True;
btOpen.Enabled := False;
btRew.Enabled := False;
btFfw.Enabled := False;
end;
procedure TForm1.AudioOut1Done(Sender: TComponent);
begin
btPlay.Enabled := True;
btStop.Enabled := False;
btOpen.Enabled := True;
btRew.Enabled := True;
btFfw.Enabled := True;
PlayTimer.Enabled := false;
end;
procedure TForm1.AudioOut1Progress(Sender: TComponent);
begin
PlayTimer.Enabled := True;
end;
procedure TForm1.AudioOut1ThreadException(Sender: TComponent; E: Exception);
begin
ShowMessage(E.Message);
end;
procedure TForm1.StopClick(Sender: TObject);
begin
AudioOut1.Stop;
end;
procedure TForm1.OpenClick(Sender: TObject);
begin
lTracksCount.Caption := Format('%.2d',[CDIn1.Trackscount]);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
tmp : real;
begin
tmp := ((CDIn1.Position * CDIn1.TotalTime) / CDIn1.Size);
lTime.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
tmp := CDIn1.TotalTime-((CDIn1.Position * CDIn1.TotalTime) / CDIn1.Size);
lLeft.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
Progress.Position := round((CDIn1.Position * 100) / CDIn1.Size);
end;
procedure TForm1.btFfwClick(Sender: TObject);
begin
CDIn1.StartTrack := CDIn1.StartTrack+1;
CDIn1.EndTrack := CDIn1.StartTrack+1;
if CDIn1.StartTrack = CDIn1.TracksCount-1 then
btFfw.Enabled := False;
if CDIn1.StartTrack > 0 then
btRew.Enabled := True;
lTrack.Caption := Format('%.2d',[CDIn1.EndTrack]);
lLeft.Caption := '';
lTime.Caption := '00:00:00';
end;
procedure TForm1.btRewClick(Sender: TObject);
begin
CDIn1.StartTrack := CDIn1.StartTrack-1;
CDIn1.EndTrack := CDIn1.StartTrack+1;
if CDIn1.StartTrack < CDIn1.TracksCount-1 then
btFfw.Enabled := True;
if CDIn1.StartTrack <= 0 then
btRew.Enabled := False;
lTrack.Caption := Format('%.2d',[CDIn1.EndTrack]);
lLeft.Caption := '';
lTime.Caption := '00:00:00';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
lTracksCount.Caption := Format('%.2d',[CDIn1.Trackscount]);
end;
initialization
{$I umain.lrs}
end.

View File

@@ -0,0 +1,302 @@
<?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="12">
<Unit0>
<CursorPos X="1" Y="14"/>
<EditorIndex Value="6"/>
<Filename Value="fileconverter.lpr"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<TopLine Value="1"/>
<UnitName Value="fileconverter"/>
<UsageCount Value="22"/>
</Unit0>
<Unit1>
<CursorPos X="20" Y="71"/>
<EditorIndex Value="0"/>
<Filename Value="umain.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<ResourceFilename Value="umain.lrs"/>
<TopLine Value="54"/>
<UnitName Value="uMain"/>
<UsageCount Value="22"/>
</Unit1>
<Unit2>
<CursorPos X="1" Y="337"/>
<EditorIndex Value="1"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\acs_file.pas"/>
<Loaded Value="True"/>
<TopLine Value="321"/>
<UnitName Value="acs_file"/>
<UsageCount Value="10"/>
</Unit2>
<Unit3>
<CursorPos X="2" Y="724"/>
<EditorIndex Value="2"/>
<Filename Value="D:\LKomponenten\acs\Src\classes\acs_classes.pas"/>
<Loaded Value="True"/>
<TopLine Value="712"/>
<UnitName Value="acs_classes"/>
<UsageCount Value="10"/>
</Unit3>
<Unit4>
<CursorPos X="1" Y="2235"/>
<Filename Value="D:\lazarus\lcl\include\control.inc"/>
<TopLine Value="2219"/>
<UsageCount Value="10"/>
</Unit4>
<Unit5>
<CursorPos X="1" Y="814"/>
<Filename Value="D:\lazarus\lcl\EditBtn.pas"/>
<TopLine Value="798"/>
<UnitName Value="EditBtn"/>
<UsageCount Value="10"/>
</Unit5>
<Unit6>
<CursorPos X="18" Y="82"/>
<EditorIndex Value="3"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Loaded Value="True"/>
<TopLine Value="66"/>
<UnitName Value="acs_vorbis"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<CursorPos X="22" Y="317"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_dsfiles.pas"/>
<TopLine Value="313"/>
<UnitName Value="acs_dsfiles"/>
<UsageCount Value="10"/>
</Unit7>
<Unit8>
<CursorPos X="8" Y="12"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\ACS_Allformats.pas"/>
<TopLine Value="1"/>
<UnitName Value="acs_allformats"/>
<UsageCount Value="10"/>
</Unit8>
<Unit9>
<CursorPos X="1" Y="227"/>
<EditorIndex Value="5"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_lame.pas"/>
<Loaded Value="True"/>
<TopLine Value="195"/>
<UnitName Value="acs_lame"/>
<UsageCount Value="10"/>
</Unit9>
<Unit10>
<CursorPos X="1" Y="1038"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\general\lame.pas"/>
<TopLine Value="1022"/>
<UnitName Value="lame"/>
<UsageCount Value="10"/>
</Unit10>
<Unit11>
<CursorPos X="3" Y="96"/>
<EditorIndex Value="4"/>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\general\vorbiscodec.pas"/>
<Loaded Value="True"/>
<TopLine Value="80"/>
<UnitName Value="vorbiscodec"/>
<UsageCount Value="10"/>
</Unit11>
</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="4" Valid="True"/>
</Item2>
</RequiredPackages>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="348" Column="1" TopLine="332"/>
</Position1>
<Position2>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="346" Column="28" TopLine="328"/>
</Position2>
<Position3>
<Filename Value="umain.pas"/>
<Caret Line="66" Column="1" TopLine="50"/>
</Position3>
<Position4>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="335" Column="1" TopLine="319"/>
</Position4>
<Position5>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="351" Column="17" TopLine="335"/>
</Position5>
<Position6>
<Filename Value="umain.pas"/>
<Caret Line="66" Column="1" TopLine="50"/>
</Position6>
<Position7>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="335" Column="1" TopLine="319"/>
</Position7>
<Position8>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="336" Column="1" TopLine="320"/>
</Position8>
<Position9>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="337" Column="1" TopLine="321"/>
</Position9>
<Position10>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="344" Column="1" TopLine="328"/>
</Position10>
<Position11>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="345" Column="1" TopLine="329"/>
</Position11>
<Position12>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="346" Column="1" TopLine="330"/>
</Position12>
<Position13>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="347" Column="1" TopLine="331"/>
</Position13>
<Position14>
<Filename Value="umain.pas"/>
<Caret Line="66" Column="1" TopLine="50"/>
</Position14>
<Position15>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="335" Column="1" TopLine="319"/>
</Position15>
<Position16>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="336" Column="1" TopLine="320"/>
</Position16>
<Position17>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="337" Column="1" TopLine="321"/>
</Position17>
<Position18>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="344" Column="1" TopLine="328"/>
</Position18>
<Position19>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="345" Column="1" TopLine="329"/>
</Position19>
<Position20>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="346" Column="1" TopLine="330"/>
</Position20>
<Position21>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="347" Column="1" TopLine="331"/>
</Position21>
<Position22>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="348" Column="1" TopLine="332"/>
</Position22>
<Position23>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="349" Column="1" TopLine="333"/>
</Position23>
<Position24>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="351" Column="1" TopLine="335"/>
</Position24>
<Position25>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="353" Column="1" TopLine="337"/>
</Position25>
<Position26>
<Filename Value="D:\LKomponenten\acs\Src\classes\acs_file.pas"/>
<Caret Line="334" Column="15" TopLine="321"/>
</Position26>
<Position27>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="353" Column="45" TopLine="347"/>
</Position27>
<Position28>
<Filename Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Caret Line="82" Column="18" TopLine="66"/>
</Position28>
<Position29>
<Filename Value="D:\LKomponenten\acs\Src\classes\acs_classes.pas"/>
<Caret Line="724" Column="2" TopLine="712"/>
</Position29>
<Position30>
<Filename Value="umain.pas"/>
<Caret Line="66" Column="1" TopLine="50"/>
</Position30>
</JumpHistory>
</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="3">
<Item1>
<Source Value="D:\LKomponenten\acs\Demos\Ripper\umain.pas"/>
<Line Value="68"/>
</Item1>
<Item2>
<Source Value="D:\LKomponenten\acs\Src\fileformats\acs_lame.pas"/>
<Line Value="297"/>
</Item2>
<Item3>
<Source Value="D:\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<Line Value="335"/>
</Item3>
</BreakPoints>
<Watches Count="1">
<Item1>
<Expression Value="newfilename"/>
</Item1>
</Watches>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,165 @@
object Form1: TForm1
ActiveControl = BitBtn1
BorderStyle = bsToolWindow
Caption = 'Fileconverter'
ClientHeight = 62
ClientWidth = 401
OnCreate = FormCreate
PixelsPerInch = 96
HorzScrollBar.Page = 400
VertScrollBar.Page = 61
Left = 440
Height = 62
Top = 309
Width = 401
object Label1: TLabel
Caption = 'Output Dir'
Color = clNone
ParentColor = False
Left = 96
Height = 14
Top = 16
Width = 51
end
object pbProgress: TProgressBar
Max = 100
Left = 8
Height = 16
Top = 40
Width = 384
end
object BitBtn1: TBitBtn
BorderSpacing.InnerBorder = 2
Caption = 'Open'
Glyph.Data = {
910900002F2A2058504D202A2F0D0A7374617469632063686172202A2062746E
5F6F70656E66696C655F78706D5B5D203D207B0D0A2231382031382039372032
222C0D0A2220200963204E6F6E65222C0D0A222E200963202330303030303022
2C0D0A222B2009632023344533333142222C0D0A224020096320234535413536
36222C0D0A22232009632023464544333941222C0D0A22242009632023464543
353835222C0D0A22252009632023464443353837222C0D0A2226200963202346
4543323832222C0D0A222A2009632023463841433632222C0D0A223D20096320
23464543383841222C0D0A222D2009632023353335303444222C0D0A223B2009
632023353535323446222C0D0A223E2009632023354335413537222C0D0A222C
2009632023353435313445222C0D0A22272009632023353635333530222C0D0A
22292009632023433438363445222C0D0A22212009632023353234463443222C
0D0A227E2009632023463546354635222C0D0A227B2009632023454345434543
222C0D0A225D2009632023453445344534222C0D0A225E200963202344434443
4443222C0D0A222F2009632023443444344434222C0D0A222820096320234342
43424342222C0D0A225F2009632023433443344334222C0D0A223A2009632023
424342434243222C0D0A223C2009632023423542354235222C0D0A225B200963
2023423342334233222C0D0A227D2009632023333033303330222C0D0A227C20
09632023344133313139222C0D0A22312009632023444244424442222C0D0A22
322009632023444644464445222C0D0A22332009632023453845384537222C0D
0A22342009632023453645364534222C0D0A2235200963202344324432443122
2C0D0A22362009632023433743374336222C0D0A223720096320234241424142
39222C0D0A22382009632023414441444143222C0D0A22392009632023413041
303946222C0D0A22302009632023393439343933222C0D0A2261200963202334
3934393438222C0D0A22622009632023423737443434222C0D0A226320096320
23353335313445222C0D0A22642009632023444144414441222C0D0A22652009
632023444244424441222C0D0A22662009632023453145314530222C0D0A2267
2009632023444444444443222C0D0A22682009632023443644364435222C0D0A
22692009632023434243424341222C0D0A226A2009632023433143314330222C
0D0A226B2009632023423642364235222C0D0A226C2009632023413941394138
222C0D0A226D2009632023363836383637222C0D0A226E200963202332323232
3231222C0D0A226F2009632023343933303138222C0D0A227020096320234344
43444344222C0D0A22712009632023434143414339222C0D0A22722009632023
443544354434222C0D0A22732009632023443244324430222C0D0A2274200963
2023434343434342222C0D0A22752009632023433243324331222C0D0A227620
09632023423942394238222C0D0A22772009632023414641464145222C0D0A22
782009632023413241324131222C0D0A22792009632023393539353934222C0D
0A227A2009632023434543454345222C0D0A2241200963202342454245424322
2C0D0A22422009632023433443344332222C0D0A224320096320234336433643
35222C0D0A22442009632023433343334332222C0D0A22452009632023424642
464245222C0D0A22462009632023414541454144222C0D0A2247200963202341
3541354134222C0D0A22482009632023394539453944222C0D0A224920096320
23364636463645222C0D0A224A2009632023313231323132222C0D0A224B2009
632023424442444244222C0D0A224C2009632023413641364135222C0D0A224D
2009632023414141414138222C0D0A224E2009632023414441444142222C0D0A
224F2009632023414541454143222C0D0A22502009632023414241424141222C
0D0A22512009632023413741374136222C0D0A22522009632023413141314130
222C0D0A22532009632023394139413939222C0D0A2254200963202339343934
3932222C0D0A22552009632023384438443842222C0D0A225620096320233233
32333233222C0D0A22572009632023344134413441222C0D0A22582009632023
344134413439222C0D0A22592009632023344334433442222C0D0A225A200963
2023344334433443222C0D0A22602009632023344234423441222C0D0A22202E
09632023343634363436222C0D0A222E2E09632023343334333433222C0D0A22
2B2E09632023343134313430222C0D0A22402E09632023333433343333222C0D
0A22232E09632023314631463145222C0D0A222020202020202020202020202E
202E202E202E2020202020202020202020202020202020222C0D0A2220202020
2020202020202E202E2020202E202E202E202E2020202E202020202020202020
222C0D0A2220202020202020202E20202020202020202020202E202E202E202E
202020202020202020222C0D0A22202020202020202020202020202020202020
202020202E202E202E202020202020202020222C0D0A22202020202020202020
20202020202020202020202E202E202E202E202020202020202020222C0D0A22
20202B202B202B202B2020202020202020202020202020202020202020202020
20202020222C0D0A222B2040202320242040202B202B202B202B202B202B202B
20202020202020202020202020222C0D0A222B202320252026202A202A202A20
2A202A202A202A202A202E2020202020202020202020222C0D0A222B203D2026
202B202D202D203B203E202C202C20272027202C202E202E202E202020202022
2C0D0A222B202620292021207E207E207B205D205E202F2028205F203A203C20
5B207D2020202020222C0D0A222B2026207C2031203220332034203220352036
2037203820392030206120202020202020222C0D0A222B206220632064206520
66206720682069206A206B206C2039206D206E20202020202020222C0D0A222B
206F207020712072207220732074207520762077207820792061202020202020
202020222C0D0A222B2027207A20412042204320442045206B20462047204820
49204A202020202020202020222C0D0A222B204B204C204D204E204F20502051
205220532054205520612020202020202020202020222C0D0A22562057205820
59205A20592060206120202E2E2E2B2E402E232E20202020202020202020222C
0D0A222020202020202020202020202020202020202020202020202020202020
20202020202020222C0D0A222020202020202020202020202020202020202020
20202020202020202020202020202020227D3B0D0A
}
NumGlyphs = 0
OnClick = BitBtn1Click
TabOrder = 0
Left = 8
Height = 24
Top = 11
Width = 72
end
object DirectoryEdit: TDirectoryEdit
ButtonWidth = 23
NumGlyphs = 1
ParentColor = False
TabOrder = 1
TabOrder = 1
Left = 152
Height = 23
Top = 11
Width = 112
end
object btStart: TBitBtn
BorderSpacing.InnerBorder = 2
Caption = 'Start'
NumGlyphs = 0
OnClick = BitBtn2Click
TabOrder = 2
Left = 352
Height = 22
Top = 11
Width = 43
end
object cbOutput: TComboBox
MaxLength = 0
Style = csDropDownList
TabOrder = 3
Left = 295
Height = 21
Top = 11
Width = 49
end
object FileIn: TACSFileIn
EndSample = -1
EndSample = -1
left = 32
top = 8
end
object FileOut: TACSFileOut
Input = FileIn
OnDone = FileOutDone
OnProgress = FileOutProgress
left = 32
top = 368
end
end

View File

@@ -0,0 +1,95 @@
unit uMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls, Buttons, EditBtn, ACS_File, StdCtrls
,ACS_AllFormats,ACS_Classes;
type
{ TForm1 }
TForm1 = class(TForm)
BitBtn1: TBitBtn;
btStart: TBitBtn;
cbOutput: TComboBox;
DirectoryEdit: TDirectoryEdit;
FileIn: TACSFileIn;
FileOut: TACSFileOut;
Label1: TLabel;
pbProgress: TProgressBar;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FileOutDone(Sender: TComponent);
procedure FileOutProgress(Sender: TComponent);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
FileIn.Open;
DirectoryEdit.Text := ExtractFileDir(FileIn.FileName);
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
var
newfilename : string;
begin
newfilename := ExtractFileName(FileIn.FileName);
if newfilename = '' then
begin
ShowMessage('You must open an file first !');
exit;
end;
newfilename := copy(newfilename,0,length(newfilename)-length(ExtractFileExt(newfilename)));
if DirectoryEdit.Directory = '' then
begin
ShowMessage('You must select an directory first !');
exit;
end;
FileOut.FileName := DirectoryEdit.Directory+DirectorySeparator+newfilename+'.'+cbOutput.Text;
btStart.Enabled := False;
FileOut.Run;
end;
procedure TForm1.FileOutDone(Sender: TComponent);
begin
btStart.Enabled := True;
pbProgress.Position := 0;
end;
procedure TForm1.FileOutProgress(Sender: TComponent);
begin
pbProgress.Position := round(FileOut.Progress);
Update;
Application.Processmessages;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i : Integer;
begin
for i := 0 to Fileformats.Count-1 do
if TACSFileFormat(Fileformats[i]).FileClass.InheritsFrom(TACSCustomFileOut) then
cbOutput.Items.Add(TACSFileFormat(Fileformats[i]).Extension);
end;
initialization
{$I umain.lrs}
end.

View File

@@ -0,0 +1,278 @@
/* XPM */
static char *Pixmap[] = {
"18 18 256 3",
"000 c black",
"001 c #010101",
"002 c #020202",
"003 c #040404",
"004 c #070707",
"005 c #090909",
"006 c #0C0C0C",
"007 c #0E0E0E",
"008 c #111111",
"009 c #131312",
"010 c gray8",
"011 c #161616",
"012 c #191919",
"013 c #1B1B1B",
"014 c gray11",
"015 c gray13",
"016 c gray15",
"017 c #282827",
"018 c gray16",
"019 c gray18",
"020 c #323231",
"021 c #353534",
"022 c gray22",
"023 c #393939",
"024 c #40403F",
"025 c gray25",
"026 c gray26",
"027 c #484847",
"028 c #515150",
"029 c dimgray",
"030 c #5B5B5B",
"031 c #5C5C5B",
"032 c #5E5E5D",
"033 c #60605F",
"034 c #636362",
"035 c #646463",
"036 c #656564",
"037 c #666665",
"038 c #676766",
"039 c #686867",
"040 c #6C6C6B",
"041 c #70706F",
"042 c #757574",
"043 c #7E7E7D",
"044 c #DFDFDE",
"045 c black",
"046 c black",
"047 c black",
"048 c black",
"049 c black",
"050 c black",
"051 c black",
"052 c black",
"053 c black",
"054 c black",
"055 c black",
"056 c black",
"057 c black",
"058 c black",
"059 c black",
"060 c black",
"061 c black",
"062 c black",
"063 c black",
"064 c black",
"065 c black",
"066 c black",
"067 c black",
"068 c black",
"069 c black",
"070 c black",
"071 c black",
"072 c black",
"073 c black",
"074 c black",
"075 c black",
"076 c black",
"077 c black",
"078 c black",
"079 c black",
"080 c black",
"081 c black",
"082 c black",
"083 c black",
"084 c black",
"085 c black",
"086 c black",
"087 c black",
"088 c black",
"089 c black",
"090 c black",
"091 c black",
"092 c black",
"093 c black",
"094 c black",
"095 c black",
"096 c black",
"097 c black",
"098 c black",
"099 c black",
"100 c black",
"101 c black",
"102 c black",
"103 c black",
"104 c black",
"105 c black",
"106 c black",
"107 c black",
"108 c black",
"109 c black",
"110 c black",
"111 c black",
"112 c black",
"113 c black",
"114 c black",
"115 c black",
"116 c black",
"117 c black",
"118 c black",
"119 c black",
"120 c black",
"121 c black",
"122 c black",
"123 c black",
"124 c black",
"125 c black",
"126 c black",
"127 c black",
"128 c black",
"129 c black",
"130 c black",
"131 c black",
"132 c black",
"133 c black",
"134 c black",
"135 c black",
"136 c black",
"137 c black",
"138 c black",
"139 c black",
"140 c black",
"141 c black",
"142 c black",
"143 c black",
"144 c black",
"145 c black",
"146 c black",
"147 c black",
"148 c black",
"149 c black",
"150 c black",
"151 c black",
"152 c black",
"153 c black",
"154 c black",
"155 c black",
"156 c black",
"157 c black",
"158 c black",
"159 c black",
"160 c black",
"161 c black",
"162 c black",
"163 c black",
"164 c black",
"165 c black",
"166 c black",
"167 c black",
"168 c black",
"169 c black",
"170 c black",
"171 c black",
"172 c black",
"173 c black",
"174 c black",
"175 c black",
"176 c black",
"177 c black",
"178 c black",
"179 c black",
"180 c black",
"181 c black",
"182 c black",
"183 c black",
"184 c black",
"185 c black",
"186 c black",
"187 c black",
"188 c black",
"189 c black",
"190 c black",
"191 c black",
"192 c black",
"193 c black",
"194 c black",
"195 c black",
"196 c black",
"197 c black",
"198 c black",
"199 c black",
"200 c black",
"201 c black",
"202 c black",
"203 c black",
"204 c black",
"205 c black",
"206 c black",
"207 c black",
"208 c black",
"209 c black",
"210 c black",
"211 c black",
"212 c black",
"213 c black",
"214 c black",
"215 c black",
"216 c black",
"217 c black",
"218 c black",
"219 c black",
"220 c black",
"221 c black",
"222 c black",
"223 c black",
"224 c black",
"225 c black",
"226 c black",
"227 c black",
"228 c black",
"229 c black",
"230 c black",
"231 c black",
"232 c black",
"233 c black",
"234 c black",
"235 c black",
"236 c black",
"237 c black",
"238 c black",
"239 c black",
"240 c black",
"241 c black",
"242 c black",
"243 c black",
"244 c black",
"245 c black",
"246 c black",
"247 c black",
"248 c black",
"249 c black",
"250 c black",
"251 c black",
"252 c black",
"253 c black",
"254 c black",
"255 c black",
"000000000000000000000000000000000000000000000000000000",
"000000016039039039039032006000000000000000000000000000",
"000000016043044044041039037013000000000000000000000000",
"000000016043044044041024039039019000000000000000000000",
"000000016043044044041012011036039027002000000000000000",
"000000016043044044043012000005031039030005000000000000",
"000000016043044044043016000000002027039036011000000000",
"000000016043044044043016000000000000020039039018000000",
"000000016043044044043016000000000000000014038039026001",
"000000016043044044043016000000000000000009034039028003",
"000000016043044044043016000000000000015039039023000000",
"000000016043044044043016000000000022039039015000000000",
"000000016042044044040012000003028039034008000000000000",
"000000016043044044041012007033039029004000000000000000",
"000000016043044044041021038039025001000000000000000000",
"000000016043044044041039039017000000000000000000000000",
"000000016039039039039035010000000000000000000000000000",
"000000000000000000000000000000000000000000000000000000"
};

View File

@@ -0,0 +1,36 @@
/* XPM */
static char *Pixmap[] = {
"16 16 16 2",
"00 c #080810",
"01 c #181821",
"02 c gray16",
"03 c #D6D6CE",
"04 c gray100",
"05 c gray100",
"06 c gray100",
"07 c gray100",
"08 c gray100",
"09 c gray100",
"10 c gray100",
"11 c gray100",
"12 c gray100",
"13 c gray100",
"14 c gray100",
"15 c gray100",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303000303030303030303",
"03030303030300010003030303030303",
"03030303030001010100030303030303",
"03030303000101010101000303030303",
"03030300010101010101010003030303",
"03030202020202020202020202030303",
"03030303030303030303030303030303",
"03030000000000000000000000030303",
"03030001010101010101010102030303",
"03030202020202020202020202030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303"
};

View File

@@ -0,0 +1,36 @@
/* XPM */
static char *Pixmap[] = {
"16 16 16 2",
"00 c #080810",
"01 c #181821",
"02 c gray16",
"03 c #D6D6CE",
"04 c gray100",
"05 c gray100",
"06 c gray100",
"07 c gray100",
"08 c gray100",
"09 c gray100",
"10 c gray100",
"11 c gray100",
"12 c gray100",
"13 c gray100",
"14 c gray100",
"15 c gray100",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030000000003030300000000030303",
"03030001010203030300010102030303",
"03030001010203030300010102030303",
"03030001010203030300010102030303",
"03030001010203030300010102030303",
"03030001010203030300010102030303",
"03030001010203030300010102030303",
"03030001010203030300010102030303",
"03030001010203030300010102030303",
"03030202020203030302020202030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303"
};

276
acs/Demos/images/play.xpm Normal file
View File

@@ -0,0 +1,276 @@
/* XPM */
static char *Pixmap[] = {
"16 16 256 3",
"000 c #0C0F12",
"001 c #1B1D20",
"002 c #2A2D2D",
"003 c #D4D0C8",
"004 c black",
"005 c black",
"006 c black",
"007 c black",
"008 c black",
"009 c black",
"010 c black",
"011 c black",
"012 c black",
"013 c black",
"014 c black",
"015 c black",
"016 c black",
"017 c black",
"018 c black",
"019 c black",
"020 c black",
"021 c black",
"022 c black",
"023 c black",
"024 c black",
"025 c black",
"026 c black",
"027 c black",
"028 c black",
"029 c black",
"030 c black",
"031 c black",
"032 c black",
"033 c black",
"034 c black",
"035 c black",
"036 c black",
"037 c black",
"038 c black",
"039 c black",
"040 c black",
"041 c black",
"042 c black",
"043 c black",
"044 c black",
"045 c black",
"046 c black",
"047 c black",
"048 c black",
"049 c black",
"050 c black",
"051 c black",
"052 c black",
"053 c black",
"054 c black",
"055 c black",
"056 c black",
"057 c black",
"058 c black",
"059 c black",
"060 c black",
"061 c black",
"062 c black",
"063 c black",
"064 c black",
"065 c black",
"066 c black",
"067 c black",
"068 c black",
"069 c black",
"070 c black",
"071 c black",
"072 c black",
"073 c black",
"074 c black",
"075 c black",
"076 c black",
"077 c black",
"078 c black",
"079 c black",
"080 c black",
"081 c black",
"082 c black",
"083 c black",
"084 c black",
"085 c black",
"086 c black",
"087 c black",
"088 c black",
"089 c black",
"090 c black",
"091 c black",
"092 c black",
"093 c black",
"094 c black",
"095 c black",
"096 c black",
"097 c black",
"098 c black",
"099 c black",
"100 c black",
"101 c black",
"102 c black",
"103 c black",
"104 c black",
"105 c black",
"106 c black",
"107 c black",
"108 c black",
"109 c black",
"110 c black",
"111 c black",
"112 c black",
"113 c black",
"114 c black",
"115 c black",
"116 c black",
"117 c black",
"118 c black",
"119 c black",
"120 c black",
"121 c black",
"122 c black",
"123 c black",
"124 c black",
"125 c black",
"126 c black",
"127 c black",
"128 c black",
"129 c black",
"130 c black",
"131 c black",
"132 c black",
"133 c black",
"134 c black",
"135 c black",
"136 c black",
"137 c black",
"138 c black",
"139 c black",
"140 c black",
"141 c black",
"142 c black",
"143 c black",
"144 c black",
"145 c black",
"146 c black",
"147 c black",
"148 c black",
"149 c black",
"150 c black",
"151 c black",
"152 c black",
"153 c black",
"154 c black",
"155 c black",
"156 c black",
"157 c black",
"158 c black",
"159 c black",
"160 c black",
"161 c black",
"162 c black",
"163 c black",
"164 c black",
"165 c black",
"166 c black",
"167 c black",
"168 c black",
"169 c black",
"170 c black",
"171 c black",
"172 c black",
"173 c black",
"174 c black",
"175 c black",
"176 c black",
"177 c black",
"178 c black",
"179 c black",
"180 c black",
"181 c black",
"182 c black",
"183 c black",
"184 c black",
"185 c black",
"186 c black",
"187 c black",
"188 c black",
"189 c black",
"190 c black",
"191 c black",
"192 c black",
"193 c black",
"194 c black",
"195 c black",
"196 c black",
"197 c black",
"198 c black",
"199 c black",
"200 c black",
"201 c black",
"202 c black",
"203 c black",
"204 c black",
"205 c black",
"206 c black",
"207 c black",
"208 c black",
"209 c black",
"210 c black",
"211 c black",
"212 c black",
"213 c black",
"214 c black",
"215 c black",
"216 c black",
"217 c black",
"218 c black",
"219 c black",
"220 c black",
"221 c black",
"222 c black",
"223 c black",
"224 c black",
"225 c black",
"226 c black",
"227 c black",
"228 c black",
"229 c black",
"230 c black",
"231 c black",
"232 c black",
"233 c black",
"234 c black",
"235 c black",
"236 c black",
"237 c black",
"238 c black",
"239 c black",
"240 c black",
"241 c black",
"242 c black",
"243 c black",
"244 c black",
"245 c black",
"246 c black",
"247 c black",
"248 c black",
"249 c black",
"250 c black",
"251 c black",
"252 c black",
"253 c black",
"254 c black",
"255 c black",
"003003003003003003003003003003003003003003003003",
"003003003003003003003003003003003003003003003003",
"003003003003003003003003003003003003003003003003",
"003003003000000003003003003003003003003003003003",
"003003003000001000000003003003003003003003003003",
"003003003000001001001000000003003003003003003003",
"003003003000001001001001001000000003003003003003",
"003003003000001001001001001001001000000003003003",
"003003003000001001001001001001001002002003003003",
"003003003000001001001001001002002003003003003003",
"003003003000001001001002002003003003003003003003",
"003003003000001002002003003003003003003003003003",
"003003003002002003003003003003003003003003003003",
"003003003003003003003003003003003003003003003003",
"003003003003003003003003003003003003003003003003",
"003003003003003003003003003003003003003003003003"
};

36
acs/Demos/images/stop.xpm Normal file
View File

@@ -0,0 +1,36 @@
/* XPM */
static char *Pixmap[] = {
"16 16 16 2",
"00 c #080810",
"01 c #181821",
"02 c gray16",
"03 c #D6D6CE",
"04 c gray100",
"05 c gray100",
"06 c gray100",
"07 c gray100",
"08 c gray100",
"09 c gray100",
"10 c gray100",
"11 c gray100",
"12 c gray100",
"13 c gray100",
"14 c gray100",
"15 c gray100",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030300000000000000000000030303",
"03030300010101010101010102030303",
"03030300010101010101010102030303",
"03030300010101010101010102030303",
"03030300010101010101010102030303",
"03030300010101010101010102030303",
"03030300010101010101010102030303",
"03030300010101010101010102030303",
"03030300010101010101010102030303",
"03030302020202020202020202030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303"
};

View File

@@ -0,0 +1,36 @@
/* XPM */
static char *Pixmap[] = {
"16 16 16 2",
"00 c #080810",
"01 c #181821",
"02 c gray16",
"03 c #D6D6CE",
"04 c gray100",
"05 c gray100",
"06 c gray100",
"07 c gray100",
"08 c gray100",
"09 c gray100",
"10 c gray100",
"11 c gray100",
"12 c gray100",
"13 c gray100",
"14 c gray100",
"15 c gray100",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030300000003030303030000030303",
"03030300010203030303000102030303",
"03030300010203030300010102030303",
"03030300010203030001010102030303",
"03030300010203000101010102030303",
"03030300010203020101010102030303",
"03030300010203030201010102030303",
"03030300010203030302010102030303",
"03030300010203030303020102030303",
"03030302020203030303030202030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303"
};

View File

@@ -0,0 +1,36 @@
/* XPM */
static char *Pixmap[] = {
"16 16 16 2",
"00 c #080810",
"01 c #181821",
"02 c gray16",
"03 c #D6D6CE",
"04 c gray100",
"05 c gray100",
"06 c gray100",
"07 c gray100",
"08 c gray100",
"09 c gray100",
"10 c gray100",
"11 c gray100",
"12 c gray100",
"13 c gray100",
"14 c gray100",
"15 c gray100",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030300000303030303000000030303",
"03030302010003030303020100030303",
"03030302010100030303020100030303",
"03030302010101000303020100030303",
"03030302010101010003020100030303",
"03030302010101010203020100030303",
"03030302010101020303020100030303",
"03030302010102030303020100030303",
"03030302010203030303020100030303",
"03030302020303030303020202030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303",
"03030303030303030303030303030303"
};

View File

@@ -0,0 +1,250 @@
<?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="17">
<Unit0>
<Filename Value="linerecord.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="linerecord"/>
<UsageCount Value="21"/>
</Unit0>
<Unit1>
<CursorPos X="24" Y="71"/>
<EditorIndex Value="0"/>
<Filename Value="umain.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<ResourceFilename Value="umain.lrs"/>
<TopLine Value="24"/>
<UnitName Value="umain"/>
<UsageCount Value="21"/>
</Unit1>
<Unit2>
<CursorPos X="15" Y="129"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/acs_file.pas"/>
<TopLine Value="129"/>
<UnitName Value="acs_file"/>
<UsageCount Value="10"/>
</Unit2>
<Unit3>
<CursorPos X="3" Y="153"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/acs_classes.pas"/>
<TopLine Value="134"/>
<UnitName Value="acs_classes"/>
<UsageCount Value="10"/>
</Unit3>
<Unit4>
<CursorPos X="15" Y="169"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/acs_mixer.pas"/>
<TopLine Value="153"/>
<UnitName Value="acs_mixer"/>
<UsageCount Value="10"/>
</Unit4>
<Unit5>
<CursorPos X="3" Y="389"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/windows/acs_mixer.inc"/>
<TopLine Value="372"/>
<UsageCount Value="10"/>
</Unit5>
<Unit6>
<CursorPos X="1" Y="2235"/>
<Filename Value="D:/lazarus/lcl/include/control.inc"/>
<TopLine Value="2219"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<CursorPos X="1" Y="645"/>
<Filename Value="D:/lazarus/lcl/EditBtn.pas"/>
<TopLine Value="629"/>
<UnitName Value="EditBtn"/>
<UsageCount Value="10"/>
</Unit7>
<Unit8>
<CursorPos X="1" Y="1379"/>
<Filename Value="D:/LKomponenten/acs/Src/fileformats/acs_wave.pas"/>
<TopLine Value="1363"/>
<UnitName Value="acs_wave"/>
<UsageCount Value="10"/>
</Unit8>
<Unit9>
<CursorPos X="27" Y="1335"/>
<Filename Value="D:/acs tmp/Src/Common/ACS_Wave.pas"/>
<TopLine Value="1326"/>
<UnitName Value="ACS_Wave"/>
<UsageCount Value="10"/>
</Unit9>
<Unit10>
<CursorPos X="1" Y="681"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/acs_audio.pas"/>
<TopLine Value="665"/>
<UnitName Value="acs_audio"/>
<UsageCount Value="10"/>
</Unit10>
<Unit11>
<CursorPos X="28" Y="377"/>
<Filename Value="D:/LKomponenten/acs/Src/drivers/windows/ACS_Audio.inc"/>
<TopLine Value="361"/>
<UsageCount Value="10"/>
</Unit11>
<Unit12>
<CursorPos X="14" Y="125"/>
<Filename Value="D:/LKomponenten/acs/Src/drivers/ACS_StdAudio.pas"/>
<TopLine Value="109"/>
<UnitName Value="acs_stdaudio"/>
<UsageCount Value="10"/>
</Unit12>
<Unit13>
<CursorPos X="1" Y="391"/>
<Filename Value="D:/LKomponenten/acs/Src/drivers/ACS_DXAudio.pas"/>
<TopLine Value="375"/>
<UnitName Value="acs_dxaudio"/>
<UsageCount Value="10"/>
</Unit13>
<Unit14>
<CursorPos X="1" Y="2456"/>
<Filename Value="D:/fpc/packages/extra/winunits/mmsystem.pp"/>
<TopLine Value="2440"/>
<UnitName Value="mmsystem"/>
<UsageCount Value="10"/>
</Unit14>
<Unit15>
<CursorPos X="18" Y="205"/>
<EditorIndex Value="2"/>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/acs_mixer.pas"/>
<Loaded Value="True"/>
<TopLine Value="197"/>
<UnitName Value="acs_mixer"/>
<UsageCount Value="10"/>
</Unit15>
<Unit16>
<CursorPos X="18" Y="99"/>
<EditorIndex Value="1"/>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Loaded Value="True"/>
<TopLine Value="152"/>
<UsageCount Value="10"/>
</Unit16>
</Units>
<PublishOptions>
<Version Value="2"/>
<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)"/>
<Display Use="True" Value=":1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="laz_acs"/>
</Item2>
</RequiredPackages>
<JumpHistory Count="12" HistoryIndex="11">
<Position1>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="163" Column="1" TopLine="136"/>
</Position1>
<Position2>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="164" Column="1" TopLine="137"/>
</Position2>
<Position3>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="163" Column="1" TopLine="136"/>
</Position3>
<Position4>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="164" Column="1" TopLine="137"/>
</Position4>
<Position5>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="163" Column="1" TopLine="136"/>
</Position5>
<Position6>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="164" Column="1" TopLine="137"/>
</Position6>
<Position7>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="163" Column="1" TopLine="136"/>
</Position7>
<Position8>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="164" Column="1" TopLine="137"/>
</Position8>
<Position9>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="163" Column="1" TopLine="136"/>
</Position9>
<Position10>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/linux/acs_mixer.inc"/>
<Caret Line="166" Column="1" TopLine="139"/>
</Position10>
<Position11>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/acs_mixer.pas"/>
<Caret Line="250" Column="3" TopLine="200"/>
</Position11>
<Position12>
<Filename Value="/windows/C/src/LKomponenten/acs/Src/classes/acs_mixer.pas"/>
<Caret Line="249" Column="40" TopLine="201"/>
</Position12>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<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="3">
<Item1>
<Source Value="D:/LKomponenten/acs/Demos/Ripper/umain.pas"/>
<Line Value="68"/>
</Item1>
<Item2>
<Source Value="D:/LKomponenten/acs/Src/fileformats/acs_wave.pas"/>
<Line Value="1379"/>
</Item2>
<Item3>
<Source Value="D:/LKomponenten/acs/Src/drivers/windows/ACS_Audio.inc"/>
<Line Value="341"/>
</Item3>
</BreakPoints>
<Watches Count="1">
<Item1>
<Expression Value="newfilename"/>
</Item1>
</Watches>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,83 @@
object Form1: TForm1
ActiveControl = bRecord
BorderStyle = bsToolWindow
Caption = 'Audio Record'
ClientHeight = 43
ClientWidth = 308
OnCreate = FormCreate
PixelsPerInch = 90
HorzScrollBar.Page = 307
VertScrollBar.Page = 42
Left = 347
Height = 43
Top = 208
Width = 308
object Label1: TLabel
Caption = 'Source'
Color = clNone
ParentColor = False
Left = 60
Height = 13
Width = 41
end
object bRecord: TBitBtn
BorderSpacing.InnerBorder = 2
Caption = 'Record'
NumGlyphs = 0
OnClick = bRecordClick
TabOrder = 0
Left = 184
Height = 26
Top = 12
Width = 60
end
object cbRecordSource: TComboBox
MaxLength = 0
OnChange = cbRecordSourceChange
TabOrder = 1
Left = 60
Height = 21
Top = 16
Width = 116
end
object bStop: TBitBtn
BorderSpacing.InnerBorder = 2
Caption = 'Stop'
NumGlyphs = 0
OnClick = bStopClick
TabOrder = 2
Left = 248
Height = 26
Top = 12
Width = 56
end
object bOpen: TBitBtn
BorderSpacing.InnerBorder = 2
Caption = 'Open'
NumGlyphs = 0
OnClick = bOpenClick
TabOrder = 3
Left = 4
Height = 26
Top = 12
Width = 51
end
object FileOut1: TACSFileOut
Input = AudioIn1
left = 4
top = 268
end
object AudioIn1: TACSAudioIn
Driver = 'Wavemapper'
InBitsPerSample = 8
InChannels = 1
InSampleRate = 8000
left = 4
top = 236
end
object Mixer1: TACSMixer
MixerName = 'Realtek ALC655 rev 0'
left = 4
top = 204
end
end

View File

@@ -0,0 +1,82 @@
unit umain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
StdCtrls, acs_file, acs_audio, EditBtn,acs_classes,acs_mixer;
type
{ TForm1 }
TForm1 = class(TForm)
bOpen: TBitBtn;
Mixer1: TACSMixer;
AudioIn1: TACSAudioIn;
FileOut1: TACSFileOut;
bRecord: TBitBtn;
bStop: TBitBtn;
cbRecordSource: TComboBox;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure bOpenClick(Sender: TObject);
procedure bRecordClick(Sender: TObject);
procedure bStopClick(Sender: TObject);
procedure cbRecordSourceChange(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
i : Integer;
begin
for i := 0 to Mixer1.Channelcount-1 do
if Mixer1.IsRecordable(i) then
cbRecordSource.Items.Add(Mixer1.ChannelName[i]);
cbRecordSource.Text := Mixer1.ChannelName[Mixer1.RecordSource];
end;
procedure TForm1.bOpenClick(Sender: TObject);
begin
FileOut1.Open;
if FileExists(FileOut1.FileName) then
FileOut1.FileMode := foAppend;
end;
procedure TForm1.bRecordClick(Sender: TObject);
begin
FileOut1.Run;
end;
procedure TForm1.bStopClick(Sender: TObject);
begin
FileOut1.Stop;
end;
procedure TForm1.cbRecordSourceChange(Sender: TObject);
var
i : Integer;
begin
for i := 0 to Mixer1.Channelcount-1 do
if Mixer1.ChannelName[i] = cbRecordSource.Text then
Mixer1.RecordSource := i;
end;
initialization
{$I umain.lrs}
end.

View File

@@ -0,0 +1,87 @@
[FileVersion]
Version=6.0
[Compiler]
A=8
B=0
C=1
D=1
E=0
F=0
G=1
H=1
I=1
J=0
K=0
L=1
M=0
N=1
O=1
P=1
Q=0
R=0
S=0
T=0
U=0
V=1
W=0
X=1
Y=1
Z=1
ShowHints=1
ShowWarnings=1
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[Linker]
MapFile=0
OutputObjs=0
ConsoleApp=1
DebugInfo=0
RemoteSymbols=0
MinStackSize=16384
MaxStackSize=1048576
ImageBase=4194304
ExeDescription=
[Directories]
OutputDir=
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
Packages=vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;vcldbx;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;dss;teeqr;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;dbexpress;dbxcds;indy;dclaxserver;visualclx;visualdbclx;ACS
Conditionals=
DebugSourceDirs=
UsePackages=0
[Parameters]
RunParams=
HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1031
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=

View File

@@ -0,0 +1,17 @@
program player;
uses
Forms,
uMain in 'umain.pas' {fMain},
uPlaylist in 'uplaylist.pas' {fPlaylist},
uvis in 'uvis.pas' {fVizu};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TfMain, fMain);
Application.CreateForm(TfPlaylist, fPlaylist);
Application.CreateForm(TfVizu, fVizu);
Application.Run;
end.

760
acs/Demos/player/player.lpi Normal file
View File

@@ -0,0 +1,760 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="6"/>
<General>
<Flags>
<AlwaysBuild Value="False"/>
</Flags>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<Title Value="Lazarus Player Example"/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<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"/>
</Item2>
</RequiredPackages>
<Units Count="96">
<Unit0>
<Filename Value="player.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="player"/>
<CursorPos X="1" Y="18"/>
<TopLine Value="1"/>
<EditorIndex Value="4"/>
<UsageCount Value="63"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="umain.pas"/>
<ComponentName Value="fMain"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="umain.lrs"/>
<UnitName Value="uMain"/>
<CursorPos X="1" Y="113"/>
<TopLine Value="99"/>
<EditorIndex Value="0"/>
<UsageCount Value="63"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\..\Src\classes\acs_audio.pas"/>
<UnitName Value="acs_audio"/>
<CursorPos X="25" Y="238"/>
<TopLine Value="225"/>
<EditorIndex Value="2"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="..\..\Src\drivers\windows\acs_audio.inc"/>
<CursorPos X="19" Y="244"/>
<TopLine Value="228"/>
<UsageCount Value="20"/>
</Unit3>
<Unit4>
<Filename Value="..\..\..\..\lazarus\lcl\include\control.inc"/>
<CursorPos X="1" Y="1823"/>
<TopLine Value="1808"/>
<UsageCount Value="10"/>
</Unit4>
<Unit5>
<Filename Value="..\..\..\..\lazarus\lcl\include\buttoncontrol.inc"/>
<CursorPos X="1" Y="58"/>
<TopLine Value="43"/>
<UsageCount Value="10"/>
</Unit5>
<Unit6>
<Filename Value="..\..\..\..\lazarus\lcl\include\buttons.inc"/>
<CursorPos X="1" Y="242"/>
<TopLine Value="227"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<Filename Value="..\..\Src\drivers\ACS_StdAudio.pas"/>
<UnitName Value="acs_stdaudio"/>
<CursorPos X="10" Y="115"/>
<TopLine Value="83"/>
<UsageCount Value="20"/>
</Unit7>
<Unit8>
<Filename Value="..\..\Src\classes\acs_file.pas"/>
<UnitName Value="acs_file"/>
<CursorPos X="1" Y="291"/>
<TopLine Value="277"/>
<EditorIndex Value="1"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
</Unit8>
<Unit9>
<Filename Value="..\..\Src\fileformats\acs_allformats.pas"/>
<UnitName Value="acs_allformats"/>
<CursorPos X="8" Y="8"/>
<TopLine Value="1"/>
<UsageCount Value="17"/>
</Unit9>
<Unit10>
<Filename Value="..\..\Src\fileformats\acs_dsaudio.pas"/>
<UnitName Value="acs_dsaudio"/>
<CursorPos X="13" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit10>
<Unit11>
<Filename Value="..\..\Src\fileformats\acs_dsfiles.pas"/>
<UnitName Value="acs_dsfiles"/>
<CursorPos X="1" Y="326"/>
<TopLine Value="305"/>
<UsageCount Value="14"/>
</Unit11>
<Unit12>
<Filename Value="..\..\Src\fileformats\acs_vorbis.pas"/>
<UnitName Value="acs_vorbis"/>
<CursorPos X="1" Y="462"/>
<TopLine Value="446"/>
<UsageCount Value="17"/>
</Unit12>
<Unit13>
<Filename Value="..\..\Src\classes\acs_classes.pas"/>
<UnitName Value="acs_classes"/>
<CursorPos X="25" Y="694"/>
<TopLine Value="680"/>
<EditorIndex Value="3"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
</Unit13>
<Unit14>
<Filename Value="..\..\Src\classes\ACS_Strings.pas"/>
<UnitName Value="ACS_Strings"/>
<CursorPos X="54" Y="48"/>
<TopLine Value="22"/>
<UsageCount Value="16"/>
</Unit14>
<Unit15>
<Filename Value="..\..\Src\drivers\acs_dxaudio.pas"/>
<UnitName Value="acs_dxaudio"/>
<CursorPos X="10" Y="335"/>
<TopLine Value="332"/>
<UsageCount Value="17"/>
</Unit15>
<Unit16>
<Filename Value="..\..\Src\fileformats\ACS_Wave.pas"/>
<UnitName Value="acs_wave"/>
<CursorPos X="16" Y="108"/>
<TopLine Value="76"/>
<UsageCount Value="10"/>
</Unit16>
<Unit17>
<Filename Value="..\..\..\..\lazarus\lcl\LResources.pp"/>
<UnitName Value="LResources"/>
<CursorPos X="26" Y="2101"/>
<TopLine Value="2082"/>
<UsageCount Value="10"/>
</Unit17>
<Unit18>
<Filename Value="..\Lazarus\Mediaplayer\uplayer.pas"/>
<HasResources Value="True"/>
<UnitName Value="uPlayer"/>
<CursorPos X="1" Y="351"/>
<TopLine Value="329"/>
<UsageCount Value="10"/>
</Unit18>
<Unit19>
<Filename Value="..\Win32\CDPlayer\Main.pas"/>
<UnitName Value="Main"/>
<CursorPos X="13" Y="121"/>
<TopLine Value="98"/>
<UsageCount Value="10"/>
</Unit19>
<Unit20>
<Filename Value="..\Win32\OggPlayer\Main.pas"/>
<UnitName Value="Main"/>
<CursorPos X="1" Y="129"/>
<TopLine Value="105"/>
<UsageCount Value="10"/>
</Unit20>
<Unit21>
<Filename Value="..\Win32\AudioPlayer\Main.pas"/>
<UnitName Value="Main"/>
<CursorPos X="13" Y="28"/>
<TopLine Value="28"/>
<UsageCount Value="10"/>
</Unit21>
<Unit22>
<Filename Value="..\..\..\..\fpc\packages\extra\winunits\activex.pp"/>
<UnitName Value="activex"/>
<CursorPos X="5" Y="2678"/>
<TopLine Value="2661"/>
<UsageCount Value="10"/>
</Unit22>
<Unit23>
<Filename Value="uplaylist.pas"/>
<ComponentName Value="fPlaylist"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="uplaylist.lrs"/>
<UnitName Value="uPlaylist"/>
<CursorPos X="8" Y="32"/>
<TopLine Value="17"/>
<UsageCount Value="43"/>
</Unit23>
<Unit24>
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\win32\win32object.inc"/>
<CursorPos X="1" Y="304"/>
<TopLine Value="287"/>
<UsageCount Value="10"/>
</Unit24>
<Unit25>
<Filename Value="..\..\Src\classes\acs_cdrom.pas"/>
<UnitName Value="acs_cdrom"/>
<CursorPos X="35" Y="6"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit25>
<Unit26>
<Filename Value="uvis.pas"/>
<ComponentName Value="fVizu"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="uvis.lrs"/>
<UnitName Value="uvis"/>
<CursorPos X="34" Y="9"/>
<TopLine Value="58"/>
<UsageCount Value="40"/>
</Unit26>
<Unit27>
<Filename Value="..\..\Src\classes\ACS_Indicator.pas"/>
<UnitName Value="ACS_Indicator"/>
<CursorPos X="52" Y="186"/>
<TopLine Value="157"/>
<UsageCount Value="11"/>
</Unit27>
<Unit28>
<Filename Value="..\..\Src\classes\ACS_Procs.pas"/>
<UnitName Value="ACS_Procs"/>
<CursorPos X="5" Y="268"/>
<TopLine Value="235"/>
<UsageCount Value="11"/>
</Unit28>
<Unit29>
<Filename Value="..\..\..\..\lazarus\lcl\Graphics.pp"/>
<UnitName Value="Graphics"/>
<CursorPos X="15" Y="927"/>
<TopLine Value="911"/>
<UsageCount Value="11"/>
</Unit29>
<Unit30>
<Filename Value="..\..\..\..\lazarus\lcl\graphtype.pp"/>
<UnitName Value="GraphType"/>
<CursorPos X="12" Y="2"/>
<TopLine Value="1"/>
<UsageCount Value="11"/>
</Unit30>
<Unit31>
<Filename Value="..\..\..\..\fpc\fcl\image\fpimage.pp"/>
<UnitName Value="FPimage"/>
<CursorPos X="15" Y="32"/>
<TopLine Value="14"/>
<UsageCount Value="10"/>
</Unit31>
<Unit32>
<Filename Value="..\..\..\..\lazarus\ide\lazarus.pp"/>
<UnitName Value="Lazarus"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit32>
<Unit33>
<Filename Value="..\..\..\..\lazarus\lcl\include\filedialog.inc"/>
<CursorPos X="1" Y="50"/>
<TopLine Value="33"/>
<UsageCount Value="10"/>
</Unit33>
<Unit34>
<Filename Value="windows\C\src\LKomponenten\acs\Src\fileformats\ACS_Vorbis.pas"/>
<UnitName Value="ACS_Vorbis"/>
<CursorPos X="37" Y="284"/>
<TopLine Value="255"/>
<UsageCount Value="10"/>
</Unit34>
<Unit35>
<Filename Value="windows\C\src\LKomponenten\acs\Src\fileformats\ACS_Allformats.pas"/>
<UnitName Value="acs_allformats"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit35>
<Unit36>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_File.pas"/>
<UnitName Value="ACS_File"/>
<CursorPos X="14" Y="231"/>
<TopLine Value="195"/>
<UsageCount Value="11"/>
</Unit36>
<Unit37>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Classes.pas"/>
<UnitName Value="ACS_Classes"/>
<CursorPos X="19" Y="231"/>
<TopLine Value="213"/>
<UsageCount Value="11"/>
</Unit37>
<Unit38>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Audio.pas"/>
<UnitName Value="ACS_Audio"/>
<CursorPos X="19" Y="308"/>
<TopLine Value="290"/>
<UsageCount Value="11"/>
</Unit38>
<Unit39>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_AudioMix.pas"/>
<UnitName Value="ACS_AudioMix"/>
<CursorPos X="42" Y="80"/>
<TopLine Value="62"/>
<UsageCount Value="10"/>
</Unit39>
<Unit40>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_CDROM.pas"/>
<UnitName Value="ACS_CDROM"/>
<CursorPos X="19" Y="127"/>
<TopLine Value="109"/>
<UsageCount Value="10"/>
</Unit40>
<Unit41>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\linux\ACS_CDROM.inc"/>
<CursorPos X="18" Y="356"/>
<TopLine Value="320"/>
<UsageCount Value="10"/>
</Unit41>
<Unit42>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Converters.pas"/>
<UnitName Value="ACS_Converters"/>
<CursorPos X="12" Y="823"/>
<TopLine Value="803"/>
<UsageCount Value="10"/>
</Unit42>
<Unit43>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Types.pas"/>
<UnitName Value="ACS_Types"/>
<CursorPos X="41" Y="75"/>
<TopLine Value="34"/>
<UsageCount Value="10"/>
</Unit43>
<Unit44>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Procs.pas"/>
<UnitName Value="ACS_Procs"/>
<CursorPos X="38" Y="276"/>
<TopLine Value="258"/>
<UsageCount Value="10"/>
</Unit44>
<Unit45>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Filters.pas"/>
<UnitName Value="ACS_Filters"/>
<CursorPos X="23" Y="673"/>
<TopLine Value="654"/>
<UsageCount Value="10"/>
</Unit45>
<Unit46>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Indicator.pas"/>
<UnitName Value="ACS_Indicator"/>
<CursorPos X="21" Y="115"/>
<TopLine Value="93"/>
<UsageCount Value="10"/>
</Unit46>
<Unit47>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Misc.pas"/>
<UnitName Value="ACS_Misc"/>
<CursorPos X="12" Y="496"/>
<TopLine Value="478"/>
<UsageCount Value="10"/>
</Unit47>
<Unit48>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_MultiMix.pas"/>
<UnitName Value="ACS_MultiMix"/>
<CursorPos X="28" Y="235"/>
<TopLine Value="217"/>
<UsageCount Value="10"/>
</Unit48>
<Unit49>
<Filename Value="windows\D\LKomponenten\acs\Src\drivers\ACS_StdAudio.pas"/>
<UnitName Value="ACS_StdAudio"/>
<CursorPos X="42" Y="164"/>
<TopLine Value="146"/>
<UsageCount Value="10"/>
</Unit49>
<Unit50>
<Filename Value="windows\D\LKomponenten\acs\Src\drivers\linux\ACS_Audio.inc"/>
<CursorPos X="12" Y="69"/>
<TopLine Value="50"/>
<UsageCount Value="10"/>
</Unit50>
<Unit51>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_VolumeQuery.pas"/>
<UnitName Value="ACS_VolumeQuery"/>
<CursorPos X="27" Y="166"/>
<TopLine Value="147"/>
<UsageCount Value="10"/>
</Unit51>
<Unit52>
<Filename Value="windows\D\LKomponenten\acs\Src\Linux\acs_reg.pas"/>
<UnitName Value="acs_reg"/>
<CursorPos X="67" Y="35"/>
<TopLine Value="11"/>
<UsageCount Value="10"/>
</Unit52>
<Unit53>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Mixer.pas"/>
<UnitName Value="ACS_Mixer"/>
<CursorPos X="16" Y="241"/>
<TopLine Value="212"/>
<UsageCount Value="10"/>
</Unit53>
<Unit54>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\linux\ACS_Mixer.inc"/>
<CursorPos X="19" Y="119"/>
<TopLine Value="101"/>
<UsageCount Value="10"/>
</Unit54>
<Unit55>
<Filename Value="windows\D\LKomponenten\acs\Src\classes\ACS_Streams.pas"/>
<UnitName Value="ACS_Streams"/>
<CursorPos X="14" Y="202"/>
<TopLine Value="172"/>
<UsageCount Value="10"/>
</Unit55>
<Unit56>
<Filename Value="windows\D\LKomponenten\acs\Src\fileformats\ACS_Vorbis.pas"/>
<UnitName Value="ACS_Vorbis"/>
<CursorPos X="14" Y="63"/>
<TopLine Value="55"/>
<UsageCount Value="10"/>
</Unit56>
<Unit57>
<Filename Value="windows\D\LKomponenten\acs\Src\fileformats\acs_flac.pas"/>
<UnitName Value="ACS_FLAC"/>
<CursorPos X="1" Y="60"/>
<TopLine Value="32"/>
<UsageCount Value="10"/>
</Unit57>
<Unit58>
<Filename Value="windows\D\LKomponenten\acs\Src\fileformats\acs_lame.pas"/>
<UnitName Value="ACS_LAME"/>
<CursorPos X="29" Y="89"/>
<TopLine Value="64"/>
<UsageCount Value="10"/>
</Unit58>
<Unit59>
<Filename Value="windows\D\LKomponenten\acs\Src\fileformats\acs_mad.pas"/>
<UnitName Value="ACS_MAD"/>
<CursorPos X="16" Y="62"/>
<TopLine Value="46"/>
<UsageCount Value="10"/>
</Unit59>
<Unit60>
<Filename Value="windows\D\LKomponenten\acs\Src\fileformats\ACS_Wave.pas"/>
<UnitName Value="ACS_Wave"/>
<CursorPos X="16" Y="1361"/>
<TopLine Value="1359"/>
<UsageCount Value="10"/>
</Unit60>
<Unit61>
<Filename Value="umain.lfm"/>
<CursorPos X="30" Y="559"/>
<TopLine Value="527"/>
<UsageCount Value="10"/>
<SyntaxHighlighter Value="LFM"/>
</Unit61>
<Unit62>
<Filename Value="..\..\..\..\fpc\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="17" Y="193"/>
<TopLine Value="175"/>
<UsageCount Value="10"/>
</Unit62>
<Unit63>
<Filename Value="..\..\..\..\fpc\rtl\objpas\classes\lists.inc"/>
<CursorPos X="1" Y="370"/>
<TopLine Value="368"/>
<UsageCount Value="10"/>
</Unit63>
<Unit64>
<Filename Value="..\..\Src\fileformats\ACS_FLAC.pas"/>
<UnitName Value="ACS_FLAC"/>
<CursorPos X="1" Y="65"/>
<TopLine Value="65"/>
<UsageCount Value="10"/>
</Unit64>
<Unit65>
<Filename Value="..\..\Src\fileformats\ACS_MAC.pas"/>
<UnitName Value="ACS_MAC"/>
<CursorPos X="1" Y="49"/>
<TopLine Value="49"/>
<UsageCount Value="10"/>
</Unit65>
<Unit66>
<Filename Value="..\..\..\..\lazarus\lcl\interfaces\win32\Win32WSControls.pp"/>
<UnitName Value="Win32WSControls"/>
<CursorPos X="30" Y="209"/>
<TopLine Value="191"/>
<UsageCount Value="10"/>
</Unit66>
<Unit67>
<Filename Value="..\..\Src\fileformats\ACS_LAME.pas"/>
<UnitName Value="ACS_LAME"/>
<CursorPos X="14" Y="61"/>
<TopLine Value="49"/>
<UsageCount Value="10"/>
</Unit67>
<Unit68>
<Filename Value="..\..\Src\fileformats\ACS_MAD.pas"/>
<UnitName Value="ACS_MAD"/>
<CursorPos X="14" Y="239"/>
<TopLine Value="207"/>
<UsageCount Value="10"/>
</Unit68>
<Unit69>
<Filename Value="..\..\..\..\fpc\rtl\inc\systemh.inc"/>
<CursorPos X="11" Y="370"/>
<TopLine Value="354"/>
<UsageCount Value="10"/>
</Unit69>
<Unit70>
<Filename Value="..\..\..\lazreport\source\lr_desgn.pas"/>
<ComponentName Value="frDesignerForm"/>
<HasResources Value="True"/>
<UnitName Value="LR_Desgn"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit70>
<Unit71>
<Filename Value="windows\D\lazarus\lcl\lresources.pp"/>
<UnitName Value="LResources"/>
<CursorPos X="1" Y="2098"/>
<TopLine Value="2077"/>
<UsageCount Value="10"/>
</Unit71>
<Unit72>
<Filename Value="windows\D\fpc\rtl\inc\systemh.inc"/>
<CursorPos X="11" Y="370"/>
<TopLine Value="352"/>
<UsageCount Value="10"/>
</Unit72>
<Unit73>
<Filename Value="..\..\..\..\acs tmp\Src\Common\ACS_Wave.pas"/>
<UnitName Value="ACS_Wave"/>
<CursorPos X="1" Y="126"/>
<TopLine Value="123"/>
<UsageCount Value="10"/>
</Unit73>
<Unit74>
<Filename Value="windows\D\fpc\rtl\i386\i386.inc"/>
<CursorPos X="72" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit74>
<Unit75>
<Filename Value="windows\D\acs tmp\Src\Common\ACS_Wave.pas"/>
<UnitName Value="ACS_Wave"/>
<CursorPos X="20" Y="899"/>
<TopLine Value="869"/>
<UsageCount Value="10"/>
</Unit75>
<Unit76>
<Filename Value="..\..\Src\classes\windows\acs_cdrom.inc"/>
<CursorPos X="16" Y="266"/>
<TopLine Value="244"/>
<UsageCount Value="10"/>
</Unit76>
<Unit77>
<Filename Value="..\..\..\..\lazarus\lcl\include\canvas.inc"/>
<CursorPos X="10" Y="1476"/>
<TopLine Value="1469"/>
<UsageCount Value="10"/>
</Unit77>
<Unit78>
<Filename Value="..\..\..\..\fpc\fcl\image\fpcanvas.pp"/>
<UnitName Value="FPCanvas"/>
<CursorPos X="13" Y="225"/>
<TopLine Value="193"/>
<UsageCount Value="10"/>
</Unit78>
<Unit79>
<Filename Value="..\..\..\..\fpc\fcl\image\FPCanvas.inc"/>
<CursorPos X="1" Y="267"/>
<TopLine Value="265"/>
<UsageCount Value="10"/>
</Unit79>
<Unit80>
<Filename Value="..\..\..\..\SRC\lazarus\ide\lazarus.pp"/>
<UnitName Value="Lazarus"/>
<CursorPos X="27" Y="20"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit80>
<Unit81>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\fileformats\acs_allformats.pas"/>
<UnitName Value="acs_allformats"/>
<CursorPos X="8" Y="13"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit81>
<Unit82>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\fileformats\acs_wave.pas"/>
<UnitName Value="acs_wave"/>
<CursorPos X="3" Y="1485"/>
<TopLine Value="1462"/>
<UsageCount Value="10"/>
</Unit82>
<Unit83>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\fileformats\acs_vorbis.pas"/>
<UnitName Value="acs_vorbis"/>
<CursorPos X="12" Y="446"/>
<TopLine Value="416"/>
<UsageCount Value="10"/>
</Unit83>
<Unit84>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\fileformats\general\Codec.pas"/>
<UnitName Value="codec"/>
<CursorPos X="16" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit84>
<Unit85>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\fileformats\general\vorbisfile.pas"/>
<UnitName Value="vorbisfile"/>
<CursorPos X="21" Y="224"/>
<TopLine Value="191"/>
<UsageCount Value="10"/>
</Unit85>
<Unit86>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\fileformats\general\ogg.pas"/>
<UnitName Value="ogg"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit86>
<Unit87>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\fileformats\general\vorbis_codec.pas"/>
<UnitName Value="codec"/>
<CursorPos X="12" Y="34"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit87>
<Unit88>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\fileformats\general\vorbiscodec.pas"/>
<UnitName Value="vorbiscodec"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="427"/>
<UsageCount Value="10"/>
</Unit88>
<Unit89>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\fileformats\general\VorbisEnc.pas"/>
<UnitName Value="vorbisenc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit89>
<Unit90>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\classes\acs_strings.pas"/>
<UnitName Value="acs_strings"/>
<CursorPos X="1" Y="23"/>
<TopLine Value="1"/>
<UsageCount Value="10"/>
</Unit90>
<Unit91>
<Filename Value="..\..\..\..\SRC\fpc\rtl\win32\wininc\ascdef.inc"/>
<CursorPos X="10" Y="70"/>
<TopLine Value="47"/>
<UsageCount Value="10"/>
</Unit91>
<Unit92>
<Filename Value="..\..\..\..\SRC\LKomponenten\acs\Src\classes\acs_classes.pas"/>
<UnitName Value="acs_classes"/>
<CursorPos X="1" Y="175"/>
<TopLine Value="164"/>
<UsageCount Value="10"/>
</Unit92>
<Unit93>
<Filename Value="windows\D\LKomponenten\acs\Src\drivers\acs_alsaaudio.pas"/>
<UnitName Value="acs_alsaaudio"/>
<CursorPos X="1" Y="356"/>
<TopLine Value="347"/>
<UsageCount Value="11"/>
</Unit93>
<Unit94>
<Filename Value="windows\D\LKomponenten\acs\Src\drivers\acs_aolive.pas"/>
<UnitName Value="acs_aolive"/>
<CursorPos X="1" Y="205"/>
<TopLine Value="177"/>
<UsageCount Value="10"/>
</Unit94>
<Unit95>
<Filename Value="windows\D\LKomponenten\acs\Src\drivers\linux\libao.pas"/>
<UnitName Value="libao"/>
<CursorPos X="22" Y="47"/>
<TopLine Value="37"/>
<UsageCount Value="10"/>
</Unit95>
</Units>
<JumpHistory Count="0" HistoryIndex="-1"/>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<PathDelim Value="\"/>
<SearchPaths>
<SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<DelphiCompat Value="True"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<BreakPoints Count="1">
<Item1>
<Source Value="..\..\Src\fileformats\ACS_FLAC.pas"/>
<Line Value="576"/>
</Item1>
</BreakPoints>
<Watches Count="2">
<Item1>
<Expression Value="newcolor"/>
</Item1>
<Item2>
<Expression Value="DrvName"/>
</Item2>
</Watches>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,26 @@
program player;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ you can add units after this }
,uMain
,uPlaylist
,uVis;
{$IFDEF WINDOWS}{$R manifest.rc}{$ENDIF}
begin
Application.Title:='Lazarus Player Example';
Application.Initialize;
Application.CreateForm(TFMain, FMain);
Application.CreateForm(TfPlaylist, fPlaylist);
Application.CreateForm(TfVizu, fVizu);
Application.Run;
end.

217
acs/Demos/player/umain.dfm Normal file
View File

@@ -0,0 +1,217 @@
object fMain: TfMain
Left = 271
Top = 150
BorderStyle = bsToolWindow
Caption = 'Audioplayer'
ClientHeight = 99
ClientWidth = 204
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
OnClose = FormClose
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 4
Top = 0
Width = 192
Height = 64
BevelOuter = bvLowered
FullRepaint = False
TabOrder = 0
object lTime: TLabel
Left = 1
Top = 24
Width = 108
Height = 29
AutoSize = False
Caption = '00:00:00'
Color = clNone
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -25
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentColor = False
ParentFont = False
Transparent = True
end
object lFilename: TLabel
Left = 1
Top = 1
Width = 190
Height = 13
Align = alTop
Caption = 'File:'
Color = clNone
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentColor = False
ParentFont = False
Transparent = True
WordWrap = True
end
object lTime1: TLabel
Left = 1
Top = 21
Width = 57
Height = 13
Caption = 'Time remain'
Color = clNone
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentColor = False
ParentFont = False
Transparent = True
end
object lTime2: TLabel
Left = 116
Top = 21
Width = 14
Height = 13
Caption = 'left'
Color = clNone
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentColor = False
ParentFont = False
Transparent = True
end
object lLeft: TLabel
Left = 116
Top = 32
Width = 42
Height = 13
Caption = '00:00:00'
Color = clNone
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentColor = False
ParentFont = False
Transparent = True
end
object Progress: TProgressBar
Left = 1
Top = 55
Width = 190
Height = 8
Align = alBottom
Min = 0
Max = 1000
Smooth = True
TabOrder = 0
end
end
object btOpen: TBitBtn
Left = 4
Top = 67
Width = 28
Height = 26
TabOrder = 1
OnClick = OpenClick
Layout = blGlyphTop
end
object btRew: TBitBtn
Left = 32
Top = 67
Width = 28
Height = 26
TabOrder = 2
OnClick = btRewClick
end
object btFfw: TBitBtn
Left = 60
Top = 67
Width = 28
Height = 26
TabOrder = 3
OnClick = btFfwClick
Layout = blGlyphRight
end
object btPlay: TBitBtn
Left = 88
Top = 67
Width = 28
Height = 30
TabOrder = 4
OnClick = PlayClick
end
object btStop: TBitBtn
Left = 144
Top = 67
Width = 28
Height = 30
TabOrder = 5
OnClick = StopClick
end
object btPause: TBitBtn
Left = 116
Top = 67
Width = 28
Height = 30
TabOrder = 6
OnClick = Pauseclick
end
object btPlaylist: TBitBtn
Left = 174
Top = 67
Width = 22
Height = 17
TabOrder = 7
OnClick = btPlaylistClick
end
object btVizu: TBitBtn
Left = 174
Top = 84
Width = 22
Height = 13
Caption = 'Vis'
TabOrder = 8
OnClick = btVizuClick
end
object FileIn1: TACSFileIn
EndSample = -1
Loop = False
StartSample = 0
Left = 72
end
object PlayTimer: TTimer
Enabled = False
Interval = 100
OnTimer = Timer1Timer
Left = 72
Top = 32
end
object AudioOut1: TACSAudioOut
Driver = 'Wavemapper'
Device = 0
Volume = 0
Input = SoundIndicator
Delay = 6
SuspendWhenIdle = True
OnDone = AudioOut1Done
OnThreadException = AudioOut1ThreadException
Left = 40
Top = 32
end
object SoundIndicator: TACSSoundIndicator
Input = FileIn1
Left = 40
end
end

444
acs/Demos/player/umain.lfm Normal file
View File

@@ -0,0 +1,444 @@
object fMain: TfMain
Left = 271
Height = 99
Top = 150
Width = 204
HorzScrollBar.Page = 203
VertScrollBar.Page = 98
ActiveControl = btOpen
BorderStyle = bsToolWindow
Caption = 'Audioplayer'
ClientHeight = 99
ClientWidth = 204
OnClose = FormClose
OnCreate = FormCreate
object Panel1: TPanel
Left = 4
Height = 64
Width = 192
BevelOuter = bvLowered
ClientHeight = 64
ClientWidth = 192
FullRepaint = False
TabOrder = 0
object lTime: TLabel
Left = 1
Height = 29
Top = 24
Width = 108
AutoSize = False
Caption = '00:00:00'
Font.Height = -25
ParentColor = False
end
object lFilename: TLabel
Left = 1
Height = 12
Top = 1
Width = 190
Align = alTop
Caption = 'File:'
Font.Height = -9
ParentColor = False
WordWrap = True
end
object lTime1: TLabel
Left = 1
Height = 12
Top = 20
Width = 53
Caption = 'Time remain'
Font.Height = -9
ParentColor = False
OnClick = lTime1Click
end
object lTime2: TLabel
Left = 116
Height = 12
Top = 20
Width = 14
Caption = 'left'
Font.Height = -9
ParentColor = False
end
object lLeft: TLabel
Left = 116
Height = 15
Top = 28
Width = 51
Caption = '00:00:00'
Font.Height = -12
ParentColor = False
end
object Progress: TProgressBar
Left = 1
Height = 10
Top = 53
Width = 190
Align = alBottom
Max = 1000
Smooth = True
end
end
object btOpen: TBitBtn
Left = 4
Height = 26
Top = 67
Width = 28
BorderSpacing.InnerBorder = 2
Glyph.Data = {
46050000424D4605000000000000360000002800000012000000120000000100
2000000000001005000064000000640000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000232323FF4A4A4AFF494A4AFF4B4C4CFF4C4C4CFF4B4C
4CFF4A4B4BFF484949FF464646FF434343FF404141FF333434FF1E1F1FFF0000
0000000000000000000000000000000000001B334EFFBDBDBDFFA5A6A6FFA8AA
AAFFABADADFFACAEAEFFAAABABFFA6A7A7FFA0A1A1FF999A9AFF929494FF8B8D
8DFF484949FF00000000000000000000000000000000000000001B334EFF5053
56FFCECECEFFBCBEBEFFC2C4C4FFC5C6C6FFC2C3C3FFBEBFBFFFB5B6B6FFADAE
AEFFA4A5A5FF9D9E9EFF6E6F6FFF121212FF0000000000000000000000000000
00001B334EFF183049FFCDCDCDFFC9CACAFFD4D5D5FFD4D5D5FFD0D2D2FFCBCC
CCFFC1C2C2FFB8B9B9FFAEAFAFFFA1A2A2FF949595FF484949FF000000000000
000000000000000000001B334EFF447DB7FF4E5153FFDADADAFFDADBDBFFE0E1
E1FFDCDDDDFFD5D6D6FFCACBCBFFC0C1C1FFB5B6B6FFA8A9A9FF9FA0A0FF6768
68FF212222FF0000000000000000000000001B334EFF82C2FEFF19314AFFDBDB
DBFFDEDFDFFFE7E8E8FFE4E6E6FFDEDFDFFFD1D2D2FFC6C7C7FFB9BABAFFACAD
ADFF9FA0A0FF939494FF484949FF0000000000000000000000001B334EFF82C2
FEFF4E86C4FF4C4F52FFF5F5F5FFF5F5F5FFECECECFFE4E4E4FFDCDCDCFFD4D4
D4FFCBCBCBFFC4C4C4FFBCBCBCFFB5B5B5FFB3B3B3FF303030FF000000000000
00001B334EFF8AC8FEFF82C2FEFF1B334EFF4D5053FF4D5053FF4F5255FF575A
5CFF4E5154FF4E5154FF505356FF505356FF4E5154FF000000FF000000FF0000
00FF00000000000000001B334EFF9AD3FEFF87C5FDFF82C2FEFF62ACF8FF62AC
F8FF62ACF8FF62ACF8FF62ACF8FF62ACF8FF62ACF8FF62ACF8FF000000FF0000
0000000000000000000000000000000000001B334EFF66A5E5FF9AD3FEFF85C5
FEFF66A5E5FF1B334EFF1B334EFF1B334EFF1B334EFF1B334EFF1B334EFF1B33
4EFF000000000000000000000000000000000000000000000000000000001B33
4EFF1B334EFF1B334EFF1B334EFF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000FF000000FF000000FF000000FF000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000FF000000FF0000
00FF000000000000000000000000000000000000000000000000000000000000
0000000000FF0000000000000000000000000000000000000000000000FF0000
00FF000000FF000000FF00000000000000000000000000000000000000000000
0000000000000000000000000000000000FF000000FF00000000000000FF0000
00FF000000FF000000FF00000000000000FF0000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000FF0000
00FF000000FF000000FF00000000000000000000000000000000000000000000
00000000000000000000
}
Layout = blGlyphTop
NumGlyphs = 0
OnClick = OpenClick
TabOrder = 1
end
object btRew: TBitBtn
Left = 32
Height = 26
Top = 67
Width = 28
BorderSpacing.InnerBorder = 2
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000CED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF808080FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF808080FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF8080
80FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF808080FFCED6D6FFCED6D6FF808080FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF808080FFCED6D6FF808080FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF808080FFCED6D6FF100808FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF808080FFCED6D6FFCED6D6FF100808FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF1008
08FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF100808FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FF
}
NumGlyphs = 0
OnClick = btRewClick
TabOrder = 2
end
object btFfw: TBitBtn
Left = 60
Height = 26
Top = 67
Width = 28
BorderSpacing.InnerBorder = 2
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000CED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF808080FF808080FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF808080FF211818FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6
D6FF808080FF211818FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF211818FF211818FF211818FF808080FFCED6D6FFCED6
D6FF808080FF211818FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF211818FF211818FF211818FF211818FF808080FFCED6
D6FF808080FF211818FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF211818FF211818FF211818FF211818FF100808FFCED6
D6FF808080FF211818FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF211818FF211818FF211818FF100808FFCED6D6FFCED6
D6FF808080FF211818FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF211818FF211818FF100808FFCED6D6FFCED6D6FFCED6
D6FF808080FF211818FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF211818FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF808080FF211818FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF100808FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FF
}
Layout = blGlyphRight
NumGlyphs = 0
OnClick = btFfwClick
TabOrder = 3
end
object btPlay: TBitBtn
Left = 88
Height = 30
Top = 67
Width = 28
BorderSpacing.InnerBorder = 2
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000C8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF2D2D2AFF2D2D2AFFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF120F0CFF201D1BFF2D2D2AFF2D2D2AFFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF120F0CFF201D1BFF201D1BFF201D1BFF2D2D2AFF2D2D2AFFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF120F0CFF201D1BFF201D1BFF201D1BFF201D1BFF201D1BFF2D2D
2AFF2D2D2AFFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF120F0CFF201D1BFF201D1BFF201D1BFF201D1BFF201D1BFF201D
1BFF201D1BFF2D2D2AFF2D2D2AFFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF120F0CFF201D1BFF201D1BFF201D1BFF201D1BFF201D1BFF201D
1BFF201D1BFF120F0CFF120F0CFFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF120F0CFF201D1BFF201D1BFF201D1BFF201D1BFF201D1BFF120F
0CFF120F0CFFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF120F0CFF201D1BFF201D1BFF201D1BFF120F0CFF120F0CFFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF120F0CFF201D1BFF120F0CFF120F0CFFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FF120F0CFF120F0CFFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0
D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FFC8D0D4FF
}
NumGlyphs = 0
OnClick = PlayClick
TabOrder = 4
end
object btStop: TBitBtn
Left = 144
Height = 30
Top = 67
Width = 28
BorderSpacing.InnerBorder = 2
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000CED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF808080FF808080FF808080FF808080FF808080FF808080FF8080
80FF808080FF808080FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF211818FF211818FF211818FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF211818FF211818FF211818FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF211818FF211818FF211818FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF211818FF211818FF211818FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF211818FF211818FF211818FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF211818FF211818FF211818FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF211818FF211818FF211818FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF211818FF211818FF211818FF211818FF211818FF2118
18FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FF100808FF100808FF100808FF100808FF100808FF100808FF1008
08FF100808FF100808FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FF
}
NumGlyphs = 0
OnClick = StopClick
TabOrder = 5
end
object btPause: TBitBtn
Left = 116
Height = 30
Top = 67
Width = 28
BorderSpacing.InnerBorder = 2
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000CED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF808080FF808080FF808080FF808080FFCED6D6FFCED6D6FFCED6D6FF8080
80FF808080FF808080FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF1008
08FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF1008
08FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF1008
08FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF1008
08FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF1008
08FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF1008
08FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF1008
08FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FF1008
08FF211818FF211818FF808080FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FF100808FF100808FF100808FF100808FFCED6D6FFCED6D6FFCED6D6FF1008
08FF100808FF100808FF100808FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6
D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FFCED6D6FF
}
NumGlyphs = 0
OnClick = Pauseclick
TabOrder = 6
end
object btPlaylist: TBitBtn
Left = 174
Height = 17
Top = 67
Width = 22
BorderSpacing.InnerBorder = 2
Glyph.Data = {
9E020000424D9E0200000000000036000000280000000B0000000E0000000100
2000000000006802000064000000640000000000000000000000000000FF0000
00FF000000FF000000FF000000FF000000FF000000FF00000000000000000000
000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
00FF00000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF000000FF000000000000000000000000000000000000
00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF000000FF0000
00FF0000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFF000000FFFFFFFFFF000000FF0000000000000000000000FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFF000000FF000000000000
0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF000000FFFFFF
FFFF000000FF000000FF000000FF00000000000000FF000000FF000000FF0000
00FFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFF000000FF000000000000
0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFF
FFFF000000FF0000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFF000000FF000000FFFFFFFFFF000000FF0000000000000000000000000000
00FF000000FF000000FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF000000FF0000
0000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF000000FF00000000000000000000000000000000000000FFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FF000000FF00000000000000000000
00000000000000000000000000FF000000FF000000FF000000FF000000000000
0000
}
NumGlyphs = 0
OnClick = btPlaylistClick
TabOrder = 7
end
object btVizu: TBitBtn
Left = 174
Height = 13
Top = 84
Width = 22
BorderSpacing.InnerBorder = 2
Caption = 'Vis'
NumGlyphs = 0
OnClick = btVizuClick
TabOrder = 8
end
object FileIn1: TACSFileIn
EndSample = -1
left = 172
top = 36
end
object PlayTimer: TTimer
Enabled = False
Interval = 50
OnTimer = Timer1Timer
left = 140
top = 36
end
object AudioOut1: TACSAudioOut
Buffersize = 100000
Driver = 'Wavemapper'
Device = 0
Input = SoundIndicator
Delay = 6
SuspendWhenIdle = True
OnDone = AudioOut1Done
OnThreadException = AudioOut1ThreadException
left = 140
top = 4
end
object SoundIndicator: TACSSoundIndicator
Input = FileIn1
left = 172
top = 4
end
end

279
acs/Demos/player/umain.pas Normal file
View File

@@ -0,0 +1,279 @@
unit uMain;
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$ENDIF}
interface
uses
{$IFDEF FPC}
LResources,
{$ENDIF}
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Buttons,
ACS_Audio,ACS_File,ACS_Classes,ACS_Allformats, ExtCtrls, StdCtrls,
ComCtrls,uPlaylist, ACS_Indicator,uvis
//You must include Output drivers to not get an "No drier selected" exception
{$IFDEF MSWINDOWS}
,ACS_DXAudio //DirectSound Driver
{$ELSE}
,ACS_AlsaAudio //Alsa Driver
// ,ACS_AOLive //AO Live Driver
{$ENDIF}
,ACS_StdAudio //Wavemapper Driver
;
type
TTimeFormat = (tfElapsed,tfRemain);
{ TfMain }
TfMain = class(TForm)
AudioOut1: TACSAudioOut;
btVizu: TBitBtn;
btPlaylist: TBitBtn;
btPause: TBitBtn;
btRew: TBitBtn;
btFfw: TBitBtn;
btPlay: TBitBtn;
btStop: TBitBtn;
btOpen: TBitBtn;
FileIn1: TACSFileIn;
lLeft: TLabel;
lFilename: TLabel;
lTime: TLabel;
Panel1: TPanel;
Progress: TProgressBar;
PlayTimer: TTimer;
lTime1: TLabel;
lTime2: TLabel;
SoundIndicator: TACSSoundIndicator;
procedure AudioOut1Done(Sender: TComponent);
procedure AudioOut1ThreadException(Sender: TComponent; E: Exception);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure Pauseclick(Sender: TObject);
procedure PlayClick(Sender: TObject);
procedure StopClick(Sender: TObject);
procedure OpenClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure btFfwClick(Sender: TObject);
procedure btPlaylistClick(Sender: TObject);
procedure btRewClick(Sender: TObject);
procedure btVizuClick(Sender: TObject);
procedure lTime1Click(Sender: TObject);
procedure resetDisplay;
private
{ private declarations }
FPaused : Boolean;
FStopped : Boolean;
TimeFormat : TTimeFormat;
public
{ public declarations }
end;
var
fMain: TfMain;
implementation
{ TfMain }
procedure TfMain.PlayClick(Sender: TObject);
begin
if FPaused then
begin
AudioOut1.Resume;
FPaused := False;
end
else
begin
if FileIn1.FileName = '' then
begin
if fPlaylist.lbPlaylist.Items.Count = 0 then exit;
if fPlaylist.lbPlaylist.ItemIndex = -1 then
fPlayList.lbPlaylist.ItemIndex := 0;
FileIn1.FileName := fPlayList.lbPlaylist.Items[fPlayList.lbPlaylist.ItemIndex];
lFilename.Caption := Format('File:%s',[ExtractFileName(FileIn1.FileName)]);
end;
AudioOut1.Run;
end;
FStopped := False;
btPlay.Enabled := False;
btStop.Enabled := True;
btOpen.Enabled := False;
btRew.Enabled := False;
btFfw.Enabled := False;
btPause.Enabled := True;
PlayTimer.Enabled := True;
end;
procedure TfMain.AudioOut1Done(Sender: TComponent);
begin
btPlay.Enabled := True;
btStop.Enabled := False;
btOpen.Enabled := True;
btRew.Enabled := True;
btFfw.Enabled := True;
PlayTimer.Enabled := false;
ResetDisplay;
if FStopped then
exit;
if fPlaylist.lbPlaylist.Items.Count = 0 then exit;
if fPlaylist.lbPlaylist.ItemIndex = -1 then
fPlayList.lbPlaylist.ItemIndex := 0;
FileIn1.FileName := fPlayList.lbPlaylist.Items[fPlayList.lbPlaylist.ItemIndex];
if fPlayList.lbPlaylist.Items.Count-1 > fPlayList.lbPlaylist.ItemIndex then
begin
fPlayList.lbPlaylist.ItemIndex := fPlayList.lbPlaylist.ItemIndex+1;
FileIn1.FileName := fPlayList.lbPlaylist.Items[fPlayList.lbPlaylist.ItemIndex];
lFilename.Caption := Format('File:%s',[ExtractFileName(FileIn1.FileName)]);
PlayClick(nil);
end;
end;
procedure TfMain.AudioOut1ThreadException(Sender: TComponent; E: Exception);
begin
ShowMessage(E.Message);
end;
procedure TfMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
FStopped := True;
if (AudioOut1.Status <> tosIdle) then
AudioOut1.Stop;
while (AudioOut1.Status <> tosIdle) do
Application.Processmessages;
end;
procedure TfMain.FormCreate(Sender: TObject);
begin
// AudioOut1.Driver := 'Alsa';
end;
procedure TfMain.Pauseclick(Sender: TObject);
begin
if FPaused then
exit;
AudioOut1.Pause;
FPaused := True;
btPause.Enabled := False;
btPlay.Enabled := True;
PlayTimer.Enabled := False;
end;
procedure TfMain.StopClick(Sender: TObject);
begin
FStopped := True;
AudioOut1.Stop;
end;
procedure TfMain.OpenClick(Sender: TObject);
begin
FileIn1.Open;
btPlay.Enabled := True;
ResetDisplay;
end;
procedure TfMain.Timer1Timer(Sender: TObject);
var
tmp : real;
begin
case TimeFormat of
tfElapsed:
begin
tmp := ((FileIn1.Position * FileIn1.TotalTime) / FileIn1.Size);
lTime.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
tmp := FileIn1.TotalTime-((FileIn1.Position * FileIn1.TotalTime) / FileIn1.Size);
lLeft.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
lTime1.Caption := 'Time elapsed';
lTime2.Caption := 'left';
end;
tfRemain:
begin
tmp := ((FileIn1.Position * FileIn1.TotalTime) / FileIn1.Size);
lLeft.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
tmp := FileIn1.TotalTime-((FileIn1.Position * FileIn1.TotalTime) / FileIn1.Size);
lTime.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
lTime1.Caption := 'Time remain';
lTime2.Caption := 'elapsed';
end;
end;
Progress.Position := round((FileIn1.Position * 100) / FileIn1.Size);
end;
procedure TfMain.btFfwClick(Sender: TObject);
begin
if fPlayList.lbPlaylist.Items.Count-1 > fPlayList.lbPlaylist.ItemIndex then
fPlayList.lbPlaylist.ItemIndex := fPlayList.lbPlaylist.ItemIndex+1;
FileIn1.FileName := fPlayList.lbPlaylist.Items[fPlayList.lbPlaylist.ItemIndex];
ResetDisplay;
end;
procedure TfMain.btPlaylistClick(Sender: TObject);
begin
fPlaylist.Visible := True;
end;
procedure TfMain.btRewClick(Sender: TObject);
begin
if fPlayList.lbPlaylist.ItemIndex >= 1 then
fPlayList.lbPlaylist.ItemIndex := fPlayList.lbPlaylist.ItemIndex-1;
FileIn1.FileName := fPlayList.lbPlaylist.Items[fPlayList.lbPlaylist.ItemIndex];
ResetDisplay;
end;
procedure TfMain.btVizuClick(Sender: TObject);
begin
fVizu.Show;
end;
procedure TfMain.lTime1Click(Sender: TObject);
begin
case TimeFormat of
tfElapsed:TimeFormat := tfRemain;
tfRemain:TimeFormat := tfElapsed;
end;
ResetDisplay;
end;
procedure TfMain.resetDisplay;
var
tmp : real;
begin
lFilename.Caption := Format('File:%s',[ExtractFileName(FileIn1.FileName)]);
case TimeFormat of
tfElapsed:
begin
tmp := 0;
// if FileIn1.Size > 0 then
// tmp := ((FileIn1.Position * FileIn1.TotalTime) / FileIn1.Size);
lTime.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
// tmp := FileIn1.TotalTime-((FileIn1.Position * FileIn1.TotalTime) / FileIn1.Size);
lLeft.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
lTime1.Caption := 'Time elapsed';
lTime2.Caption := 'left';
end;
tfRemain:
begin
// if FileIn1.Size > 0 then
// tmp := ((FileIn1.Position * FileIn1.TotalTime) / FileIn1.Size);
lLeft.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
// tmp := FileIn1.TotalTime-((FileIn1.Position * FileIn1.TotalTime) / FileIn1.Size);
lTime.Caption := Format('%.2d:%.2d:%.2d',[round((tmp-30) / 60) mod 120,round(tmp) mod 60,round(tmp*100) mod 100]);
lTime1.Caption := 'Time remain';
lTime2.Caption := 'elapsed';
end;
end;
// Progress.Position := round((FileIn1.Position * 100) / FileIn1.Size);
end;
initialization
{$IFDEF FPC}
{$I umain.lrs}
{$ELSE}
{$R *.dfm}
{$ENDIF}
end.

View File

@@ -0,0 +1,55 @@
object fPlaylist: TfPlaylist
Left = 278
Top = 276
Width = 208
Height = 242
BorderStyle = bsSizeToolWin
Caption = 'Playlist'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
DesignSize = (
200
215)
PixelsPerInch = 96
TextHeight = 13
object lbPlaylist: TListBox
Left = 0
Top = 0
Width = 200
Height = 215
Align = alClient
BorderStyle = bsNone
ItemHeight = 13
TabOrder = 0
end
object btAdd: TBitBtn
Left = 0
Top = 193
Width = 27
Height = 22
Anchors = [akLeft, akBottom]
Caption = '+'
TabOrder = 1
OnClick = btAddClick
end
object Button1: TButton
Left = 32
Top = 193
Width = 27
Height = 22
Anchors = [akLeft, akBottom]
Caption = '-'
TabOrder = 2
OnClick = Button1Click
end
object OpenDialog: TOpenDialog
FilterIndex = 0
Options = [ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
Title = 'Vorhandene Datei '#246'ffnen'
end
end

View File

@@ -0,0 +1,48 @@
object fPlaylist: TfPlaylist
BorderStyle = bsSizeToolWin
Caption = 'Playlist'
ClientHeight = 215
ClientWidth = 200
PixelsPerInch = 96
HorzScrollBar.Page = 199
VertScrollBar.Page = 214
Left = 278
Height = 215
Top = 276
Width = 200
object lbPlaylist: TListBox
Align = alClient
BorderSpacing.OnChange = nil
BorderSpacing.Bottom = 25
BorderStyle = bsNone
TabOrder = 0
Height = 190
Width = 200
end
object btAdd: TBitBtn
Anchors = [akLeft, akBottom]
Caption = '+'
OnClick = btAddClick
TabOrder = 1
Height = 22
Top = 193
Width = 27
end
object Button1: TButton
Anchors = [akLeft, akBottom]
BorderSpacing.OnChange = nil
Caption = '-'
OnClick = Button1Click
TabOrder = 2
Left = 32
Height = 22
Top = 193
Width = 27
end
object OpenDialog: TOpenDialog
Options = [ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing, ofViewDetail]
Title = 'Vorhandene Datei <20>ffnen'
FilterIndex = 0
Title = 'Vorhandene Datei <20>ffnen'
end
end

View File

@@ -0,0 +1,67 @@
unit uPlaylist;
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$ENDIF}
interface
uses
{$IFDEF FPC}
LResources,
{$ENDIF}
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons;
type
{ TfPlaylist }
TfPlaylist = class(TForm)
btAdd: TBitBtn;
Button1: TButton;
lbPlaylist: TListBox;
OpenDialog: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure btAddClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
fPlaylist: TfPlaylist;
implementation
uses ACS_File;
{ TfPlaylist }
procedure TfPlaylist.btAddClick(Sender: TObject);
var
desc : string;
begin
FileFormats.BuildFilterStrings(desc,[fcLoad]);
OpenDialog.Filter := desc;
if OpenDialog.Execute then
begin
lbPlayList.Items.AddStrings(OpenDialog.Files);
end;
end;
procedure TfPlaylist.Button1Click(Sender: TObject);
begin
if lbPlayList.ItemIndex > -1 then
lbPlayList.Items.Delete(lbPlayList.ItemIndex);
end;
initialization
{$IFDEF FPC}
{$I uplaylist.lrs}
{$else}
{$R *.dfm}
{$ENDIF}
end.

53
acs/Demos/player/uvis.dfm Normal file
View File

@@ -0,0 +1,53 @@
object fVizu: TfVizu
Left = 483
Top = 150
Width = 202
Height = 126
BorderStyle = bsSizeToolWin
Caption = 'Visualization'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
Menu = MainMenu1
OldCreateOrder = True
OnPaint = FormPaint
PixelsPerInch = 96
TextHeight = 13
object Image: TImage
Left = 0
Top = 0
Width = 194
Height = 80
Align = alClient
Transparent = True
end
object MainMenu1: TMainMenu
Left = 17
Top = 10
object miType: TMenuItem
Caption = 'Type'
object rFFT: TMenuItem
AutoCheck = True
Caption = 'FFT'
Checked = True
GroupIndex = 1
RadioItem = True
end
object MenuItem2: TMenuItem
AutoCheck = True
Caption = 'Wave'
GroupIndex = 1
RadioItem = True
end
end
end
object Timer1: TTimer
Interval = 100
OnTimer = Timer1Timer
Left = 48
Top = 8
end
end

49
acs/Demos/player/uvis.lfm Normal file
View File

@@ -0,0 +1,49 @@
object fVizu: TfVizu
BorderStyle = bsSizeToolWin
Caption = 'Visualization'
ClientHeight = 79
ClientWidth = 194
Menu = MainMenu1
OnPaint = FormPaint
PixelsPerInch = 96
HorzScrollBar.Page = 193
VertScrollBar.Page = 78
Left = 483
Height = 99
Top = 150
Width = 194
object Image: TImage
Align = alClient
Transparent = True
Height = 79
Width = 194
end
object MainMenu1: TMainMenu
left = 17
top = 10
object miType: TMenuItem
Caption = 'Type'
object rFFT: TMenuItem
AutoCheck = True
Caption = 'FFT'
Checked = True
GroupIndex = 1
RadioItem = True
ShowAlwaysCheckable = True
end
object MenuItem2: TMenuItem
AutoCheck = True
Caption = 'Wave'
GroupIndex = 1
RadioItem = True
ShowAlwaysCheckable = True
end
end
end
object Timer1: TTimer
Interval = 150
OnTimer = Timer1Timer
left = 17
top = 44
end
end

104
acs/Demos/player/uvis.pas Normal file
View File

@@ -0,0 +1,104 @@
unit uvis;
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$ENDIF}
interface
uses
{$IFDEF FPC}
LResources,FPImage,
{$ENDIF}
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Menus, ExtCtrls;
type
TVals = array[0..31] of Double;
{ TfVizu }
TfVizu = class(TForm)
Image: TImage;
MainMenu1: TMainMenu;
rFFT: TMenuItem;
MenuItem2: TMenuItem;
miType: TMenuItem;
Timer1: TTimer;
procedure FormPaint(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
lVals : array of TVals;
Vals : TVals;
end;
var
fVizu: TfVizu;
implementation
uses uMain;
{ TfVizu }
procedure TfVizu.FormPaint(Sender: TObject);
var
i,x,y : Integer;
{$IFDEF FPC}
newcolor : TFPColor;
{$ENDIF}
begin
Canvas.Lock;
Canvas.Brush.Color := clBlack;
Canvas.Pen.Color := clBlack;
Canvas.Rectangle(0,0,Width,Height);
if rFFT.Checked then
begin
fMain.SoundIndicator.GetValues(Vals);
Setlength(lVals,0);
Canvas.Pen.Color := clAqua;
Canvas.Brush.Color := clAqua;
for i := 0 to 31 do
Canvas.Rectangle(((Width div 31)*i)+1,Height-Round(Vals[i]*Height),((Width div 31)*(i+1))-1,Height);
end
else
begin
{$IFDEF FPC}
Setlength(lVals,Height div 4);
for i := 0 to length(lVals)-2 do
lVals[i] := lVals[i+1];
fMain.SoundIndicator.GetValues(lVals[length(lVals)-1]);
for y := 0 to (Height div 4)-1 do
for x := 0 to 31 do
begin
newcolor := TColorToFPColor(clBlack);
newcolor.blue := round(65535*lVals[y][x]);
newcolor.green := round(65535*lVals[y][x]);
Canvas.Brush.Color := FPColorToTColor(newcolor);
newcolor.blue := round(32000*lVals[y][x]);
newcolor.green := round(32000*lVals[y][x]);
Canvas.Pen.Color := FPColorToTColor(newcolor);
Canvas.Rectangle(((Width div 31)*x),y*4,((Width div 31)*(x+1)),((y+1)*4));
end;
{$ENDIF}
end;
Canvas.Unlock;
end;
procedure TfVizu.Timer1Timer(Sender: TObject);
begin
if fVizu.Visible then
fVizu.Invalidate;
end;
initialization
{$IFDEF FPC}
{$I uvis.lrs}
{$else}
{$R *.dfm}
{$ENDIF}
end.

View File

@@ -0,0 +1,259 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
<Version Value="5"/>
<General>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="3"/>
</General>
<LazDoc Paths=""/>
<Units Count="22">
<Unit0>
<CursorPos X="5" Y="3"/>
<Filename Value="recorder.lpr"/>
<IsPartOfProject Value="True"/>
<TopLine Value="1"/>
<UnitName Value="recorder"/>
<UsageCount Value="26"/>
</Unit0>
<Unit1>
<CursorPos X="49" Y="22"/>
<EditorIndex Value="0"/>
<Filename Value="umain.pas"/>
<ComponentName Value="fMain"/>
<IsPartOfProject Value="True"/>
<Loaded Value="True"/>
<ResourceFilename Value="umain.lrs"/>
<TopLine Value="1"/>
<UnitName Value="uMain"/>
<UsageCount Value="26"/>
</Unit1>
<Unit2>
<CursorPos X="1" Y="41"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/ACS_Audio.pas"/>
<TopLine Value="9"/>
<UnitName Value="acs_audio"/>
<UsageCount Value="11"/>
</Unit2>
<Unit3>
<CursorPos X="3" Y="77"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/ACS_Classes.pas"/>
<TopLine Value="63"/>
<UnitName Value="ACS_Classes"/>
<UsageCount Value="11"/>
</Unit3>
<Unit4>
<CursorPos X="1" Y="171"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/ACS_VolumeQuery.pas"/>
<TopLine Value="157"/>
<UnitName Value="ACS_VolumeQuery"/>
<UsageCount Value="11"/>
</Unit4>
<Unit5>
<CursorPos X="69" Y="32"/>
<Filename Value="D:/LKomponenten/acs/Src/Win32/acs_reg.pas"/>
<TopLine Value="13"/>
<UnitName Value="acs_reg"/>
<UsageCount Value="10"/>
</Unit5>
<Unit6>
<CursorPos X="53" Y="17"/>
<Filename Value="D:/LKomponenten/acs/Src/Linux/acs_reg.pas"/>
<TopLine Value="1"/>
<UnitName Value="acs_reg"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<CursorPos X="9" Y="363"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/ACS_Misc.pas"/>
<TopLine Value="340"/>
<UnitName Value="ACS_Misc"/>
<UsageCount Value="11"/>
</Unit7>
<Unit8>
<CursorPos X="1" Y="298"/>
<Filename Value="D:/LKomponenten/acs/Src/drivers/windows/ACS_Audio.inc"/>
<TopLine Value="271"/>
<UsageCount Value="11"/>
</Unit8>
<Unit9>
<CursorPos X="20" Y="176"/>
<Filename Value="D:/LKomponenten/acs/Src/drivers/ACS_StdAudio.pas"/>
<TopLine Value="168"/>
<UnitName Value="ACS_StdAudio"/>
<UsageCount Value="11"/>
</Unit9>
<Unit10>
<CursorPos X="3" Y="26"/>
<Filename Value="D:/LKomponenten/acs/Src/classes/ACS_Strings.pas"/>
<TopLine Value="18"/>
<UnitName Value="ACS_Strings"/>
<UsageCount Value="10"/>
</Unit10>
<Unit11>
<CursorPos X="1" Y="114"/>
<Filename Value="D:/LKomponenten/acs/Src/drivers/linux/ACS_Audio.inc"/>
<TopLine Value="104"/>
<UsageCount Value="10"/>
</Unit11>
<Unit12>
<CursorPos X="27" Y="63"/>
<Filename Value="umain.lfm"/>
<SyntaxHighlighter Value="LFM"/>
<TopLine Value="38"/>
<UsageCount Value="10"/>
</Unit12>
<Unit13>
<CursorPos X="1" Y="989"/>
<Filename Value="D:/fpc/packages/extra/winunits/mmsystem.pp"/>
<TopLine Value="957"/>
<UnitName Value="mmsystem"/>
<UsageCount Value="11"/>
</Unit13>
<Unit14>
<CursorPos X="4" Y="203"/>
<Filename Value="D:/LKomponenten/acs/Src/drivers/acs_dxaudio.pas"/>
<TopLine Value="171"/>
<UnitName Value="acs_dxaudio"/>
<UsageCount Value="11"/>
</Unit14>
<Unit15>
<CursorPos X="22" Y="109"/>
<EditorIndex Value="4"/>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/acs_stdaudio.pas"/>
<Loaded Value="True"/>
<TopLine Value="103"/>
<UnitName Value="acs_stdaudio"/>
<UsageCount Value="10"/>
</Unit15>
<Unit16>
<CursorPos X="21" Y="96"/>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/windows/acs_audio.inc"/>
<TopLine Value="73"/>
<UsageCount Value="10"/>
</Unit16>
<Unit17>
<CursorPos X="16" Y="239"/>
<EditorIndex Value="5"/>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/linux/acs_audio.inc"/>
<Loaded Value="True"/>
<TopLine Value="203"/>
<UsageCount Value="10"/>
</Unit17>
<Unit18>
<CursorPos X="1" Y="339"/>
<EditorIndex Value="6"/>
<Filename Value="/windows/D/lazarus/lcl/include/screen.inc"/>
<Loaded Value="True"/>
<TopLine Value="321"/>
<UsageCount Value="10"/>
</Unit18>
<Unit19>
<CursorPos X="26" Y="320"/>
<EditorIndex Value="1"/>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/linux/alsa.pas"/>
<Loaded Value="True"/>
<TopLine Value="284"/>
<UnitName Value="alsa"/>
<UsageCount Value="10"/>
</Unit19>
<Unit20>
<CursorPos X="27" Y="247"/>
<EditorIndex Value="2"/>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/linux/libao.pas"/>
<Loaded Value="True"/>
<TopLine Value="211"/>
<UnitName Value="libao"/>
<UsageCount Value="10"/>
</Unit20>
<Unit21>
<CursorPos X="1" Y="67"/>
<EditorIndex Value="3"/>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/acs_alsaaudio.pas"/>
<Loaded Value="True"/>
<TopLine Value="56"/>
<UnitName Value="acs_alsaaudio"/>
<UsageCount Value="10"/>
</Unit21>
</Units>
<PublishOptions>
<Version Value="2"/>
<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)"/>
<Display Use="True" Value=":1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="LAZ_ACS"/>
<MinVersion Major="2" Minor="4" Valid="True"/>
</Item2>
</RequiredPackages>
<JumpHistory Count="5" HistoryIndex="4">
<Position1>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/acs_stdaudio.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/acs_stdaudio.pas"/>
<Caret Line="151" Column="36" TopLine="123"/>
</Position2>
<Position3>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/acs_stdaudio.pas"/>
<Caret Line="170" Column="5" TopLine="152"/>
</Position3>
<Position4>
<Filename Value="/windows/D/LKomponenten/acs/Src/drivers/linux/acs_audio.inc"/>
<Caret Line="239" Column="16" TopLine="203"/>
</Position4>
<Position5>
<Filename Value="/windows/D/lazarus/lcl/include/screen.inc"/>
<Caret Line="339" Column="26" TopLine="318"/>
</Position5>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<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="1">
<Item1>
<Source Value="D:/Worldspace/Src/gstdintf/home/z0m3ie/lazarus/components/turbopower_ipro/iphtml.pas"/>
<Line Value="17239"/>
</Item1>
</BreakPoints>
<Watches Count="1">
<Item1>
<Expression Value="TControlPanel(FList^[i])"/>
</Item1>
</Watches>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,74 @@
object fMain: TfMain
BorderStyle = bsToolWindow
Caption = 'Sound Indicator'
ClientHeight = 53
ClientWidth = 400
OnShow = FormShow
PixelsPerInch = 96
HorzScrollBar.Page = 399
VertScrollBar.Page = 52
Left = 276
Height = 53
Top = 155
Width = 400
object Label1: TLabel
Caption = 'Input Level'
Color = clNone
ParentColor = False
Left = 8
Height = 14
Top = 2
Width = 55
end
object Label2: TLabel
Caption = '-3 db'
Color = clNone
ParentColor = False
Left = 192
Height = 14
Top = 36
Width = 26
end
object Label3: TLabel
Caption = '-96 db'
Color = clNone
ParentColor = False
Left = 8
Height = 14
Top = 36
Width = 32
end
object ProgressBar: TProgressBar
Max = 200
Left = 8
Height = 16
Top = 16
Width = 376
end
object AudioIn1: TACSAudioIn
Driver = 'Wavemapper'
InBitsPerSample = 8
InChannels = 1
InSampleRate = 8000
RecTime = -1
left = 9
top = 296
end
object NULLOut1: TACSNULLOut
Input = VolumeQuery
SuspendWhenIdle = True
left = 9
top = 368
end
object VolumeQuery: TACSVolumeQuery
Input = AudioIn1
left = 9
top = 332
end
object Timer1: TTimer
Interval = 100
OnTimer = Timer1Timer
left = 9
top = 264
end
end

View File

@@ -0,0 +1,53 @@
unit uMain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ACS_Audio, ComCtrls, StdCtrls, ACS_Misc,
ACS_VolumeQuery, ExtCtrls;
type
{ TfMain }
TfMain = class(TForm)
AudioIn1: TACSAudioIn;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
NULLOut1: TACSNULLOut;
ProgressBar: TProgressBar;
Timer1: TTimer;
VolumeQuery: TACSVolumeQuery;
procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
fMain: TfMain;
implementation
{ TfMain }
procedure TfMain.FormShow(Sender: TObject);
begin
NULLOut1.Run;
end;
procedure TfMain.Timer1Timer(Sender: TObject);
begin
ProgressBar.Position := (round((VolumeQuery.dbLeft+VolumeQuery.dbRight)/2)+96);
end;
initialization
{$I umain.lrs}
end.

10
acs/Docs/README Normal file
View File

@@ -0,0 +1,10 @@
Audio Components Suite v 2.3
Copyright (c) 2002-2005 Andrei Borovsky.
You can contact me at acs@compiler4.net
You can get the package sources at
Audio Components Suite home page
http://www.compiler4.net/acs
NOTE: These components require Delphi 6 or above (has been tested on Delphi 6, 7, 2005)
or Kylix 2+.
See "installation" file on how to install ACS.
See "license" file for licesing information.

58
acs/Docs/docs.pds Normal file
View File

@@ -0,0 +1,58 @@
[Main]
Language=6
OutputDir=D:\SRC\LKomponenten\acs\Docs\help
GenerateFormat=0
ProjectName=Audio Component Suite
Verbosity=2
ClassMembers_0=1
ClassMembers_1=1
ClassMembers_2=0
ClassMembers_3=0
ClassMembers_4=0
AutoAbstract=0
UseTipueSearch=0
LineBreakQuality=0
SpecialMarkerTreatment=1
VizGraphClasses=1
VizGraphUses=1
CheckSpelling=0
[Defines]
Count=3
Item_0=FPC
Item_1=MSWINDOWS
Item_2=WIN32
[Header]
Count=0
[Footer]
Count=0
[IncludeDirectories]
Count=1
Item_0=D:\SRC\LKomponenten\acs\Src\classes
[Files]
Count=12
Item_0=D:\SRC\LKomponenten\acs\Src\classes\ACS_Audio.pas
Item_1=D:\SRC\LKomponenten\acs\Src\classes\ACS_AudioMix.pas
Item_2=D:\SRC\LKomponenten\acs\Src\classes\ACS_CDROM.pas
Item_3=D:\SRC\LKomponenten\acs\Src\classes\ACS_Classes.pas
Item_4=D:\SRC\LKomponenten\acs\Src\classes\ACS_Converters.pas
Item_5=D:\SRC\LKomponenten\acs\Src\classes\ACS_File.pas
Item_6=D:\SRC\LKomponenten\acs\Src\classes\ACS_Filters.pas
Item_7=D:\SRC\LKomponenten\acs\Src\classes\ACS_Indicator.pas
Item_8=D:\SRC\LKomponenten\acs\Src\classes\ACS_Misc.pas
Item_9=D:\SRC\LKomponenten\acs\Src\classes\ACS_Mixer.pas
Item_10=D:\SRC\LKomponenten\acs\Src\classes\ACS_MultiMix.pas
Item_11=D:\SRC\LKomponenten\acs\Src\classes\ACS_Streams.pas
[HyphenatedWords]
Count=0
[SpecialMarkers]
Count=0
[IgnoreWords]
Count=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

3
acs/Docs/installation Normal file
View File

@@ -0,0 +1,3 @@
If you have installed previous version of ACS, uninstall it before installing the new version. Click Component->Install Packages menu item. In the opened dialog box select the Audio Components Suite package and click "Remove" button. Make sure to remove all the previous version files from the IDE search path.
To install Audio Components Suite, first compile the package. Create or select directory where you want the components to be installed (you can use your Delphi/Kylix lib directory). We will call this directory ACS directory. Now go to the Src directory of the ACS distribution, and copy all the files from either Linux or Win32 directory to the ACS directory. Copy all the files from the Common directory into ACS directory.
Now go to the ACS directory, open ACS.dpk file in your IDE. Press "Options" button, in the opened dialog go to Directories/Conditionals tab and up set the output paths to the directory where you have copied ACS source files, press OK and then in the package window press "Compile" button. Click Component->Install Packages menu item. In the opened dialog box click "Add" button. Browse to the ACS directory and select the file called bplACS.so.2.2 (Kylix) or ACS.bpl (Delphi). After this two new tabs: "Audio I/O" and "Audio Processing" will appear on the components palette. Unless you have selected your Kylix/Delphi lib directory as ACS directory, you will have to add the ACS installation directory to the Kylix/Delphi libraries search path. This can be done on the "Library" page of the "Environment Options" dialog box (Tools->Environment Options... menu item).

14
acs/Docs/license Normal file
View File

@@ -0,0 +1,14 @@
License
Audio Components Suite Copyright (c) 2002-2005 Andrei Borovsky. All rights reserved.
The Audio Components Suite is free. It may be used both in commercial and non-commercial software either in original or in modified form.
The Audio Components Suite can be freely distributed in any way and by any means provided this copyright notice is preserved.
I have tried to make the Audio Components Suite (software) as stable and reliable as possible but still I have to warn you of the following:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.

14
acs/Docs/readme-lazarus Normal file
View File

@@ -0,0 +1,14 @@
to use the Package in Linux you must add cthreads unit to
main lazarus unit lazarus.pp
like:
uses
{$ifdef MemCheck}
MemCheck
{$endif}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
{$ifdef Linux}
,cthreads
{$endif}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
...

View File

@@ -0,0 +1,834 @@
(*
this file is a part of audio components suite
see the license file for more details.
you can contact me at mail@z0m3ie.de
$Log: acs_audio.pas,v $
Revision 1.12 2006/07/07 15:51:19 z0m3ie
*** empty log message ***
Revision 1.11 2006/07/04 18:38:32 z0m3ie
*** empty log message ***
Revision 1.10 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.4 2006/01/02 18:54:46 z0m3ie
*** empty log message ***
Revision 1.3 2006/01/01 18:46:40 z0m3ie
*** empty log message ***
Revision 1.2 2005/12/26 17:31:38 z0m3ie
fixed some problems in acs_dsfiles
fixed some problems in acs_vorbis
reworked all buffers
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.14 2005/12/18 17:01:54 z0m3ie
delphi compatibility
Revision 1.13 2005/12/04 16:54:33 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.12 2005/11/28 21:57:24 z0m3ie
mostly FileOut fixes
moved PBuffer to PBuffer8
set all to dynamically Buffering
Revision 1.11 2005/11/27 16:50:33 z0m3ie
add ACS VolumeQuerry
make ACS_VolumeQuerry localizeable
some little errorfixes (buffersize for linuxdrivers was initially 0)
make TAudioIn workable
Revision 1.10 2005/10/02 16:51:46 z0m3ie
*** empty log message ***
Revision 1.9 2005/09/23 14:04:58 z0m3ie
*** empty log message ***
Revision 1.8 2005/09/18 19:28:59 z0m3ie
more progress on driver handling
Revision 1.7 2005/09/16 17:34:29 z0m3ie
*** empty log message ***
Revision 1.6 2005/09/15 20:59:37 z0m3ie
start translate the documentation in the source for pasdoc
Revision 1.5 2005/09/14 21:19:37 z0m3ie
*** empty log message ***
Revision 1.4 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.3 2005/09/13 20:14:52 z0m3ie
driver handling classes (basic audio class)
*)
{
@abstract(this unit introduces the base classes for acs)
@author(Andrei Borovsky (2003-2005))
@author(Christian Ulrich (2005))
}
unit acs_audio;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
ACS_Types, ACS_Classes,Classes,ACS_Strings,SysUtils;
type
{ Audio Formats used in DeviceInfo record
format constants mask : af<SampleRate><Mono/Stereo><BitsPerSample>
where 1, 2, 4 means sample rate of 11025, 22050, and 44100 Hz respectively
M, S means mono or stereo, 08, 16 means 8 or 16 bits per sample.
For example, af4S16 corresponds to 44100 Hz stereo 16 bit format.
}
TACSAudioFormat = (af1M08, af1M16, af1S08, af1S16, af2M08, af2M16, af2S08, af2S16,
af4M08, af4M16, af4S08, af4S16);
TACSAudioFormats = set of TACSAudioFormat;
TACSBaseAudioOut = class;
TACSBaseAudioIn = class;
{ This record is used to get an deviceinfo from the Drivers
}
TACSDeviceInfo = record
DeviceName : String;
DrvVersion : LongWord;
Formats : TACSAudioFormats;
Stereo : Boolean;
end;
{ This introduces an base class for the drivers
}
{ TAudioOut }
{ TACSAudioOut }
TACSAudioOut = class(TComponent)
private
FDriver: string;
FOutput : TACSBaseAudioOut;
FInput : TACSCustomInput;
FOnDone: TACSOutputDoneEvent;
FOnProgress: TACSOutputProgressEvent;
FOnThreadException: TACSThreadExceptionEvent;
FLatency : Integer;
FBufferSize : Integer;
function GetBufferSize: Integer;
function GetBusy: Boolean;
function GetDelay: Integer;
function GetPriority: TTPriority;
function GetProgress: real;
function GetStatus: TACSOutputStatus;
function GetSuspend: Boolean;
function GetTE: Integer;
procedure SetBufferSize(const AValue: Integer);
procedure SetDelay(const AValue: Integer);
procedure SetPriority(const AValue: TTPriority);
procedure SetSuspend(const AValue: Boolean);
procedure ThreadException(Sender : TComponent;E : Exception);
procedure OutputDone(Sender : TComponent);
procedure OutputProgress(Sender : TComponent);
protected
FBaseChannel: Integer;
FVolume: Byte;
procedure SetInput(Input : TACSCustomInput);
procedure SetDevice(Ch : Integer);virtual;
function GetDeviceInfo : TACSDeviceInfo;virtual;
function GetDeviceCount : Integer;virtual;
procedure SetDriver(Driver : string);virtual;
function GetDriverName(idx : Integer) : string;
function GetDriversCount : Integer;
procedure Done;
function DoOutput(Abort : Boolean):Boolean;
procedure Prepare;
public
constructor Create(AOwner: TComponent);override;
destructor Destroy;override;
{ The result returns an deviceinfo record that can be used to enumerate devices
just set device property from 0 to DeviceCount-1 and read deviceInfo to
enumerate all Devices from current Driver
}
property DeviceInfo : TACSDeviceInfo read GetDeviceInfo;
{ Returns the count of devices supported by actual driver
}
property DeviceCount : Integer read GetDeviceCount;
{ This can be used to enumerate the Drivers
just use Driverscount as index it returns the DriverName
}
property Drivers[idx : Integer] : string read GetDriverName;
{ Returns the total count of avalible drivers
}
property DriversCount : Integer read GetDriversCount;
{ pauses the output.
}
procedure Pause;virtual;
{ Resumes previously paused output.
}
procedure Resume;virtual;
{ This is the most important method in the output components.
After an input component has been assigned, call Run to start audio-processing chain.
}
procedure Run;
{ Stops the running output process.
}
procedure Stop;
{ Output components perform output in their own threads.
Use this property to set the priority for the thread.
}
property ThreadPriority : TTPriority read GetPriority write SetPriority;
{ Read Progress to get the output progress in percents.
This value is meaningful only after the input component has been set
and only if the input component can tell the size of its stream.
}
property Progress : real read GetProgress;
{ This property indicates the output component's current status. Possible values are:
tosPlaying: the component is working;
tosPaused: the component is paused (the Pause method was called);
tosIdle: the component is idle;
}
property Status : TACSOutputStatus read GetStatus;
property TimeElapsed : Integer read GetTE;
property Latency : Integer read FLatency;
published
{ The output buffer size in bytes default is 4000
}
property Buffersize : Integer read GetBufferSize write SetBufferSize;
{ use this property to set an driver, on create of this component the driver
with lowest latency is used for default
}
property Driver : string read FDriver write SetDriver stored True;
{ Use this property to set the output device
}
property Busy : Boolean read GetBusy;
property Device : Integer read FBaseChannel write SetDevice stored True;
property Volume : Byte read FVolume write FVolume;
property Input : TACSCustomInput read FInput write SetInput;
{ Use this property to set the delay (in milliseconds) in output thread.
This property allows the user to reduce the stress the output thread puts
on the CPU (especially under Windows).
Be careful with this property when using TAudioOut component.
Assigning too large values to it can cause dropouts in audio playback.
}
property Delay : Integer read GetDelay write SetDelay;
property SuspendWhenIdle : Boolean read GetSuspend write SetSuspend;
property OnDone : TACSOutputDoneEvent read FOnDone write FOndone;
property OnProgress : TACSOutputProgressEvent read FOnProgress write FOnProgress;
property OnThreadException : TACSThreadExceptionEvent read FOnThreadException write FOnThreadException;
end;
{ TAudioIn }
TACSAudioIn = class(TACSCustomInput)
private
FInput : TACSBaseAudioIn;
FDriver : string;
function GetBPS : Integer;override;
function GetCh : Integer;override;
function GetSR : Integer;override;
procedure SetDevice(Ch : Integer);
function GetDeviceInfo : TACSDeviceInfo;
function GetTotalTime : real;override;
function GetDriverName(idx : Integer) : string;
function GetDriversCount : Integer;
procedure SetDriver(Driver : string);
protected
FBPS: Integer;
FChan: Integer;
FFreq: Integer;
FRecTime: Integer;
FBaseChannel: Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer;override;
procedure Init;override;
procedure Flush;override;
{ The result returns an deviceinfo record that can be used to enumerate devices
just set device property from 0 to DeviceCount-1 and read deviceInfo to
enumerate all Devices from current Driver
}
property DeviceInfo : TACSDeviceInfo read GetDeviceInfo;
{ This can be used to enumerate the Drivers
just use Driverscount as index it returns the DriverName
}
property Drivers[idx : Integer] : string read GetDriverName;
{ Returns the total count of avalible drivers
}
property DriversCount : Integer read GetDriversCount;
published
{ use this property to set an driver, on create of this component the driver
with lowest latency is used for default
}
property Driver : string read FDriver write SetDriver stored True;
{ Use this property to set the output device
}
property Device : Integer read FBaseChannel write SetDevice stored True;
{ Use this property to set the number of bits per sample for the input audio stream.
Possible values are 8 and 16.
}
property InBitsPerSample : Integer read GetBPS write FBPS stored True;
{ Use this property to set the number of channels for the input audio stream.
Possible values are 1 (mono) and 2 (stereo).
}
property InChannels : Integer read GetCh write FChan stored True;
{ Use this property to set the sample rate for the input audio stream.
Possible values are determined by the soundcard hardware.
}
property InSampleRate : Integer read GetSR write FFreq stored True;
{ This property allow you to set the record duration time in seconds.
If you assign -1 to this property TAudioIn will never stop recording by itself.
In both cases you can stop recording at any time by calling Stop method of
the respective output component.
}
property RecTime : Integer read FRecTime write FRecTime stored True;
end;
{ This class is an abstract base class for the drivers
}
{ TBaseAudioOut }
TACSBaseAudioOut = class(TACSCustomOutput)
private
FDriver: string;
FOutput : TACSAudioOut;
protected
FBaseChannel: Integer;
FVolume: Byte;
procedure SetDevice(Ch : Integer);virtual;abstract;
function GetDeviceInfo : TACSDeviceInfo;virtual;abstract;
function GetDeviceCount : Integer;virtual;abstract;
public
constructor Create(AOwner: TComponent);override;
destructor Destroy;override;
property DeviceInfo : TACSDeviceInfo read GetDeviceInfo;
property DeviceCount : Integer read GetDeviceCount;
property Buffersize : Integer read FBufferSize write FBufferSize;
published
property Device : Integer read FBaseChannel write SetDevice stored True;
property Volume : Byte read FVolume write FVolume;
end;
{ This class is an abstract base class for the drivers
}
{ TBaseAudioIn }
TACSBaseAudioIn = class(TACSCustomInput)
private
FInput : TACSAudioIn;
FDriver : string;
protected
FBPS: Integer;
FChan: Integer;
FFreq: Integer;
FRecTime: Integer;
FBaseChannel: Integer;
procedure SetDevice(Ch : Integer);virtual;abstract;
function GetDeviceInfo : TACSDeviceInfo;virtual;abstract;
function GetDeviceCount : Integer;virtual;abstract;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property DeviceInfo : TACSDeviceInfo read GetDeviceInfo;
published
property Device : Integer read FBaseChannel write SetDevice stored True;
property InBitsPerSample : Integer read GetBPS write FBPS stored True;
property InChannels : Integer read GetCh write FChan stored True;
property InSampleRate : Integer read GetSR write FFreq stored True;
property RecTime : Integer read FRecTime write FRecTime stored True;
end;
TACSAudioOutClass = class of TACSBaseAudioOut;
TACSAudioInClass = class of TACSBaseAudioIn;
TACSOutDriverinfo = record
DriverName : string;
Latency : Integer;
DrvClass : TACSAudioOutClass;
end;
TACSInDriverinfo = record
DriverName : string;
Latency : Integer;
DrvClass : TACSAudioInClass;
end;
{ This procedure must be used to register drivers to the system
just call them at initialization of the driver main unit
}
procedure RegisterAudioOut(DrvName : string;OutClass : TACSAudioOutClass;Latency : Integer);
{ This procedure must be used to register drivers to the system
just call them at initialization of the driver main unit
}
procedure RegisterAudioIn(DrvName : string;InClass : TACSAudioInClass;Latency : Integer);
var
OutDriverInfos : array of TACSOutDriverInfo;
InDriverInfos : array of TACSInDriverInfo;
implementation
{ TAudioOut }
function TACSAudioOut.GetDelay: Integer;
begin
if Assigned(FOutput) then
Result := FOutput.GetDelay
else
Result := -1;
end;
function TACSAudioOut.GetBufferSize: Integer;
begin
if Assigned(FOutput) then
Result := FOutput.BufferSize
else
Result := -1;
end;
function TACSAudioOut.GetBusy: Boolean;
begin
if Assigned(FOutput) then
Result := FOutput.Busy;
end;
function TACSAudioOut.GetPriority: TTPriority;
begin
if not Assigned(FOutput) then
raise EACSException(strNoDriverselected);
Result := FOutput.GetPriority;
end;
function TACSAudioOut.GetProgress: real;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
Result := FOutput.GetProgress;
end;
function TACSAudioOut.GetStatus: TACSOutputStatus;
begin
if not Assigned(FOutput) then
Result := tosUndefined
else
Result := FOutput.Status;
end;
function TACSAudioOut.GetSuspend: Boolean;
begin
if Assigned(FOutput) then
Result := FOutput.GetSuspend;
end;
function TACSAudioOut.GetTE: Integer;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
Result := FOutput.GetTE;
end;
procedure TACSAudioOut.SetBufferSize(const AValue: Integer);
begin
if Assigned(FOutput) then
FOutput.BufferSize := AValue;
FBufferSize := AValue;
end;
procedure TACSAudioOut.SetDelay(const AValue: Integer);
begin
if Assigned(FOutput) then
FOutput.SetDelay(AValue);
end;
procedure TACSAudioOut.SetPriority(const AValue: TTPriority);
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
FOutput.SetPriority(AValue);
end;
procedure TACSAudioOut.SetSuspend(const AValue: Boolean);
begin
if Assigned(FOutput) then
FOutput.SetSuspend(AValue);
end;
procedure TACSAudioOut.ThreadException(Sender: TComponent; E: Exception);
begin
if Assigned(FOnThreadException) then
FOnThreadException(Sender,E);
end;
procedure TACSAudioOut.OutputDone(Sender: TComponent);
begin
if Assigned(FOnDone) then
FOnDone(Sender);
end;
procedure TACSAudioOut.OutputProgress(Sender: TComponent);
begin
if Assigned(FOnProgress) then
FOnProgress(Sender);
end;
procedure TACSAudioOut.SetInput(Input: TACSCustomInput);
begin
FInput := Input;
if Assigned(FOutput) then
FOutput.Input := Input;
end;
procedure TACSAudioOut.SetDevice(Ch: Integer);
begin
FBaseChannel := ch;
if Assigned(FOutput) then
FOutput.SetDevice(ch);
end;
function TACSAudioOut.GetDeviceInfo : TACSDeviceInfo;
begin
if Assigned(FOutput) then
Result := FOutput.DeviceInfo;
end;
function TACSAudioOut.GetDeviceCount : Integer;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
Result := FOutput.GetDeviceCount;
end;
procedure TACSAudioOut.SetDriver(Driver: string);
var
i : Integer;
begin
if Driver = '' then
exit;
if Assigned(Foutput) then
FOutput.Free;
FOutput := nil;
for i := 0 to length(OutDriverInfos)-1 do
if OutDriverInfos[i].DriverName = Driver then
begin
FOutput := OutDriverInfos[i].DrvClass.Create(nil);
try
FOutput.SetDevice(FBaseChannel);
except
FOutput.SetDevice(0);
end;
FDriver := OutDriverInfos[i].DriverName;
FLatency := OutDriverInfos[i].Latency;
if Assigned(FInput) then
FOutput.Input := FInput;
FOutput.OnDone := OutputDone;
FOutput.OnProgress := OutputProgress;
Foutput.OnThreadException := ThreadException;
Foutput.Buffersize := FBuffersize;
exit;
end;
end;
function TACSAudioOut.GetDriverName(idx: Integer): string;
begin
if (idx < 0) or (idx > length(OutDriverInfos)-1)then
exit;
Result := OutDriverInfos[idx].DriverName;
end;
function TACSAudioOut.GetDriversCount: Integer;
begin
Result := length(OutDriverInfos);
end;
procedure TACSAudioOut.Done;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
Foutput.Done;
end;
function TACSAudioOut.DoOutput(Abort: Boolean): Boolean;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
FOutput.DoOutput(Abort);
end;
procedure TACSAudioOut.Prepare;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
FOutput.Prepare;
end;
constructor TACSAudioOut.Create(AOwner: TComponent);
var
lowestindex,lowest,minlat,i : Integer;
tmp : string;
exc: Boolean;
label retry;
begin
inherited Create(AOwner);
minlat := 0;
retry:
lowest := 99999;
for i := 0 to length(OutDriverInfos)-1 do
if (OutDriverInfos[i].Latency < lowest) and (OutDriverInfos[i].Latency > minlat) then
begin
lowest := OutDriverInfos[i].Latency;
lowestindex := i;
end;
if lowest < 99999 then
begin
try
SetDriver(OutDriverInfos[lowestindex].DriverName);
exc := false;
except
minlat := lowest+1;
exc := true;
end;
if exc then
goto retry;
end
else
FDriver := 'No Driver';
end;
destructor TACSAudioOut.Destroy;
begin
FOutput.Free;
inherited Destroy;
end;
procedure TACSAudioOut.Pause;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
FOutput.Pause;
end;
procedure TACSAudioOut.Resume;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
FOutput.Resume;
end;
procedure TACSAudioOut.Run;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoDriverselected);
FOutput.Run;
end;
procedure TACSAudioOut.Stop;
begin
if Assigned(FOutput) then
FOutput.Stop;
end;
{ TACSAudioIn }
function TACSAudioIn.GetBPS: Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoDriverselected);
Result := FInput.GetBPS;
end;
function TACSAudioIn.GetCh: Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoDriverselected);
Result := FInput.GetCh;
end;
function TACSAudioIn.GetSR: Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoDriverselected);
Result := FInput.GetSr;
end;
procedure TACSAudioIn.SetDevice(Ch: Integer);
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoDriverselected);
FInput.SetDevice(Ch);
end;
function TACSAudioIn.GetDeviceInfo : TACSDeviceInfo;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoDriverselected);
//TODO: Complete
end;
function TACSAudioIn.GetTotalTime : real;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoDriverselected);
Result := FInput.GetTotalTime;
end;
function TACSAudioIn.GetDriverName(idx: Integer): string;
begin
if (idx < 0) or (idx > length(InDriverInfos)-1)then
exit;
Result := InDriverInfos[idx].DriverName;
end;
function TACSAudioIn.GetDriversCount: Integer;
begin
Result := length(InDriverInfos);
end;
procedure TACSAudioIn.SetDriver(Driver: string);
var
i : Integer;
begin
if Assigned(FInput) then
FInput.Free;
for i := 0 to length(InDriverInfos)-1 do
if InDriverInfos[i].DriverName = Driver then
begin
FDriver := InDriverInfos[i].DriverName;
FInput := InDriverInfos[i].DrvClass.Create(nil);
FInput.SetDevice(FBaseChannel);
exit;
end;
end;
constructor TACSAudioIn.Create(AOwner: TComponent);
var
lowestindex,lowest,i : Integer;
minlat: Integer;
exc: Boolean;
label retry;
begin
inherited Create(AOwner);
minlat := 0;
retry:
lowest := 99999;
for i := 0 to length(InDriverInfos)-1 do
if (InDriverInfos[i].Latency < lowest) and (InDriverInfos[i].Latency > minlat) then
begin
lowest := InDriverInfos[i].Latency;
lowestindex := i;
end;
if lowest < 99999 then
begin
try
SetDriver(InDriverInfos[lowestindex].DriverName);
exc := false;
except
minlat := lowest+1;
exc := true;
end;
if exc then
goto retry;
end
else
FDriver := 'No Driver';
end;
destructor TACSAudioIn.Destroy;
begin
inherited Destroy;
end;
function TACSAudioIn.GetData(Buffer: Pointer; BufferSize: Integer): Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoDriverselected);
Result := FInput.GetData(Buffer,BufferSize);
end;
procedure TACSAudioIn.Init;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoDriverselected);
FInput.Init;
end;
procedure TACSAudioIn.Flush;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoDriverselected);
FInput.Flush;
end;
procedure RegisterAudioOut(DrvName : string;OutClass : TACSAudioOutClass;Latency : Integer);
begin
Setlength(OutDriverInfos,length(OutdriverInfos)+1);
OutDriverInfos[length(OutDriverInfos)-1].DriverName := DrvName;
OutDriverInfos[length(OutDriverInfos)-1].Latency := Latency;
OutDriverInfos[length(OutDriverInfos)-1].DrvClass := OutClass;
end;
procedure RegisterAudioIn(DrvName : string;InClass : TACSAudioInClass;Latency : Integer);
begin
Setlength(InDriverInfos,length(IndriverInfos)+1);
InDriverInfos[length(InDriverInfos)-1].DriverName := DrvName;
InDriverInfos[length(InDriverInfos)-1].Latency := Latency;
InDriverInfos[length(InDriverInfos)-1].DrvClass := InClass;
end;
{ TACSBaseAudioOut }
constructor TACSBaseAudioOut.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
destructor TACSBaseAudioOut.Destroy;
begin
inherited Destroy;
end;
{ TBaseAudioIn }
constructor TACSBaseAudioIn.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
destructor TACSBaseAudioIn.Destroy;
begin
inherited Destroy;
end;
initialization
Setlength(OutDriverInfos,0);
Setlength(InDriverInfos,0);
finalization
Setlength(OutDriverInfos,0);
Setlength(InDriverInfos,0);
end.

View File

@@ -0,0 +1,413 @@
(*
this file is a part of audio components suite.
see the license file for more details.
you can contact me at mail@z0m3ie.de
$Log: acs_audiomix.pas,v $
Revision 1.6 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.4 2005/12/04 16:54:33 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.3 2005/09/15 20:59:37 z0m3ie
start translate the documentation in the source for pasdoc
Revision 1.2 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.3 2005/08/23 19:45:51 z0m3ie
changed to Version 2.31
Revision 1.2 2005/08/22 20:17:01 z0m3ie
changed Headers to log
changed mail adress
*)
{
@abstract(this unit introduces the base classes for acs)
@author(Andrei Borovsky (2003-2005))
@author(Christian Ulrich (2005))
}
{$hints off}
unit acs_audiomix;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, SysUtils, ACS_Types, ACS_Classes, ACS_Strings;
const
BUF_SIZE = $100000;
type
TACSAudioMixerMode = (amMix, amConcatenate, amRTMix, amCustomMix);
TACSAudioMixer = class(TACSCustomInput)
private
FInput1, FInput2 : TACSCustomInput;
BufStart, BufEnd : Integer;
ByteCount : Cardinal; // add by leozhang
FVolume1, FVolume2 : Byte;
EndOfInput1, EndOfInput2 : Boolean;
InBuf1, InBuf2 : array[1..BUF_SIZE] of Byte;
Buisy : Boolean;
FMode : TACSAudioMixerMode;
FInput2Start: Cardinal;
FLock : Boolean;
FFgPlaying : Boolean;
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
procedure SetInput1(aInput : TACSCustomInput);
procedure SetInput2(aInput : TACSCustomInput);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
property FgPlaying : Boolean read FFgPlaying;
published
property Input1 : TACSCustomInput read FInput1 write SetInput1;
property Input2 : TACSCustomInput read FInput2 write SetInput2;
property Mode : TACSAudioMixerMode read FMode write FMode;
property Input2Start :Cardinal read FInput2Start write FInput2Start;
property Volume1 : Byte read FVolume1 write FVolume1;
property Volume2 : Byte read FVolume2 write FVolume2;
end;
implementation
procedure MixChannels16(Buf1, Buf2 : PACSBuffer16; Vol1, Vol2, InSize : Integer);
var // optimized by leozhang
i, tmp : Integer;
V1,V2: Real;
begin
V1 := Vol1 / 127;
V2 := Vol2 / 127;
for i := 0 to (Insize shr 1) - 1 do
begin
if Buf2[i] = 0 then
begin
Buf2[i] := Round(Buf1[i] * V1);
end else
if Buf1[i] = 0 then
begin
Buf2[i] := Round(Buf2[i] * V2);
end else
Buf2[i] := Round(Buf1[i] * V1) + Round(Buf2[i] * V2);
end;
end;
constructor TACSAudioMixer.Create;
begin
inherited Create(AOwner);
FVolume1 := 127;
FVolume2 := 127;
FInput2Start := 0;
end;
destructor TACSAudioMixer.Destroy;
begin
inherited Destroy;
end;
function TACSAudioMixer.GetBPS;
begin
if not Assigned(FInput1) then
raise EACSException.Create(strInputnotAssigned);
Result := FInput1.BitsPerSample;
end;
function TACSAudioMixer.GetCh;
begin
if not Assigned(FInput1) then
raise EACSException.Create(strInputnotAssigned);
Result:= FInput1.Channels;
end;
function TACSAudioMixer.GetSR;
begin
if not Assigned(FInput1) then
raise EACSException.Create(strInputnotAssigned);
Result := FInput1.SampleRate;
end;
procedure TACSAudioMixer.Init;
var
In2StartByte : Cardinal; // add by zhangl.
begin
Buisy := True;
FPosition := 0;
BufStart := 1;
BufEnd := 0;
EndOfInput1 := False;
EndOfInput2 := False;
if not Assigned(FInput1) then
raise EACSException.Create(strInputnotAssigned);
if FMode = amRTMix then
begin
FInput1.Init;
FSize := FInput1.Size;
if Assigned(FInput2) then
begin
FInput2.Init;
FFgPlaying := True;
end else EndOfInput2 := True;
FLock := False;
end else
begin
if not Assigned(FInput2) then
raise EACSException.Create(strInputnotAssigned);
FInput1.Init;
FInput2.Init;
case FMode of
amMix :
if FInput1.Size > FInput2.Size then FSize := FInput1.Size
else FSize := FInput2.Size;
amConcatenate :
FSize := FInput1.Size + FInput2.Size; //determine the size of the output stream in bytes
amCustomMix:
// add by leozhang
begin
In2StartByte := Round(Int((FInput2Start * FInput2.SampleRate) /1000) *
(FInput2.Channels) * ((FInput2.BitsPerSample) shr 3));
ByteCount := In2StartByte;
if Cardinal(FInput1.Size) > In2StartByte + FInput2.Size then
FSize := FInput1.Size
else
FSize := In2StartByte + FInput2.Size;
FLock := False;
end;
// leozhang
end;
end;
end;
procedure TACSAudioMixer.Flush;
begin
FInput1.Flush;
if (FMode <> amRTMix) or Assigned(FInput2) then
FInput2.Flush;
Buisy := False;
end;
function TACSAudioMixer.GetData;
var
l1, l2 : Integer;
InSize : Integer;
begin
if not Buisy then raise EACSException.Create(strStreamnotopen);
if BufStart > BufEnd then
begin
if EndOfInput1 and EndOfInput2 then
begin
Result := 0;
Exit;
end;
if (FMode = amRTMix) and EndOfInput1 then
begin
Result := 0;
Exit;
end;
BufStart := 1;
case Mode of
amMix :
begin
l1 := 0;
l2 := 0;
FillChar(InBuf1[1], BUF_SIZE, 0);
FillChar(InBuf2[1], BUF_SIZE, 0);
if not EndOfInput1 then
begin
l1 := FInput1.GetData(@InBuf1[1], BUF_SIZE);
InSize := l1;
while (InSize <> 0) and (l1 < BUF_SIZE) do
begin
InSize := FInput1.GetData(@InBuf1[l1+1], BUF_SIZE - l1);
Inc(l1, InSize);
end;
if InSize = 0 then EndOfInput1 := True;
end;
if not EndOfInput2 then
begin
l2 := FInput2.GetData(@InBuf2[1], BUF_SIZE);
InSize := l2;
while (InSize <> 0) and (l2 < BUF_SIZE) do
begin
InSize := FInput2.GetData(@InBuf2[l2+1], BUF_SIZE - l2);
Inc(l2, InSize);
end;
if InSize = 0 then EndOfInput2 := True;
end;
if (l1 = 0) and (l2 = 0) then
begin
Result := 0;
Exit;
end;
if l1 > l2 then BufEnd := l1 else BufEnd := l2;
MixChannels16(@InBuf1[1], @InBuf2[1], FVolume1, FVolume2, BufEnd);
end;
amConcatenate :
begin
if not EndOfInput1 then
begin
l1 := FInput1.GetData(@InBuf2[1], BUF_SIZE);
if l1 = 0 then EndOfInput1 := True
else BufEnd := l1;
end;
if EndOfInput1 then
begin
l2 := FInput2.GetData(@InBuf2[1], BUF_SIZE);
if l2 = 0 then
begin
Result := 0;
Exit;
end
else BufEnd := l2;
end;
end;
// add by leo.zhang
amCustomMix:
begin
l1 := 0;
l2 := 0;
FillChar(InBuf1[1], BUF_SIZE, 0);
FillChar(InBuf2[1], BUF_SIZE, 0);
if not EndOfInput1 then
begin
l1 := FInput1.GetData(@InBuf1[1], BUF_SIZE);
InSize := l1;
while (InSize <> 0) and (l1 < BUF_SIZE) do
begin
InSize := FInput1.GetData(@InBuf1[l1+1], BUF_SIZE - l1);
Inc(l1, InSize);
end;
if InSize = 0 then EndOfInput1 := True;
end;
if not (FLock or EndOfInput2) then
begin
FLock := True;
if ByteCount > BUF_SIZE then
begin
ByteCount := ByteCount - BUF_SIZE;
l2 := BUF_SIZE; InSize := l2;
end else
begin
l2 := FInput2.GetData(@InBuf2[ByteCount+1],BUF_SIZE - ByteCount);
InSize := l2;
if ByteCount <> 0 then
begin
Inc(l2,ByteCount);
InSize := l2;
ByteCount := 0;
end;
while (InSize <> 0) and (l2 < BUF_SIZE) do
begin
InSize := FInput2.GetData(@InBuf2[l2+1], BUF_SIZE - l2);
Inc(l2, InSize);
end;
end;
if InSize = 0 then EndOfInput2 := True;
FLock := False;
end;
if (l1 = 0) and (l2 = 0) then
begin
Result := 0;
Exit;
end;
if l1 > l2 then BufEnd := l1 else BufEnd := l2;
MixChannels16(@InBuf1[1], @InBuf2[1], FVolume1, FVolume2, BufEnd);
end;
// leo.zhang.
amRTMix :
begin
l1 := 0;
l2 := 0;
FillChar(InBuf1[1], BUF_SIZE, 0);
FillChar(InBuf2[1], BUF_SIZE, 0);
if not EndOfInput1 then
begin
l1 := FInput1.GetData(@InBuf1[1], BUF_SIZE);
InSize := l1;
while (InSize <> 0) and (l1 < BUF_SIZE) do
begin
InSize := FInput1.GetData(@InBuf1[l1+1], BUF_SIZE - l1);
Inc(l1, InSize);
end;
if InSize = 0 then EndOfInput1 := True;
end;
if not (FLock or EndOfInput2) then
begin
FLock := True;
l2 := FInput2.GetData(@InBuf2[1], BUF_SIZE);
InSize := l2;
while (InSize <> 0) and (l2 < BUF_SIZE) do
begin
InSize := FInput2.GetData(@InBuf2[l2+1], BUF_SIZE - l2);
Inc(l2, InSize);
end;
if InSize = 0 then
begin
EndOfInput2 := True;
FFGPlaying := False;
FInput2.Flush;
FInput2 := nil;
end;
FLock := False;
end;
if (l1 = 0) and (l2 = 0) then
begin
Result := 0;
Exit;
end;
if l1 > l2 then BufEnd := l1 else BufEnd := l2;
MixChannels16(@InBuf1[1], @InBuf2[1], FVolume1, FVolume2, BufEnd);
end;
end; // case end.
end; // endif.
if BufferSize < (BufEnd - BufStart + 1)
then Result := BufferSize
else Result := BufEnd - BufStart + 1;
Move(InBuf2[BufStart], Buffer^, Result);
Inc(BufStart, Result);
Inc(FPosition, Result);
end; // procedure end.
procedure TACSAudioMixer.SetInput1;
begin
if Buisy then
raise EACSException.Create(strBusy);
FInput1 := aInput;
end;
procedure TACSAudioMixer.SetInput2;
begin
if not Buisy then FInput2 := aInput
else
if FMode = amRTMix then
begin
if FFgPlaying then
begin
while Flock do;
FLock := True;
Input2.Flush;
end;
FInput2 := aInput;
Finput2.Init;
Flock := False;
FFgPlaying := True;
EndOfInput2 := False;
end else
raise EACSException.Create(strNotinFBMode);
end;
end.

View File

@@ -0,0 +1,321 @@
(*
this file is a part of audio components suite
see the license file for more details.
you can contact me at mail@z0m3ie.de
Special thanks to Thomas Grelle <grelle@online.de> for improving this unit.
$Log: acs_cdrom.pas,v $
Revision 1.11 2006/08/31 20:10:54 z0m3ie
*** empty log message ***
Revision 1.10 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.2 2005/12/26 17:31:38 z0m3ie
fixed some problems in acs_dsfiles
fixed some problems in acs_vorbis
reworked all buffers
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.7 2005/12/18 17:01:54 z0m3ie
delphi compatibility
Revision 1.6 2005/12/04 16:54:33 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.5 2005/11/28 21:57:24 z0m3ie
mostly FileOut fixes
moved PBuffer to PBuffer8
set all to dynamically Buffering
Revision 1.4 2005/10/02 16:51:46 z0m3ie
*** empty log message ***
Revision 1.3 2005/09/15 20:59:38 z0m3ie
start translate the documentation in the source for pasdoc
Revision 1.2 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.6 2005/09/09 21:33:42 z0m3ie
linux corrections
Revision 1.5 2005/09/08 22:18:59 z0m3ie
completed akrip based CDIn
Revision 1.4 2005/09/07 20:53:22 z0m3ie
begon to add MPEG and WMA support using DirectX
Revision 1.3 2005/09/04 17:59:37 z0m3ie
moving CDIn support to AKRip mostly
begon to add mpegin support for Win with mpg123
Revision 1.2 2005/08/28 20:31:17 z0m3ie
linux restructuring for 2.4
Revision 1.1 2005/08/25 20:18:00 z0m3ie
Version 2.4 restructure
TCDPlayer removed (fits not in component structure)
TMP3ToWavConverter removed (fits not in component structure)
Revision 1.5 2005/08/22 20:17:02 z0m3ie
changed Headers to log
changed mail adress
*)
{
@abstract(this unit introduces the base classes for acs)
@author(Andrei Borovsky (2003-2005))
@author(Christian Ulrich (2005))
}
unit acs_cdrom;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, SysUtils, ACS_Classes,ACS_Strings,ACS_Types
{$IFDEF MSWINDOWS}
,Windows, MMSystem, akrip32
{$ELSE}
,baseunix,cd_rom
{$ENDIF}
;
type
{$IFDEF MSWINDOWS}
{$IFDEF FPC}
TAuxCaps = AUXCAPS;
{$ENDIF}
{$ENDIF}
TACSCDStatus = (cdsNotReady, cdsReady, cdsPlaying, cdsPaused);
TACSTrackType = (ttAudio, ttData);
TACSCDInfo = (cdiNoDisc, cdiDiscAudio, cdiDiscData, cdiDiscMixed, cdiUnknown);
TACSMCN = array[0..13] of Char;
TACSCDMSF = record
Minute : Byte;
Second : Byte;
Frame : Byte;
end;
PACSCDMSF = ^TACSCDMSF;
TACSCDTrackInfo = record
TrackStart: TACSCDMSF;
TrackLength : TACSCDMSF;
TrackType : TACSTrackType;
end;
TACSCDPosition = record
Track : Integer;
MSF : TACSCDMSF;
end;
const
EndOfDisc : TACSCDPosition = (Track : 100; MSF : (Minute : 0; Second : 0; Frame : 0));
CD_FRAMESIZE_RAW = 2352;
BUF_SIZE = 50; // 75 frames - 1 sec
var
AppPath : String;
WinPath : String;
type
{ This is the cdreader component of acs it reads in windows with aspi
and linux direct from device
}
TACSCDIn = class(TACSCustomInput)
private
FBuffer : array of byte;
FCurrentDrive : Integer;
FStartTrack, FEndTrack : Integer;
FStartPos, FEndPos: TACSCDPosition;
FRipEnd : Integer;
FCDDBId: Longint;
{$IFDEF LINUX}
FOpened : Integer;
FCurPos,FEndMSF : TACSCDMSF;
FDrivesCount : Integer;
_cd_fd : Integer;
BufSize : Integer;
{$ELSE}
FToc: TOC;
FCDList: CDLIST;
FCDHandle : HCDROM;
FPlaying : Boolean;
FRipStart : LongInt;
FiBuffer : PTRACKBUF;
{$ENDIF}
procedure OpenCD;
procedure CloseCD;
function GetStatus : TACSCDStatus;
function GetNumTracks : Integer;
function GetTrackInfo(const vIndex : Integer) : TACSCDTrackInfo;
procedure SetST(Track : Integer);
procedure SetET(Track : Integer);
procedure SetSP(Pos : TACSCDPosition);
procedure SetEP(Pos : TACSCDPosition);
function GetSize : Integer;
function GetInfo : TACSCDInfo;
function GetDrivesCount : Integer;
procedure SetCurrentDrive(Value : Integer);
function GetDriveName : String;
function GetCDDBID : LongInt;
function GetTotalTime : real; override;
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
procedure Eject;
procedure CloseTray;
property DiscInfo: TACSCDInfo read GetInfo;
property Status: TACSCDStatus read GetStatus;
property Tracks[const vIndex : Integer] : TACSCDTrackInfo read GetTrackInfo;
property TracksCount : Integer read GetNumTracks;
property DriveName : String read GetDriveName;
property DrivesCount : Integer read GetDrivesCount;
property StartPos : TACSCDPosition read FStartPos write SetSP;
property EndPos : TACSCDPosition read FEndPos write SetEP;
property CDDBId : LongInt read GetCDDBID;
published
property CurrentDrive : Integer read FCurrentDrive write SetCurrentDrive;
property StartTrack: Integer read FStartTrack write SetSt;
property EndTrack: Integer read FEndTrack write SetET;
end;
function MSFToStr(const MSF : TACSCDMSF) : String;
procedure Frames2MSF(Frames : Integer; var MSF : TACSCDMSF);
function MSF2Frames(const MSF : TACSCDMSF) : Integer;
{$IFDEF LINUX}
var
DrivesCount : Integer;
DrivesPaths : array of string;
procedure CountDrives;
{$ENDIF}
implementation
{$I ACS_CDROM.inc}
function MSFToStr(const MSF : TACSCDMSF) : String;
var
sep : String;
sec, min : Integer;
begin
min := MSF.Minute;
if MSF.Frame > 37 then
begin
sec := MSF.Second + 1;
if sec = 60 then
begin
Inc(min);
sec := 0;
end;
end
else sec := MSF.Second;
if sec<10 then sep := ':0'
else sep := ':';
Result := IntToStr(min) + sep + IntToStr(sec);
end;
procedure Frames2MSF(Frames : Integer; var MSF : TACSCDMSF);
var
Temp : Integer;
begin
Temp := Frames div 75;
MSF.Minute := Temp div 60;
MSF.Second := Temp mod 60;
MSF.Frame := Frames mod 75;
end;
function MSF2Frames(const MSF : TACSCDMSF) : Integer;
begin
Result := ((MSF.Minute * 60) + MSF.Second) * 75 + MSF.Frame;
end;
function TACSCDIn.GetBPS : Integer;
begin
Result := 16;
end;
function TACSCDIn.GetCh : Integer;
begin
Result := 2;
end;
function TACSCDIn.GetSR : Integer;
begin
Result := 44100;
end;
function TACSCDIn.GetTotalTime : real;
begin
if (SampleRate = 0) or (Channels = 0) or (BitsPerSample = 0) then
Exit;
Result := Size/(SampleRate*Channels*(BitsPerSample shr 3));
end;
function TACSCDIn.GetCDDBID: LongInt;
FUNCTION prg_sum(n: integer): integer;
VAR
buf: STRING;
ib: Integer;
BEGIN
buf := IntToStr(n);
Result := 0;
FOR ib := 1 TO Length(buf) DO
Result := Result + (StrToInt(Copy(Buf, ib, 1)));
END;
VAR
i, N, L: Longint;
CDM: TACSCDMSF;
BEGIN
N := 0;
L := 0;
FOR i := 0 TO GetNumTracks-1 DO
BEGIN
WITH Tracks[i].TrackStart DO
BEGIN
N := N + prg_sum((minute * 60) + second + 2);
L := L + MSF2Frames(Tracks[i].TrackLength);
// adjust the length of last audio track if a data track is following
IF (i > 0) AND (i = TracksCount - 2) AND (Tracks[i + 1].TrackType = ttData) THEN
inc(L, 152 * 75);
END;
END;
Frames2MSF(L, CDM);
L := CDM.Minute * 60 + CDM.Second;
Result := ((N MOD $0FF) SHL 24) XOR (L SHL 8) XOR TracksCount;
FCDDBId := Result;
end;
{$IFDEF LINUX}
initialization
CountDrives;
{$ENDIF}
end.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,910 @@
(*
this file is a part of audio components suite.
see the license file for more details.
you can contact me at mail@z0m3ie.de
$Log: acs_converters.pas,v $
Revision 1.6 2006/08/31 20:10:54 z0m3ie
*** empty log message ***
Revision 1.5 2006/07/04 18:38:32 z0m3ie
*** empty log message ***
Revision 1.4 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.2 2006/01/01 18:46:40 z0m3ie
*** empty log message ***
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.4 2005/12/04 16:54:33 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.3 2005/09/15 20:59:38 z0m3ie
start translate the documentation in the source for pasdoc
Revision 1.2 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.4 2005/09/01 19:55:48 z0m3ie
again Delphi corrections
Revision 1.3 2005/08/31 20:30:39 z0m3ie
Mixer Channelname work now
minior corrections for Converters
Revision 1.2 2005/08/22 20:17:01 z0m3ie
changed Headers to log
changed mail adress
*)
{
@abstract(this unit introduces the base classes for acs)
@author(Andrei Borovsky (2003-2005))
@author(Christian Ulrich (2005))
}
unit acs_converters;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, SysUtils, ACS_Types, ACS_Procs, ACS_Classes, ACS_Strings, Math;
const
BUF_SIZE = $8000;
KERNEL_WIDTH = 64;
SD_BUF_SIZE = 2048;
type
TACSMSConverterMode = (msmMonoToBoth, msmMonoToLeft, msmMonoToRight);
TDA = array[0..63] of Double;
PDA = ^TDA;
TACSRateConverter = class(TACSCustomConverter)
private
FOutSampleRate : Integer;
WantedSize : Integer;
EndOfInput : Boolean;
remainder : Integer;
InBufM, OutBufM : PACSBuffer16;
InBufS, OutBufS : PACSStereoBuffer16;
DAM : array of Double;
DAS : array of TACSStereoSampleD;
Kernel : array of Double;
FKernelWidth : Integer;
FFilterWindow : TACSFilterWindowType;
Tail : Pointer;
LBS : TACSStereoSample16;
function ConvertFreqs16Mono(InSize : Integer): Integer;
function ConvertFreqs16Stereo(InSize : Integer): Integer;
procedure SetOutSampleRate(aSR : Integer);
procedure SetKernelWidth(aKW : Integer);
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
published
property FilterWindow : TACSFilterWindowType read FFilterWindow write FFilterWindow;
property KernelWidth : Integer read FKernelWidth write SetKernelWidth;
property OutSampleRate : Integer read FOutSampleRate write SetOutSampleRate;
end;
TACSMSConverter = class(TACSCustomConverter)
private
WantedSize : Integer;
EndOfInput : Boolean;
InOutBuf : array[1..BUF_SIZE] of Byte;
FMode : TACSMSConverterMode;
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
published
property Mode : TACSMSConverterMode read FMode write FMode;
end;
TACSSampleConverter = class(TACSCustomConverter)
private
WantedSize : Integer;
EndOfInput : Boolean;
InOutBuf : array[1..BUF_SIZE] of Byte;
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
end;
TACSStereoBalance = class(TACSCustomConverter)
private
FBalance : Single;
procedure SetBalance(a : Single);
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
published
property Balance : Single read FBalance write SetBalance;
end;
implementation
function TACSRateConverter.ConvertFreqs16Mono(InSize : Integer): Integer;
var
i, step, j, k, s, m : Integer;
D : Double;
TailMono : PACSBuffer16;
TailMonoD : PACSDoubleArray;
begin
TailMono := Tail;
s := InSize shr 1;
if FInput.SampleRate > FOutSampleRate then
begin
step := FInput.SampleRate - FOutSampleRate;
j := 0;
if remainder < 0 then remainder := FOutSampleRate;
for i := 0 to s - 1 do
begin
if remainder > FOutSampleRate then Dec(remainder, FOutSampleRate)
else begin
D := 0;
for k := 0 to FKernelWidth - 1 do
if i-k >= 0 then
D := D + InBufM[i-k]*Kernel[FKernelWidth - 1 - k]
else
D := D + TailMono[FKernelWidth-1+i-k]*Kernel[FKernelWidth - 1 - k];
OutBufM[j] := Round(D);
Inc(j);
Inc(remainder, step);
end;
end;
for i := 0 to FKernelWidth-2 do TailMono[i] := InBufM[i+s-FKernelWidth+1]
end else
begin
TailMonoD := Tail;
FillChar(DAM[0], Length(DAM)*8, 0);
for i := 0 to FKernelWidth-2 do
begin
DAM[i] := TailMonoD[i];
TailMonoD[i] := 0;
end;
Step := Finput.SampleRate;
j := 0;
if remainder < 0 then remainder := 0;
while remainder < FOutSampleRate do
begin
m := Round(((FOutSampleRate - remainder)*LBS.Left + remainder*InBufM[0])/FOutSampleRate);
for k := 0 to FKernelWidth-1 do
DAM[j+k] := DAM[j+k] + m*Kernel[k];
Inc(j);
Inc(remainder, step);
end;
Dec(remainder, FOutSampleRate);
for i := 0 to s - 2 do
begin
while remainder < FOutSampleRate do
begin
m := Round(((FOutSampleRate - remainder)*InBufM[i] + remainder*InBufM[i+1])/FOutSampleRate);
for k := 0 to FKernelWidth-1 do
DAM[j+k] := DAM[j+k] + m*Kernel[k];
Inc(j);
Inc(remainder, step);
end;
Dec(remainder, FOutSampleRate);
end;
LBS.Left := InBufM[s-1];
for i := 0 to j-1 do
OutBufM[i] := Round(DAM[i]);
for i := 0 to FKernelWidth-2 do TailMonoD[i] := DAM[i+j];
end;
Result := j shl 1;
end;
function TACSRateConverter.ConvertFreqs16Stereo(InSize : Integer): Integer;
var
i, step, j, k, s, m1, m2 : Integer;
D1, D2 : Double;
TailStereo : PACSStereoBuffer16;
TailStereoD : PACSStereoBufferD;
begin
TailStereo := Tail;
s := InSize shr 2;
if FInput.SampleRate > FOutSampleRate then
begin
step := FInput.SampleRate - FOutSampleRate;
j := 0;
if remainder < 0 then remainder := FOutSampleRate;
for i := 0 to s - 1 do
begin
try
if remainder > FOutSampleRate then Dec(remainder, FOutSampleRate)
else begin
D1 := 0;
D2 := 0;
for k := 0 to FKernelWidth - 1 do
if i-k >= 0 then
begin
D1 := D1 + InBufS[i-k].Left*Kernel[FKernelWidth - 1 - k];
D2 := D2 + InBufS[i-k].Right*Kernel[FKernelWidth - 1 - k];
end else
begin
D1 := D1 + TailStereo[FKernelWidth-1+i-k].Left*Kernel[FKernelWidth - 1 - k];
D2 := D2 + TailStereo[FKernelWidth-1+i-k].Right*Kernel[FKernelWidth - 1 - k];
end;
OutBufS[j].Left := Round(D1);
OutBufS[j].Right := Round(D2);
Inc(j);
Inc(remainder, step);
end;
except
end;
end;
for i := 0 to FKernelWidth-2 do TailStereo[i] := InBufS[i+s-FKernelWidth+1]
//Move(InBufS[s-FKernelWidth+1], TailStereo[0], FKernelWidth-1);
end else
begin
TailStereoD := Tail;
FillChar(DAS[0], Length(DAS)*16, 0);
for i := 0 to FKernelWidth-2 do
begin
DAS[i] := TailStereoD[i];
TailStereoD[i].Left := 0;
TailStereoD[i].Right := 0;
end;
Step := Finput.SampleRate;
j := 0;
if remainder < 0 then remainder := 0;
while remainder < FOutSampleRate do
begin
m1 := Round(((FOutSampleRate - remainder)*LBS.Left + remainder*InBufS[0].Left)/FOutSampleRate);
m2 := Round(((FOutSampleRate - remainder)*LBS.Right + remainder*InBufS[0].Right)/FOutSampleRate);
for k := 0 to FKernelWidth-1 do
begin
DAS[j+k].Left := DAS[j+k].Left + m1*Kernel[k]; //InBufS[i].Left*Kernel[k];
DAS[j+k].Right := DAS[j+k].Right + m2*Kernel[k]; //InBufS[i].Right*Kernel[k];
end;
Inc(j);
Inc(remainder, step);
end;
Dec(remainder, FOutSampleRate);
for i := 0 to s - 2 do
begin
while remainder < FOutSampleRate do
begin
m1 := Round(((FOutSampleRate - remainder)*InBufS[i].Left + remainder*InBufS[i+1].Left)/FOutSampleRate);
m2 := Round(((FOutSampleRate - remainder)*InBufS[i].Right + remainder*InBufS[i+1].Right)/FOutSampleRate);
for k := 0 to FKernelWidth-1 do
begin
DAS[j+k].Left := DAS[j+k].Left + m1*Kernel[k]; //InBufS[i].Left*Kernel[k];
DAS[j+k].Right := DAS[j+k].Right + m2*Kernel[k]; //InBufS[i].Right*Kernel[k];
end;
Inc(j);
Inc(remainder, step);
end;
Dec(remainder, FOutSampleRate);
end;
LBS := InBufS[s-1];
for i := 0 to j-1 do
begin
OutBufS[i].Left := Round(DAS[i].Left);
OutBufS[i].Right := Round(DAS[i].Right);
end;
for i := 0 to FKernelWidth-2 do TailStereoD[i] := DAS[i+j];
end;
Result := j shl 2;
end;
procedure Convert16To8(InOutBuf : PACSBuffer8; InSize : Integer);
var
i : Integer;
P : PACSBuffer16;
begin
P := @InOutBuf[0];
for i := 0 to (Insize shr 1) -1 do
InOutBuf[i] := Hi(P[i]+$8000);
end;
procedure Convert8To16(InOutBuf : PACSBuffer8; InSize : Integer);
var
i : Integer;
P : PACSBuffer16;
begin
P := @InOutBuf[0];
for i := Insize - 1 downto 0 do P[i] := (InOutBuf[i] shl 8) - $8000;
end;
procedure ConvertStereoToMono16(InOutBuf : PACSBuffer16; InSize : Integer);
var
i : Integer;
begin
for i := 0 to (Insize shr 2) - 1 do
begin
InOutBuf[i] := (InOutBuf[i shl 1] + InOutBuf[(i shl 1)+1]) div 2;
end;
end;
procedure ConvertMonoToStereo16(InOutBuf : PACSBuffer16; InSize : Integer; Mode : TACSMSConverterMode);
var
i : Integer;
begin
case Mode of
msmMonoToBoth :
for i := (Insize shr 1) - 1 downto 0 do
begin
InOutBuf[i shl 1] := InOutBuf[i];
InOutBuf[(i shl 1)+1] := InOutBuf[i];
end;
msmMonoToLeft :
for i := (Insize shr 1) - 1 downto 0 do
begin
InOutBuf[i shl 1] := 0;
InOutBuf[(i shl 1)+1] := InOutBuf[i];
end;
msmMonoToRight :
for i := (Insize shr 1) - 1 downto 0 do
begin
InOutBuf[i shl 1] := InOutBuf[i];
InOutBuf[(i shl 1)+1] := 0;
end;
end;
end;
function GCD(a, b : Integer) : Integer;
var
p, q, r : Integer;
begin
p := a;
q := b;
r := p mod q;
while r <> 0 do
begin
p := q;
q := r;
r := p mod q;
end;
Result := q;
end;
constructor TACSRateConverter.Create;
begin
inherited Create(AOwner);
FOutSampleRate := 22050;
FKernelWidth := 30;
FFilterWindow := fwBlackman;
end;
destructor TACSRateConverter.Destroy;
begin
Kernel := nil;
DAS := nil;
DAM := nil;
inherited Destroy;
end;
function TACSRateConverter.GetBPS : Integer;
begin
Result := 16;
end;
function TACSRateConverter.GetCh : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result := FInput.Channels;
end;
function TACSRateConverter.GetSR : Integer;
begin
Result := FOutSampleRate;
end;
procedure TACSRateConverter.Init;
var
Ratio : Single;
TailSize : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
FInput.Init;
InputLock := False;
FBusy := True;
FPosition := 0;
BufStart := 1;
BufEnd := 0;
EndOfInput := False;
Ratio := FOutSampleRate/Finput.SampleRate;
if Ratio > 1. then
WantedSize := (Trunc(BUF_SIZE/Ratio) shr 2) * 4
else WantedSize := BUF_SIZE;
if Finput.Channels = 1 then
begin
GetMem(InBufM, WantedSize);
GetMem(OutBufM, BUF_SIZE);
if Ratio < 1. then
TailSize := (KernelWidth-1)*2
else
begin
SetLength(DAM, (BUF_SIZE div 2)+KernelWidth);
TailSize := (KernelWidth-1)*8;
end;
FillChar(DAM[0], Length(DAM)*Sizeof(DAM[0]), 0);
end else
begin
GetMem(InBufS, WantedSize);
GetMem(OutBufS, BUF_SIZE);
if Ratio < 1. then
TailSize := (KernelWidth-1)*4
else
begin
SetLength(DAS, (BUF_SIZE div 4)+KernelWidth);
TailSize := (KernelWidth-1)*16;
end;
end;
GetMem(Tail, TailSize);
FillChar(Tail^, TailSize, 0);
FSize := Round(FInput.Size*Ratio);
remainder := -1;
if Ratio > 1. then Ratio := 1/Ratio;
Ratio := Ratio*0.4;
SetLength(Kernel, FKernelWidth);
CalculateSincKernel(@Kernel[0], Ratio, FKernelWidth, FFilterWindow);
end;
procedure TACSRateConverter.Flush;
begin
FreeMem(Tail);
FInput.Flush;
if Finput.Channels = 1 then
begin
FreeMem(InBufM);
FreeMem(OutBufM);
end else
begin
FreeMem(InBufS);
FreeMem(OutBufS);
end;
FBusy := False;
end;
function TACSRateConverter.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
var
l : Integer;
InSize : Integer;
P : PACSBuffer8;
begin
if not Busy then raise EACSException.Create(strStreamnotopen);
if BufStart > BufEnd then
begin
if EndOfInput then
begin
Result := 0;
Exit;
end;
BufStart := 1;
if FInput.Channels = 1 then P := Pointer(InBufM)
else P := Pointer(InBufS);
while InputLock do;
InputLock := True;
l := Finput.GetData(@P[0], WantedSize);
InputLock := False;
if l = 0 then
begin
Result := 0;
Exit;
end;
InSize := l;
while (l<>0) and (InSize < WantedSize) do
begin
while InputLock do;
InputLock := True;
l := Finput.GetData(@P[InSize], WantedSize - InSize);
InputLock := False;
Inc(InSize, l);
end;
if l = 0 then
begin
EndOfInput := True;
if InSize < FKernelWidth*2 then
begin // stop buffer corruption?
Result := 0;
Exit;
end;
end;
if Self.Channels = 1 then
begin
BufEnd := ConvertFreqs16Mono(InSize);
end else
begin
BufEnd := ConvertFreqs16Stereo(InSize);
end;
end;
if BufferSize < (BufEnd - BufStart + 1)
then Result := BufferSize
else Result := BufEnd - BufStart + 1;
if FInput.Channels = 1 then P := Pointer(OutBufM)
else P := Pointer(OutBufS);
Move(P[BufStart-1], Buffer^, Result);
Inc(BufStart, Result);
// FPosition := Round(FInput.Position*(FSize/FInput.Size));
Inc(FPosition, Result);
end;
constructor TACSMSConverter.Create;
begin
inherited Create(AOwner);
end;
destructor TACSMSConverter.Destroy;
begin
inherited Destroy;
end;
function TACSMSConverter.GetBPS : Integer;
begin
Result := 16;
end;
function TACSMSConverter.GetCh : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
if FInput.Channels = 1 then Result := 2
else Result := 1;
end;
function TACSMSConverter.GetSR : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result := FInput.SampleRate;
end;
procedure TACSMSConverter.Init;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
FInput.Init;
FBusy := True;
FPosition := 0;
BufStart := 1;
BufEnd := 0;
InputLock := False;
EndOfInput := False;
if FInput.Channels = 2 then WantedSize := BUF_SIZE else
WantedSize := BUF_SIZE shr 1;
if FInput.Channels = 2 then
FSize := FInput.Size shr 1
else FSize := FInput.Size shl 1;
end;
procedure TACSMSConverter.Flush;
begin
FInput.Flush;
FBusy := False;
end;
function TACSMSConverter.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
var
l : Integer;
InSize : Integer;
begin
if not Busy then raise EACSException.Create(strStreamnotopen);
if BufStart > BufEnd then
begin
if EndOfInput then
begin
Result := 0;
Exit;
end;
BufStart := 1;
while InputLock do;
InputLock := True;
l := Finput.GetData(@InOutBuf[1], WantedSize);
InputLock := False;
if l = 0 then
begin
Result := 0;
Exit;
end;
InSize := l;
while (l<>0) and (InSize < WantedSize) do
begin
while InputLock do;
InputLock := True;
l := Finput.GetData(@InOutBuf[InSize+1], WantedSize - InSize);
InputLock := False;
Inc(InSize, l);
end;
if l = 0 then EndOfInput := True;
if FInput.Channels = 2 then
begin
ConvertStereoToMono16(@InOutBuf[1], InSize);
BufEnd := InSize shr 1;
end else
begin
ConvertMonoToStereo16(@InOutBuf[1], InSize, FMode);
BufEnd := InSize shl 1;
end;
end;
if BufferSize < (BufEnd - BufStart + 1)
then Result := BufferSize
else Result := BufEnd - BufStart + 1;
Move(InOutBuf[BufStart], Buffer^, Result);
Inc(BufStart, Result);
// FPosition := Round(FInput.Position*(FSize/FInput.Size));
Inc(FPosition, Result);
end;
constructor TACSSampleConverter.Create;
begin
inherited Create(AOwner);
end;
destructor TACSSampleConverter.Destroy;
begin
inherited Destroy;
end;
function TACSSampleConverter.GetBPS : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
if FInput.BitsPerSample = 16 then Result := 8
else Result := 16;
end;
function TACSSampleConverter.GetCh : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result:= FInput.Channels;
end;
function TACSSampleConverter.GetSR : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result := FInput.SampleRate;
end;
procedure TACSSampleConverter.Init;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
FInput.Init;
FBusy := True;
FPosition := 0;
BufStart := 1;
BufEnd := 0;
InputLock := False;
EndOfInput := False;
if FInput.BitsPerSample = 16 then WantedSize := BUF_SIZE else
WantedSize := BUF_SIZE shr 1;
if FInput.BitsPerSample = 16 then
FSize := FInput.Size shr 1
else FSize := FInput.Size shl 1;
end;
procedure TACSSampleConverter.Flush;
begin
FInput.Flush;
FBusy := False;
end;
function TACSSampleConverter.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
var
l : Integer;
InSize : Integer;
begin
if not Busy then raise EACSException.Create(strStreamnotopen);
if BufStart > BufEnd then
begin
if EndOfInput then
begin
Result := 0;
Exit;
end;
BufStart := 1;
while InputLock do;
InputLock := True;
l := Finput.GetData(@InOutBuf[1], WantedSize);
InputLock := False;
if l = 0 then
begin
Result := 0;
Exit;
end;
InSize := l;
while (l<>0) and (InSize < WantedSize) do
begin
while InputLock do;
InputLock := True;
l := Finput.GetData(@InOutBuf[InSize+1], WantedSize - InSize);
InputLock := False;
Inc(InSize, l);
end;
if l = 0 then EndOfInput := True;
if FInput.BitsPerSample = 16 then
begin
Convert16To8(@InOutBuf[1], InSize);
BufEnd := InSize shr 1;
end else
begin
Convert8To16(@InOutBuf[1], InSize);
BufEnd := InSize shl 1;
end;
end;
if BufferSize < (BufEnd - BufStart + 1)
then Result := BufferSize
else Result := BufEnd - BufStart + 1;
Move(InOutBuf[BufStart], Buffer^, Result);
Inc(BufStart, Result);
FPosition := Round(FInput.Position*(FSize/FInput.Size));
// Inc(FPosition, Result);
end;
procedure TACSRateConverter.SetOutSampleRate(aSR : Integer);
begin
if (aSR > 0) {and (not Busy)} then FOutSampleRate := aSR;
end;
procedure TACSRateConverter.SetKernelWidth;
begin
if (aKW > 1) and (not Busy) then FKernelWidth := aKW;
end;
constructor TACSStereoBalance.Create;
begin
inherited Create(AOwner);
FBalance := 0.5;
end;
destructor TACSStereoBalance.Destroy;
begin
inherited Destroy;
end;
procedure TACSStereoBalance.SetBalance;
begin
if (a >= 0) and (a <=1) then FBalance := a;
end;
function TACSStereoBalance.GetBPS : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result := FInput.BitsPerSample;
end;
function TACSStereoBalance.GetCh : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result := 2;
end;
function TACSStereoBalance.GetSR : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result := FInput.SampleRate;
end;
procedure TACSStereoBalance.Init;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
FInput.Init;
FBusy := True;
if FInput.Channels = 2 then FSize := FInput.Size
else FSize := FInput.Size*2;
FPosition := 0;
InputLock := False;
end;
procedure TACSStereoBalance.Flush;
begin
FInput.Flush;
FBusy := False;
end;
function TACSStereoBalance.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
var
WantedSize, i : Integer;
P16 : PACSBuffer16;
P8 : PACSBuffer8;
Diff : Double;
begin
if not Busy then raise EACSException.Create(strStreamnotopen);
while InputLock do;
InputLock := True;
if FInput.Channels = 2 then WantedSize := BufferSize
else WantedSize := BufferSize shr 1;
Result := Finput.GetData(Buffer, WantedSize);
InputLock := False;
if Result = 0 then Exit;
if FInput.Channels = 1 then
begin
if FInput.BitsPerSample = 8 then
begin
P8 := Buffer;
for i := Result*2-1 downto 1 do P8[i] := P8[i shr 1];
end else
begin
P16 := Buffer;
for i := Result-1 downto 1 do
P16[i] := P16[i shr 1];
end;
Result := Result*2;
end;
if FInput.BitsPerSample = 8 then
begin
P8 := Buffer;
if FBalance > 0.5 then
begin
Diff := 1-Balance;
for i := 0 to (Result shr 1) -1 do
P8[i*2] := Round(P8[i*2]*Diff);
end else
begin
for i := 0 to (Result shr 1) -1 do
P8[i*2+1] := Round(P8[i*2+1]*FBalance);
end;
end else
begin
P16 := Buffer;
if FBalance > 0.5 then
begin
Diff := 1-Balance;
for i := 0 to (Result shr 2) -1 do
P16[i*2] := Round(P16[i*2]*Diff);
end else
begin
for i := 0 to (Result shr 2) -1 do
P16[i*2+1] := Round(P16[i*2+1]*FBalance);
end;
end;
FPosition := Round(FSize/FInput.Size)*FInput.Position;
end;
end.

View File

@@ -0,0 +1,674 @@
(*
this file is a part of audio components suite.
see the license file for more details.
you can contact me at mail@z0m3ie.de
$Log: acs_file.pas,v $
Revision 1.11 2006/08/03 17:31:09 z0m3ie
*** empty log message ***
Revision 1.10 2006/07/09 16:40:34 z0m3ie
*** empty log message ***
Revision 1.9 2006/07/07 15:51:19 z0m3ie
*** empty log message ***
Revision 1.8 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.3 2006/01/01 18:46:40 z0m3ie
*** empty log message ***
Revision 1.2 2005/12/26 17:31:38 z0m3ie
fixed some problems in acs_dsfiles
fixed some problems in acs_vorbis
reworked all buffers
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.10 2005/12/18 17:01:54 z0m3ie
delphi compatibility
Revision 1.9 2005/12/04 16:54:33 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.8 2005/10/05 20:26:36 z0m3ie
Linux changes
Revision 1.7 2005/10/02 16:51:46 z0m3ie
*** empty log message ***
Revision 1.6 2005/09/15 20:59:38 z0m3ie
start translate the documentation in the source for pasdoc
Revision 1.5 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.4 2005/09/13 20:14:25 z0m3ie
driver handling classes (basic audio class)
Revision 1.3 2005/09/13 04:37:30 z0m3ie
*** empty log message ***
Revision 1.2 2005/09/13 04:04:50 z0m3ie
First release without Components for Fileformats
only TFileIn and TFileOut are Visible
*)
{
@abstract(this unit introduces the base classes for acs)
@author(Christian Ulrich (2005))
this unit introduces basic fileformat support
}
unit acs_file;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, ACS_Classes, Dialogs, SysUtils, ACS_Strings;
type
TACSFileInClass = class of TACSCustomFileIn;
TACSFileOutClass = class of TACSCustomFileOut;
TACSFileCapTyp = (fcLoad,fcSave);
TACSFileCapTyps = set of TACSFileCapTyp;
{ TACSFileFormat }
TACSFormatClass = class of TComponent;
TACSFileFormat = class
public
FileClass : TACSFormatClass;
Extension : String;
Description : String;
end;
{ To this List all Filefomats must be added,
use initialization section of your format units to add your format to acs
so the user must only add your unit to the uses clausle to have support for
your fileformat.
}
{ tacsfileformatslist }
tacsfileformatslist = class (tlist)
public
destructor Destroy; override;
procedure Add(const Ext, Desc: String; AClass: TACSFormatClass);
function FindExt(ext : string;Typs : TACSFileCapTyps) : TACSFormatClass;
function FindFromFileName(const fileName : String;Typs : TACSFileCapTyps) : TACSFormatClass;
procedure Remove(AClass: TACSFormatClass);
procedure BuildFilterStrings(var descriptions: String;Typs : TACSFileCapTyps);
end;
{ This class is an wrapper for all fileformats
}
{ TFileIn }
TACSFileIn = CLASS(TACSCustomFileIn)
private
FEndSample: Integer;
FFileName: string;
FInput : TACSCustomFileIn;
FDialog : TOpenDialog;
FLoop: Boolean;
FStartSample: Integer;
FTotalSamples: Integer;
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
function GetTime : Integer;
function GetValid : Boolean;
function GetTotalTime : real; override;
procedure Reset; override;
procedure SetFileName(const AValue : String);
function GetSize : Integer;
function GetPosition : Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy;override;
procedure Open;
procedure Flush; override;
procedure Init; override;
function Seek(SampleNum : Integer) : Boolean; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer;override;
function SetStartTime(Minutes, Seconds : Integer) : Boolean;
function SetEndTime(Minutes, Seconds : Integer) : Boolean;
procedure Jump(Offs : real);
property Time : Integer read GetTime;
property TotalSamples : Integer read FTotalSamples;
property Valid : Boolean read GetValid;
property Size : Integer read GetSize;
property Position : Integer read GetPosition;
published
property EndSample : Integer read FEndSample write FEndSample;
property FileName : string read FFileName write SetFileName;
property Loop : Boolean read FLoop write FLoop;
property StartSample : Integer read FStartSample write FStartSample;
end;
{ This class is an wrapper for all fileformats
}
{ TFileOut }
TACSFileOut = class(TComponent)
private
FBufferSize: Integer;
FFileMode: TACSFileOutputMode;
FFileName: string;
FOnDone: TACSOutputDoneEvent;
FOnProgress: TACSOutputProgressEvent;
FOnThreadException: TACSThreadExceptionEvent;
FOutput : TACSCustomFileOut;
FDialog : TSaveDialog;
FInput : TACSCustomInput;
{$IFDEF LINUX}
FAccessMask : Integer;
{$ENDIF}
function GetDelay: Integer;
function GetPriority: TTPriority;
function GetProgress: real;
function GetStatus: TACSOutputStatus;
function GetTE: Integer;
procedure SetDelay(const AValue: Integer);
procedure SetPriority(const AValue: TTPriority);
procedure ThreadException(Sender : TComponent;E : Exception);
procedure OutputDone(Sender : TComponent);
procedure OutputProgress(Sender : TComponent);
protected
FBaseChannel: Integer;
procedure SetInput(vInput : TACSCustomInput);
procedure Done;
function DoOutput(Abort : Boolean):Boolean;
procedure Prepare;
procedure SetFileMode(aMode : TACSFileOutputMode); virtual;
procedure SetFileName(const AValue: string);
public
destructor Destroy;override;
procedure Open;
property Buffersize : Integer read FBufferSize write FBufferSize;
procedure Pause;virtual;
procedure Resume;virtual;
procedure Run;
procedure Stop;
property Delay : Integer read GetDelay write SetDelay;
property ThreadPriority : TTPriority read GetPriority write SetPriority;
property Progress : real read GetProgress;
property Status : TACSOutputStatus read GetStatus;
property TimeElapsed : Integer read GetTE;
{$IFDEF LINUX}
property AccessMask : Integer read FAccessMask write FAccessMask;
{$ENDIF}
published
property FileMode : TACSFileOutputMode read FFileMode write SetFileMode;
property FileName : string read FFileName write SetFileName;
property Input : TACSCustomInput read FInput write SetInput;
property OnDone : TACSOutputDoneEvent read FOnDone write FOndone;
property OnProgress : TACSOutputProgressEvent read FOnProgress write FOnProgress;
property OnThreadException : TACSThreadExceptionEvent read FOnThreadException write FOnThreadException;
end;
var
FileFormats : TACSFileFormatsList;
implementation
{ TFileIn }
function TACSFileIn.GetBPS: Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
Result := FInput.BitsPerSample;
end;
function TACSFileIn.GetCh: Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
Result := FInput.Channels;
end;
function TACSFileIn.GetSR: Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
Result := FInput.SampleRate;
end;
function TACSFileIn.GetTime: Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
Result := FInput.Time;
end;
function TACSFileIn.GetValid: Boolean;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
Result := FInput.Valid;
end;
function TACSFileIn.GetTotalTime: real;
begin
if not Assigned(FInput) then
exit;
Result := FInput.TotalTime;
end;
procedure TACSFileIn.Reset;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
FInput.Reset;
end;
procedure TACSFileIn.SetFileName(const AValue: string);
begin
FFileName := AValue;
if Assigned(FInput) then
FInput.Free;
FInput := nil;
if AValue = '' then
exit;
FInput := TACSFileInClass(FileFormats.FindFromFileName(AValue,[fcLoad])).Create(nil);
if Assigned(FInput) then
FInput.FileName := FFilename;
end;
function TACSFileIn.GetSize: Integer;
begin
Result := 1;
if Assigned(FInput) then
Result := FInput.Size;
end;
function TACSFileIn.GetPosition: Integer;
begin
Result := 0;
if Assigned(FInput) then
Result := FInput.Position;
end;
constructor TACSFileIn.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
destructor TACSFileIn.Destroy;
begin
if Assigned(FInput) then
FInput.Free;
inherited Destroy;
end;
procedure TACSFileIn.Open;
var
desc : string;
begin
FDialog := TOpenDialog.Create(nil);
FileFormats.BuildFilterStrings(desc,[fcLoad]);
FDialog.Filter := desc;
if FDialog.Execute then
begin
if Assigned(FInput) then
FInput.Free;
FInput := TACSFileInClass(FileFormats.FindFromFileName(FDialog.FileName,[fcLoad])).Create(nil);
FFileName := FDialog.FileName;
if Assigned(FInput) then
FInput.FileName := FFilename;
end;
FDialog.Free;
end;
procedure TACSFileIn.Flush;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
FInput.Flush;
end;
procedure TACSFileIn.Init;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
FInput.Init;
end;
function TACSFileIn.Seek(SampleNum : Integer): Boolean;
begin
if not Assigned(Finput) then
EACSException.Create(strnoFileOpened);
FInput.Seek(SampleNum);
end;
function TACSFileIn.GetData(Buffer: Pointer; BufferSize: Integer): Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
Result:=FInput.GetData(Buffer, BufferSize);
end;
function TACSFileIn.SetStartTime(Minutes, Seconds: Integer): Boolean;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
Result := FInput.SetStartTime(Minutes,Seconds);
end;
function TACSFileIn.SetEndTime(Minutes, Seconds: Integer): Boolean;
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
Result := FInput.SetEndTime(Minutes,Seconds);
end;
procedure TACSFileIn.Jump(Offs: real);
begin
if not Assigned(FInput) then
raise EACSException.Create(strNoFileOpened);
FInput.Jump(Offs);
end;
{ TACSFileOut }
procedure TACSFileOut.SetFileName(const AValue: string);
begin
if FFileName=AValue then exit;
if Assigned(FOutput) then
FOutput.Free;
FOutput := nil;
FOutput := TACSFileOutClass(FileFormats.FindFromFileName(AValue,[fcSave])).Create(nil);
if Assigned(FOutput) then
begin
FOutput.FileName:=AValue;
foutput.FileMode := FFileMode; //GAK:20060731
FOutput.Input := FInput;
FOutput.OnDone := OutputDone;
FOutput.OnProgress := OutputProgress;
Foutput.OnThreadException := ThreadException;
ffilename := avalue;//GAK:20060731
end;
end;
procedure TACSFileOut.Done;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
FOutput.Done;
end;
function TACSFileOut.DoOutput(Abort: Boolean): Boolean;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
Result := FOutput.DoOutput(Abort);
end;
procedure TACSFileOut.Prepare;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
FOutput.Prepare;
end;
function TACSFileOut.GetDelay: Integer;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
result := FOutput.Delay;
end;
function TACSFileOut.GetPriority: TTPriority;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
Result := FOutput.ThreadPriority;
end;
function TACSFileOut.GetProgress: real;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
Result := FOutput.Progress;
end;
function TACSFileOut.GetStatus: TACSOutputStatus;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
Result := FOutput.Status;
end;
function TACSFileOut.GetTE: Integer;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
Result := FOutput.TimeElapsed;
end;
procedure TACSFileOut.SetDelay(const AValue: Integer);
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
FOutput.Delay := AValue;
end;
procedure TACSFileOut.SetPriority(const AValue: TTPriority);
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
FOutput.ThreadPriority := AValue;
end;
procedure TACSFileOut.ThreadException(Sender : TComponent;E: Exception);
begin
if Assigned(OnThreadException) then
OnThreadException(Sender,E);
end;
procedure TACSFileOut.OutputDone(Sender: TComponent);
begin
if Assigned(OnDone) then
OnDone(Sender);
end;
procedure TACSFileOut.OutputProgress(Sender: TComponent);
begin
if Assigned(OnProgress) then
OnProgress(Sender);
end;
procedure TACSFileOut.SetInput(vInput: TACSCustomInput);
begin
FInput := vInput;
if Assigned(FOutput) then
FOutput.Input := FInput;
end;
procedure TACSFileOut.SetFileMode(aMode: TACSFileOutputMode);
begin
//GAK:20060731 changed whole of this method, as it was stopping component loading/creating
if amode <> ffilemode then
begin
FFileMode := amode;
if Assigned(FOutput) then FOutput.FileMode := aMode;
end;
end;
procedure TACSFileOut.Open;
var
desc : string;
begin
FDialog := TSaveDialog.Create(nil);
FileFormats.BuildFilterStrings(desc,[fcSave]);
FDialog.Filter := desc;
if FDialog.Execute then
begin
FOutput := TACSFileOutClass(FileFormats.FindFromFileName(FDialog.FileName,[fcSave])).Create(nil);
FileName := FDialog.FileName;
foutput.FileMode := ffilemode;
FOutput.Input := FInput;
FInput := FInput;
FOutput.OnDone := OutputDone;
FOutput.OnProgress := OutputProgress;
Foutput.OnThreadException := ThreadException;
end;
FDialog.Free;
end;
procedure TACSFileOut.Pause;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
FOutput.Pause;
end;
procedure TACSFileOut.Resume;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
FOutput.Resume;
end;
procedure TACSFileOut.Run;
begin
if not Assigned(FOutput) then
raise EACSException.Create(strNoFileOpened);
FOutput.Run;
end;
procedure TACSFileOut.Stop;
begin
if Assigned(FOutput) then
FOutput.Stop;
end;
destructor TACSFileOut.Destroy;
begin
if Assigned(FOutput) then
FOutput.Free;
inherited Destroy;
end;
{ TACSFileFormatsList }
destructor tacsfileformatslist.Destroy;
var
i: integer;
begin
for i:= 0 to Count-1 do
TACSFileFormat(Items[i]).Free;
inherited Destroy;
end;
procedure TACSFileFormatsList.Add(const Ext, Desc: String;AClass: TACSFormatClass);
var
newRec : TACSFileFormat;
begin
newRec:=TACSFileFormat.Create;
with newRec do
begin
Extension:=LowerCase(Ext);
FileClass:=AClass;
Description:=Desc;
end;
inherited Add(newRec);
end;
function TACSFileFormatsList.FindExt(ext: string;Typs : TACSFileCapTyps): TACSFormatClass;
var
i : Integer;
begin
ext:=LowerCase(ext);
for i:=Count-1 downto 0 do
with TACSFileFormat(Items[I]) do
begin
if ((fcLoad in Typs) and (TACSFileFormat(Items[I]).FileClass.InheritsFrom(TACSCustomFileIn))) or ((fcSave in Typs) and (TACSFileFormat(Items[I]).FileClass.InheritsFrom(TACSCustomFileOut))) then
if Extension=ext then
begin
Result:=TACSFileFormat(Items[I]).FileClass;
Exit;
end;
end;
Result:=nil;
end;
function TACSFileFormatsList.FindFromFileName(const fileName: String;Typs : TACSFileCapTyps): TACSFormatClass;
var
ext : String;
begin
ext:=ExtractFileExt(Filename);
System.Delete(ext, 1, 1);
Result:=FindExt(ext,Typs);
if not Assigned(Result) then
raise EACSException.CreateFmt(strUnknownExtension, [ext]);
end;
procedure TACSFileFormatsList.Remove(AClass: TACSFormatClass);
var
i : Integer;
begin
for i:=Count-1 downto 0 do begin
if TACSFileFormat(Items[i]).FileClass.InheritsFrom(AClass) then
begin
TACSFileFormat(Items[i]).Free;
Delete(i);
end;
end;
end;
procedure TACSFileFormatsList.BuildFilterStrings(var descriptions : String;Typs : TACSFileCapTyps);
var
k, i : Integer;
p : TACSFileFormat;
filters : string;
begin
descriptions:='';
filters := '';
k:=0;
for i:=0 to Count-1 do
begin
p:=TACSFileFormat(Items[i]);
if ((fcLoad in Typs) and (p.FileClass.InheritsFrom(TACSCustomFileIn))) or ((fcSave in Typs) and (p.FileClass.InheritsFrom(TACSCustomFileOut))) then
with p do
begin
if k<>0 then
begin
descriptions:=descriptions+'|';
filters := filters+';';
end;
descriptions:=descriptions+Description+' (*.'+Extension+')|'+'*.'+Extension;
filters := filters+'*.'+Extension;
Inc(k);
end;
end;
descriptions := strAllFormats+'|'+filters+'|'+descriptions;
end;
initialization
FileFormats := TACSFileFormatsList.Create;
finalization
FileFormats.Free;
end.

View File

@@ -0,0 +1,772 @@
(*
this file is a part of audio components suite v 2.3.
copyright (c) 2002-2005 andrei borovsky. all rights reserved.
see the license file for more details.
you can contact me at mail@z0m3ie.de
*)
{
$Log: acs_filters.pas,v $
Revision 1.4 2006/08/31 20:10:54 z0m3ie
*** empty log message ***
Revision 1.3 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.3 2005/12/04 16:54:33 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.2 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.2 2005/08/22 20:17:01 z0m3ie
changed Headers to log
changed mail adress
}
unit acs_filters;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, SysUtils, ACS_Types, ACS_Procs, ACS_Classes, ACS_Strings, Math;
const
BUF_SIZE = $4000;
type
TACSFilterType = (ftBandPass, ftBandReject, ftHighPass, ftLowPass, ftAllPass);
TACSBWFilter = class(TACSCustomConverter)
private
a3 : array[0..2] of Double;
b2 : array[0..1] of Double;
x0, x1, y0, y1 : array[0..1] of Double;
FLowFreq, FHighFreq : Integer;
FAmplification : Word;
FFilterType : TACSFilterType;
InBuf : array[1..BUF_SIZE] of Byte;
procedure SetHighFreq(aFreq : Integer);
procedure SetLowFreq(aFreq : Integer);
procedure SetAmplification(Ampl : Word);
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
published
property Amplification : Word read FAmplification write SetAmplification;
property FilterType : TACSFilterType read FFilterType write FFilterType;
property HighFreq : Integer read FHighFreq write SetHighFreq;
property LowFreq : Integer read FLowFreq write SetLowFreq;
end;
TACSSincFilter = class(TACSCustomConverter)
private
Lock : Boolean;
Kernel : array of Double;
DA : PACSDoubleArray;
DAS : PACSStereoBufferD;
inBuf : array[1..BUF_SIZE] of Byte;
FFilterType : TACSFilterType;
FKernelWidth : Integer;
FLowFreq, FHighFreq : Integer;
FWindowType : TACSFilterWindowType;
procedure SetFilterType(aFT : TACSFilterType);
procedure SetKernelWidth(aKW : Integer);
procedure SetWindowType(aWT : TACSFilterWindowType);
procedure SetHighFreq(aFreq : Integer);
procedure SetLowFreq(aFreq : Integer);
procedure CalculateFilter;
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
procedure GetKernel(var K : PACSDoubleArray);
published
property FilterType : TACSFilterType read FFilterType write SetFilterType;
property HighFreq : Integer read FHighFreq write SetHighFreq;
property KernelWidth : Integer read FKernelWidth write SetKernelWidth;
property LowFreq : Integer read FLowFreq write SetLowFreq;
property WindowType : TACSFilterWindowType read FWindowType write SetWindowType;
end;
TACSConvolver = class(TACSCustomConverter)
private
Lock : Boolean;
Kernel : array of Double;
DA : PACSDoubleArray;
DAS : PACSStereoBufferD;
inBuf : array[1..BUF_SIZE] of Byte;
FKernelWidth : Integer;
FAllPass : Boolean;
procedure SetKernelWidth(a : Integer);
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
procedure SetKernel(K : PACSDoubleArray; Inverted : Boolean);
property KrenelWidth : Integer read FKernelWidth write SetKernelWidth;
published
property AllPass : Boolean read FAllPass write FAllPass;
end;
implementation
constructor TACSBWFilter.Create;
begin
inherited Create(AOwner);
FFilterType := ftBandPass;
FAmplification := 1;
end;
destructor TACSBWFilter.Destroy;
begin
inherited Destroy;
end;
function TACSBWFilter.GetBPS : Integer;
begin
Result := 16;
end;
function TACSBWFilter.GetCh : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result := FInput.Channels;
end;
function TACSBWFilter.GetSR : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result := FInput.SampleRate;
end;
procedure TACSBWFilter.SetHighFreq;
begin
if FFilterType = ftLowPass then
FHighFreq := 0
else FHighFreq := aFreq;
end;
procedure TACSBWFilter.SetLowFreq;
begin
if FFilterType = ftHighPass then
FLowFreq := 0
else FLowFreq := aFreq;
end;
procedure TACSBWFilter.SetAmplification;
begin
if Ampl > 0 then FAmplification := Ampl;
end;
procedure TACSBWFilter.Init;
var
C, D : Double;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
FInput.Init;
if ((FHighFreq - FlowFreq) < 0) or (((FHighFreq - FlowFreq) * 2) >= FInput.SampleRate) then
begin
FInput.Flush;
raise EACSException.Create(strIllegalFrequency);
end;
FBusy := True;
FPosition := 0;
BufStart := 1;
BufEnd := 0;
FSize := FInput.Size;
x0[0] := 0.0;
x0[1] := 0.0;
x1[0] := 0.0;
x1[1] := 0.0;
y0[0] := 0.0;
y0[1] := 0.0;
y1[0] := 0.0;
y1[1] := 0.0;
case FFilterType of
ftBandPass :
begin
C := 1 / Tan(Pi * (FHighFreq-FLowFreq+1) / FInput.SampleRate);
D := 2 * Cos(2 * Pi * ((FHighFreq+FLowFreq) shr 1) / FInput.SampleRate);
a3[0] := 1 / (1 + C);
a3[1] := 0.0;
a3[2] := -a3[0];
b2[0] := -C * D * a3[0];
b2[1] := (C - 1) * a3[0];
end;
ftBandReject: // This doesn't seem to work well
begin
C := Tan(Pi * (FHighFreq-FLowFreq+1) / FInput.SampleRate);
D := 2 * Cos(2 * Pi * ((FHighFreq+FLowFreq) shr 1) / FInput.SampleRate);
a3[0] := 1 / (1 + C);
a3[1] := -D * a3[0];
a3[2] := a3[0];
b2[0] := a3[1];
b2[1] := (1 - C) * a3[0];
end;
ftLowPass:
begin
C := 1 / Tan(Pi * FLowFreq / FInput.SampleRate);
a3[0] := 1 / (1 + Sqrt(2) * C + C * C);
a3[1] := 2 * a3[0];
a3[2] := a3[0];
b2[0] := 2 * (1 - C * C) * a3[0];
b2[1] := (1 - Sqrt(2) * C + C * C) * a3[0];
end;
ftHighPass:
begin
C := Tan(Pi * FHighFreq / FInput.SampleRate);
a3[0] := 1 / (1 + Sqrt(2) * C + C * C);
a3[1] := -2 * a3[0];
a3[2] := a3[0];
b2[0] := 2 * (C * C - 1) * a3[0];
b2[1] := (1 - Sqrt(2) * C + C * C) * a3[0];
end;
end;
end;
procedure TACSBWFilter.Flush;
begin
FInput.Flush;
FBusy := False;
end;
function TACSBWFilter.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
var
i : Integer;
InBufMono : PACSBuffer16;
InBufStereo : PACSStereoBuffer16;
arg, res : Double;
begin
if not Busy then raise EACSException.Create(strStreamnotopen);
if BufStart > BufEnd then
begin
BufStart := 1;
BufEnd := FInput.GetData(@InBuf[1], BUF_SIZE);
if BufEnd = 0 then
begin
Result := 0;
Exit;
end;
if Self.Channels = 1 then
begin
InBufMono := @InBuf[1];
for i := 0 to (BufEnd shr 1) - 1 do
begin
arg := InBufMono[i];
res := a3[0] * arg + a3[1] * x0[0] + a3[2] * x1[0] -
b2[0] * y0[0] - b2[1] * y1[0];
InBufMono[i] := Round(res);
x1[0] := x0[0];
x0[0] := arg;
y1[0] := y0[0];
y0[0] := res;
InBufMono[i] := FAmplification * InBufMono[i];
end;
end else
begin
InBufStereo := @InBuf[1];
for i := 0 to (BufEnd shr 2) - 1 do
begin
arg := InBufStereo[i].Left;
res := a3[0] * arg + a3[1] * x0[0] + a3[2] * x1[0] -
b2[0] * y0[0] - b2[1] * y1[0];
InBufStereo[i].Left := Round(res);
x1[0] := x0[0];
x0[0] := arg;
y1[0] := y0[0];
y0[0] := res;
arg := InBufStereo[i].Right;
res := a3[0] * arg + a3[1] * x0[1] + a3[2] * x1[1] -
b2[0] * y0[1] - b2[1] * y1[1];
InBufStereo[i].Right := Round(res);
x1[1] := x0[1];
x0[1] := arg;
y1[1] := y0[1];
y0[1] := res;
InBufStereo[i].Right := FAmplification * InBufStereo[i].Right;
InBufStereo[i].Left := FAmplification * InBufStereo[i].Left;
end;
end;
end;
if BufferSize < (BufEnd - BufStart + 1)
then Result := BufferSize
else Result := BufEnd - BufStart + 1;
Move(InBuf[BufStart], Buffer^, Result);
Inc(BufStart, Result);
FPosition := Round(FInput.Position*(FSize/FInput.Size));
// Inc(FPosition, Result);
end;
constructor TACSSincFilter.Create;
begin
inherited Create(AOwner);
FKernelWidth := 31;
FWindowType := fwBlackman;
FLowFreq := 8000;
FHighFreq := 16000;
DA := nil;
DAS := nil;
end;
destructor TACSSincFilter.Destroy;
begin
Kernel := nil;
if DA <> nil then FreeMem(DA);
if DAS <> nil then FreeMem(DAS);
Inherited Destroy;
end;
procedure TACSSincFilter.CalculateFilter;
var
Kernel1, Kernel2 : array of Double;
CutOff : Double;
i, j : Integer;
Sum : Double;
begin
if csDesigning in ComponentState then Exit;
if not Assigned(FInput) then Exit;
if (FLowFreq > FInput.SampleRate/2) or (FHighFreq > FInput.SampleRate/2) then
raise EACSException.Create(strCutofftolow);
while Lock do;
Lock := True;
case FilterType of
ftLowPass:
begin
SetLength(Kernel, FKernelWidth);
CutOff := FLowFreq/FInput.SampleRate;
CalculateSincKernel(@Kernel[0], CutOff, FKernelWidth, FWindowType);
end;
ftHighPass:
begin
if not Odd(FKernelWidth) then Inc(FKernelWidth);
SetLength(Kernel, FKernelWidth);
CutOff := FHighFreq/FInput.SampleRate;
CalculateSincKernel(@Kernel[0], CutOff, FKernelWidth, FWindowType);
for i := 0 to FKernelWidth - 1 do
Kernel[i] := -Kernel[i];
Kernel[(FKernelWidth shr 1)] := Kernel[(FKernelWidth shr 1)] + 1;
end;
ftBandPass:
begin
if not Odd(FKernelWidth) then Inc(FKernelWidth);
SetLength(Kernel1, FKernelWidth);
CutOff := FLowFreq/FInput.SampleRate;
CalculateSincKernel(@Kernel1[0], CutOff, FKernelWidth, FWindowType);
for i := 0 to FKernelWidth - 1 do
Kernel1[i] := -Kernel1[i];
Kernel1[(FKernelWidth shr 1)] := Kernel1[(FKernelWidth shr 1)] + 1;
SetLength(Kernel2, FKernelWidth);
CutOff := FHighFreq/FInput.SampleRate;
CalculateSincKernel(@Kernel2[0], CutOff, FKernelWidth, FWindowType);
SetLength(Kernel, 2*FKernelWidth);
FillChar(Kernel[0], Length(Kernel)*SizeOf(Double), 0);
for i := 0 to KernelWidth - 1 do
for j := 0 to KernelWidth - 1 do
Kernel[i+j] := Kernel[i+j] + Kernel1[i]*Kernel2[j];
SetLength(Kernel, FKernelWidth);
Kernel1 := nil;
Kernel2 := nil;
end;
ftBandReject:
begin
if not Odd(FKernelWidth) then Inc(FKernelWidth);
SetLength(Kernel1, FKernelWidth);
CutOff := FHighFreq/FInput.SampleRate;
CalculateSincKernel(@Kernel1[0], CutOff, FKernelWidth, FWindowType);
for i := 0 to FKernelWidth - 1 do
Kernel1[i] := -Kernel1[i];
Kernel1[(FKernelWidth shr 1)] := Kernel1[(FKernelWidth shr 1)] + 1;
SetLength(Kernel2, FKernelWidth);
CutOff := FLowFreq/FInput.SampleRate;
CalculateSincKernel(@Kernel2[0], CutOff, FKernelWidth, FWindowType);
SetLength(Kernel, FKernelWidth);
for i := 0 to FKernelWidth - 1 do
Kernel[i] := Kernel1[i] + Kernel2[i];
Kernel1 := nil;
Kernel2 := nil;
end;
ftAllPass :
begin
SetLength(Kernel, FKernelWidth);
FillChar(Kernel[0], Length(Kernel)*SizeOf(Double), 0);
Kernel[FKernelWidth shr 1] := 1;
end;
end;
Lock := False;
end;
procedure TACSSincFilter.SetFilterType;
begin
FFilterType := aFT;
if Busy then CalculateFilter;
end;
procedure TACSSincFilter.SetKernelWidth;
begin
if aKW > 2 then
if not Busy then FKernelWidth := aKW;
end;
procedure TACSSincFilter.SetWindowType;
begin
FWindowType := aWT;
if Busy then CalculateFilter;
end;
procedure TACSSincFilter.SetHighFreq;
begin
if aFreq > 0 then
FHighFreq := aFreq;
if csDesigning in ComponentState then Exit;
if Assigned(Finput) then
if FHighFreq > Finput.SampleRate div 2 then
FHighFreq := Finput.SampleRate div 2;
if FHighFreq < FLowFreq then
FLowFreq := FHighFreq;
if Busy then CalculateFilter;
end;
procedure TACSSincFilter.SetLowFreq;
begin
if aFreq > 0 then
FLowFreq := aFreq;
if csDesigning in ComponentState then Exit;
if Assigned(Finput) then
if FlowFreq > Finput.SampleRate div 2 then
FLowFreq := Finput.SampleRate div 2;
if FHighFreq < FLowFreq then
FHighFreq := FLowFreq;
if Busy then CalculateFilter;
end;
function TACSSincFilter.GetBPS : Integer;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.BitsPerSample;
end;
function TACSSincFilter.GetCh : Integer;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.Channels;
end;
function TACSSincFilter.GetSR : Integer;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.SampleRate;
end;
procedure TACSSincFilter.Init;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Lock := False;
InputLock := False;
FBusy := True;
FInput.Init;
FPosition := 0;
CalculateFilter;
if FInput.Channels = 1 then
begin
GetMem(DA, ((BUF_SIZE div 2)+FKernelWidth-1)*SizeOf(Double));
FillChar(DA[0], ((BUF_SIZE div 2)+FKernelWidth-1)*SizeOf(Double), 0);
end else
begin
GetMem(DAS, ((BUF_SIZE div 2)+(FKernelWidth-1)*2)*SizeOf(Double));
FillChar(DAS[0], ((BUF_SIZE div 2)+(FKernelWidth-1)*2)*SizeOf(Double), 0);
end;
BufStart := 1;
BufEnd := 0;
FSize := FInput.Size;
end;
procedure TACSSincFilter.Flush;
begin
FInput.Flush;
if DA <> nil then FreeMem(DA);
if DAS <> nil then FreeMem(DAS);
DA := nil;
DAS := nil;
FBusy := False;
end;
function TACSSincFilter.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
var
i, j, NumSamples : Integer;
InBufMono : PACSBuffer16;
InBufStereo : PACSStereoBuffer16;
begin
if not Busy then raise EACSException.Create(strStreamnotopen);
if BufStart > BufEnd then
begin
while Lock do;
Lock := True;
BufStart := 1;
while InputLock do;
InputLock := True;
BufEnd := FInput.GetData(@InBuf[1], BUF_SIZE);
InputLock := False;
if BufEnd = 0 then
begin
Result := 0;
Exit;
end;
if FInput.Channels = 1 then
begin
InBufMono := @InBuf[1];
NumSamples := BufEnd div 2;
for i := 0 to NumSamples-1 do
for j := 0 to FKernelWidth-1 do
DA[i+j] := DA[i+j] + InbufMono[i]*Kernel[j];
for i := 0 to NumSamples-1 do
InBufMono[i] := Round(DA[i]);
BufEnd := NumSamples*2;
FillChar(DA[0], NumSamples*SizeOf(Double), 0);
Move(DA[NumSamples], DA[0], (FKernelWidth-1)*SizeOf(Double));
end else
begin
InBufStereo := @InBuf[1];
NumSamples := BufEnd div 4;
for i := 0 to NumSamples-1 do
for j := 0 to FKernelWidth-1 do
begin
DAS[i+j].Left := DAS[i+j].Left + InbufStereo[i].Left*Kernel[j];
DAS[i+j].Right := DAS[i+j].Right + InbufStereo[i].Right*Kernel[j];
end;
for i := 0 to NumSamples-1 do
begin
InBufStereo[i].Left := Round(DAS[i].Left);
InBufStereo[i].Right := Round(DAS[i].Right);
end;
BufEnd := NumSamples*4;
FillChar(DAS[0], NumSamples*2*SizeOf(Double), 0);
for i := 0 to FKernelWidth-2 do
begin
DAS[i] := DAS[NumSamples+i];
DAS[NumSamples+i].Left := 0;
DAS[NumSamples+i].Right := 0;
end;
//Move(DAS[NumSamples], DAS[0], (FKernelWidth-1)*2*SizeOf(Double));
end;
Lock := False;
end;
if BufferSize < (BufEnd - BufStart + 1)
then Result := BufferSize
else Result := BufEnd - BufStart + 1;
Move(InBuf[BufStart], Buffer^, Result);
Inc(BufStart, Result);
FPosition := Round(FInput.Position*(FSize/FInput.Size));
end;
procedure TACSSincFilter.GetKernel;
begin
K := @Kernel[0];
end;
constructor TACSConvolver.Create;
begin
inherited Create(AOwner);
FKernelWidth := 31;
if csDesigning in ComponentState then Exit;
SetLength(Kernel, FKernelWidth);
FillChar(Kernel[1], Length(Kernel)*SizeOf(Double), 0);
DA := nil;
DAS := nil;
end;
destructor TACSConvolver.Destroy;
begin
Kernel := nil;
if DA <> nil then FreeMem(DA);
if DAS <> nil then FreeMem(DAS);
Inherited Destroy;
end;
procedure TACSConvolver.SetKernelWidth;
begin
if a > 2 then
if not Busy then FKernelWidth := a;
end;
function TACSConvolver.GetBPS : Integer;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.BitsPerSample;
end;
function TACSConvolver.GetCh : Integer;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.Channels;
end;
function TACSConvolver.GetSR : Integer;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.SampleRate;
end;
procedure TACSConvolver.Init;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Lock := False;
InputLock := False;
FBusy := True;
FInput.Init;
FPosition := 0;
if FInput.Channels = 1 then
begin
GetMem(DA, ((BUF_SIZE div 2)+FKernelWidth-1)*SizeOf(Double));
FillChar(DA[0], ((BUF_SIZE div 2)+FKernelWidth-1)*SizeOf(Double), 0);
end else
begin
GetMem(DAS, ((BUF_SIZE div 2)+(FKernelWidth-1)*2)*SizeOf(Double));
FillChar(DAS[0], ((BUF_SIZE div 2)+(FKernelWidth-1)*2)*SizeOf(Double), 0);
end;
BufStart := 1;
BufEnd := 0;
FSize := FInput.Size;
end;
procedure TACSConvolver.Flush;
begin
FInput.Flush;
if DA <> nil then FreeMem(DA);
if DAS <> nil then FreeMem(DAS);
DA := nil;
DAS := nil;
FBusy := False;
end;
function TACSConvolver.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
var
i, j, NumSamples : Integer;
InBufMono : PACSBuffer16;
InBufStereo : PACSStereoBuffer16;
begin
if not Busy then raise EACSException.Create(strStreamNotopen);
if BufStart > BufEnd then
begin
while Lock do;
Lock := True;
BufStart := 1;
while InputLock do;
InputLock := True;
BufEnd := FInput.GetData(@InBuf[1], BUF_SIZE);
InputLock := False;
if BufEnd = 0 then
begin
Result := 0;
Exit;
end;
if not FAllPass then
begin
if FInput.Channels = 1 then
begin
InBufMono := @InBuf[1];
NumSamples := BufEnd div 2;
for i := 0 to NumSamples-1 do
for j := 0 to FKernelWidth-1 do
DA[i+j] := DA[i+j] + InbufMono[i]*Kernel[j];
for i := 0 to NumSamples-1 do
InBufMono[i] := Round(DA[i]);
BufEnd := NumSamples*2;
FillChar(DA[0], NumSamples*SizeOf(Double), 0);
Move(DA[NumSamples], DA[0], (FKernelWidth-1)*SizeOf(Double));
end else
begin
InBufStereo := @InBuf[1];
NumSamples := BufEnd div 4;
for i := 0 to NumSamples-1 do
for j := 0 to FKernelWidth-1 do
begin
DAS[i+j].Left := DAS[i+j].Left + InbufStereo[i].Left*Kernel[j];
DAS[i+j].Right := DAS[i+j].Right + InbufStereo[i].Right*Kernel[j];
end;
for i := 0 to NumSamples-1 do
begin
InBufStereo[i].Left := Round(DAS[i].Left);
InBufStereo[i].Right := Round(DAS[i].Right);
end;
BufEnd := NumSamples*4;
FillChar(DAS[0], NumSamples*2*SizeOf(Double), 0);
for i := 0 to FKernelWidth-2 do
begin
DAS[i] := DAS[NumSamples+i];
DAS[NumSamples+i].Left := 0;
DAS[NumSamples+i].Right := 0;
end;
//Move(DAS[NumSamples], DAS[0], (FKernelWidth-1)*2*SizeOf(Double));
end;
end;
Lock := False;
end;
if BufferSize < (BufEnd - BufStart + 1)
then Result := BufferSize
else Result := BufEnd - BufStart + 1;
Move(InBuf[BufStart], Buffer^, Result);
Inc(BufStart, Result);
FPosition := Round(FInput.Position*(FSize/FInput.Size));
end;
procedure TACSConvolver.SetKernel;
var
i : Integer;
begin
while Lock do;
Lock := True;
if not Inverted then
for i := 0 to FKernelWidth - 1 do
Kernel[i] := K[i]
else
for i := 0 to FKernelWidth - 1 do
Kernel[i] := K[FKernelWidth - 1-i];
Lock := False;
end;
end.

View File

@@ -0,0 +1,207 @@
(*
this file is a part of audio components suite v 2.3.
copyright (c) 2002-2005 andrei borovsky. all rights reserved.
see the license file for more details.
you can contact me at mail@z0m3ie.de
*)
{
$Log: acs_indicator.pas,v $
Revision 1.2 2006/08/31 20:10:54 z0m3ie
*** empty log message ***
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.4 2005/12/04 16:54:33 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.3 2005/10/02 16:51:46 z0m3ie
*** empty log message ***
Revision 1.2 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.2 2005/08/22 20:17:01 z0m3ie
changed Headers to log
changed mail adress
}
unit acs_indicator;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, ACS_Types, ACS_Classes, ACS_Procs, ACS_Strings;
type
TACSSoundIndicator = class(TACSCustomConverter)
private
Lock : Boolean;
Window : array[0..1023] of Double;
FValues : array[0..31] of Double;
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure GetValues(var Values : array of Double);
procedure Init; override;
procedure Flush; override;
end;
implementation
constructor TACSSoundIndicator.Create;
begin
inherited Create(AOwner);
HannWindow(@Window, 1024, True);
end;
destructor TACSSoundIndicator.Destroy;
begin
inherited Destroy;
end;
function TACSSoundIndicator.GetBPS : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.BitsPerSample;
end;
function TACSSoundIndicator.GetCh : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.Channels;
end;
function TACSSoundIndicator.GetSR : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.SampleRate;
end;
procedure TACSSoundIndicator.Init;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotassigned);
FBusy := True;
FInput.Init;
FSize := FInput.Size;
FillChar(FValues[0], SizeOf(Double)*32, 0);
Lock := False;
FPosition := 0;
end;
procedure TACSSoundIndicator.Flush;
begin
FInput.Flush;
FBusy := False;
Lock := False;
end;
function TACSSoundIndicator.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
var
i, j, k, NumSamples : Integer;
P : Pointer;
P8 : PACSBuffer8;
P16 : PACSBuffer16;
PS8 : PACSStereoBuffer8;
PS16 : PACSStereoBuffer16;
DA : array[0..63] of Double;
C1 : array[0..63] of TACSComplex;
begin
if not Busy then raise EACSException.Create(strStreamnotopen);
while InputLock do;
InputLock := True;
Result := FInput.GetData(Buffer, BufferSize);
InputLock := False;
FPosition := Finput.Position;
if Result = 0 then Exit;
if Lock then Exit;
Lock := True;
k := Result;
GetMem(P, k);
Move(Buffer^, P^, k);
if FInput.BitsPerSample = 8 then
begin
if FInput.Channels = 1 then NumSamples := k
else NumSamples := k shr 1;
end else
begin
if FInput.Channels = 1 then NumSamples := k shr 1
else NumSamples := k shr 2;
end;
for i := 0 to (NumSamples div 64) - 1 do
begin
if FInput.BitsPerSample = 8 then
begin
if FInput.Channels = 1 then
begin
P8 := P;
for j := 0 to 63 do DA[j] := P8[i*64+j];
end else
begin
PS8 := P;
for j := 0 to 63 do DA[j] := (PS8[i*64+j].Left+PS8[i*64+j].Right)/2;
end
end else
begin
if FInput.Channels = 1 then
begin
P16 := P;
for j := 0 to 63 do DA[j] := P16[i*64+j];
end else
begin
PS16 := P;
for j := 0 to 63 do DA[j] := (PS16[i*64+j].Left+PS16[i*64+j].Right)/2;
end
end;
MultDoubleArrays(@Window[0], @DA[0], 64);
for j := 0 to 63 do
begin
C1[j].Re := DA[j];
C1[j].Im := 0;
end;
ComplexFFT(@C1, 64, 1);
LgMagnitude(@C1[0], @DA[0], 64, 0);
try
for j := 0 to 31 do FValues[j]:=FValues[j]+DA[j];
except
for j := 0 to 31 do FValues[j] := 0;
end;
end;
for j := 0 to 31 do FValues[j]:=FValues[j]/(NumSamples div 64);
FreeMem(P);
Lock := False;
end;
procedure TACSSoundIndicator.GetValues;
var
i : Integer;
begin
while Lock do;
Lock := True;
for i := 0 to 31 do Values[i] := FValues[i]*0.4; //ValCount;
for i := 0 to 31 do FValues[i] := 0;
Lock := False;
end;
end.

View File

@@ -0,0 +1,547 @@
(*
this file is a part of audio components suite v 2.3.
copyright (c) 2002-2005 andrei borovsky. all rights reserved.
see the license file for more details.
you can contact me at mail@z0m3ie.de
*)
{
$Log: acs_misc.pas,v $
Revision 1.4 2006/08/31 20:10:54 z0m3ie
*** empty log message ***
Revision 1.3 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.4 2005/12/04 16:54:34 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.3 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.2 2005/09/13 04:04:50 z0m3ie
First release without Components for Fileformats
only TFileIn and TFileOut are Visible
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.9 2005/09/07 20:53:22 z0m3ie
begon to add MPEG and WMA support using DirectX
Revision 1.8 2005/09/04 17:59:37 z0m3ie
moving CDIn support to AKRip mostly
begon to add mpegin support for Win with mpg123
Revision 1.7 2005/08/28 18:35:53 z0m3ie
created Delphi package for 2.4
more Mixer stuff
updated some things for Delphi
Revision 1.6 2005/08/22 20:17:01 z0m3ie
changed Headers to log
changed mail adress
}
unit acs_misc;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, SysUtils, ACS_Types, ACS_Classes, ACS_Strings
{$IFDEF LINUX}
,baseunix, LibAO
{$ENDIF};
const
BUF_SIZE = $4000;
type
TACSOnBufferDone = procedure(Sender : TComponent) of object;
TACSAudioProcessorInitEvent = procedure(Sender : TComponent; var TotalSize : Integer) of object;
TACSAudioProcessorFlushEvent = procedure(Sender : TComponent) of object;
TACSGetParameterEvent = procedure(Sender : TComponent; var Param : Integer) of object;
TACSGetRealParameterEvent = procedure(Sender : TComponent; var Param : real) of object;
TACSGetDataEvent = procedure(Sender : TComponent; Data : Pointer; var n : Integer) of object;
TACSMemoryIn = class(TACSCustomInput)
private
FBuffer : PACSBuffer8;
FDataSize : Integer;
FOnBufferDone : TACSOnBufferDone;
Busy : Boolean;
BufStart, BufEnd : Integer;
FBPS, FSR, FChan : Integer;
function GetBuffer : Pointer;
procedure SetBuffer(v : Pointer);
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
property DataBuffer : Pointer read GetBuffer write SetBuffer;
property DataSize : Integer read FDataSize write FDataSize;
published
property GlobalSize : Integer read FSize write FSize;
property InBitsPerSample : Integer read GetBPS write FBPS;
property InChannels : Integer read GetCh write FChan;
property InSampleRate : Integer read GetSR write FSR;
property OnBufferDone : TACSOnBufferDone read FOnBufferDone write FOnBufferDone;
end;
TACSAudioProcessor = class(TACSCustomConverter)
private
FOnInit : TACSAudioProcessorInitEvent;
FOnFlush : TACSAudioProcessorFlushEvent;
FOnGetData : TACSGetDataEvent;
FOnGetSampleRate : TACSGetParameterEvent;
FOnGetBitsPerSample : TACSGetParameterEvent;
FOnGetChannels : TACSGetParameterEvent;
FOnGetTotalTime : TACSGetRealParameterEvent;
FOnGetSize : TACSGetParameterEvent;
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
function GetTotalTime : real; override;
public
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
published
property OnFlush : TACSAudioProcessorFlushEvent read FOnFlush write FOnFlush;
property OnGetBitsPerSample : TACSGetParameterEvent read FOnGetBitsPerSample write FOnGetBitsPerSample;
property OnGetChannels : TACSGetParameterEvent read FOnGetChannels write FOnGetChannels;
property OnGetData : TACSGetDataEvent read FOnGetData write FOnGetData;
property OnGetSampleRate : TACSGetParameterEvent read FOnGetSampleRate write FOnGetSampleRate;
property OnGetSize : TACSGetParameterEvent read FOnGetSize write FOnGetSize;
property OnGetTotalTime : TACSGetrealParameterEvent read FOnGetTotalTime write FOnGetTotalTime;
property OnInit : TACSAudioProcessorInitEvent read FOnInit write FOnInit;
end;
TACSNULLOut = class(TACSCustomOutput)
private
Buf : array[0..BUF_SIZE-1] of Byte;
protected
procedure Done; override;
function DoOutput(Abort : Boolean):Boolean; override;
procedure Prepare; override;
end;
TACSInputItem = class(TCollectionItem)
protected
FInput : TACSCustomInput;
function GetOwner : TPersistent; override;
published
property Input : TACSCustomInput read FInput write FInput;
end;
TACSInputItems = class(TOwnedCollection)
end;
TACSInputChangedEvent = procedure(Sender : TComponent; var Index : Integer; var Continue : Boolean) of object;
TACSInputList = class(TACSCustomInput)
private
FCurrentInput : Integer;
FInputItems : TACSInputItems;
Lock : Boolean;
FOnInputChanged : TACSInputChangedEvent;
FIndicateProgress : Boolean;
procedure SetCurrentInput(aInput : Integer);
procedure SetInputItems(aItems : TACSInputItems);
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
property CurrentInput : Integer read FCurrentInput write SetCurrentInput;
published
property IndicateProgress : Boolean read FIndicateProgress write FIndicateProgress;
property InputItems : TACSInputItems read FInputItems write SetInputItems;
property OnInputChanged : TACSInputChangedEvent read FOnInputChanged write FOnInputChanged;
end;
implementation
{$IFDEF LINUX}
var
AOInitialized : Integer = 0;
{$ENDIF}
constructor TACSMemoryIn.Create;
begin
inherited Create(AOwner);
FSize := -1;
end;
destructor TACSMemoryIn.Destroy;
begin
inherited Destroy;
end;
function TACSMemoryIn.GetBPS : Integer;
begin
if (FBPS in [8, 16]) = False then FBPS := 16;
Result := FBPS;
end;
function TACSMemoryIn.GetCh : Integer;
begin
if (FChan in [1..2]) = False then FChan := 1;
Result := FChan;
end;
function TACSMemoryIn.GetSR : Integer;
begin
if (FSR < 4000) or (FSR > 48000) then FSR := 8000;
Result := FSR;
end;
procedure TACSMemoryIn.Init;
begin
FPosition := 0;
BufEnd := FDataSize;
BufStart := 1;
Busy := True;
end;
procedure TACSMemoryIn.Flush;
begin
Busy := False;
FDataSize := 0;
end;
function TACSMemoryIn.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
begin
if not Busy then raise EACSException.Create(strStreamnotopen);
if not Assigned(FBuffer) then
begin
Result := 0;
Exit;
end;
if BufStart > BufEnd then
begin
BufStart := 1;
if FDataSize = 0 then
begin
if Assigned(FOnBufferDone) then FOnBufferDone(Self)
else
begin
Result := 0;
Exit;
end;
end;
BufEnd := FDataSize;
if FDataSize = 0 then
begin
Result := 0;
Exit;
end;
end;
if BufferSize < (BufEnd - BufStart + 1)
then Result := BufferSize
else Result := BufEnd - BufStart + 1;
Move(FBuffer[BufStart-1], Buffer^, Result);
Inc(BufStart, Result);
Inc(FPosition, Result);
Dec(FDataSize, Result);
end;
function TACSMemoryIn.GetBuffer : Pointer;
begin
Result := Pointer(FBuffer);
end;
procedure TACSMemoryIn.SetBuffer;
begin
FBuffer := PACSBuffer8(v);
end;
function TACSAudioProcessor.GetBPS : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
if Assigned(FOnGetBitsPerSample) then FOnGetBitsPerSample(Self, Result) else
Result := FInput.BitsPerSample;
end;
function TACSAudioProcessor.GetSR : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
if Assigned(FOnGetSampleRate) then FOnGetSampleRate(Self, Result) else
Result := FInput.SampleRate;
end;
function TACSAudioProcessor.GetCh : Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
if Assigned(FOnGetChannels) then FOnGetChannels(Self, Result) else
Result := FInput.Channels;
end;
function TACSAudioProcessor.GetTotalTime : real;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
if Assigned(FOnGetTotalTime) then FOnGetTotalTime(Self, Result) else
Result := FInput.TotalTime;
end;
function TACSAudioProcessor.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
Result := BufferSize;
if Assigned(FOnGetData) then FOnGetData(Self, Buffer, Result)
else Result := FInput.GetData(Buffer, BufferSize);
Inc(FPosition, Result);
// if Result = 0 then
// Result := Result shl 1;
end;
procedure TACSAudioProcessor.Init;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
if Assigned(FOnInit) then FOnInit(Self, FSize)
else
begin
FInput.Init;
if Assigned(FOnGetSize) then FOnGetSize(Self, FSize)
else FSize := Finput.Size;
end;
FBusy := True;
FPosition := 0;
end;
procedure TACSAudioProcessor.Flush;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
if Assigned(FOnFlush) then FOnFlush(Self)
else FInput.Flush;
FBusy := False;
end;
procedure TACSNULLOut.Prepare;
begin
if not Assigned(FInput) then
raise EACSException.Create(strInputnotAssigned);
FInput.Init;
end;
function TACSNULLOut.DoOutput(Abort : Boolean):Boolean;
begin
Result := True;
if not Busy then Exit;
if Abort or (not CanOutput) then
begin
Result := False;
Exit;
end;
if Finput.GetData(@Buf[0], BUF_SIZE) > 0 then Result := True
else
begin
Result := False;
Exit;
end;
end;
procedure TACSNULLOut.Done;
begin
FInput.Flush;
end;
function TACSInputItem.GetOwner : TPersistent;
begin
Result := Collection;
end;
constructor TACSInputList.Create;
begin
inherited Create(AOwner);
FInputItems := TACSInputItems.Create(Self, TACSInputItem);
FPosition := 0;
FSize := -1;
FIndicateProgress := True;
end;
destructor TACSInputList.Destroy;
begin
FInputItems.Free;
Inherited Destroy;
end;
procedure TACSInputList.SetCurrentInput;
var
I : TACSInputItem;
begin
if aInput <> 0 then
if (aInput < 0) or (aInput >= FInputItems.Count) then
raise EACSException.Create(Format(strListIndexOOB,[aInput]));
if Busy then
begin
while Lock do;
Lock := True;
I := TACSInputItem(InputItems.Items[FCurrentInput]);
I.Input.Flush;
I := TACSInputItem(InputItems.Items[aInput]);
I.Input.Init;
if FIndicateProgress then
FSize := I.Input.Size
else FSize := -1;
FPosition := 0;
Lock := False;
end;
FCurrentInput := aInput;
end;
function TACSInputList.GetBPS : Integer;
var
I : TACSInputItem;
begin
if Busy then
begin
I := TACSInputItem(InputItems.Items[FCurrentInput]);
Result := I.Input.BitsPerSample;
end else
if InputItems.Count > 0 then
begin
I := TACSInputItem(InputItems.Items[0]);
Result := I.Input.BitsPerSample;
end;
end;
function TACSInputList.GetCh : Integer;
var
I : TACSInputItem;
begin
if Busy then
begin
I := TACSInputItem(InputItems.Items[FCurrentInput]);
Result := I.Input.Channels;
end else
if InputItems.Count > 0 then
begin
I := TACSInputItem(InputItems.Items[0]);
Result := I.Input.Channels;
end;
end;
function TACSInputList.GetSR : Integer;
var
I : TACSInputItem;
begin
if Busy then
begin
I := TACSInputItem(InputItems.Items[FCurrentInput]);
Result := I.Input.SampleRate;
end else
if InputItems.Count > 0 then
begin
I := TACSInputItem(InputItems.Items[0]);
Result := I.Input.SampleRate;
end;
end;
procedure TACSInputList.Init;
var
I : TACSInputItem;
begin
if Busy then
raise EACSException.Create(strBusy);
if InputItems.Count = 0 then
raise EACSException.Create(strNoInputItems);
I := TACSInputItem(InputItems.Items[FCurrentInput]);
if not Assigned(I.Input) then
raise EACSException.Create(Format(strNoInputAssigned,[FCurrentInput]));
FBusy := True;
I.Input.Init;
if FIndicateProgress then
FSize := I.Input.Size
else FSize := -1;
FPosition := 0;
end;
procedure TACSInputList.Flush;
var
I : TACSInputItem;
begin
I := TACSInputItem(InputItems.Items[FCurrentInput]);
I.Input.Flush;
FCurrentInput := 0;
Lock := False;
FBusy := False;
end;
function TACSInputList.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
var
I : TACSInputItem;
Continue : Boolean;
begin
while Lock do;
Lock := True;
I := TACSInputItem(InputItems.Items[FCurrentInput]);
Result := I.Input.GetData(Buffer, BufferSize);
while Result = 0 do
begin
if FCurrentInput < InputItems.Count -1 then
begin
I.Input.Flush;
Inc(FCurrentInput);
Continue := True;
if Assigned(FonInputChanged) then
FonInputChanged(Self, FCurrentInput, Continue);
if Continue then
begin
I := TACSInputItem(InputItems.Items[FCurrentInput]);
if not Assigned(I.Input) then
raise EACSException.Create(Format(strNoInputAssigned,[FCurrentInput]));
I.Input.Init;
if FIndicateProgress then
FSize := I.Input.Size
else FSize := -1;
FPosition := 0;
Result := I.Input.GetData(Buffer, BufferSize);
end else Break;
end else Break;
end;
if FIndicateProgress then
FPosition := I.Input.Position;
Lock := False;
end;
procedure TACSInputList.SetInputItems;
begin
FInputItems.Assign(aItems);
end;
end.

View File

@@ -0,0 +1,262 @@
(*
this file is a part of audio components suite v 2.4.
copyright (c) 2002-2005 andrei borovsky. all rights reserved.
see the license file for more details.
you can contact me at mail@z0m3ie.de
*)
{
$Log: acs_mixer.pas,v $
Revision 1.2 2005/12/30 12:54:42 z0m3ie
some error checks
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.3 2005/12/04 16:54:34 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.2 2005/10/02 16:51:46 z0m3ie
*** empty log message ***
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.11 2005/09/01 19:55:48 z0m3ie
again Delphi corrections
Revision 1.10 2005/08/31 20:30:39 z0m3ie
Mixer Channelname work now
minior corrections for Converters
Revision 1.9 2005/08/31 14:37:59 z0m3ie
*** empty log message ***
Revision 1.8 2005/08/31 14:33:16 z0m3ie
fixed delphi issue with TControlEntry
Revision 1.7 2005/08/30 22:10:55 z0m3ie
Mixer mostly completed
Revision 1.6 2005/08/29 21:46:43 z0m3ie
*** empty log message ***
Revision 1.5 2005/08/28 20:31:18 z0m3ie
linux restructuring for 2.4
Revision 1.4 2005/08/28 18:35:53 z0m3ie
created Delphi package for 2.4
more Mixer stuff
updated some things for Delphi
Revision 1.3 2005/08/26 17:12:56 z0m3ie
*** empty log message ***
Revision 1.2 2005/08/26 17:03:20 z0m3ie
begon to make acs resourcestring aware
more advanced tmixer for windows
restructured tmixer its better handleable now
Revision 1.1 2005/08/25 20:18:00 z0m3ie
Version 2.4 restructure
TCDPlayer removed (fits not in component structure)
TMP3ToWavConverter removed (fits not in component structure)
Revision 1.2 2005/08/22 20:17:01 z0m3ie
changed Headers to log
changed mail adress
}
unit acs_mixer;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, SysUtils, ACS_Classes, ACS_Strings
{$IFDEF MSWINDOWS}
,MMSystem,Windows,Dialogs
,Math
{$ELSE}
,Soundcard, baseunix
{$ENDIF}
;
type
TACSMixerChannel = (mcUnknown,
mcVolume,
mcTreble,
mcBass,
mcSynth,
mcPCM,
mcSpeaker,
mcLine,
mcMic,
mcCD,
mcIMix,
mcAltPCM,
mcRecLev,
mcDigital,
mcMonitor,
mcHeadphone,
mcTelephone);
{$IFDEF MSWINDOWS}
const
FirstSource = MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED - MIXERLINE_COMPONENTTYPE_SRC_FIRST ;
LastSource = MIXERLINE_COMPONENTTYPE_SRC_ANALOG - MIXERLINE_COMPONENTTYPE_SRC_FIRST ;
FirstDest = MIXERLINE_COMPONENTTYPE_DST_FIRST;
LastDest = MIXERLINE_COMPONENTTYPE_DST_LAST;
type
{$IFDEF LCL}
TMixerLine = MIXERLINE;
TMixerCaps = MIXERCAPS;
TMixerControl = MIXERCONTROL;
TMixerLineControls = MIXERLINECONTROLS;
TMixerControlDetails = MIXERCONTROLDETAILS;
{$ENDIF}
TDataArray = ARRAY[FirstSource .. LastSource] OF MIXERCONTROLDETAILS_UNSIGNED;
PDataArray = ^TDataArray;
PControlEntry = ^TControlEntry;
TControlEntry = RECORD
IsInited : Boolean;
CHandle : Thandle;
CDestination : INTEGER;
CID : INTEGER;
CName : String[MIXER_SHORT_NAME_CHARS];
CConnect : INTEGER;
CCControls : INTEGER;
CControlTyp : INTEGER;
CKanal : INTEGER;
CControl : INTEGER;
CComponentTyp : DWORD;
CMin, Cmax : INTEGER;
Cdetails : TDataArray;
CMultItems : INTEGER;
CcSteps : DWORD;
END;
{$ENDIF}
TACSMixerLevel = record
case Word of
1 :
(
Left, Right : Byte;
);
2 : (Main : Byte;);
end;
{ TACSMixer }
TACSMixer = class(TComponent)
private
FDevNum : Integer;
FChannels : array of TACSMixerChannel;
{$IFDEF LINUX}
_mix_fd : Integer;
FFileName : String;
{$ELSE}
FMixer : HMixer;
FMixerCaps : TMixerCaps;
FControls : array of TControlEntry;
FMuteControls : array of TControlEntry;
{$ENDIF}
FMixerName : String;
function GetRecSource : Integer;
function GetVolume(vChannel : integer) : TACSMixerLevel;
procedure SetVolume(vChannel : integer; vLevel : TACSMixerLevel);
procedure SetRecSource(vChannel : integer);
procedure SetDevNum(Num : Integer);
function GetChannel(Num : Integer) : TACSMixerChannel;
function GetDevCount : Integer;
function GetChannelCount : Integer;
function GetChannelName(vChannel : Integer) : string;
function GetMute(vChannel : integer) : Boolean;
procedure SetMute(vChannel : integer; Mute : Boolean);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function IsStereo(vChannel : Integer) : Boolean;
function IsRecordable(vChannel : Integer) : Boolean;
property Channel[vChannel : Integer] : TACSMixerChannel read GetChannel;
property Level[vChannel : Integer] : TACSMixerLevel read GetVolume write SetVolume;
property Mute[vChannels : Integer] : Boolean read GetMute write SetMute;
property ChannelName[vChannel : Integer] : string read GetChannelName;
property RecordSource : Integer read GetRecSource write SetRecSource;
property DevCount : Integer read GetDevCount;
property Channelcount : Integer read GetChannelCount;
published
property DevNum : Integer read FDevNum write SetDevNum stored True;
property MixerName : String read FMixerName;
end;
var
MixersCount : Byte;
function ChannelToStr(ch : TACSMixerChannel) : String;
implementation
{$I ACS_Mixer.inc}
function ChannelToStr(ch : TACSMixerChannel) : String;
begin
case ch of
mcVolume: Result := strMixerVolume;
mcTreble: Result := strMixerTreble;
mcBass: Result := strMixerBass;
mcSynth: Result := strMixerSynth;
mcPCM: Result := strMixerPCM;
mcSpeaker: Result := strMixerSpeaker;
mcLine: Result := strMixerLine;
mcMic: Result := strMixerMic;
mcCD: Result := strMixerCD;
mcIMix: Result := strMixerIMix;
mcAltPCM: Result := strMixerAlt;
mcRecLev: Result := strMixerRec;
mcUnknown: Result := strMixerUnknown;
else Result := IntToStr(Integer(ch));
end;
end;
constructor TACSMixer.Create;
begin
inherited Create(AOwner);
if MixersCount > 0 then
SetDevNum(0);
end;
function TACSMixer.GetChannel(Num: Integer): TACSMixerChannel;
begin
if (Num < 0) or (Num > (length(FChannels)-1)) then
exit;
Result := FChannels[Num];
end;
function TACSMixer.GetDevCount : Integer;
begin
Result := MixersCount;
end;
function TACSMixer.GetChannelCount : Integer;
begin
result := length(FChannels);
end;
function TACSMixer.GetChannelName(vChannel : Integer) : string;
begin
if (vChannel > -1) and (vChannel < ChannelCount) then
Result := ChannelToStr(FChannels[vChannel]);
end;
initialization
MixersCount := CountMixers;
end.

View File

@@ -0,0 +1,299 @@
(*
this file is a part of audio components suite,
copyright (c) 2005 ross levis. all rights reserved.
see the license file for more details.
TMultiMixer provides for an unlimited number of inputs (channels)
to be mixed into one audio buffer. Only supports 44100/16/2
TMultiMixer
- property TotalChannels: Integer; // get/set the number of channels
- property Channel[Index: Integer]: TChannel; default
TChannel
- procedure Preload; // runs Input.Init to make starting faster (optional)
- procedure Start; // Start channel
- procedure Stop; // Stop channel
- property Input: TACSInput
- property Volume: Word; // 0 = silent, 32768 = 100%
eg.
MultiMixer.TotalChannels := 1;
MultiMixer[0].Input := VorbisIn1;
AudioOut1.Run;
MultiMixer.TotalChannels := 2; // Channels can be added or removed while playing
MultiMixer[1].Input := WAVEIn1;
MultiMixer[1].Volume := 16384; // 50% volume
MultiMixer[1].Start; // while at least 1 mixer is playing, others
MultiMixer[0].Stop; // can be started and stopped individually.
*)
{
$Log: acs_multimix.pas,v $
Revision 1.3 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.3 2005/12/04 16:54:34 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.2 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.1 2005/08/25 21:02:31 z0m3ie
TMultiMixer by Ross Levis added
}
{$hints off}
unit acs_multimix;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, SysUtils, ACS_Types, ACS_Classes, ACS_Strings;
const
BUF_SIZE = 8820;
type
TACSMultiMixer = class;
TACSChannel = class
private
FOwner: TACSMultiMixer;
FInput: TACSCustomInput;
FVolume: Word;
EndOfInput: Boolean;
Preloaded: Boolean;
InBuf: array[1..BUF_SIZE] of Byte;
public
constructor Create(AOwner: TACSMultiMixer); virtual;
destructor Destroy; override;
procedure Preload;
procedure Start;
procedure Stop;
property Input: TACSCustomInput read FInput write FInput;
property Volume: Word read FVolume write FVolume;
end;
TACSMultiMixer = class(TACSCustomInput)
private
FChannel: array of TACSChannel;
FTotalChannels: Integer;
OutBuf: array[1..BUF_SIZE] of Byte;
Buisy : Boolean;
FLock: Boolean;
function GetChannel(Index: Integer): TACSChannel;
procedure SetTotalChannels(Num: Integer);
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property Channel[Index: Integer]: TACSChannel read GetChannel; default;
function GetData(Buffer: Pointer; BufferSize: Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
published
property TotalChannels: Integer read FTotalChannels write SetTotalChannels;
end;
implementation
// TChannel
constructor TACSChannel.Create;
begin
inherited Create;
FOwner := AOwner;
FVolume := 32768;
EndOfInput := True;
Preloaded := False;
end;
destructor TACSChannel.Destroy;
begin
inherited Destroy;
end;
procedure TACSChannel.Preload;
begin
if EndOfInput and not Preloaded and Assigned(FInput) then
begin
FInput.Init;
Preloaded := True;
end;
end;
procedure TACSChannel.Start;
begin
if FOwner.Buisy and EndOfInput and Assigned(FInput) then
begin
if not Preloaded then Preload;
EndOfInput := False;
end;
end;
procedure TACSChannel.Stop;
begin
if not EndOfInput then
begin
EndOfInput := True;
Preloaded := False;
while FOwner.Flock do;
FOwner.FLock := True;
FInput.Flush;
FOwner.Flock := False;
end;
end;
// TACSMultiMixer
constructor TACSMultiMixer.Create;
begin
inherited Create(AOwner);
FLock := False;
end;
destructor TACSMultiMixer.Destroy;
begin
SetTotalChannels(0); // free channels
inherited Destroy;
end;
procedure TACSMultiMixer.SetTotalChannels(Num: Integer);
var
chan: Integer;
begin
if (Num >= 0) and (Num <> FTotalChannels) then
begin
while Flock do;
FLock := True;
if Num < FTotalChannels then // remove channels
begin
for chan := FTotalChannels-1 downto Num do
with FChannel[chan] do
begin
if not EndOfInput then FInput.Flush;
Free;
end;
SetLength(FChannel,Num);
end
else begin // add channels
SetLength(FChannel,Num);
for chan := FTotalChannels to Num-1 do
FChannel[chan] := TACSChannel.Create(Self);
end;
FTotalChannels := Num;
FLock := False;
end;
end;
function TACSMultiMixer.GetBPS;
begin
Result := 16;
end;
function TACSMultiMixer.GetCh;
begin
Result:= 2;
end;
function TACSMultiMixer.GetSR;
begin
Result := 44100;
end;
procedure TACSMultiMixer.Init;
var
chan: Integer;
begin
Buisy := True;
FPosition := 0;
for chan := 0 to FTotalChannels-1 do
FChannel[chan].Start;
FSize := 0;
FLock := False;
end;
procedure TACSMultiMixer.Flush;
var
chan: Integer;
begin
for chan := 0 to FTotalChannels-1 do
with FChannel[chan] do
begin
if Assigned(FInput) then FInput.Flush;
EndOfInput := True;
Preloaded := False;
end;
Buisy := False;
end;
function TACSMultiMixer.GetData;
var
i, chan, ReadSize, BufSize: Integer;
InBuf16, OutBuf16: PACSBuffer16;
begin
if not Buisy then raise EACSException.Create(strStreamnotopen);
begin
while Flock do sleep(0);
Flock := True;
BufSize := 0;
if BufferSize > BUF_SIZE then BufferSize := BUF_SIZE;
for chan := 0 to FTotalChannels-1 do
with FChannel[chan] do
if not EndOfInput then
begin
ReadSize := FInput.GetData(@InBuf[1], BufferSize);
while (ReadSize < BufferSize) and (ReadSize <> 0) do
begin
Result := FInput.GetData(@InBuf[ReadSize+1], BufferSize-ReadSize);
Inc(ReadSize, Result);
end;
FillChar(InBuf[ReadSize+1], BufferSize-ReadSize, 0); // zero rest of buffer
if ReadSize = 0 then EndOfInput := True
else if ReadSize > BufSize then BufSize := ReadSize;
end;
if BufSize = 0 then
begin
Flock := False;
Result := 0;
Exit;
end;
// mix
FillChar(OutBuf[1], BufferSize, 0);
OutBuf16 := @OutBuf;
for chan := 0 to FTotalChannels-1 do
with FChannel[chan] do
if not EndOfInput then
begin
InBuf16 := @InBuf;
for i := 0 to (BufSize shr 1) - 1 do
OutBuf16[i] := OutBuf16[i] + (InBuf16[i] * FVolume div 32768);
end;
Flock := False;
end;
Result := BufSize;
Move(OutBuf[1], Buffer^, Result);
Inc(FPosition, Result);
end;
function TACSMultiMixer.GetChannel(Index: Integer): TACSChannel;
begin
Result := FChannel[Index];
end;
end.

View File

@@ -0,0 +1,343 @@
(*
this file is a part of audio components suite v 2.3.
copyright (c) 2002-2005 andrei borovsky. all rights reserved.
see the license file for more details.
you can contact me at mail@z0m3ie.de
*)
{
$Log: acs_procs.pas,v $
Revision 1.4 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.2 2005/12/04 16:54:34 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.2 2005/08/22 20:17:01 z0m3ie
changed Headers to log
changed mail adress
}
unit acs_procs;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
SysUtils, ACS_Types, Math;
type
TACSFilterWindowType = (fwHamming, fwHann, fwBlackman);
{$IFDEF LINUX}
function FindLibs(const Pattern : String) : String;
{$ENDIF}
// Direction = 1 - forward FFT, Direction = -1 - inverse FFT.
procedure ComplexFFT(Data : PACSComplexArray; DataSize, Direction : Integer);
procedure HannWindow(OutData : PACSDoubleArray; Width : Integer; Symmetric : Boolean);
procedure HammingWindow(OutData : PACSDoubleArray; Width : Integer; Symmetric : Boolean);
procedure BlackmanWindow(OutData : PACSDoubleArray; Width : Integer; Symmetric : Boolean);
procedure CalculateSincKernel(OutData : PACSDoubleArray; CutOff : Double; Width : Integer; WType : TACSFilterWindowType);
procedure SmallIntArrayToDouble(InData : PSmallInt; OutData : PDouble; DataSize : Integer);
procedure SmallIntArrayToComplex(InData : PSmallInt; OutData : PACSComplex; DataSize : Integer);
// Computes Op2[i] = Op1[i]*Op2[i], i = [0..DataSize-1]
procedure MultDoubleArrays(Op1, Op2 : PDouble; DataSize : Integer);
(*
Performs calculation of
/
| Lg(Abs(InData[i])) + Shift, if Lg(Abs(InData[i])) + Shift >= 0
OutData[i] = < 0, if Lg(Abs(InData[i])) + Shift < 0
| 0, if Abs(InData[i]) = 0.
\
i = [0..DataSize-1]
*)
procedure LgMagnitude(InData : PACSComplex; OutData : PDouble; DataSize, Shift : Integer);
implementation
{$IFDEF LINUX}
function FindLibs(const Pattern : String) : String;
var
Path : String;
SR : TSearchRec;
begin
Path := '/usr/lib/';
if FindFirst(Path + Pattern, faAnyFile, SR) = 0 then
begin
Result := SR.Name;
FindClose(SR);
Exit;
end;
Path := '/usr/local/lib/';
if FindFirst(Path + Pattern, faAnyFile, SR) = 0 then
begin
Result := SR.Name;
FindClose(SR);
Exit;
end;
Result := '';
end;
{$ENDIF}
(* This routine is converted from the original C code by P. Burke
Direction = 1 - forward FFT, Direction = -1 - inverse FFT. *)
procedure ComplexFFT(Data : PACSComplexArray; DataSize, Direction : Integer);
var
i, i1, j, k, i2, l, l1, l2, Log2n : Integer;
c1, c2, tx, ty, t1, t2, u1, u2, z : Double;
begin
Log2n := Trunc(Log2(DataSize));
// Do the bit reversal
i2 := DataSize shr 1;
j := 0;
for i := 0 to DataSize-2 do
begin
if i < j then
begin
tx := Data[i].Re;
ty := Data[i].Im;
Data[i].Re := Data[j].Re;
Data[i].Im := Data[j].Im;
Data[j].Re := tx;
Data[j].Im := ty;
end;
k := i2;
while k <= j do
begin
Dec(j, k);
k := k shr 1;
end;
Inc(j, k);
end;
// Compute the FFT
c1 := -1.0;
c2 := 0.0;
l2 := 1;
for l := 0 to Log2n-1 do
begin
l1 := l2;
l2 := l2 shl 1;
u1 := 1.0;
u2 := 0.0;
for j := 0 to l1-1 do
begin
i := j;
while i < DataSize do
begin
i1 := i + l1;
t1 := u1 * Data[i1].Re - u2 * Data[i1].Im;
t2 := u1 * Data[i1].Im + u2 * Data[i1].Re;
Data[i1].Re := Data[i].Re - t1;
Data[i1].Im := Data[i].Im - t2;
Data[i].Re := Data[i].Re + t1;
Data[i].Im := Data[i].Im + t2;
Inc(i, l2);
end;
z := u1*c1 - u2*c2;
u2 := u1*c2 + u2*c1;
u1 := z;
end;
c2 := Sqrt((1.0 - c1)/2.0);
if Direction = 1 then c2 := -c2;
c1 := Sqrt((1.0 + c1)/2.0);
end;
// Scaling for forward transform
if Direction = 1 then
for i := 0 to DataSize-1 do
begin
Data[i].Re := Data[i].Re/DataSize;
Data[i].Im := Data[i].Im/DataSize;
end;
end;
procedure HannWindow(OutData : PACSDoubleArray; Width : Integer; Symmetric : Boolean);
var
i, n : Integer;
begin
if Symmetric then n := Width-1
else n := Width;
for i := 0 to Width-1 do OutData[i] := (1-Cos(TwoPi*i/n))/2;
end;
procedure HammingWindow(OutData : PACSDoubleArray; Width : Integer; Symmetric : Boolean);
var
i, n : Integer;
begin
if Symmetric then n := Width-1
else n := Width;
for i := 0 to Width-1 do OutData[i] := 0.54-0.46*Cos(TwoPi*i/n);
end;
procedure BlackmanWindow(OutData : PACSDoubleArray; Width : Integer; Symmetric : Boolean);
var
i, n : Integer;
begin
if Symmetric then n := Width-1
else n := Width;
for i := 0 to Width-1 do OutData[i] := 0.42-0.5*Cos(TwoPi*i/n) + 0.08*Cos(2*TwoPi*i/n);
end;
procedure CalculateSincKernel(OutData : PACSDoubleArray; CutOff : Double; Width : Integer; WType : TACSFilterWindowType);
var
i : Integer;
S : Double;
Window : array of Double;
begin
// SetLength(OutData, Width);
SetLength(Window, Width);
case WType of
fwHamming : HammingWindow(@Window[0], Width, False);
fwHann : HannWindow(@Window[0], Width, False);
fwBlackman : BlackmanWindow(@Window[0], Width, False);
end;
S := 0;
for i := 0 to Width-1 do
begin
if i-(Width shr 1) <> 0 then
OutData[i] := Sin(TwoPi*CutOff*(i-(Width shr 1)))/(i-(Width shr 1))*Window[i]
else OutData[i] := TwoPi*CutOff*Window[i];
S := S + OutData[i];
end;
for i := 0 to Width-1 do OutData[i] := OutData[i]/S;
end;
procedure SmallIntArrayToDouble(InData : PSmallInt; OutData : PDouble; DataSize : Integer);
begin
{$IFDEF CPU32}
asm
MOV EDX, DataSize;
SHL EDX, 3;
MOV ECX, OutData;
ADD EDX, ECX;
MOV EAX, InData;
@test: CMP EDX, ECX;
JE @out;
FILD WORD[EAX];
ADD EAX, 2;
FSTP QWORD[ECX];
ADD ECX, 8;
JMP @test;
@out: ;
end;
{$ENDIF}
end;
procedure SmallIntArrayToComplex(InData : PSmallInt; OutData : PACSComplex; DataSize : Integer);
begin
{$IFDEF CPU32}
asm
MOV EDX, DataSize;
SHR EDX, 4;
MOV ECX, OutData;
ADD EDX, ECX;
MOV EAX, InData;
@test: CMP EDX, ECX;
JE @out;
FILD WORD[EAX];
ADD EAX, 2;
FSTP QWORD[EAX];
ADD ECX, 16;
JMP @test;
@out: ;
end;
{$ENDIF}
end;
procedure MultDoubleArrays(Op1, Op2 : PDouble; DataSize : Integer);
begin
{$IFDEF CPU32}
asm
MOV EDX, DataSize;
SHL EDX, 3;
MOV ECX, Op1;
ADD EDX, ECX;
MOV EAX, Op2;
@test: CMP EDX, ECX;
JE @out;
FLD QWORD[ECX];
FLD QWORD[EAX];
FMUL;
FSTP QWORD[EAX];
ADD ECX, 8;
ADD EAX, 8;
JMP @test;
@out: ;
end;
{$ENDIF}
end;
procedure LgMagnitude(InData : PACSComplex; OutData : PDouble; DataSize, Shift : Integer);
var
LogBase : Double;
begin
{$IFDEF CPU32}
asm
FLD1;
FLDL2T;
FDIVP;
FSTP LogBase;
MOV EDX, DataSize;
SHL EDX, 3;
MOV ECX, OutData;
ADD EDX, ECX;
MOV EAX, InData;
@test: CMP EDX, ECX;
JE @out;
FLD QWORD[EAX];
FMUL ST(0), ST(0);
ADD EAX, 8;
FLD QWORD[EAX];
FMUL ST(0), ST(0);
FADDP;
FSQRT;
FTST;
PUSH EAX;
FSTSW AX;
SAHF;
JE @skip;
FLD LogBase;
FXCH;
FYL2X;
FIADD Shift;
FTST;
FSTSW AX;
SAHF;
JAE @skip;
FSTP QWORD[ECX];
FLDZ;
@skip: POP EAX;
ADD EAX, 8;
FSTP QWORD[ECX];
ADD ECX, 8;
JMP @test;
@out: ;
end;
{$ENDIF}
end;
end.

View File

@@ -0,0 +1,223 @@
(*
this file is a part of audio components suite v 2.3.
copyright (c) 2002-2005 andrei borovsky. all rights reserved.
see the license file for more details.
you can contact me at mail@z0m3ie.de
*)
{
$Log: acs_streams.pas,v $
Revision 1.5 2006/08/31 20:10:54 z0m3ie
*** empty log message ***
Revision 1.4 2006/07/04 17:12:45 z0m3ie
ACS 2.4 alt wiederhergestellt (unterschiedliche Sampleformate ...)
Revision 1.1 2005/12/19 18:34:35 z0m3ie
*** empty log message ***
Revision 1.4 2005/12/04 16:54:34 z0m3ie
All classes are renamed, Style TACS... than T... to avoid conflicts with other components (eg TMixer is TACSMixer now)
Revision 1.3 2005/11/27 16:50:33 z0m3ie
add ACS VolumeQuerry
make ACS_VolumeQuerry localizeable
some little errorfixes (buffersize for linuxdrivers was initially 0)
make TAudioIn workable
Revision 1.2 2005/09/13 21:54:11 z0m3ie
acs is localizeable now (ACS_Strings)
Revision 1.1 2005/09/12 22:04:52 z0m3ie
modified structure again, fileformats are now in an sperat folder.
all File In/Out classes are capsulated from TFileIn and TFileOut
Revision 1.2 2005/08/22 20:17:01 z0m3ie
changed Headers to log
changed mail adress
}
unit acs_streams;
{$ifdef fpc}
{$mode delphi}
{$endif}
interface
uses
Classes, SysUtils, ACS_Classes, ACS_Strings;
const
OUTBUF_SIZE = $4000;
type
TACSStreamOut = class(TACSStreamedOutput)
private
function GetSR : Integer;
function GetBPS : Integer;
function GetCh : Integer;
protected
procedure Done; override;
function DoOutput(Abort : Boolean):Boolean; override;
procedure Prepare; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property OutSampleRate : Integer read GetSR;
property OutBitsPerSample : Integer read GetBPS;
property OutChannles : Integer read GetCh;
end;
TACSStreamIn = class(TACSStreamedInput)
private
FBPS, FChan, FFreq : Integer;
protected
function GetBPS : Integer; override;
function GetCh : Integer; override;
function GetSR : Integer; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetData(Buffer : Pointer; BufferSize : Integer): Integer; override;
procedure Init; override;
procedure Flush; override;
published
property InBitsPerSample : Integer read FBPS write FBPS;
property InChannels : Integer read FChan write FChan;
property InSampleRate : Integer read FFreq write FFreq;
end;
implementation
procedure TACSStreamOut.Prepare;
begin
if not FStreamAssigned then
raise EACSException.Create(strStreamObjectnotassigned);
FInput.Init;
end;
procedure TACSStreamOut.Done;
begin
FInput.Flush;
end;
function TACSStreamOut.DoOutput(Abort : Boolean):Boolean;
var
Len : Integer;
P : Pointer;
begin
// No exceptions Here
Result := True;
if not Busy then Exit;
if Abort or (not CanOutput) then
begin
Result := False;
Exit;
end;
GetMem(P, OUTBUF_SIZE);
while InputLock do;
InputLock := True;
Len := Finput.GetData(P, OUTBUF_SIZE);
InputLock := False;
if Len > 0 then
begin
Result := True;
FStream.WriteBuffer(P^, Len);
end
else Result := False;
FreeMem(P);
end;
constructor TACSStreamOut.Create;
begin
inherited Create(AOwner);
end;
destructor TACSStreamOut.Destroy;
begin
inherited Destroy;
end;
constructor TACSStreamIn.Create;
begin
inherited Create(AOwner);
FBPS := 8;
FChan := 1;
FFreq := 8000;
FSize := -1;
end;
destructor TACSStreamIn.Destroy;
begin
inherited Destroy;
end;
procedure TACSStreamIn.Init;
begin
if Busy then raise EACSException.Create(strBusy);
if not Assigned(FStream) then raise EACSException.Create(strStreamObjectnotassigned);
FPosition := FStream.Position;
FBusy := True;
FSize := FStream.Size;
end;
procedure TACSStreamIn.Flush;
begin
// FStream.Position := 0;
FBusy := False;
end;
function TACSStreamIn.GetData(Buffer : Pointer; BufferSize : Integer): Integer;
begin
Result := FStream.Read(Buffer^, BufferSize);
FPosition := FStream.Position;
// Inc(FPosition, Result);
if FPosition >= FSize then
Result := 0;
end;
function TACSStreamOut.GetSR : Integer;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.SampleRate;
end;
function TACSStreamOut.GetBPS : Integer;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.BitsPerSample;
end;
function TACSStreamOut.GetCh : Integer;
begin
if not Assigned(Input) then
raise EACSException.Create(strInputnotassigned);
Result := FInput.Channels;
end;
function TACSStreamIn.GetBPS : Integer;
begin
Result := FBPS
end;
function TACSStreamIn.GetCh : Integer;
begin
Result := FChan;
end;
function TACSStreamIn.GetSR : Integer;
begin
Result := Self.FFreq;
end;
end.

Some files were not shown because too many files have changed in this diff Show More