Articles, tutorials and other stuff related to my many doings at Stardock.
Why you should use DXPlayer for your next media player widget
Published on December 16, 2004 By GreenReaper In DesktopX
Note: This article refers to changes introduced in the DXPlayer plugin distributed with DesktopX 2.4. If you don't have that version, upgrade now! (trial version here - registered users can use the support emailer to get a link, or download via Stardock Central like ODNT subscribers)

I know a lot of skinners feel like they have to be programmers half the time. This has been especially true in DesktopX - it seems you have to know VBScript inside-out if you want to do anything really cool. One of the biggest issues people have is in the area of media player widgets - it seems like you have to do an awful lot just to play some music!

Well, the DXPlayer plugin takes the hassle out of creating a media player widget. No longer do you have to work out how to call obscure COM objects, paw through software development kits, puzzle over obscure script errors, or just look on in wonderment at the objects of people who did get it all to work, somehow. You can let DXPlayer do the hard work of talking to the player, while you work on the equally hard (but more fun!) work of making your objects look and feel just as you want them to.


Users can choose the player they wish to control with DXPlayer

But best of all, you don't have to restrict users to just using the player you've written code to support. With DXPlayer, you can make it while using your favourite player, and it works with whatever users choose to use. On your end, you choose from a selection of features, like "Play the current track", "Open a file", or "Display the time left with a gauge drawn using these images". DXPlayer then figures out what player is currently loaded, and makes it so that when the user clicks the play button, it's as if they had pressed play in the current player. If they don't like the player that it chose, they can force it to use any of the supported players installed on their system. It's that simple!

"Wait a minute!", I hear you saying, "How can one system work with all the different media players around? Don't they all do different things?". Well, no! The thing that makes DXPlayer work so well is that due to a certainly amount of what I like to call 'competitive feature-matching' in the media player market, the number of differences between player feature sets is surprisingly small.

Even more conveniently, the more popular a feature, the more likely it is that players will have it! For example, Winamp, Windows Media Player and iTunes all feature a 10-band parametric equalizer. Both Winamp and iTunes offer a pre-amp, and iTunes and Windows Media Player offer a selection of EQ presets, as well as information on the album, artist, genre and composer of a piece of music. Everything has start/pause/stop/next/previous/title/duration, and that's all you need for a basic remote. And if a feature isn't supported on a player, the failure is handled gracefully - for example, lack of volume control would just result in the volume track-thumb not appearing.

For those of you who may have tried DXPlayer and found it lacking in the style department, look again. Recent improvements have allowed the use of native DesktopX text. Yes, that's right - all you have to do is select what you want to display, and then change the DesktopX text settings - including colour, shadows and antialiasing - just as you would do for any other text object. You can convert existing DXPlayer text objects to native text just by ticking the appropriate checkbox in the DXPlayer Display settings window.

Other new features - all backwards-compatible with your old DXPlayer widgets - include:
  • iTunes support!
  • Expanded Winamp and QCD support (duration, position, volume, pan and EQ controls)
  • An internal Windows Media Player control (this means your player widgets can always load and play music, even if there is no media player running)
  • The user settings dialog allowing the selection of a preferred player - even in user mode
  • Numerous other tweaks and requested features

How do you use all these nifty features? Well, instructions on how to use DXPlayer are included in the DesktopX\SDPlugins\DXPlayer.txt file, but basically just select to Add an additional property in the Object Properties window, select DXPlayer, and then click Configure to select what you want that particular object to do - or be, in the case of gauges, displays and the like.

If there's something you want it to do that it doesn't, let me know below!

Comments (Page 1)
3 Pages1 2 3 
on Dec 16, 2004
on Dec 16, 2004
If there's something you want it to do that it doesn't, let me know below!


Well, you asked, so. . .

I would be blissfully happy and my life would be complete (okay, so maybe I am going a little overboard here) if this thing could utilize foobar2000 as the media player.

I don't know about folks here, but there is a pretty sizable foobar2000 community, so I know there are folks who use it, it is open source, really quite customizable, and the sounds quality is second to none really. I haven't used any media player that allows as much control over the way the music sounds. Oh, very resource lite as well.

That is my only real request, some foobar2000 love around here. Thanks for the great work on this though. It has really come a long way.



