Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

722 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