KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Roll your own Media Player - Kixforms Media Player

 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Aug 09, 2007 10:14 pm    Post subject: Roll your own Media Player - Kixforms Media Player Reply with quote

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 ...



kmp.kix
 Description:
Kixforms Media Player

Download
 Filename:  kmp.kix
 Filesize:  104.87 KB
 Downloaded:  917 Time(s)



Last edited by Shawn on Mon Aug 13, 2007 4:49 am; edited 3 times in total
Back to top
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Thu Aug 09, 2007 11:10 pm    Post subject: Reply with quote

I just rocked out to one of songs using KMP. Awesome work, Shawn! Kudos!
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Aug 09, 2007 11:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Aug 09, 2007 11:21 pm    Post subject: Reply with quote

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:



shot2.png
 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:  16928 Time(s)

shot2.png



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

shot1b.png



shot1.png
 Description:
This is the finished product:
 Filesize:  60.96 KB
 Viewed:  831 Time(s)

shot1.png


Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Aug 10, 2007 2:11 am    Post subject: Reply with quote

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
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Aug 10, 2007 3:50 am    Post subject: Reply with quote

Here's a good link for working with WMPlayer.OCX and working with PlayLists ....

Using Scripts to Manage Your Music Files and Playlists
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Aug 10, 2007 2:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group