00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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
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;
00059 class Playlist;
00060
00061 using namespace boost::posix_time;
00062
00063
00064
00065
00066
00067
00068
00069
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
00307
00308
00309
00310
00311
00312 }
00313 }
00314
00315 #endif // LiveSupport_Core_Playable_h
00316