1 /* 2 * Copyright © 2009-2010 freedcpp, http://code.google.com/p/freedcpp 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 * 18 * In addition, as a special exception, compiling, linking, and/or 19 * using OpenSSL with this program is allowed. 20 */ 21 22 #pragma once 23 24 class Sound 25 { 26 public: 27 enum TypeSound 28 { 29 DOWNLOAD_BEGINS, 30 DOWNLOAD_FINISHED, 31 DOWNLOAD_FINISHED_USER_LIST, 32 UPLOAD_FINISHED, 33 PRIVATE_MESSAGE, 34 HUB_CONNECT, 35 HUB_DISCONNECT, 36 FAVORITE_USER_JOIN, 37 FAVORITE_USER_QUIT, 38 NONE 39 }; 40 41 static Sound* get(); 42 static void start(); 43 static void stop(); 44 Sound()45 Sound() { sound_init(); } ~Sound()46 ~Sound() { sound_finalize(); } 47 48 void playSound(TypeSound sound); 49 void playSound(const std::string &target); 50 51 private: 52 static Sound *pSound; 53 54 void sound_init(); 55 void sound_finalize(); 56 }; 57