<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -416,7 +416,7 @@
 * TODO Add MusicBrainz support
   It would be helpful to have external metadata support beyond FreeDB,
   since FreeDB is very primitive.
-** TODO Ensure that MusicBrainz is interchangeable with FreeDB/XMCD
+** DONE Ensure that MusicBrainz is interchangeable with FreeDB/XMCD
 *** DONE Unify track2xmcd/track2mb, cd2xmcd/cd2mb
     Based on preliminary testing, MusicBrainz's output is better than FreeDB's
     but its album coverage is not as broad.
@@ -430,7 +430,7 @@
     Therefore, editxmcd should be extended with additional fields
     to handle XML backend data if necessary.
 *** DONE Handle multiple Release entries with single Disc ID
-*** TODO Allow MusicBrainz XML output for new editxmcd files
+*** DONE Allow MusicBrainz XML output for new editxmcd files
     FreeDB output should also be an option, however.
 ** DONE Add MusicBrainz protocol/format documentation
 ** DONE Add MusicBrainz-specific unit tests</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -310,10 +310,13 @@ class EditXMCD:
 
     metadata_update = xmcd_update
 
-    def new(self,caller):
-        self.xml.get_widget(&quot;selecttracks&quot;).run()
+    def new_xmcd(self,caller):
+        self.xml.get_widget(&quot;select_xmcd_tracks&quot;).run()
 
