Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2000-04-11
4
Medium Priority
?
399 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

971 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