unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,SongsDB_TLB,SongsDBEvents, StdCtrls, ComCtrls, XPMan;
type
TfrmMediaMonkey =
class(TForm)
lstPlaylist: TListView;
Button1: TButton;
lblPlaylist: TLabel;
btnStop: TButton;
lblStatus: TLabel;
XPMani: TXPManifest;
procedure FormCreate(Sender: TObject);
procedure GetStatus;
procedure OnMMStatusChanged(Sender:TObject);
private
{ Private-Deklarationen }
MM:ISDBApplication;
MMEvents:TSongsDBISDBApplicationEvents;
public
{ Public-Deklarationen }
end;
var
frmMediaMonkey: TfrmMediaMonkey;
implementation
{$R *.dfm}
procedure TfrmMediaMonkey.FormCreate(Sender: TObject);
begin
MM:=CoSDBApplication.Create;
MMEvents:=TSongsDBISDBApplicationEvents.Create;
MMEvents.OnPlay:=OnMMStatusChanged;
MMEvents.OnPause:=OnMMStatusChanged;
MMEvents.OnStop:=OnMMStatusChanged;
MMEvents.Connect(MM);
GetStatus;
end;
procedure TfrmMediaMonkey.OnMMStatusChanged(Sender:TObject);
begin
ShowMessage('
Status changed');
GetStatus;
end;
procedure TfrmMediaMonkey.GetStatus;
var Status:
string;
begin
Status:='
';
if MM.Player.isPlaying
then
Status:=Status+'
Playing'+sLineBreak
else
Status:=Status+'
Stopped'+sLineBreak;
if MM.Player.isPaused
then
Status:=Status+'
Paused'+SlineBreak;
lblStatus.Caption:=Status;
end;
end.