Re: How to release an opened file?
From: Marcio Ehrlich (nouser_at_nouser.com)
Date: 01/13/04
- Next message: Jose Perez: "Re: How to reference an assembly created from VS.Net"
- Previous message: Tom Leung: "How to reference an assembly created from VS.Net"
- In reply to: Marcio Ehrlich: "How to release an opened file?"
- Next in thread: Christen Fihl: "Re: How to release an opened file?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 13 Jan 2004 14:33:12 -0200
"Marcio Ehrlich" <nouser@nouser.com> wrote: in message
news:400402e3@newsgroups.borland.com...
> I am trying to adapt the project published in
> http://delphi.about.com/library/weekly/aa112800a.htm to read and write ID3
> tags of MP3 files.
Maybe this must be of interest to people who wants to use the code quoted
above.
Since that is only a tutorial (very interesting anyway), Zarko Gajic
probably didn't worry about some bugs in the code.
I found the problem. After reading the file, the program loads an
TMediaPlayer component with the filename and open it so the user can listen
to the mp3.
So, if the user clicks again on the mp3 file name, the ID3 read routine is
unable to acomplish its tasks since the file is being used by the
TMediaPlayer.
Closing the TMediaPlayer before trying to assing the mp3 file to a
TFileStream or else will solve the problem.
After the reading a/o writing, it is just a matter of openning the player
again.
BTW, the real ID3 tag has this configuration, not the one defined at the
code:
TID3Rec = packed record
Tag : array[0..2] of Char;
Title,
Artist,
Album : array[0..29] of Char;
Year : array[0..3] of Char;
Comment : array[0..29] of Char;
Genre : Byte;
end;
Marcio
- Next message: Jose Perez: "Re: How to reference an assembly created from VS.Net"
- Previous message: Tom Leung: "How to reference an assembly created from VS.Net"
- In reply to: Marcio Ehrlich: "How to release an opened file?"
- Next in thread: Christen Fihl: "Re: How to release an opened file?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|