Solved

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

Posted on 2000-04-11
4
354 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
Comment Utility
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
Comment Utility
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
Comment Utility
 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
Comment Utility
 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Master Detail with TADODataset 4 94
Thread safe  opinion 7 109
Help on project with Soap 10 42
select query - oracle 16 81
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now