Edit: This could also address one of the only complaints I have about foobar2000, no real good skin support. You can alter the way it looks to a degree, but none of the freeform stuff like you see for WMP or Winamp. Being able to make widgets that looked like whatever you wanted, and have them run off foobar2000 would really be a hit with the users I think.
on Dec 16, 2004
Thanks for the feedback, BlueDev! I had downloaded Foobar2000 with this idea, but got diverted. I have had a little investigation, and it seems that there is no real interface to support such remote control/information gathering. This means that someone will have to write one. I think it would have to be someone in the Foobar2000 community as I do not know the API, and really am not all that interested in writing both sides of an interface, one of which I don't know at all.

There is a recent forum posting on the subject. I would highly encourage you and anyone else who wishes for Foobar2000 support to be in DXPlayer to chime in there. The more users want it, the more incentive there is for the Foobar2000 community to develop such an interface.

For the time being you may find the foo_winamp_spam or foo_remote plugins of use (to pretend that it is Winamp), but I understand that support for this interface is limited - the plugins do not implement everything. Having tried foo_winamp_spam quickly I can say that you are not able to set progress or read/write volume with it, but you can control what music is playing which may be enough . . . for now.
on Dec 16, 2004
Thans for the reply GreenReaper. Not knowing that much about it I just figured it was worth tossing out. I will head over there and try to drum up some more support for it from the community.
on Dec 16, 2004
It was indeed worth your time.

I get the feeling that the community there is pretty responsive and eager to get new users and please existing ones if possible - I guess we'll have to see how it turns out. For now, the foo_winamp_spam plugin seems to work well enough for most things.
on Dec 17, 2004
What I really would like to have when playing media is a cd-cover plugin or some script like there is for samurize. http://www.samurize.com/modules/mydownloads/singlefile.php?cid=18&lid=1373
on Dec 17, 2004
Hmm. Well, I know iTunes can have artwork associated with a track, as can WMP (although it's a bit more tricky to get it out with that). I'll have a look at the plugin and see what it does, and see if it's possible to add something like it (looks like it checks directories and the internet too - the "search the internet" thing might not be so possible for legal concerns, but files on your disk are fair game).

The end result if implemented would probably be an object that had the picture property of the current state set to the current album each time it changed.

Thanks for the suggestion!
on Dec 17, 2004
Thank you for the great info
on Dec 17, 2004
Only request I'd make is to be able to rate and show song ratings in an object. This is an excellent plugin!
on Dec 17, 2004
Good idea. I had that on my personal list already, had just ran out of time. Do you have any suggestions as to how to show it? I was thinking of just having it as another gauge (and you could make an image that was 5 stars wide) but I am open to suggestions.
on Dec 17, 2004
I would suggest a 2 image bit strip of star (for example) just showing on and off state, it might make it easier to rate songs via the plugin and would also allow for more or less than 5 stars.
on Dec 17, 2004
I tink it is possible to have the lyrics in the metatags of some media formats (.wma and maybe some mp3). Can the current DXPlayer have access to it? If not, I think it could be an interesting addition.
on Dec 17, 2004
Well, it would probably work the way gauges do now - you would provide two images, a background and a foreground, and the foreground would used linearly from 0 to 100% - so wherever you clicked it would be rated that good. So whether there are 5 or 10 or no stars would be up to the designer and it could be whatever size they wanted - the images just have to fit. However it might decide to only take input or show output in (say) 10% chunks - so that it could give 3 or 4.5 stars but not 1.242 stars. I figure an 11-point rating system (0 to 10) is enough for most people.
on Dec 17, 2004
paxx: There are indeed the WM/Lyrics and even WM/Lyrics_Synchronised attributes. The former may be available as part of a CD track. I don't know how widespread they are, though - I will have to have a look.
on Dec 17, 2004
I like the new "internal" use of WMP - but the only problem there is the lack of a playlist editor. I noticed that it does create it's own playlist, so I guess we could create our own proprietary editor's - but it would be very cool if it was integrated into the plug-in somehow (don't even know if that is possible).

Having said that, this is a great step forward for this plug-in and after dilly-dallying around with scripting for the wmp activex control I am looking forward to creating a dx media player using it.

One other thing - wouldn't it be cool to be able to pass parameters to dx widgets and then we could associate file types with them and have them run automatically, or add files to a playlist, by clicking on the music files directly from windows explorer?
3 Pages1 2 3