|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionProrgammers are lazy, we all know that. Whenever we come across some API we want to make a wrapper for it in order to use it more easily. Microsoft wrote its "Foundation Classes", and every day someone posts an article about his own new wrapper class here on CodeProject.com. I have also decided to do so. I needed to control my Winamp2 from another app, and after doing some research if finally found the fine Winamp2 API documentation. But after a few minutes I was tired to type all those My main goal was to keep the wrapper simple as possible, so that even beginners would have no problems using it. The result is one single header-file that needs to be included to your workspace. No more! Now let's start, I'll explain the most important steps and functions. Using the winamp2 wrapper classUsing this class is easy as can be. Just CWinamp amp // create the wrapper variable named "amp" Before you can use all the functions you need to There are so many functions that I don't want to explain them all in detail. These are probably the most important ones: void Previous(); void Next(); void Play(); void Pause(); void Stop(); const char* GetCurrentTitle() Should be self-explanatory I hope :-) So if you want to go to the next track just call the CWinamp amp; if(amp.FindWinamp()) { // Winamp has been found, play next track amp.Next(); } The functions all have names that explain what they do, e.g. int GetVolume(); void SetVolume(int volume); int EQGetData(int band); void EQSetData(int band, int value); int EQGetPreampValaue(); The Note: For some reason, Winamp does NOT refresh the equalizer bars during runtime, but the changes are applied. You need to ConclusionI'd say this is everything you need to know in order to understand the class. If you have any futher questions, feel free to post a comment or send me a mail. The class has been successfully tested with Winamp 2.81
|
||||||||||||||||||||||