Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Media player in a dll

Status
Not open for further replies.

Hubba

Programmer
May 17, 2003
6
US
Hi all, Im a newbe so beware... I have been using Multimedia Builder for quite some time, this app uses dll files and Im tryin to make one, a simple mp3 dll (open,play),Im using the MediaPlayer in delphi 7 (will probably get something better later) but this is what I have so far..
------------------
procedure DllOpen; cdecl;

implementation

procedure DllOpen; cdecl;
begin
g_theForm.MediaPlayer1.Stop;
g_theForm.MediaPlayer1.FileName:=g_sScriptString;
g_theForm.MediaPlayer1.Open;
g_theForm.MediaPlayer1.Play;
end;
------------------

Most of this I got from the Delphi 7 help files or what I could understand of em, And im know Im probably way off...
 
I know Im way off, Please atleast point me in the right direction...
 
Here is some help for you.


This is the code I used to play the next song in my listbox using TMediaPlayer.OnNotify:

procedure TForm1.MP3PlayerNotify(Sender: TObject);
begin
if MP3Player.Mode=mpPlaying then
begin
MP3Player.Stop;
MP3Player.Close;
ListBox1.ItemIndex := ListBox1.ItemIndex + 1;
MP3Player.FileName:= ListBox1.Items[ListBox1.ItemIndex];
MP3Player.Open;
MP3Player.Play;
MP3Player.Notify := true;
end;
end;

Brian
"There are 2 kinds of people in the world, those that divide people into two groups and those that don't. I belong to the second group." - tag line I stole
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top