Remove most using declarations from header files.
[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 /** Represents metadata associated to a Session
35  * Metadata can be accessed and edited via this class.
36  * Exported files can also be tagged with this data.
37  */
38 class SessionMetadata : public PBD::StatefulDestructible
39 {
40   public:
41         SessionMetadata ();
42         ~SessionMetadata ();
43         
44         /*** Accessing ***/
45         Glib::ustring comment () const;
46         Glib::ustring copyright () const;
47         Glib::ustring isrc () const;
48         uint32_t year () const;
49
50         Glib::ustring grouping () const;
51         Glib::ustring title () const;
52         Glib::ustring subtitle () const;
53         
54         Glib::ustring artist () const;
55         Glib::ustring album_artist () const;
56         Glib::ustring lyricist () const;
57         Glib::ustring composer () const;
58         Glib::ustring conductor () const;
59         Glib::ustring remixer () const;
60         Glib::ustring arranger () const;
61         Glib::ustring engineer () const;
62         Glib::ustring producer () const;
63         Glib::ustring dj_mixer () const;
64         Glib::ustring mixer () const;
65         
66         Glib::ustring album () const;
67         Glib::ustring compilation () const;
68         Glib::ustring disc_subtitle () const;
69         uint32_t disc_number () const;
70         uint32_t total_discs () const;
71         uint32_t track_number () const;
72         uint32_t total_tracks () const;
73         
74         Glib::ustring genre () const;
75         
76         /*** Editing ***/
77         void set_comment (const Glib::ustring &);
78         void set_copyright (const Glib::ustring &);
79         void set_isrc (const Glib::ustring &);
80         void set_year (uint32_t);
81         
82         void set_grouping (const Glib::ustring &);
83         void set_title (const Glib::ustring &);
84         void set_subtitle (const Glib::ustring &);
85         
86         void set_artist (const Glib::ustring &);
87         void set_album_artist (const Glib::ustring &);
88         void set_lyricist (const Glib::ustring &);
89         void set_composer (const Glib::ustring &);
90         void set_conductor (const Glib::ustring &);
91         void set_remixer (const Glib::ustring &);
92         void set_arranger (const Glib::ustring &);
93         void set_engineer (const Glib::ustring &);
94         void set_producer (const Glib::ustring &);
95         void set_dj_mixer (const Glib::ustring &);
96         void set_mixer (const Glib::ustring &);
97         
98         void set_album (const Glib::ustring &);
99         void set_compilation (const Glib::ustring &);
100         void set_disc_subtitle (const Glib::ustring &);
101         void set_disc_number (uint32_t);
102         void set_total_discs (uint32_t);
103         void set_track_number (uint32_t);
104         void set_total_tracks (uint32_t);
105         
106         void set_genre (const Glib::ustring &);
107         
108         /*** Serialization ***/
109         XMLNode & get_state ();
110         int set_state (const XMLNode &);
111
112   private:
113         
114         typedef std::pair<Glib::ustring, Glib::ustring> Property;
115         typedef std::map<Glib::ustring, Glib::ustring> PropertyMap;
116         PropertyMap map;
117
118         XMLNode * get_xml (const Glib::ustring & name);
119         
120         Glib::ustring get_value (const Glib::ustring & name) const;
121         uint32_t get_uint_value (const Glib::ustring & name) const;
122         
123         void set_value (const Glib::ustring & name, const Glib::ustring & value);
124         void set_value (const Glib::ustring & name, uint32_t value);
125 };
126
127 } // namespace ARDOUR
128
129 #endif // __ardour_session_metadata_h__