Einzelnen Beitrag anzeigen

DSFreak

Registriert seit: 24. Apr 2008
9 Beiträge
 
#15

Re: iTunes steuern mit iTunes Type Library

  Alt 1. Jul 2009, 22:25
Hier noch die Kontrollprozeduren, sogar nicht im mIRC-Format

Delphi-Quellcode:
unit Control;

interface

uses
  ComObj,
  Variants,
  Windows;

implementation

procedure play;
var
  iTunes : OleVariant;
begin
  try
    iTunes := CreateOleObject('iTunes.Application');
    if not VarIsNull(iTunes) then begin
      iTunes.Play;
    end;
  except
  end;
end;

procedure pause;
var
  iTunes : OleVariant;
begin
  try
    iTunes := CreateOleObject('iTunes.Application');
    if not VarIsNull(iTunes) then
      iTunes.Pause;
  except
  end;
end;

procedure prev;
var
  iTunes : OleVariant;
begin
  try
    iTunes := CreateOleObject('iTunes.Application');
    if not VarIsNull(iTunes) then
      iTunes.PreviousTrack;
  except
  end;
end;

procedure next;
var
  iTunes : OleVariant;
begin
  try
    iTunes := CreateOleObject('iTunes.Application');
    if not VarIsNull(iTunes) then
      iTunes.NextTrack;
  except
  end;
end;

procedure stop;
var
  iTunes : OleVariant;
begin
  try
    iTunes := CreateOleObject('iTunes.Application');
    if not VarIsNull(iTunes) then
      iTunes.Stop;
  except
  end;
end;

end.
  Mit Zitat antworten Zitat