Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "SDL/SDL.h"
- #include "SDL/SDL_mixer.h"
- #include <iostream>
- #include <fstream>
- #include <string>
- #include "surface.h"
- using namespace std;
- ofstream output("output.txt");
- string sound;
- void playSound();
- void stopSound();
- void pauseSound();
- void resumeSound();
- void loadSound();
- void convertFile();
- void exit();
- Mix_Music *music;
- void write(string writing) {
- output << writing << endl;
- }
- int main(int argc, char *args[]) {
- SDL_Init(SDL_INIT_EVERYTHING);
- Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096);
- SDL_WM_SetCaption("Kaktus MP3 Player", NULL);
- screen = SDL_SetVideoMode(340, 125, 32, SDL_SWSURFACE);
- write("Screen loaded");
- background = SDL_LoadBMP("images/background.bmp");
- write("Background loaded");
- SDL_BlitSurface(background, NULL, screen, NULL);
- SDL_Flip(screen);
- convertFile();
- write(sound);
- playSound();
- SDL_Delay(2000);
- write("Porgram exit");
- exit();
- Mix_CloseAudio();
- SDL_Quit();
- return 0;
- }
- void playSound() {
- music = Mix_LoadMUS(sound);
- Mix_PlayMusic(music, -1);
- }
- void convertFile() {
- }
- void exit() {
- SDL_FreeSurface(background);
- Mix_FreeMusic(music);
- }
Advertisement
Add Comment
Please, Sign In to add comment