X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fsession_metadata.h;h=a8fb977e51948d177d50fde32e80fa6ae4eedf54;hb=fa73112f081ee38bc5c9752f900c9c5dccb68141;hp=2163a3dfef8900c6bf7baa92855d0b7d44570e43;hpb=f2b007195cd75b195e38a4cd7757debac73e7792;p=ardour.git diff --git a/libs/ardour/ardour/session_metadata.h b/libs/ardour/ardour/session_metadata.h index 2163a3dfef..a8fb977e51 100644 --- a/libs/ardour/ardour/session_metadata.h +++ b/libs/ardour/ardour/session_metadata.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2008 Paul Davis + Copyright (C) 2008 Paul Davis Author: Sakari Bergen This program is free software; you can redistribute it and/or modify it @@ -21,110 +21,135 @@ #define __ardour_session_metadata_h__ #include -#include #include #include -#include -#include +#include "pbd/statefuldestructible.h" +#include "pbd/xml++.h" -namespace ARDOUR { +#include "ardour/libardour_visibility.h" -using std::string; -using Glib::ustring; +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 ***/ - ustring comment () const; - ustring copyright () const; - ustring isrc () const; + std::string comment () const; + std::string copyright () const; + std::string isrc () const; uint32_t year () const; - ustring grouping () const; - ustring title () const; - ustring subtitle () const; - - ustring artist () const; - ustring album_artist () const; - ustring lyricist () const; - ustring composer () const; - ustring conductor () const; - ustring remixer () const; - ustring arranger () const; - ustring engineer () const; - ustring producer () const; - ustring dj_mixer () const; - ustring mixer () const; - - ustring album () const; - ustring compilation () const; - ustring disc_subtitle () const; + std::string grouping () const; + std::string barcode () const; + std::string title () const; + std::string subtitle () const; + + std::string artist () const; + std::string album_artist () const; + std::string lyricist () const; + std::string composer () const; + std::string conductor () const; + std::string remixer () const; + std::string arranger () const; + std::string engineer () const; + std::string producer () const; + std::string dj_mixer () const; + std::string mixer () const; + + std::string album () const; + std::string compilation () const; + std::string disc_subtitle () const; uint32_t disc_number () const; uint32_t total_discs () const; uint32_t track_number () const; uint32_t total_tracks () const; - - ustring genre () const; - + + 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 ustring &); - void set_copyright (const ustring &); - void set_isrc (const ustring &); + 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 ustring &); - void set_title (const ustring &); - void set_subtitle (const ustring &); - - void set_artist (const ustring &); - void set_album_artist (const ustring &); - void set_lyricist (const ustring &); - void set_composer (const ustring &); - void set_conductor (const ustring &); - void set_remixer (const ustring &); - void set_arranger (const ustring &); - void set_engineer (const ustring &); - void set_producer (const ustring &); - void set_dj_mixer (const ustring &); - void set_mixer (const ustring &); - - void set_album (const ustring &); - void set_compilation (const ustring &); - void set_disc_subtitle (const ustring &); + + void set_grouping (const std::string &); + void set_barcode (const std::string &); + void set_title (const std::string &); + void set_subtitle (const std::string &); + + void set_artist (const std::string &); + void set_album_artist (const std::string &); + void set_lyricist (const std::string &); + void set_composer (const std::string &); + void set_conductor (const std::string &); + void set_remixer (const std::string &); + void set_arranger (const std::string &); + void set_engineer (const std::string &); + void set_producer (const std::string &); + void set_dj_mixer (const std::string &); + void set_mixer (const std::string &); + + void set_album (const std::string &); + void set_compilation (const std::string &); + void set_disc_subtitle (const std::string &); void set_disc_number (uint32_t); void set_total_discs (uint32_t); void set_track_number (uint32_t); void set_total_tracks (uint32_t); - - void set_genre (const ustring &); - + + 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 &); + 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: - - typedef std::pair Property; - typedef std::map PropertyMap; + + static SessionMetadata *_metadata; //singleton instance + + typedef std::pair Property; + typedef std::map PropertyMap; PropertyMap map; + PropertyMap user_map; + + XMLNode * get_xml (const std::string & name); + + std::string get_value (const std::string & name) const; + uint32_t get_uint_value (const std::string & name) const; - XMLNode * get_xml (const ustring & name); - - ustring get_value (const ustring & name) const; - uint32_t get_uint_value (const ustring & name) const; - - void set_value (const ustring & name, const ustring & value); - void set_value (const ustring & name, uint32_t value); + void set_value (const std::string & name, const std::string & value); + void set_value (const std::string & name, uint32_t value); }; } // namespace ARDOUR