Solved

How can I get a DeviceID when I user Mediaplayer component??

Posted on 2000-04-11
4
376 Views
Last Modified: 2010-04-04
 When I try to use Windows's Mediaplayer,I have some problem with It.
  Because I must use MCI's function mcisendcommand,I need a MCI deviceID.
  I can get it from DeviceID property ,
When I use TMediaplayer.But,I can't get deviceID when I using the ActiveX component MediaPlayer(this compenent can find from palette of "ActiveX").
  Is someone can tell me :
  How can I current deviceID,when I use windows Mediaplayer component?
0
Comment
Question by:hntangwei
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 2703397
It should work. You must have a device open when you want to use DeviceID: Set the Filename property to a valid media file and call the Open method (or set the AutoOpen property to true).
0
 
LVL 2

Accepted Solution

by:
craig_capel earned 100 total points
ID: 2703411
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, mmsystem,shellapi;

type
  TForm1 = class(TForm)
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormActivate(Sender: TObject);
var
      cct, NumAux : shortint;
  AuxCaps     : TAuxCaps;
begin
  // This will list all multimedia devices and add their names to the
  // radio group that allows for multimedia device selection.
  // Only Auxiliary devices will be displayed (not the main ones).
      NumAux := AuxGetNumDevs;
  if (NumAux <= 0) then
  begin
     application.messagebox('No multimedia devices are present', 'Multimedia Volume', MB_ICONHAND + MB_OK);
     exit;
  end;;
  for cct:= 0 to (NumAux-1) do
  begin
        auxGetDevCaps(cct,  @AuxCaps, sizeof(AuxCaps));
       showmessage(AuxCaps.szPname);
  end;



end;

end.


does this help you in anyway?... :)
0
 

Author Comment

by:hntangwei
ID: 2706579
 My media device has already opened.
  Because I need to use mcisendcommand .I need to get current audio device id. when I try to use mcigetdeviceID function .I doesn't get it.
  Has someone can tell me ,how can I get DeviceID with mciGetDeviceID command?
0
 

Author Comment

by:hntangwei
ID: 2715687
 I can't get a device id when use
MediaPlayer .
  can you tell me ,how can I get
deviceid when I use mcisendcommand?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month7 days, 6 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question