Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

music.h

00001 /*
00002   libwftk - Worldforge Toolkit - a widget library
00003   Copyright (C) 2002 Malcolm Walker <malcolm@worldforge.org>
00004   Based on code copyright  (C) 1999-2002  Karsten Laux 
00005 
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Lesser General Public
00008   License as published by the Free Software Foundation; either
00009   version 2.1 of the License, or (at your option) any later version.
00010   
00011   This library is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Lesser General Public License for more details.
00015   
00016   You should have received a copy of the GNU Lesser General Public
00017   License along with this library; if not, write to the
00018   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019   Boston, MA  02111-1307, SA.
00020 */
00021 
00022 // writtten May 1999
00023 
00024 
00025 
00026 #ifndef _MUSIC_H
00027 #define _MUSIC_H
00028 
00029 #include <wftk/sound.h>
00030 #include <wftk/resources.h>
00031 
00032 #include <string>
00033 
00034 namespace wftk {
00035 
00037 class Music : public Sound
00038 {
00039 
00040 public:
00041 
00043   Music();
00045   Music(const std::string& );
00047   virtual ~Music();
00048   
00050   virtual bool load(const std::string&);  
00052   virtual bool play(int loops = 0) const;
00053 
00055   virtual int setVolume(int vol);  
00057   virtual void stop() const;
00059   virtual bool playing() const;
00061   virtual bool paused() const;
00063   virtual void pause() const;
00065   virtual void rewind() const; 
00067   virtual void resume() const;
00068 
00089   static ResourceRegistry<Music*> registry;
00091   typedef Resource<Music*> Resource;
00092     
00093  private:
00094 
00096   int channel_;
00097 
00099   void* data_; // Mix_Music*
00100 };
00101 
00102 }
00103 
00104 #endif

Generated Thu Mar 18 20:06:04 2004.
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.