All pastes #274771 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-12-10 23:16 UTC
rendered paste body
#include <iostream>
#include <conio.h>
#include "audiere.h"
using namespace audiere;
using namespace std;
int main(int argc, char *argv[])
{
cout<<"Wildinc's music player"<<endl;
cout<<"----------------------";
cout<<endl<<endl<<endl;
cout<<endl<<"This Music 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<<"Email me at wild@inbox.com"<<endl<<endl;
cout<<"For help press 'h'"<<endl;
cout<<"-----------------------------------------------------"<<endl;
char musicfilename[100];
char musicfilenamee[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);           
    char input=getch();
    
    if(input=='i')
    volume=volume+0.1;
    
    if(input=='d')
    volume=volume-0.1;
    
    if(input=='m')
    volume=0.0;
    
    if(input=='r')
    sound->reset();
    
    if (volume > 1.0)
    volume=1.0;
    
    if (volume < 0.0)
    volume=0.0;
    
      if(input == 'h')
    {
    cout<<"To increase volume press 'i'"<<endl;
    cout<<"To decrease voulme press 'd'"<<endl;
    cout<<"To restart the song press 'r'"<<endl;
    cout<<"To change the song press 'c'"<<endl;
    }
    if(input == 'c')
    {
    test:
    sound->stop();
    cout<<"Enter new file 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);       
    char input = getch();
    if (input == 'c'){
    goto test;
}
    if(input=='i')
    volume=volume+0.1;
    
    if(input=='d')
    volume=volume-0.1;
    
    if(input=='m')
    volume=0.0;
    
    if(input=='r')
    sound->reset();
    
    if (volume > 1.0)
    volume=1.0;
    
    if (volume < 0.0)
    volume=0.0;
    
    if(input == 'h')
    {
    cout<<"To increase volume press 'i'"<<endl;
    cout<<"To decrease voulme press 'd'"<<endl;
    cout<<"To restart the song press 'r'"<<endl;
    cout<<"To change the song press 'c'"<<endl;
    }
} 
    return 0;
}
}
}