How To Make A Simple Media Player In Visual Studio 2010

How To Make A Simple Media Player In Visual Studio 2010
Download Microsoft Visual C++ 2010 and start making your first cd player program.It is very simple cd player project in visual C++ 2010.It is built using windows form application with 5 or more buttons doing their respective tasks.Visual C++ 2010 makes everything very easy,everything is given just drag and drop events and write their respective tasks.This program only shows that if media file is entered in cd room than you can play , pause , stop and eject your media file.And don’t worry about the header file ##pragme once it is built in file.

#pragme once
#include<iostream>
#include<conio.h>
#include<cdtring>
using namespace System;
ref class cdplayer
{
  staticint pwr;
  staticint act;
  staticint tray;
  staticint med;
  staticint a;

		  String^ s1;         //object of type string

		public:
			cdplayer(void);
               String^ pushPower()
	       {
		if(pwr==0)
		    {
			pwr = 1;
                        s1= "Powered"
		    }
		else if(pwr == 1)
		    {
			pushStop();
			pwr=0;
			    s1= "Power Out";
		    }
return s1;
	        }

            String^ pushEject()
	    {
		if(pwr==0)
		    {
                    s1= "No Power";
		    }
		else if(pwr==1)
		    {
			if(tray==0)
			    {
				tray=1;
				  s1= "Tray Open"
			    }
			else if(tray==1)
			    {
				tray=0;
				    s1= "Tray Closed";
			    }
		    }
return s1;
	    }

            String^ pushPlay()
	    {
		if(pwr==1)
		    {
			if(tray==0 && med==1)
			    {
				act=1;
				   s1= "Now Playing";
			    }
			else if(tray==1 || med==0)
                             {
				if(tray==1)
				    s1= "First Close the Tray";
				if(med==0)
				    s1= "No Media Loaded";	
			    }
		    }
		else if(pwr==0)
			    s1= "No Power";
return s1;
	    }

            String^ pushStop()
	    {
		if(pwr==1)
		    {
			if(act==1)
			    {
				act = 0;
				    s1= "Stopped";
			    }
else
                    s1= "Not Playing";
		    }
		else if(pwr==0)
		    {
                    s1= "No Power";
		    }
return s1;
	    }

            String^ loadUnloadMedia()
	    {
		if(pwr==1)
		    {
			if(tray==1)
			    {
				if(med==1)
				    {
					med=0;
				        s1= "Media Unloaded";
				    }
				else if(med==0)
				    {
					med=1;
					    s1 = "Media Loaded";
				    }
			    }
			else if(tray==0)
			    {
				    s1 = "Tray is Closed";
			    }
                }
else if (pwr == 0)

                    s1 = "No Power";
                }
return s1;
            }	
};

Here is the output of this program :

{post

Let's Discuss