Home > Enterprise >  Delphi 2007 - Using TMediaPlayer for non-media applications
Delphi 2007 - Using TMediaPlayer for non-media applications

Time:10-23

I needed a control with Run, Stop and Step buttons and thought I would put a TMediaPlayer to work. It has the buttons I need and I can control the enables and use of colour.

If I drop one onto a form and compile and run - the buttons are all disabled. I unchecked the AutoEnable property and now the buttons are enabled when I run, but as soon as I click any of them I get an error No MCI Device Open.

I get that it's a media player and I haven't told it anything about any media, but is there a way of getting it to run in a media-free environment?

CodePudding user response:

If your question is whether you can use TMediaPleyer buttons to control other things then I'm afraid the answer is NO.

The mentioned buttons are part of TMediaPlayer component itself and are only designed to control the Media Control Interface (MCI) driver.

Their purpose is to make working with MCI driver much easer as you don't need to link bunch of your buttons to the TMediaPleyer component as you would have to do otherwise.

So I'm afraid you will have to make your own set of buttons to do your thing.

You might want to learn about TRadioButton to see how to group multiple buttons together in a way so that only one of them can be pressed down at one time to mimic some functionality of TMediaPlayer buttons.

  • Related