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 2)
3 Pages1 2 3 
on Dec 17, 2004
Mmm, the playlist problem is an issue. One possibility is that I just make one big object that has one. I don't think that's a particularly good idea, but it's an option. Another is that I make "Current Playlist Object +/- 0/1/2/3 . . ." text objects. These would change text each time you modified the playlist or moved around in it (including automatic progression). You could scroll up and down either with buttons or a slider/gauge, and clicking on an item would probably select, double-clicking would play (or maybe just one of those would be possible, in which case I'd probably have it select and play it). Does that idea sound reasonable, or are there any flaws that you can see in it? (note that there are already move up/down/delete item buttons)

I like the parameter idea, I don't think DX does anything like that right now but I'm sure it would be possible . . . will suggest it.
on Dec 18, 2004
I am not sure I fully understand what you mean about the "Current Playlist Object +/- 0/1/2/3 . . ." text objects. Is the "current playlist object" seperate from the "currently playing object"? I agree tho that componentized method of playlist depiction would offer the greatest degree of flexibility in overal design.

If it's possible I would go with click to select and double click to play - it would facilitate editing the playlist order and deleting playlist items without constantly skipping to a new track. Maybe the playlist objects could have a number of different states such as: "unselected", "selected", "playing" and "playingselected" so we could define font charecteristics for each of those seperate conditions, if that makes sense.

Another usefull feature in a media player is the ability to drag and drop files to add to/replace the current playlist. This is the method by which I prefer to populate my playlists whichever media player I happen to be using.

And finally back to the parameter idea - this feature would basically enable us to turn widgets into proper little apps. The implications are not just limited to media players. For example we could create a "todo list" widget with the ability to save data to it's own specific file extension and subsequently load those lists automatically from explorer at any given time. Or we could save lists of wallpapers from our "wallpaper changing widgets", or appointments from calendars, or... etc.

Anyway, I appreciate your efforts in developing the media plug-in and your willingness to engage with the community. Thanks alot.
on Dec 18, 2004
What I meant with the current playlist was that if you look at a playlist it is basically something like this, where each of the objects had the DXPlayer display type and state in the parentheses:

(Selected - 2) Pink Floyd - Money
(Selected - 1) Kermit - It's Not Easy Being Green
(Selected+Playing state) Various - The Crystal Method
(Selected + 1) REM - Losing My Religion
(Selected + 2) Spirited Away - Chihiro's Theme

The Crystal Method is selected here. If we moved onto the next track (either with a "shift playback to next track" button or automatically), it would go onto:

(Selected - 2) Kermit - It's Not Easy Being Green
(Selected - 1) Various - The Crystal Method
(Selected+Playing state) REM - Losing My Religion
(Selected + 1) Spirited Away - Chihiro's Theme
(Selected + 2) Art Garfunkel - Bright Eyes

If you clicked on the one behind the currently playing one, it would probably change to:

(Selected - 2) Pink Floyd - Money
(Selected - 1) Kermit - It's Not Easy Being Green
(Selected) Various - The Crystal Method
(Selected + 1 + Playing state) REM - Losing My Religion
(Selected + 2) Spirited Away - Chihiro's Theme

I agree with the states idea, if it can be done that way.

Drag and drop . . . hmm. May be possible. I will ask. Right now I think that would involve subclassing the window which is something I'd like to avoid if possible, but it may not come to that. Right now the Playlist window for the WMP object is drag-droppable onto, I could just make it show that in all cases, not just when the playlist is empty.
on Dec 18, 2004
hehe, interesting example playlist you came up with there btw

In your first example above, let's say you click on Pink Floyd (and why wouldn't you as it's a great song?) and it was the first song in the playlist. Would then selected-1 and selected-2 become empty strings? Maybe there could be another object state, "undefined", in which we could place a string of our choosing such as "******" or an empty string or whatever?

As for drag-dropping - your preferred solution sounds totally fine, just as long as we can drag into something it doesnt particularly matter what it is.
on Dec 18, 2004
That's just a random selection of songs from my playlist.

