mark session dirty when plugin pin mapping changes
[ardour.git] / libs / ardour / session_metadata.cc
index 00f5d31ed877c9b881fc6b902121920bcf752651..0620f1200586ea0b92714489429486e34582e33f 100644 (file)
@@ -77,7 +77,7 @@ SessionMetadata::SessionMetadata ()
        //map.insert (Property ("lyrics", ""));
        //map.insert (Property ("media", ""));
        //map.insert (Property ("label", ""));
-       //map.insert (Property ("barcode", ""));
+       map.insert (Property ("barcode", ""));
        //map.insert (Property ("encoded_by", ""));
        //map.insert (Property ("catalog_number", ""));
 
@@ -86,7 +86,7 @@ SessionMetadata::SessionMetadata ()
        //map.insert (Property ("album_artist_sort", ""));
        //map.insert (Property ("artist_sort", ""));
        //map.insert (Property ("title_sort", ""));
-       
+
        /*** Globals ***/
        user_map.insert (Property ("user_name", ""));
        user_map.insert (Property ("user_email", ""));
@@ -122,8 +122,8 @@ SessionMetadata::get_value (const string & name) const
        if (it == map.end()) {
                it = user_map.find (name);
                if (it == user_map.end()) {
-                       // Should not be reached!
-                       std::cerr << "Programming error in SessionMetadata::get_value" << std::endl;
+                       // Should not be reached, except if loading metadata from a newer version with a new type
+                       std::cerr << "Programming error in SessionMetadata::get_value (" << name << ")" << std::endl;
                        return "";
                }
        }
@@ -144,8 +144,8 @@ SessionMetadata::set_value (const string & name, const string & value)
        if (it == map.end()) {
                it = user_map.find (name);
                if (it == user_map.end()) {
-                       // Should not be reached!
-                       std::cerr << "Programming error in SessionMetadata::set_value" << std::endl;
+                       // Should not be reached, except if loading metadata from a newer version with a new type
+                       std::cerr << "Programming error in SessionMetadata::set_value (" << name << ")" << std::endl;
                        return;
                }
        }
@@ -182,7 +182,7 @@ SessionMetadata::get_state ()
 }
 
 int
-SessionMetadata::set_state (const XMLNode & state, int version_num)
+SessionMetadata::set_state (const XMLNode & state, int /*version_num*/)
 {
        const XMLNodeList & children = state.children();
        string name;
@@ -252,6 +252,12 @@ SessionMetadata::grouping () const
        return get_value("grouping");
 }
 
+string
+SessionMetadata::barcode () const
+{
+       return get_value("barcode");
+}
+
 string
 SessionMetadata::title () const
 {
@@ -454,6 +460,12 @@ SessionMetadata::set_grouping (const string & v)
        set_value ("grouping", v);
 }
 
+void
+SessionMetadata::set_barcode (const string & v)
+{
+       set_value ("barcode", v);
+}
+
 void
 SessionMetadata::set_title (const string & v)
 {