# Path: nord/nm2g2.py
# class NM2G2Converter:
#   def __init__(self, pchfilename, options, log):
#   def convert(self):
#   def doarea(self, nmarea, g2area):
#   def doconverters(self, nmarea, g2area):
#   def domodules(self, converters):
#   def docolorizemultis(self, converters):
#   def dogroups(self, converters):
#   def doreposition(self, converters):
#     def locationcmp(a, b):
#   def doprecables(self, converters):
#   def docables(self, nmarea, g2area):
#   def douprate(self, g2area):
#   def dologiccombine(self, g2area):
#     def locationcmp(a, b):
#     def gateused(gate, num):
#     def freegate(gate):
#     def usedgate(gate):
#     def invertused(invert, num):
#     def freeinvert(invert):
#     def usedinvert(invert):
#     def makepairs(shortnm, freelogic):
#     def movecable(g2area, fromconn, toconn):
#   def cablerecolorize(self, g2area):
#   def docableshorten(self, g2area):
#   def domorphs(self):
#     def find_unused():
#   def doknobs(self):
#   def domidiccs(self):
#   def docurrentnotes(self):
#   def dofinalize(self):
#   def dotitleblock(self):
#     def addnamebars(lines, horiz, vert):


import logging
import os, sys, time, traceback
from optparse import OptionParser, make_option
from glob import glob
from nord.nm2g2 import NM2G2Converter, NM1Error
      dest='allfiles', default=False,
      help='Process all files (not just *.pch)'),
  make_option('-A', '--adsr-for-ad', action='store_true',
      dest='adsrforad', default=False,
      help='Replace AD modules with ADSR modules'),
  make_option('-c', '--compress-columns', action='store_true',
      dest='compresscolumns', default=False,
      help='Remove columns not containing modules'),
  make_option('-d', '--debug', action='store_true',
      dest='debug', default=False,
      help='Allow exceptions to terminate application'),
  make_option('-k', '--keep-old', action='store_true',
      dest='keepold', default=False,
      help='If .pch2 file exists, do not replace it'),
  make_option('-l', '--no-logic-combine', action='store_false',
      dest='logiccombine', default=True,
      help='Do not combine logic and inverter modules'),
  make_option('-n', '--no-log', action='store_true',
      dest='nolog', default=False,
      help='Do not generated failed patches log'),
  make_option('-o', '--g2-overdrive', action='store_true',
      dest='g2overdrive', default=False,
      help='Use g2 overdrive model'),
  make_option('-p', '--pad-mixer', action='store_true',
      dest='padmixer', default=False,
      help='Use mixers with Pad when possible'),
  make_option('-r', '--recursive', action='store_true',
      dest='recursive', default=False,
      help='On dir arguments, convert all .pch files'),
  make_option('-s', '--no-shorten', action='store_false',

# Path: nord/nm2g2.py
# class NM2G2Converter:
#   def __init__(self, pchfilename, options, log):
#   def convert(self):
#   def doarea(self, nmarea, g2area):
#   def doconverters(self, nmarea, g2area):
#   def domodules(self, converters):
#   def docolorizemultis(self, converters):
#   def dogroups(self, converters):
#   def doreposition(self, converters):
#     def locationcmp(a, b):
#   def doprecables(self, converters):
#   def docables(self, nmarea, g2area):
#   def douprate(self, g2area):
#   def dologiccombine(self, g2area):
#     def locationcmp(a, b):
#     def gateused(gate, num):
#     def freegate(gate):
#     def usedgate(gate):
#     def invertused(invert, num):
#     def freeinvert(invert):
#     def usedinvert(invert):
#     def makepairs(shortnm, freelogic):
#     def movecable(g2area, fromconn, toconn):
#   def cablerecolorize(self, g2area):
#   def docableshorten(self, g2area):
#   def domorphs(self):
#     def find_unused():
#   def doknobs(self):
#   def domidiccs(self):
#   def docurrentnotes(self):
#   def dofinalize(self):
#   def dotitleblock(self):
#     def addnamebars(lines, horiz, vert):


# Path: nm2g2.py
import logging
import os, sys, time, traceback
from optparse import OptionParser, make_option
from glob import glob
from nord.nm2g2 import NM2G2Converter, NM1Error

      dest='allfiles', default=False,
      help='Process all files (not just *.pch)'),
  make_option('-A', '--adsr-for-ad', action='store_true',
      dest='adsrforad', default=False,
      help='Replace AD modules with ADSR modules'),
  make_option('-c', '--compress-columns', action='store_true',
      dest='compresscolumns', default=False,
      help='Remove columns not containing modules'),
  make_option('-d', '--debug', action='store_true',
      dest='debug', default=False,
      help='Allow exceptions to terminate application'),
  make_option('-k', '--keep-old', action='store_true',
      dest='keepold', default=False,
      help='If .pch2 file exists, do not replace it'),
  make_option('-l', '--no-logic-combine', action='store_false',
      dest='logiccombine', default=True,
      help='Do not combine logic and inverter modules'),
  make_option('-n', '--no-log', action='store_true',
      dest='nolog', default=False,
      help='Do not generated failed patches log'),
  make_option('-o', '--g2-overdrive', action='store_true',
      dest='g2overdrive', default=False,
      help='Use g2 overdrive model'),
  make_option('-p', '--pad-mixer', action='store_true',
      dest='padmixer', default=False,
      help='Use mixers with Pad when possible'),
  make_option('-r', '--recursive', action='store_true',
      dest='recursive', default=False,
      help='On dir arguments, convert all .pch files'),
  make_option('-s', '--no-shorten', action='store_false',

      dest='shorten', default=True,