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
Solved

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

Posted on 2000-04-11
4
363 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 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