View previous topic :: View next topic |
Author |
Message |
Shawn KiXforms Developer


Joined: 22 Feb 2003 Posts: 1983 Location: Canada
|
Posted: Thu Aug 09, 2007 10:14 pm Post subject: Roll your own Media Player - Kixforms Media Player |
|
|
Windows Media Player exposes a COM interface that is usable from scripts. The object is called WMPlayer.OCX and to be honest - I dont recall seeing anybody ever use the thing (with Kixtart I mean). It provides the "basic" functionality of playing, pausing, stopping, setting the volume - all you have to do is wrap the whole thing in a cool GUI interface.
I choose to use the standard windows media player GUI. It had a nice look-and-feel and was relatively easy to convert to Kixforms. I used print-screen to take screen-shots - then used MSPaint to "rip" the graphical elements into individual components (buttons, sliders etc) - tedious ? yup!
One of the problems I think is that since WMPlayer is an OCX (a windows control meant to be plugged into a "form") ... that calling it without the form/window context can cause issues. In fact, my first attempt at just scripting the object without a form failed miserably - It was the magic of the "DoEvents" loop that finally breathed life into the object.
Anyways here's something new ... not all features are available ... enough to have some fun and fire the imagination ... click the "File Open" button at the top to start things off ...
Description: |
|
 Download |
Filename: |
kmp.kix |
Filesize: |
104.87 KB |
Downloaded: |
915 Time(s) |
Last edited by Shawn on Mon Aug 13, 2007 4:49 am; edited 3 times in total |
|
Back to top |
|
 |
pearly KiXforms Aficionado


Joined: 27 Jan 2004 Posts: 332
|
Posted: Thu Aug 09, 2007 11:10 pm Post subject: |
|
|
I just rocked out to one of songs using KMP. Awesome work, Shawn! Kudos!
|
|
Back to top |
|
 |
Shawn KiXforms Developer


Joined: 22 Feb 2003 Posts: 1983 Location: Canada
|
Posted: Thu Aug 09, 2007 11:13 pm Post subject: |
|
|
lol - fun stuff eh ? Just found an issue when loading more than one song - the "current play list" grows by one - need to trim it to one song I think. Going to see if one can implement a quick play-list selection feature.
|
|
Back to top |
|
 |
Shawn KiXforms Developer


Joined: 22 Feb 2003 Posts: 1983 Location: Canada
|
Posted: Thu Aug 09, 2007 11:21 pm Post subject: |
|
|
By the way, prolly best to use the latest Kixforms.Net development build for this ... not sure if its absolutely required but doesn't hurt.
For those that don't want to bother downloading here's some screen-shots:
Description: |
Here's the bitmap strip for the Play button - this gets loaded into an ImageList. The buttons are actually Labels - not Buttons. |
|
Filesize: |
5.1 KB |
Viewed: |
16880 Time(s) |

|
Description: |
Here's the basic underlying form - without all the controls layered-in on top - notice no volume slider. |
|
Filesize: |
36.34 KB |
Viewed: |
859 Time(s) |

|
Description: |
This is the finished product: |
|
Filesize: |
60.96 KB |
Viewed: |
829 Time(s) |

|
|
|
Back to top |
|
 |
Shawn KiXforms Developer


Joined: 22 Feb 2003 Posts: 1983 Location: Canada
|
Posted: Fri Aug 10, 2007 2:11 am Post subject: |
|
|
I hate playlists. Giong to use a folder-based playlist idea. Plus - gives me chance to use those new ListView sorting features. By the way - I left a "debug tracer" in the last dev build - fixing that ListViewItem constructor issue - removed now.
|
|
Back to top |
|
 |
Shawn KiXforms Developer


Joined: 22 Feb 2003 Posts: 1983 Location: Canada
|
|
Back to top |
|
 |
Shawn KiXforms Developer


Joined: 22 Feb 2003 Posts: 1983 Location: Canada
|
Posted: Fri Aug 10, 2007 2:59 pm Post subject: |
|
|
Uploaded a new version that supports a folder-based playlist. Clicking the folder button at the top opens-up the FolderBrowserDialog now - then the ListView (PlayList) is populated with the folder contents. Then one can click-and-play from the list.
|
|
Back to top |
|
 |
|