Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-03

Burn a CD

15 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marcos Douglas

Hi,

Anyone knows how burn a CD using the Windows API (should works in XP and Vista)?

Thanks,

Marcos Douglas

Jorge Aldo G. de F. Junior
to Marcos Douglas

you should :

1 - Learn to use ASPI.dll (wich is basically a way to send ATAPI commands to the device).
2 - Learn ATAPI commands (ATAPI is more or less SCSI commands sent over SATA/PATA layer).

2012/3/13 Marcos Douglas :

Show quoted text 12 lines
Hi, Anyone knows how burn a CD using the Windows API (should works in XP and Vista)? Thanks, Marcos Douglas _______________________________________________ fpc-pascal maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Jorge Aldo G. de F. Junior
to Jorge Aldo G. de F. Junior

you are lucky !

a quick search at google returned the following document :

http://tools.assembla.com/svn/zalex/FuzzyReader/WNaspi32.pas

i dont know the license of this code, but it can be used, at least, as reference...

2012/3/13 Jorge Aldo G. de F. Junior :

Show quoted text 20 lines
you should : 1 - Learn to use ASPI.dll (wich is basically a way to send ATAPI commands to the device). 2 - Learn ATAPI commands (ATAPI is more or less SCSI commands sent over SATA/PATA layer). 2012/3/13 Marcos Douglas : > Hi, > > Anyone knows how burn a CD using the Windows API (should works in XP and > Vista)? > > Thanks, > > Marcos Douglas > > _______________________________________________ > fpc-pascal maillist  -   > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Leonardo M. Ramé
to stootch

If you think in the future your app must work in another OSes, maybe a better solution is to use cdrecord, it has everything you need (CD, DVD, BluRay) . Here's the Win32 version http://www.student.tugraz.at/thomas.plank/

We run it using TProcess, then parse the results and show them on screen.  
Leonardo M. Ramé
http://leonardorame.blogspot.com

Show quoted text 24 lines
________________________________ From: stootch To: Sent: Wednesday, March 14, 2012 4:26 AM Subject: Re: [fpc-pascal] Burn a CD W dniu 13.03.2012 14:13, Marcos Douglas pisze: > Hi, > > Anyone knows how burn a CD using the Windows API (should works in XP and > Vista)? Take a look at: http://blog.delphi-jedi.net/2009/07/18/im-burning-baby/ Porting to FPC/Lazarus (if any) should be straightforward. stootch _______________________________________________ fpc-pascal maillist  -  http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Marcos Douglas
to Jorge Aldo G. de F. Junior: you are lucky ! a quick search at google returned the following document :…
Jorge Aldo G. de F. Junior wrote 7 lines
you should : 1 - Learn to use ASPI.dll (wich is basically a way to send ATAPI commands to the device). 2 - Learn ATAPI commands (ATAPI is more or less SCSI commands sent over SATA/PATA layer).

Well, thanks... but I want something already works with FPC, if is possible.

Jorge Aldo G. de F. Junior wrote 8 lines
you are lucky ! a quick search at google returned the following document : http://tools.assembla.com/svn/zalex/FuzzyReader/WNaspi32.pas i dont know the license of this code, but it can be used, at least, as reference...

I do not know what I can do with this code. There are just 4 procedures/funcition...

Marcos Douglas

Marcos Douglas
to stootch: W dniu 13.03.2012 14:13, Marcos Douglas pisze: Take a look at:…
stootch wrote 12 lines
W dniu 13.03.2012 14:13, Marcos Douglas pisze: > Hi, > > Anyone knows how burn a CD using the Windows API (should works in XP and > Vista)? Take a look at: http://blog.delphi-jedi.net/2009/07/18/im-burning-baby/ Porting to FPC/Lazarus (if any) should be straightforward.

Yeah, I saw this before. This code uses JEDI so, maybe works with \packages\winunits-jedi\src sources.

Marcos Douglas

Marcos Douglas
to Leonardo M. Ramé: If you think in the future your app must work in another OSes, maybe a better solution is…
Leonardo M. Ramé wrote 6 lines
If you think in the future your app must work in another OSes, maybe a better solution is to use cdrecord, it has everything you need (CD, DVD, BluRay) . Here's the Win32 version http://www.student.tugraz.at/thomas.plank/ We run it using TProcess, then parse the results and show them on screen.

Interesting. Could you give an example how do you use it, please? You do not translated the headers, just use the binaries, rigth?

Marcos Douglas

Mark Morgan Lloyd
to Marcos Douglas
Marcos Douglas wrote 10 lines
On Wed, Mar 14, 2012 at 7:42 AM, Leonardo M. Ramé wrote: > If you think in the future your app must work in another OSes, maybe a > better solution is to use cdrecord, it has everything you need (CD, DVD, > BluRay) . Here's the Win32 > version http://www.student.tugraz.at/thomas.plank/ > > We run it using TProcess, then parse the results and show them on screen. Interesting. Could you give an example how do you use it, please? You do not translated the headers, just use the binaries, rigth?

cdrecord is generally well-regarded in terms of the number of different drives etc. it supports, but I've always found (on Linux) that it needs a bit of nursing when scanning and selecting available devices. Also there are issues with e.g. Debian forking the project and applying patches which weren't approved by the original author.

