Einzelnen Beitrag anzeigen

Fritz the Cat

Registriert seit: 6. Mai 2005
28 Beiträge
 
Delphi 7 Enterprise
 
#1

Markiertes im StringGrid an Komponente übergeben???

  Alt 6. Mai 2005, 21:00
Hallo.

ich hoffe das ich hier richtig bin. Ich habe hier im Forum ein Beispiel gefunden, wie man Audio-CD's rippt und durch Lame jagt, um diese nach MP3 zu konvertieren.

Hier mal die Unit:

Delphi-Quellcode:
unit LDUnit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, StdCtrls, CDRIP, LameCoder, Grids;

type
  TForm1 = class(TForm)
    LameCoder1: TLameCoder;
    CDRIP1: TCDRIP;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    CheckBox1: TCheckBox;
    Button1: TButton;
    Button2: TButton;
    CheckBox2: TCheckBox;
    ComboBox1: TComboBox;
    Label1: TLabel;
    CheckBox3: TCheckBox;
    Label2: TLabel;
    ComboBox2: TComboBox;
    CheckBox4: TCheckBox;
    CheckBox5: TCheckBox;
    Label4: TLabel;
    CheckBox6: TCheckBox;
    OpenDialog1: TOpenDialog;
    Button3: TButton;
    Label5: TLabel;
    ListBox2: TListBox;
    Button4: TButton;
    Button5: TButton;
    ProgressBar1: TProgressBar;
    Label6: TLabel;
    ComboBox3: TComboBox;
    TrackBar1: TTrackBar;
    Label3: TLabel;
    Label7: TLabel;
    CheckBox7: TCheckBox;
    ComboBox4: TComboBox;
    Label8: TLabel;
    Label9: TLabel;
    ComboBox5: TComboBox;
    Label10: TLabel;
    CheckBox8: TCheckBox;
    StringGrid1: TStringGrid;
    ListBox1: TListBox;
    procedure CheckBox1Click(Sender: TObject);
    procedure CheckBox2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure CDRIP1Progress(Sender: TObject; PercentComplete: Word);
    procedure Button2Click(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
    procedure ComboBox2Change(Sender: TObject);
    procedure ComboBox3Change(Sender: TObject);
    procedure CheckBox6Click(Sender: TObject);
    procedure CheckBox3Click(Sender: TObject);
    procedure CheckBox4Click(Sender: TObject);
    procedure CheckBox5Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure CDRIP1BeginTrack(Sender: TObject; TrackNum: Word);
    procedure CDRIP1EndTrack(Sender: TObject; TrackNum: Word);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure LameCoder1Progress(Sender: TObject; PercentComplete: Word);
    procedure LameCoder1EndProcess(Sender: TObject);
    procedure LameCoder1BeginFile(Sender: TObject; Num: Word;
      FileName: String);
    procedure TrackBar1Change(Sender: TObject);
    procedure CheckBox7Click(Sender: TObject);
    procedure ComboBox4Change(Sender: TObject);
    procedure ComboBox5Change(Sender: TObject);
    procedure CheckBox8Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Lame_dll;

{$R *.DFM}

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
     CheckBox2.Checked := not CheckBox1.Checked;
     CDRIP1.Encode:=CheckBox1.Checked;
end;

procedure TForm1.CheckBox2Click(Sender: TObject);
begin
     CheckBox1.Checked := not CheckBox2.Checked;
     CDRIP1.WriteWAV:=CheckBox2.Checked;
end;

//Ich vermute mal da ab hier was geändert werden muß

procedure TForm1.FormCreate(Sender: TObject);
var i : integer;
begin
     for i:=0 to CDRIP1.Tracks.Count-1 do begin
         StringGrid1.Cells[0,0]:='Track';
         StringGrid1.Cells[1,0]:='Mode';
         StringGrid1.Cells[0,i+1]:=CDRIP1.Tracks[i];
         StringGrid1.Cells[1,i+1]:=TTrack(CDRIP1.Tracks.Objects[i]).Mode;
     end;
     StringGrid1.RowCount:=i+1;
     ComboBox1.ItemIndex:=0;
     ComboBox2.ItemIndex:=4;
     ComboBox3.ItemIndex:=0;
     ComboBox4.ItemIndex:=0;
     ComboBox5.ItemIndex:=0;
end;

procedure TForm1.Button1Click(Sender: TObject);
var f : string;
begin
     f:=CDRIP1.Tracks[StringGrid1.Row-1];
     if CDRIP1.WriteWAV then f:=f+'.wavelse f:=f+'.pcm';
     CDRIP1.RipTrack(StringGrid1.Row,f);
end;

//Bis hier

procedure TForm1.CDRIP1Progress(Sender: TObject; PercentComplete: Word);
begin
     ProgressBar1.Position:=PercentComplete;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
     CDRIP1.CancelRip;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
     LameCoder1.SampleRate:=StrToInt(ComboBox1.Text);
end;

procedure TForm1.ComboBox2Change(Sender: TObject);
begin
     LameCoder1.BitRate:=StrToInt(ComboBox2.Text);
end;

procedure TForm1.ComboBox3Change(Sender: TObject);
begin
     LameCoder1.MaxBitRate:=StrToInt(ComboBox3.Text);
end;

procedure TForm1.CheckBox6Click(Sender: TObject);
begin
     LameCoder1.EnableVBR:=CheckBox6.Checked;
end;

procedure TForm1.CheckBox3Click(Sender: TObject);
begin
     LameCoder1.Copyright:=CheckBox3.Checked;
end;

procedure TForm1.CheckBox4Click(Sender: TObject);
begin
     LameCoder1.Original:=CheckBox4.Checked;
end;

procedure TForm1.CheckBox5Click(Sender: TObject);
begin
     LameCoder1.CRC:=CheckBox5.Checked;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
     if OpenDialog1.Execute then begin
        LameCoder1.InputFiles:=OpenDialog1.Files;
        ListBox2.Items.Assign(OpenDialog1.Files);
     end;
end;

procedure TForm1.CDRIP1BeginTrack(Sender: TObject; TrackNum: Word);
begin
     Label5.Caption:='Begin ripping Track' + inttostr(tracknum);
end;

procedure TForm1.CDRIP1EndTrack(Sender: TObject; TrackNum: Word);
begin
     Label5.Caption:='End ripping Track' + inttostr(tracknum);
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
     LameCoder1.ProcessFiles;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
     LameCoder1.CancelProcess;
end;

procedure TForm1.LameCoder1Progress(Sender: TObject;
  PercentComplete: Word);
begin
     ProgressBar1.Position:=PercentComplete;
end;

procedure TForm1.LameCoder1EndProcess(Sender: TObject);
begin
     ProgressBar1.Position:=0;
end;

procedure TForm1.LameCoder1BeginFile(Sender: TObject; Num: Word;
  FileName: String);
begin
     Label6.Caption:='Process file '+FileName;
end;

procedure TForm1.TrackBar1Change(Sender: TObject);
begin
     LameCoder1.VBRQuality:=TrackBar1.Position;
     Label7.Caption:=IntToStr(TrackBar1.Position);
end;

procedure TForm1.CheckBox7Click(Sender: TObject);
begin
     LameCoder1.WriteVBRHeader:=CheckBox7.Checked;
end;

procedure TForm1.ComboBox4Change(Sender: TObject);
begin
     LameCoder1.Mode:=TLameMode(ComboBox4.ItemIndex);
end;

procedure TForm1.ComboBox5Change(Sender: TObject);
begin
     LameCoder1.Quality:=MPEG_QUALITY(ComboBox5.ItemIndex);
end;

procedure TForm1.CheckBox8Click(Sender: TObject);
begin
     LameCoder1.Private:=CheckBox8.Checked;
end;

end.
Man kann immer nur einen Titel rippen. Wie kann man das was man markiert hat, hintereinander weg rippen, ohne ständig neu wählen zu müssen?

Wäre vielleicht eine andere Komponente besser?

Ich bin abloluter Newbie. Soll aber keine Entschuldigung sein.

Danke schonmal!
  Mit Zitat antworten Zitat