Typically empty strings (or rather, invalid strings) become --- in DXPlayer, but setting an undefined state is another possibility.
on Dec 18, 2004
I'm glad to see anti-aliasing of text is finally incorporated into DXplayer. This was one of the major drawbracks (in my opinion) of previous versions which got me started using Tiggz's brilliant WMP script. Another reason was his implementing of the drag-and-drop of playlists. I'm with Tiggz in the need for this feature to be added to DXplayer. With that included I believe DXplayer will be a great little sub-program.

Thankyous to all involved with DesktopX and the continuing development of it and DXplayer. I'm off to try out the update.
on Dec 22, 2004
OK. I have implemented clip rating as gauges, sliders, faders and text display. This feature is supported by iTunes, WMP (internal) and Winamp 5.04+ (with the Media Library), although there is a bug in the Winamp handling of setting - DXPlayer-altered ratings will only show up correctly in the media library after restarting Winamp.

Using either 5 or 10 stars works well for gauges (there are 11 "notches", from 0 to 10). If not set manually, the WMP rating will be derived from the number of times the clip has been played.

This feature will be in release 1.63 of DXPlayer and higher.
on Jan 10, 2005
GreenReaper: Any plans on adding the ability to display Album art?
on Jan 10, 2005
sranshaft: Given the comments above, I've looked at it. I think I know how I would go about it. I have other projects that I am working on currently, and the visualization/video window container is the first thing I intend to add when I resume work on DXPlayer, but it's not been forgotten.
on Jan 12, 2005
I don't know if this is doable, but I'd really appreciate to be able to set DXPlayer as my default player, so that when I click on any media file, it opens directly using my widget. So I would need a script function able to detect when the player is fired or not...
I hope you'll have your visa very soon GreenReaper, you have so much work to do
Good luck for you,
Best regards
on Mar 14, 2005
Woodbridge dragged article back from the depths of page X


If this plugin is still looking for new things to do, then I have a couple of suggestions. I stopped making a Media widget because I couldn't get it do two thing (these may be possible via DX script, but its far beyond my scripting knowledge).

I was messing around with a script to display album art, but I wanted it to display the album art that I've already got in each album folder. What I'd like to see in the plugin is to output the location/path of the currently playing song, this way it would be easy *famous last words...* to display the album art (e.g. folder.jpg). The plan was, if that folder.jpg wasn't avavialbe then it would download one from Amazon, and save that album art as folder.jpg inside the song's folder.

The other (very minor) thing was mouseover states. I wanted to have mousestate for a single button that had the play/pause/resume function. Each of the above states had their own image, but I couldn't get each state to have its own mouseover image. Am I loosing the plot and missing something obvious, or can this not be done?
on Mar 14, 2005
In the future (read: probably not immediately ) we will be looking to provide the first option (and various other bits of info) directly via scripting. If you have the new DX beta, you may have noticed the new scriptable email plugin - this sort of thing could be extended to give access to most of the features now offered by the plugin. I've not been asked to work on DXPlayer right at this very moment, but I suspect when it gets more attention that will be one of the features added.

AS for the mouseover image, I don't know of an ideal way to do that, but one workaround might be to have a non-activatable object that was normally transparent but who's image was set to something specific when the state of the button changed to one of the DXPlayer states (should be able to detect this in script on the DXPlayer object), and which was made visible when the mouse over state was given (and which became invisible again when the mouse leave state. So, the DXPlayer object would handle the normal states, and this special object would display and handle it when it was mouseovere'd. Haven't tried this, though.
on Mar 14, 2005
Ok, I think I can see how that would work, thanks for the reply

I'll hold fire on the media widget for now. I best tart up my other widget to be ready for the DX3 release.
on Mar 15, 2005
not sure if its been said .. but "dials" .. not sliders would be nice. i had a few retro style of players ready but for the life of me couldnt get the dials to control volume etc... ..

VU meters or a spectral analyzer. that way we can make meters or visual plugins that respond to a beat, like speakers that move with the music ...
on May 28, 2006
mztlkqhp whlu bnzcew ylqpi xomnb lytpqn zjeqoth
3 Pages1 2 3