proper semantics for variable port-count
[ardour.git] / libs / ardour / ardour / session_metadata.h
index 296bf6243f56d1fc58bf479f986b67155ef0f150..a8fb977e51948d177d50fde32e80fa6ae4eedf54 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 ();
 
@@ -47,6 +52,7 @@ class SessionMetadata : public PBD::StatefulDestructible
        uint32_t year () const;
 
        std::string grouping () const;
+       std::string barcode () const;
        std::string title () const;
        std::string subtitle () const;
 
@@ -72,6 +78,15 @@ 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_comment (const std::string &);
        void set_copyright (const std::string &);
@@ -79,6 +94,7 @@ class SessionMetadata : public PBD::StatefulDestructible
        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 +120,28 @@ 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 &);
+
        /*** 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);