All pastes #260105 Raw Edit

Unnamed

public text v1 · immutable
#260105 ·published 2006-11-28 00:48 UTC
rendered paste body
/* ========================================================================== */
/*                                                                            */
/*   main.cpp                                                                 */
/*   wildinc (c) 2006 Author                                                  */
/*                                                                            */
/*   Description                                                              */
/* simple media cente                                                         */
/* ========================================================================== */
#include <iostream>
#include <conio.h>
#include "audiere.h"
using namespace audiere;
using namespace std;
int main(int argc, char *argv[],int d = 1)
{
cout<<"Wildinc's music player"<<endl;
cout<<"----------------------";
cout<<endl<<endl<<endl;
cout<<endl<<"This Mp3 Player is Wriiten in C++ and "<<endl;
cout<<"uses the Aduiere API and classes.This Music  "<<endl;
cout<<"Player is capable of playing a lot of file formats";
cout<<endl<<"including .MP3 , .WAV ."<<endl<<endl;
cout<<"If you have any questions of suggestions"<<endl;
cout<<endl<<"Email me at wildrj@wildinc.info"<<endl;
cout<<"                  wildrj13@yahoo.com"<<endl;
cout<<"For help press 'h'"<<endl;
cout<<"-----------------------------------------------------"<<endl;
char musicfilename[100];
cout<<endl<<"Enter the filename to play (with path)"<<endl;
cin.getline(musicfilename,100);

AudioDevicePtr device(OpenDevice());
OutputStreamPtr sound(OpenSound(device,musicfilename, false));

    float volume = 0.1;
    while(volume<=1.0)
 {
    sound->setVolume(volume);
    sound->play();
    sound->setRepeat(true);
    
    if(getch()=='i')
        volume=volume+0.1;
          if(getch()=='d')
            volume=volume-0.1;
               if(getch()=='m')
                 volume=0.0;
                   if(getch()=='r')
                     sound->reset();
                         if (volume > 1.0)
                                 volume=1.0;
                             if (volume < 0.0)
                                        volume=0.0;
                      
    if(getch()=='o')
    {
    sound->stop(); 
    cout<<"Enter the new song path"<<endl;
    cin.getline(musicfilename,100);
    OutputStreamPtr sound(OpenSound(device,musicfilename, false));
    float volume = 0.1;
    while(volume<=1.0)
    {
    sound->setVolume(volume);
    sound->play();
    sound->setRepeat(true);
    
    if(getch()=='i')
        volume=volume+0.1;
          if(getch()=='d')
            volume=volume-0.1;
               if(getch()=='m')
                 volume=0.0;
                   if(getch()=='r')
                     sound->reset();
                         if (volume > 1.0)
                                 volume=1.0;
                             if (volume < 0.0)
                                        volume=0.0;
                                           
}      
}
} 
    return 0;
}