Frankly, I think that I'd settle for building a .iso image, and rely on the user having his own software which is known to be compatible with his hardware.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Leonardo M. Ramé
to Marcos Douglas: Interesting. Could you give an example how do you use it, please? You do not translated…

----- Original Message -----

Show quoted text 17 lines
From: Marcos Douglas To: Leonardo M. Ramé ; FPC-Pascal users discussions Cc: Sent: Wednesday, March 14, 2012 12:05 PM Subject: Re: [fpc-pascal] Burn a CD On Wed, Mar 14, 2012 at 7:42 AM, Leonardo M. Ramé wrote: > If you think in the future your app must work in another OSes, maybe a > better solution is to use cdrecord, it has everything you need (CD, DVD, > BluRay) . Here's the Win32 > version http://www.student.tugraz.at/thomas.plank/ > > We run it using TProcess, then parse the results and show them on screen. Interesting. Could you give an example how do you use it, please? You do not translated the headers, just use the binaries, rigth?

I don't have a small example, but basically the process is very simple.

First, you need to create an ISO image with mkisofs, part of the CDRtools bundle, then use "cdrecord -scanbus" to get a list of drives, and the last step is to use cdrecord to burn the ISO image into the drive.

Regarding the 2nd question, I just use the binaries.  
Leonardo M. Ramé
http://leonardorame.blogspot.com

Marcos Douglas
to Leonardo M. Ramé
Leonardo M. Ramé wrote 32 lines
----- Original Message ----- > From: Marcos Douglas > To: Leonardo M. Ramé ; FPC-Pascal users > discussions > Cc: > Sent: Wednesday, March 14, 2012 12:05 PM > Subject: Re: [fpc-pascal] Burn a CD > > On Wed, Mar 14, 2012 at 7:42 AM, Leonardo M. Ramé > wrote: >>  If you think in the future your app must work in another OSes, maybe a >>  better solution is to use cdrecord, it has everything you need (CD, >> DVD, >>  BluRay) . Here's the Win32 >>  version http://www.student.tugraz.at/thomas.plank/ >> >>  We run it using TProcess, then parse the results and show them on >> screen. > > Interesting. Could you give an example how do you use it, please? > You do not translated the headers, just use the binaries, rigth? I don't have a small example, but basically the process is very simple. First, you need to create an ISO image with mkisofs, part of the CDRtools bundle, then use "cdrecord -scanbus" to get a list of drives, and the last step is to use cdrecord to burn the ISO image into the drive. Regarding the 2nd question, I just use the binaries.

I will try.
Thanks for these tips.

Marcos Douglas

Marcos Douglas
to Leonardo M. Ramé: ----- Original Message ----- I don't have a small example, but basically the process is…
Leonardo M. Ramé wrote 26 lines
----- Original Message ----- > From: Marcos Douglas > To: Leonardo M. Ramé ; FPC-Pascal users discussions > Cc: > Sent: Wednesday, March 14, 2012 12:05 PM > Subject: Re: [fpc-pascal] Burn a CD > > On Wed, Mar 14, 2012 at 7:42 AM, Leonardo M. Ramé > wrote: >>  If you think in the future your app must work in another OSes, maybe a >>  better solution is to use cdrecord, it has everything you need (CD, DVD, >>  BluRay) . Here's the Win32 >>  version http://www.student.tugraz.at/thomas.plank/ >> >>  We run it using TProcess, then parse the results and show them on screen. > > Interesting. Could you give an example how do you use it, please? > You do not translated the headers, just use the binaries, rigth? I don't have a small example, but basically the process is very simple. First, you need to create an ISO image with mkisofs, part of the CDRtools bundle, then use "cdrecord -scanbus" to get a list of drives, and the last step is to use cdrecord to burn the ISO image into the drive. Regarding the 2nd question, I just use the binaries.

Today I'm back to this problem.
I downloaded the CDRtools (it need cygwin too).
I burned the files on the CD-R... very good!

But I still have a problem:
The CD or DVD will have many files so, recording may take much time. How do you show to user the progress?

Marcos Douglas

Ludo Brands
to Marcos Douglas
Show quoted text 9 lines
Today I'm back to this problem. I downloaded the CDRtools (it need cygwin too). I burned the files on the CD-R... very good! But I still have a problem: The CD or DVD will have many files so, recording may take much time. How do you show to user the progress?

CDRtfe is a gui front-end for cdrecord written in Delphi. You can find the sources here http://cdrtfe.sourceforge.net/cdrtfe/source_en.html. I appears they show the output of cdrecord in a TMemo. When you launch cdrecord with -v you get the progress in %.

Ludo

Marcos Douglas
to Ludo Brands
Ludo Brands wrote 15 lines
> > Today I'm back to this problem. > I downloaded the CDRtools (it need cygwin too). > I burned the files on the CD-R... very good! > > But I still have a problem: > The CD or DVD will have many files so, recording may take > much time. How do you show to user the progress? > CDRtfe is a gui front-end for cdrecord written in Delphi. You can find the sources here http://cdrtfe.sourceforge.net/cdrtfe/source_en.html. I appears they show the output of cdrecord in a TMemo. When you launch cdrecord with -v you get the progress in %.

I will see, thanks.
To read the Output, I think is better to use this tutorial: http://wiki.lazarus.freepascal.org/Executing_External_Programs#Reading_large_output

Marcos Douglas