Editor Summary: fix direction of scroll zoom to match other conventions
[ardour.git] / gtk2_ardour / session_metadata_dialog.cc
index c4eede02c3e06002f461d2c6ee95072b196ae969..43bf320be86c9353e9289313765f857f62265a9b 100644 (file)
     675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "session_metadata_dialog.h"
-
 #include <sstream>
-
-#include <gtkmm2ext/utils.h>
+#include <gtkmm/filechooserdialog.h>
+#include <gtkmm/messagedialog.h>
+#include <gtkmm/stock.h>
 
 #include "pbd/xml++.h"
 #include "pbd/error.h"
 #include "ardour/session.h"
 #include "ardour/session_utils.h"
 
-#include "i18n.h"
+#include "gtkmm2ext/utils.h"
+
+#include "session_metadata_dialog.h"
+
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace Glib;
@@ -270,23 +273,26 @@ EAN13MetadataField::update_status ()
                // calculate EAN-13 modulo 10 check digit
                int sum = 0;
                const char *p = _value.c_str();
-               for (int i =0; i < 12; i++) {
+               for (int i = 0; i < 12; i++) {
                        char c = p[i] - '0';
                        if (i % 2) {
-                               sum += c;
-                       } else {
                                sum += c * 3;
+                       } else {
+                               sum += c;
                        }
                }
                sum %= 10;
+               if (sum)
+                       sum = 10 - sum;
+
                if (sum == p[12] - '0') {
                        status_label->set_markup (string_compose(
                                                "<span color=\"green\">%1: %2</span>",
                                                _("EAN Check digit OK"), sum));
                } else {
                        status_label->set_markup (string_compose(
-                                               "<span color=\"#ffa755\">%1: %2 (expected %3)</span>",
-                                               _("EAN Check digit error"), p[12] - '0', sum));
+                                               "<span color=\"#ffa755\">%1: %2 (%3 %4)</span>",
+                                               _("EAN Check digit error"), p[12] - '0', _("expected"), sum));
                }
        } else if (len > 0) {
                status_label->set_markup (string_compose(
@@ -900,7 +906,7 @@ SessionMetadataImporter::run ()
                return;
        }
 
-       //create a temporary 
+       //create a temporary
        ARDOUR::SessionMetadata data;
        data.set_state (*node, version);
        init_data ( true );  //skip user data here