Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Funkymunky

Windows Media Player

This topic is 5220 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I''m trying to make a program for the LAN we have in my apartment here. We have one computer hooked up to some monster speakers which we use to play music at parties. We also have my computer with generic speakers and a laptop that sits in the living room. What I want to do is make a program that can control windows media player across the network. I think I can do the network programming pretty easily, but I can''t figure out how to mess with WMP. I downloaded the windows media series 9 SDK stuff, but can''t make any sense of how to use it. specifically, my call to CoCreateInstance to create the server object returns REGDB_E_CLASSNOTREG. Any help on using the SDK for simple stuff like playing/pausing/stopping a file and editing playlists? Could I maybe do it some other way, like with SendMessage calls or even command line options? Any help will be greatly appreciated by me and my roommates.

Share this post


Link to post
Share on other sites
Advertisement
I''d I''d I''d.. I''d just send commands over the network, and let the other side (the clientside) read those commands and work with WMP.

--
You''re Welcome,
Rick Wong

- sitting in his chair doing the most time-consuming thing..

Share this post


Link to post
Share on other sites

#!perl
# achtung: quick and messy server
use IO::Socket;

$PLAY = 0x1;
$STOP = 0x2;
# etc.

$server = IO::Socket::INET->new(LocalPort=> $server_port,
Type => SOCK_STREAM,
Reuse => 1,
Listen =>10)
or die "Sorry: $@\n";
while ($client = $server->accept()){
$server->recv($data_read, $maxlen, $flags) or die "Error.";
if($data_read == $PLAY){
system("wmplayer /Play myplaylist.wpl")
}
else if($data_read == $STOP) {
system("wmplayer /Stop");
}
else {
# more commands
}
}
   
#!perl
#achtung: messy messy client
use IO::Socket;

$PLAY = 0x1;
$STOP = 0x2;

$socket = IO::Socket::INET->new(PeerAddr => $remote_host, PeerPort => $remote_port,
Proto => 'tcp',
Type => SOCK_STREAM) or die "Error: $@\n";

print $socket "$PLAY";
print $socket "$STOP";
#...
close($socket);


[edited by - flangazor on April 5, 2004 1:15:27 PM]

[edited by - flangazor on April 6, 2004 7:18:38 AM]

Share this post


Link to post
Share on other sites
WMP is an ActiveX Control (Correct me if am wrong guys), so you can host it in your own app. Have another thread in the same app that listens to network calls and translate those calls to control the ActiveX Cntrl. One caveat is that you should always control the activex control from the UI thread. Using C# simplifies your prorgramming a lot. I think there may be some articles on codeproject.com with regard to using the WMP in a C# app. Good Luck.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Maybe the multimedia API...try searching for MCI Functions in ms sdk (pretty sure it plays video and audio).

You can also play with the winamp sdk, it is pretty easy to use.

Share this post


Link to post
Share on other sites
You can do it in VC++ too. Create a MFC Dialog App and import the ActiveX Control. MFC will generate wrapper classes (extends COleDispatchDriver I think) for your ActiveX Control and you could call the methods (like Play...) on these Wrapper Class to control your WMP. Check out Programming in Visual C++ book by Dave Kruglinski which has an example on how to import an Activex Control into a VC++ app. You still have to use Winsock on another thread to listen to connections and invoke the methods on the wrapper class.

Share this post


Link to post
Share on other sites
Also do you have to use WMP? Why not WinAmp? WinAmp comes with its own SDK and the last time I looked at it, it uses SendMessage calls to control it. I think the SDK had samples as to how you could use it and I remember someone providing a remote control interface to the player using SendMessage calls. It will simplify your task to a great extent. Just a thought.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!