Playable.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002  
00003     Copyright (c) 2004 Media Development Loan Fund
00004   
00005     This file is part of the Campcaster project.
00006     https://www.campware.org/
00007     To report bugs, send an e-mail to [email protected]
00008   
00009     Campcaster is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013    
00014     Campcaster is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018   
00019     You should have received a copy of the GNU General Public License
00020     along with Campcaster; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022   
00023   
00024     Author   : $Author: fgerlits $
00025     Version  : $Revision: 2329 $
00026     Location : $URL: svn://code.campware.org/campcaster/trunk/campcaster/src/modules/core/include/LiveSupport/Core/Playable.h $
00027  
00028 ------------------------------------------------------------------------------*/
00029 #ifndef LiveSupport_Core_Playable_h
00030  #define LiveSupport_Core_Playable_h
00031  
00032 #ifndef __cplusplus
00033  #error This is a C++ include file
00034  #endif
00035  
00036 
00037 /* ============================================================ include files */
00038 
00039 #ifdef HAVE_CONFIG_H
00040  #include "configure.h"
00041 #endif
00042  
00043 #include <stdexcept>
00044 #include <string>
00045 #include <libxml++/libxml++.h>
00046 #include <boost/date_time/posix_time/posix_time.hpp>
00047 #include <boost/enable_shared_from_this.hpp>
00048 #include <glibmm/ustring.h>
00049 
00050 #include "LiveSupport/Core/Ptr.h"
00051 #include "LiveSupport/Core/UniqueId.h"
00052 #include "LiveSupport/Core/Configurable.h"
00053 
00054 
00055 namespace LiveSupport {
00056 namespace Core {
00057 
00058 class   AudioClip;      // forward declarations to avoid circularity
00059 class   Playlist;
00060 
00061 using namespace boost::posix_time;
00062 
00063 /* ================================================================ constants */
00064 
00065 
00066 /* =================================================================== macros */
00067 
00068 
00069 /* =============================================================== data types */
00070 
00078 class Playable : public boost::enable_shared_from_this<Playable>
00079 {
00080     public:
00081 
00085         enum Type { AudioClipType, PlaylistType };
00086  
00087     private:
00088  
00092         Type        type;
00093  
00094     protected:
00095 
00101         Playable(Type   typeParam)              throw ()
00102                     : type(typeParam)
00103         {
00104         }
00105  
00106 
00107     public:
00108 
00112         virtual
00113         ~Playable(void)                         throw ()
00114         {
00115         }
00116 
00122         virtual Ptr<UniqueId>::Ref
00123         getId(void) const                       throw () = 0;
00124 
00130         virtual Ptr<time_duration>::Ref
00131         getPlaylength(void) const               throw () = 0;
00132 
00133 
00141         virtual Ptr<const std::string>::Ref
00142         getUri(void) const                      throw () = 0;
00143 
00151         virtual void
00152         setUri(Ptr<const std::string>::Ref uri) throw () = 0;
00153 
00154 
00164         virtual Ptr<const std::string>::Ref
00165         getToken(void) const                    throw () = 0;
00166 
00176         virtual void
00177         setToken(Ptr<const std::string>::Ref token) 
00178                                                 throw () = 0;
00179 
00180 
00186         virtual Ptr<const Glib::ustring>::Ref
00187         getTitle(void) const                    throw () = 0;
00188 
00194         virtual void
00195         setTitle(Ptr<const Glib::ustring>::Ref title)
00196                                                 throw () = 0;
00197 
00198 
00208         virtual Ptr<Glib::ustring>::Ref
00209         getMetadata(const std::string &key) const
00210                                                 throw () = 0;
00211 
00220         virtual void
00221         setMetadata(Ptr<const Glib::ustring>::Ref value, 
00222                     const std::string &key)
00223                                                 throw (std::invalid_argument)
00224                                                                             = 0;
00225 
00238         virtual Ptr<Glib::ustring>::Ref
00239         getXmlElementString(void) const         throw () = 0;
00240 
00241 
00269         virtual Ptr<Glib::ustring>::Ref
00270         getXmlDocumentString(void) const        throw () = 0;
00271 
00272 
00278         Type
00279         getType(void) const                     throw ()
00280         {
00281             return type;
00282         }
00283  
00291         Ptr<AudioClip>::Ref
00292         getAudioClip(void)                      throw ();
00293  
00301         Ptr<Playlist>::Ref
00302         getPlaylist(void)                       throw ();
00303 };
00304 
00305 
00306 /* ================================================= external data structures */
00307 
00308 
00309 /* ====================================================== function prototypes */
00310 
00311 
00312 } // namespace Core
00313 } // namespace LiveSupport
00314 
00315 #endif // LiveSupport_Core_Playable_h
00316  

Generated on Fri Sep 21 02:00:25 2007 for Campcaster by  1.4.7