Winter Visualization for Windows Media Player in C++

Sign in to queue

The Discussion

  • User profile image
    Davon Muchett

    this visualization is off the hook i believe this is the best visualization ever if i could just take the whole world of it i would.

  • User profile image
    Davon Muchett

    this is totally off the hook every one should have this i even hate it because i love it its davon yow!!!!!!!!!!!!!!!!!!!

  • User profile image
    Richard Haaf

    Thank you Paul-Valentin,

    A few weeks ago my development machine with Visual Studio .NET, Media Player 10 and Media Player 10 SDK died.  This was replaced with a new machine with Visual Studion 2005 and Media Player 11.  I've been trying for weeks to figure out how to get the Project wizard in the 2008 Windows SDK to work with Visual Studio 2005.  The Microsoft documentation doesn't give a clue how to do this.  Your explaination gave me all the info I needed to get it to work.  As an added plus, you described exactly what I've needed to get off-screen buffering to work.

    Many Thanks!!

  • User profile image
    Adriana

    Last year I was doing an engineering project for  my Science Fair Project. I wanted to create a Music Visualization and this tutorial saved my grade and project. Thank you!

  • User profile image
    Martin

    It looked like fun project, but unfortunately Visual Studio could not load the Windows Media Player Plug-In Wizard.

    Running Windows XP, Visual Studio C++ 2008 Express, SDK version 6.1. I have changed the path-adresses accordingly - that is equivalently to your description. Get the fail message on status bar at the bottom of the Studio: Creating Project ....  project creation failed. What can I have done wrong?

  • User profile image
    Clint

    @Martin, looking into it.

  • User profile image
    Paul

    @Martin,

    Have you installed the 2003 R2 SDK also? Although it's similar with the SDK for Vista, you need to install that in order to make it work. However, those steps for changing paths are only required for the Express editions -- if you have a standard or higher version, there's no need to make those.

    Do you have a more clearer error message than "creation failed"?

  • User profile image
    Paul

    @Martin,

    Have you installed the 2003 R2 SDK also? Although it's similar with the SDK for Vista, you need to install that in order to make it work. However, those steps for changing paths are only required for the Express editions -- if you have a standard or higher version, there's no need to make those.

    Do you have a more clearer error message than "creation failed"?

  • User profile image
    Martin

    I found 2003 R2 SDK, and it did not install, stating I already have got the latest version of the plug-in program. Same result as before.

    And no, sorry, "creation failed" is the only message I get. It is a small, almost not notable message, at the bottom part of the Express window.

  • User profile image
    Gautham G

    I installed the windows media player plug-in wizard. Got Windows SDK (newer version of platform SDK)... When I create a new project and select the wizard, it opens up an IE page, but it says it can't find the webpage i'm looking for.

  • User profile image
    Alan Z

    well im having trouble, but not with the installation and the other things.

    anyway when i finished writing the code for the Initialization part of the tutorial and i went 2 build the code i get the undeclared errors so then i go and add the #include "WinterVisualization.h" all the errors go away but then i get another error saying that it can't open the include file. so im wondering what i need 2 do that will hep me get past the problem.

    So does anyone know how i can declare all the undeclared units or what ever you want to call them?

    or can some one give me a link to a working code of this visualization, or even a screen shot or even email me the code.  

  • User profile image
    Clint

    @Lachlan I emailed Paul, he is currently out of the country for two weeks.  If you email me (code4fun@microsoft.com), I'll email you when I get the files.  I'll also update the post with new links on our server.

  • User profile image
    Clint

    Fixed!  Source now lives on the Coding4Fun server.  Sorry about that.  http://coding4fun.net/source/WinterVisualization.zip

  • User profile image
    Phil Rogers

    This is an excellent demonstration of how to create a visualization.  Thanks.  I only came looking for how to get the WMP SDK to work with VS2005, but ended up with a great head start on creating a visualization.

    By coincidence it's snowing outside, so the example is so appropriate!

  • User profile image
    Phil Rogers

    I built this visualization and then ran WMP 11.

    It appeared in the visualization menu, and I selected it.

    However, the visualization client area is not repainted after selecting it, so the menu is not removed until I start playing some music and the first call to Render occurs.

    I noticed the same thing happens if I open anything else that covers the visualization client area, such as the About Box.

    I created a default visualization using the Wizard in the SDK and that works as expected.  I compared the code of the two projects and there's nothing obviously missing from the Winter Visualization, so why is it not refreshing the client area correctly?

  • User profile image
    Paul V. Borza

    Hi Phil,

    I haven't been playing with Windows Media Player visualizations since 2007, so my advices might not be as accurate as you'd expect. However, the rendering has to occur once the song starts playing (and it does from what you're saying). In a visualization, you have to take care of all the drawing that occurs in the specified rectangle, or the surface; that includes, taking care when user is resizing the window, right-clicks the surface and the menu appears etc.

    Usually, when you right-click, and event will be fired up telling you the invalidated region that needs repainting (the menu that you're talking about).

    First, try to see if you have the same behavior on a different machine. If you do, investigate the following:

    * has the visualization been created before playing a song (is the constructor being called, and the rendering performed);

    * has some event changed (it's been three years since I've published the article -- are you using Windows 7, a different SDK version perhaps);

    * are the events that I was using now deprecated and no longer being called properly.

    Try to attach to the WMP event and debug it to see what happens; use breakpoints in some key functions and see whether those functions are called after you right-click in the drawing area.

    If everything fails, try to reproduce the same behavior using a computer that runs Windows Vista, and be sure you use Visual Studio 2005 together with all additional dependencies.

    Thanks,

    Paul

  • User profile image
    Clint

    @Phil Rogers  Contacting Paul-Valentin to see what is up.

  • User profile image
    Phil Rogers

    Thanks for the tips.  I'll give them a try.

    I guessed it must be something to do with invalidated rectangles and events etc.  I'll just have to do some experimenting.

    Phil

  • User profile image
    Clint

    @nkateko, try the download link again at the top of the page.

  • User profile image
    nkateko

    i need winter vusualisation for my windows 7 windows media player

  • User profile image
    Clint

    @Alan Z, confused by your last statement, you don't want to increase the list but you want to add more?

  • User profile image
    Alan Z

    so i got it working and i have been exploring and modifying the code as i see fit. the one thing that i have been trying to do and with no success yet in adding more visualizations to the list, by that i mean other choices other then Snow Flakes and Snow Flames. also with out increasing the list in the Visualization list.

  • User profile image
    Alan Z

    So what I'm trying to say is that I don't want to increase the list of categories, meaning that i don want to add more to the Album Art, Alchemy, Bars and Waves, Battery, and Winter, list (the only categories that I have in my Windows Media Player). I want to add more choices in the category, meaning I want other selections in the Winter category other then Snow Flakes and Snow Flames.

  • User profile image
    Alan Z.

    So the menu I don't want to increase is the main visualization menu, I don't want to add more categories to the main list of visualizations, meaning I don't want to add more to the Album Art, Alchemy, Bars and Waves, Battery, Winter, list. I want to add more selections with in the Winter category, I want more choices other then Snow Flakes, and Snow Flames.

  • User profile image
    Paul V. Borza

    Hi Alan,

    You'll have to change the following:

    1. Open WinterVisualization.rc with the visual editor (if you open the source file, you'll also have to modify resource.h by hand) and add IDS_NEWPRESET "My New Preset Name";

    3. WinterVisualization.h:31 (duplicate the enum value and change it to something like NEW_PRESET);

    4. WinterVisualization.cpp:515-517 (duplicate those lines and make the necessary changes in the switch/case);

    5. Search for "PRESET_FLAME" and whenever you find it in WinterVisualization.cpp duplicate those line and make whatever change you wish (like making the snowflakes green).

    I believe that's enough to add another option under the winter menu item. If you have additional questions, please leave a comment and we'll get back to you.

    Thanks,

    Paul

Add Your 2 Cents