new files from sakari, missed last time
[ardour.git] / libs / ardour / ardour / session_metadata.h
1 /*
2     Copyright (C) 2008 Paul Davis 
3     Author: Sakari Bergen
4
5     This program is free software; you can redistribute it and/or modify it
6     under the terms of the GNU General Public License as published by the Free
7     Software Foundation; either version 2 of the License, or (at your option)
8     any later version.
9
10     This program is distributed in the hope that it will be useful, but WITHOUT
11     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13     for more details.
14
15     You should have received a copy of the GNU General Public License along
16     with this program; if not, write to the Free Software Foundation, Inc.,
17     675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __ardour_session_metadata_h__
21 #define __ardour_session_metadata_h__
22
23 #include <string>
24 #include <glibmm/ustring.h>
25
26 #include <map>
27 #include <utility>
28
29 #include <pbd/statefuldestructible.h>
30 #include <pbd/xml++.h>
31
32 namespace ARDOUR {
33
34 using std::string;
35 using Glib::ustring;
36
37 /** Represents metadata associated to a Session
38  * Metadata can be accessed and edited via this class.
39  * Exported files can also be tagged with this data.
40  */
41 class SessionMetadata : public PBD::StatefulDestructible
42 {
43   public:
44         SessionMetadata ();
45         ~SessionMetadata ();
46         
47         /*** Accessing ***/
48         ustring comment () const;
49         ustring copyright () const;
50         ustring isrc () const;
51         uint32_t year () const;
52
53         ustring grouping () const;
54         ustring title () const;
55         ustring subtitle () const;
56         
57         ustring artist () const;
58         ustring album_artist () const;
59         ustring lyricist () const;
60         ustring composer () const;
61         ustring conductor () const;
62         ustring remixer () const;
63         ustring arranger () const;
64         ustring engineer () const;
65         ustring producer () const;
66         ustring dj_mixer () const;
67         ustring mixer () const;
68         
69         ustring album () const;
70         ustring compilation () const;
71         ustring disc_subtitle () const;
72         uint32_t disc_number () const;
73         uint32_t total_discs () const;
74         uint32_t track_number () const;
75         uint32_t total_tracks () const;
76         
77         ustring genre () const;
78         
79         /*** Editing ***/
80         void set_comment (const ustring &);
81         void set_copyright (const ustring &);
82         void set_isrc (const ustring &);
83         void set_year (uint32_t);
84         
85         void set_grouping (const ustring &);
86         void set_title (const ustring &);
87         void set_subtitle (const ustring &);
88         
89         void set_artist (const ustring &);
90         void set_album_artist (const ustring &);
91         void set_lyricist (const ustring &);
92         void set_composer (const ustring &);
93         void set_conductor (const ustring &);
94         void set_remixer (const ustring &);
95         void set_arranger (const ustring &);
96         void set_engineer (const ustring &);
97         void set_producer (const ustring &);
98         void set_dj_mixer (const ustring &);
99         void set_mixer (const ustring &);
100         
101         void set_album (const ustring &);
102         void set_compilation (const ustring &);
103         void set_disc_subtitle (const ustring &);
104         void set_disc_number (uint32_t);
105         void set_total_discs (uint32_t);
106         void set_track_number (uint32_t);
107         void set_total_tracks (uint32_t);
108         
109         void set_genre (const ustring &);
110         
111         /*** Serialization ***/
112         XMLNode & get_state ();
113         int set_state (const XMLNode &);
114
115   private:
116         
117         typedef std::pair<ustring, ustring> Property;
118         typedef std::map<ustring, ustring> PropertyMap;
119         PropertyMap map;
120
121         XMLNode * get_xml (const ustring & name);
122         
123         ustring get_value (const ustring & name) const;
124         uint32_t get_uint_value (const ustring & name) const;
125         
126         void set_value (const ustring & name, const ustring & value);
127         void set_value (const ustring & name, uint32_t value);
128 };
129
130 } // namespace ARDOUR
131
132 #endif // __ardour_session_metadata_h__