Стартовый пул
This commit is contained in:
197
acs/Demos/Ripper/cdripper.lpi
Normal file
197
acs/Demos/Ripper/cdripper.lpi
Normal 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
119
acs/Demos/Ripper/umain.lfm
Normal 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
126
acs/Demos/Ripper/umain.pas
Normal 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.
|
||||
|
Reference in New Issue
Block a user