sound.h

Go to the documentation of this file.
00001 /*
00002   libwt - Vassilis Virvilis Toolkit - a widget library
00003   Copyright (C) 2006 Vassilis Virvilis <vasvir2@fastmail.fm>
00004  
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 of the License, or (at your option) any later version.
00009   
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Lesser General Public License for more details.
00014   
00015   You should have received a copy of the GNU Lesser General Public
00016   License along with this library; if not, write to the
00017   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018   Boston, MA  02111-1307, SA.
00019 */
00020 
00021 #ifndef WT_SOUND_H
00022 #define WT_SOUND_H
00023 
00024 #include <string>
00025 
00026 #include <boost/shared_ptr.hpp>
00027 
00028 #include <sigc++/object.h>
00029 
00030 #include <wt/audio.h>
00031 
00032 namespace Wt {
00033 
00034 class Sound : virtual public sigc::trackable {
00035 public:
00036     Sound(const std::string& filename);
00037     Sound();
00038     const std::string& fileName() const;
00039     bool isFinished() const;
00040     void play();
00041     void stop();
00042 
00043     static bool available();
00044     static bool isAvailable();
00045     static void play(const std::string& filename);
00046 
00047 protected:
00048     void detach();
00049 
00050 private:
00051     typedef boost::shared_ptr<Audio::Chunk> Ptr;
00052     Ptr chunk;
00053     std::string filename_;
00054 };
00055 
00056 } // namespace Wt
00057 
00058 #endif // SOUND_

Generated Fri Jul 28 19:23:01 2006.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.