Optimize automation-event process splitting
[ardour.git] / libs / ardour / ardour / session_metadata.h
index 296bf6243f56d1fc58bf479f986b67155ef0f150..7232d9ec5dfe41609e3318b0bb1a2a3b9d2d11a8 100644 (file)
 #include "pbd/statefuldestructible.h"
 #include "pbd/xml++.h"
 
+#include "ardour/libardour_visibility.h"
+
 namespace ARDOUR {
 
 /** Represents metadata associated to a Session
  * Metadata can be accessed and edited via this class.
  * Exported files can also be tagged with this data.
  */
-class SessionMetadata : public PBD::StatefulDestructible
+class LIBARDOUR_API SessionMetadata : public PBD::StatefulDestructible
 {
   public:
+       //singleton instance:
+       static SessionMetadata *Metadata() { if (_metadata == NULL) _metadata = new SessionMetadata();  return _metadata; }
+
        SessionMetadata ();
        ~SessionMetadata ();
 
        /*** Accessing ***/
+       std::string description () const;
+
        std::string comment () const;
        std::string copyright () const;
        std::string isrc () const;
        uint32_t year () const;
 
        std::string grouping () const;
+       std::string barcode () const;
        std::string title () const;
        std::string subtitle () const;
 
@@ -72,13 +80,24 @@ class SessionMetadata : public PBD::StatefulDestructible
 
        std::string genre () const;
 
+       std::string instructor () const;
+       std::string course () const;
+
+       std::string user_name () const;
+       std::string user_email () const;
+       std::string user_web () const;
+       std::string organization () const;
+       std::string country () const;
+
        /*** Editing ***/
+       void set_description (const std::string &);
        void set_comment (const std::string &);
        void set_copyright (const std::string &);
        void set_isrc (const std::string &);
        void set_year (uint32_t);
 
        void set_grouping (const std::string &);
+       void set_barcode (const std::string &);
        void set_title (const std::string &);
        void set_subtitle (const std::string &);
 
@@ -104,15 +123,32 @@ class SessionMetadata : public PBD::StatefulDestructible
 
        void set_genre (const std::string &);
 
+       void set_instructor (const std::string &);
+       void set_course (const std::string &);
+
+       void set_user_name (const std::string &);
+       void set_user_email (const std::string &);
+       void set_user_web (const std::string &);
+       void set_organization (const std::string &);
+       void set_country (const std::string &);
+
+       /*** Export ***/
+       typedef std::map<std::string,std::string> MetaDataMap;
+       void av_export_tag (MetaDataMap&) const;
+
        /*** Serialization ***/
-       XMLNode & get_state ();
-       int set_state (const XMLNode &, int version);
+       XMLNode & get_state ();  //serializes stuff in the map, to be stored in session file
+       XMLNode & get_user_state ();  //serializes stuff in the user_map, to be stored in user's config file
+       int set_state (const XMLNode &, int version_num);
 
   private:
 
+       static SessionMetadata *_metadata;  //singleton instance
+
        typedef std::pair<std::string, std::string> Property;
        typedef std::map<std::string, std::string> PropertyMap;
        PropertyMap map;
+       PropertyMap user_map;
 
        XMLNode * get_xml (const std::string & name);