-    def from_tracks(self,dialog,signal):
+    def new_mbxml(self,caller):
+        self.xml.get_widget(&quot;select_mbxml_tracks&quot;).run()
+
+    def from_xmcd_tracks(self,dialog,signal):
         dialog.hide()
         if (signal == -5):
             self.read_xmcd(audiotools.XMCD.from_files(
@@ -322,6 +325,15 @@ class EditXMCD:
             self.filename = None
             self.set_title()
 
+    def from_mbxml_tracks(self,dialog,signal):
+        dialog.hide()
+        if (signal == -5):
+            self.read_mbxml(audiotools.MusicBrainzReleaseXML.from_files(
+                    audiotools.open_files(dialog.get_filenames())))
+            self.edited = False
+            self.filename = None
+            self.set_title()
+
     def save(self,caller):
         if (self.xmcd is None):
             return
@@ -645,8 +657,10 @@ if (__name__ == '__main__'):
     xml.signal_connect(&quot;on_paste1_activate&quot;,editxmcd.paste)
     xml.signal_connect(&quot;on_delete1_activate&quot;,editxmcd.clear)
 
-    xml.signal_connect(&quot;on_new1_activate&quot;,editxmcd.new)
-    xml.signal_connect(&quot;tracks_selected&quot;,editxmcd.from_tracks)
+    xml.signal_connect(&quot;on_new1_activate&quot;,editxmcd.new_xmcd)
+    xml.signal_connect(&quot;on_new2_activate&quot;,editxmcd.new_mbxml)
+    xml.signal_connect(&quot;xmcd_tracks_selected&quot;,editxmcd.from_xmcd_tracks)
+    xml.signal_connect(&quot;mbxml_tracks_selected&quot;,editxmcd.from_mbxml_tracks)
     xml.signal_connect(&quot;on_save_as1_activate&quot;,editxmcd.saveas)
 
     xml.signal_connect(&quot;save_file&quot;,editxmcd.save)</diff>
      <filename>editxmcd</filename>
    </modified>
    <modified>
      <diff>@@ -43,11 +43,47 @@
 		&lt;widget class=&quot;GtkMenu&quot; id=&quot;menuitem1_menu&quot;&gt;
 
 		  &lt;child&gt;
-		    &lt;widget class=&quot;GtkImageMenuItem&quot; id=&quot;new&quot;&gt;
+		    &lt;widget class=&quot;GtkImageMenuItem&quot; id=&quot;new-submenu&quot;&gt;
 		      &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
-		      &lt;property name=&quot;label&quot;&gt;gtk-new&lt;/property&gt;
-		      &lt;property name=&quot;use_stock&quot;&gt;True&lt;/property&gt;
-		      &lt;signal name=&quot;activate&quot; handler=&quot;on_new1_activate&quot; last_modification_time=&quot;Wed, 31 Dec 2008 19:35:25 GMT&quot;/&gt;
+		      &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;_New&lt;/property&gt;
+		      &lt;property name=&quot;use_underline&quot;&gt;True&lt;/property&gt;
+
+		      &lt;child internal-child=&quot;image&quot;&gt;
+			&lt;widget class=&quot;GtkImage&quot; id=&quot;image9&quot;&gt;
+			  &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+			  &lt;property name=&quot;stock&quot;&gt;gtk-new&lt;/property&gt;
+			  &lt;property name=&quot;icon_size&quot;&gt;1&lt;/property&gt;
+			  &lt;property name=&quot;xalign&quot;&gt;0.5&lt;/property&gt;
+			  &lt;property name=&quot;yalign&quot;&gt;0.5&lt;/property&gt;
+			  &lt;property name=&quot;xpad&quot;&gt;0&lt;/property&gt;
+			  &lt;property name=&quot;ypad&quot;&gt;0&lt;/property&gt;
+			&lt;/widget&gt;
+		      &lt;/child&gt;
+
+		      &lt;child&gt;
+			&lt;widget class=&quot;GtkMenu&quot; id=&quot;new-submenu_menu&quot;&gt;
+
+			  &lt;child&gt;
+			    &lt;widget class=&quot;GtkMenuItem&quot; id=&quot;new-xmcd&quot;&gt;
+			      &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+			      &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;XMCD File&lt;/property&gt;
+			      &lt;property name=&quot;use_underline&quot;&gt;True&lt;/property&gt;
+			      &lt;signal name=&quot;activate&quot; handler=&quot;on_new1_activate&quot; last_modification_time=&quot;Mon, 21 Sep 2009 15:53:23 GMT&quot;/&gt;
+			      &lt;accelerator key=&quot;N&quot; modifiers=&quot;GDK_CONTROL_MASK&quot; signal=&quot;activate&quot;/&gt;
+			    &lt;/widget&gt;
+			  &lt;/child&gt;
+
+			  &lt;child&gt;
+			    &lt;widget class=&quot;GtkMenuItem&quot; id=&quot;new-mbxml&quot;&gt;
+			      &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+			      &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;MusicBrainz File&lt;/property&gt;
+			      &lt;property name=&quot;use_underline&quot;&gt;True&lt;/property&gt;
+			      &lt;signal name=&quot;activate&quot; handler=&quot;on_new2_activate&quot; last_modification_time=&quot;Mon, 21 Sep 2009 15:53:23 GMT&quot;/&gt;
+			      &lt;accelerator key=&quot;N&quot; modifiers=&quot;GDK_CONTROL_MASK | GDK_SHIFT_MASK&quot; signal=&quot;activate&quot;/&gt;
+			    &lt;/widget&gt;
+			  &lt;/child&gt;
+			&lt;/widget&gt;
+		      &lt;/child&gt;
 		    &lt;/widget&gt;
 		  &lt;/child&gt;
 
@@ -115,7 +151,7 @@
 		      &lt;accelerator key=&quot;Z&quot; modifiers=&quot;GDK_CONTROL_MASK&quot; signal=&quot;activate&quot;/&gt;
 
 		      &lt;child internal-child=&quot;image&quot;&gt;
-			&lt;widget class=&quot;GtkImage&quot; id=&quot;image4&quot;&gt;
+			&lt;widget class=&quot;GtkImage&quot; id=&quot;image10&quot;&gt;
 			  &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
 			  &lt;property name=&quot;stock&quot;&gt;gtk-undo&lt;/property&gt;
 			  &lt;property name=&quot;icon_size&quot;&gt;1&lt;/property&gt;
@@ -137,7 +173,7 @@
 		      &lt;accelerator key=&quot;Z&quot; modifiers=&quot;GDK_CONTROL_MASK | GDK_SHIFT_MASK&quot; signal=&quot;activate&quot;/&gt;
 
 		      &lt;child internal-child=&quot;image&quot;&gt;
-			&lt;widget class=&quot;GtkImage&quot; id=&quot;image5&quot;&gt;
+			&lt;widget class=&quot;GtkImage&quot; id=&quot;image11&quot;&gt;
 			  &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
 			  &lt;property name=&quot;stock&quot;&gt;gtk-redo&lt;/property&gt;
 			  &lt;property name=&quot;icon_size&quot;&gt;1&lt;/property&gt;
@@ -808,7 +844,7 @@
   &lt;/child&gt;
 &lt;/widget&gt;
 
-&lt;widget class=&quot;GtkFileChooserDialog&quot; id=&quot;selecttracks&quot;&gt;
+&lt;widget class=&quot;GtkFileChooserDialog&quot; id=&quot;select_xmcd_tracks&quot;&gt;
   &lt;property name=&quot;border_width&quot;&gt;5&lt;/property&gt;
   &lt;property name=&quot;action&quot;&gt;GTK_FILE_CHOOSER_ACTION_OPEN&lt;/property&gt;
   &lt;property name=&quot;local_only&quot;&gt;True&lt;/property&gt;
@@ -1296,4 +1332,75 @@
   &lt;/child&gt;
 &lt;/widget&gt;
 
+&lt;widget class=&quot;GtkFileChooserDialog&quot; id=&quot;select_mbxml_tracks&quot;&gt;
+  &lt;property name=&quot;border_width&quot;&gt;5&lt;/property&gt;
+  &lt;property name=&quot;action&quot;&gt;GTK_FILE_CHOOSER_ACTION_OPEN&lt;/property&gt;
+  &lt;property name=&quot;local_only&quot;&gt;True&lt;/property&gt;
+  &lt;property name=&quot;select_multiple&quot;&gt;True&lt;/property&gt;
+  &lt;property name=&quot;show_hidden&quot;&gt;False&lt;/property&gt;
+  &lt;property name=&quot;do_overwrite_confirmation&quot;&gt;False&lt;/property&gt;
+  &lt;property name=&quot;title&quot; translatable=&quot;yes&quot;&gt;Select Audio Tracks&lt;/property&gt;
+  &lt;property name=&quot;type&quot;&gt;GTK_WINDOW_TOPLEVEL&lt;/property&gt;
+  &lt;property name=&quot;window_position&quot;&gt;GTK_WIN_POS_NONE&lt;/property&gt;
+  &lt;property name=&quot;modal&quot;&gt;True&lt;/property&gt;
+  &lt;property name=&quot;resizable&quot;&gt;True&lt;/property&gt;
+  &lt;property name=&quot;destroy_with_parent&quot;&gt;False&lt;/property&gt;
+  &lt;property name=&quot;decorated&quot;&gt;True&lt;/property&gt;
+  &lt;property name=&quot;skip_taskbar_hint&quot;&gt;False&lt;/property&gt;
+  &lt;property name=&quot;skip_pager_hint&quot;&gt;False&lt;/property&gt;
+  &lt;property name=&quot;type_hint&quot;&gt;GDK_WINDOW_TYPE_HINT_DIALOG&lt;/property&gt;
+  &lt;property name=&quot;gravity&quot;&gt;GDK_GRAVITY_NORTH_WEST&lt;/property&gt;
+  &lt;property name=&quot;focus_on_map&quot;&gt;True&lt;/property&gt;
+  &lt;property name=&quot;urgency_hint&quot;&gt;False&lt;/property&gt;
+  &lt;signal name=&quot;response&quot; handler=&quot;mbxml_tracks_selected&quot; last_modification_time=&quot;Mon, 21 Sep 2009 16:33:13 GMT&quot;/&gt;
+
+  &lt;child internal-child=&quot;vbox&quot;&gt;
+    &lt;widget class=&quot;GtkVBox&quot; id=&quot;dialog-vbox7&quot;&gt;
+      &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+      &lt;property name=&quot;homogeneous&quot;&gt;False&lt;/property&gt;
+      &lt;property name=&quot;spacing&quot;&gt;2&lt;/property&gt;
+
+      &lt;child internal-child=&quot;action_area&quot;&gt;
+	&lt;widget class=&quot;GtkHButtonBox&quot; id=&quot;dialog-action_area7&quot;&gt;
+	  &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+	  &lt;property name=&quot;layout_style&quot;&gt;GTK_BUTTONBOX_END&lt;/property&gt;
+
+	  &lt;child&gt;
+	    &lt;widget class=&quot;GtkButton&quot; id=&quot;button7&quot;&gt;
+	      &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;can_default&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;label&quot;&gt;gtk-cancel&lt;/property&gt;
+	      &lt;property name=&quot;use_stock&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;relief&quot;&gt;GTK_RELIEF_NORMAL&lt;/property&gt;
+	      &lt;property name=&quot;focus_on_click&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;response_id&quot;&gt;-6&lt;/property&gt;
+	    &lt;/widget&gt;
+	  &lt;/child&gt;
+
+	  &lt;child&gt;
+	    &lt;widget class=&quot;GtkButton&quot; id=&quot;button8&quot;&gt;
+	      &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;can_default&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;has_default&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;label&quot;&gt;gtk-open&lt;/property&gt;
+	      &lt;property name=&quot;use_stock&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;relief&quot;&gt;GTK_RELIEF_NORMAL&lt;/property&gt;
+	      &lt;property name=&quot;focus_on_click&quot;&gt;True&lt;/property&gt;
+	      &lt;property name=&quot;response_id&quot;&gt;-5&lt;/property&gt;
+	    &lt;/widget&gt;
+	  &lt;/child&gt;
+	&lt;/widget&gt;
+	&lt;packing&gt;
+	  &lt;property name=&quot;padding&quot;&gt;0&lt;/property&gt;
+	  &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
+	  &lt;property name=&quot;fill&quot;&gt;True&lt;/property&gt;
+	  &lt;property name=&quot;pack_type&quot;&gt;GTK_PACK_END&lt;/property&gt;
+	&lt;/packing&gt;
+      &lt;/child&gt;
+    &lt;/widget&gt;
+  &lt;/child&gt;
+&lt;/widget&gt;
+
 &lt;/glade-interface&gt;</diff>
      <filename>glade/editxmcd.glade</filename>
    </modified>
    <modified>
      <diff>@@ -77,7 +77,7 @@ if (__name__ == '__main__'):
                 sys.exit(1)
         except audiotools.DecodingError,err:
             msg.error(unicode(err))
-            sys.exit(2)
+            sys.exit(1)
 
     elif (os.path.isdir(args[0]) and os.path.isdir(args[1])):
         returnval = 0</diff>
      <filename>trackcmp</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>faa389762235eb19ccc600e557e8ed3aa678edbc</id>
    </parent>
  </parents>
  <author>
    <name>Brian Langenberger</name>
    <email>bjl@usa.net</email>
  </author>
  <url>http://github.com/tuffy/python-audio-tools/commit/20d83d34c4878577b099cbfb70a043dee6628d96</url>
  <id>20d83d34c4878577b099cbfb70a043dee6628d96</id>
  <committed-date>2009-09-21T09:42:27-07:00</committed-date>
  <authored-date>2009-09-21T09:42:27-07:00</authored-date>
  <message>Add support for MusicBrainz XML files to editxmcd's &quot;New&quot; menu.</message>
  <tree>5a6cd279d1bf6e1dca2a6e850e0d2d89dff1a867</tree>
  <committer>
    <name>Brian Langenberger</name>
    <email>bjl@usa.net</email>
  </committer>
</commit>
