Exemplo n.º 1
0
 def testMultiMeasures(self):
     score = Score()
     settings = ASCIISettings()
     settings.omitEmpty = False
     score.drumKit = DrumKit.DrumKit()
     score.drumKit.addDrum(Drum.Drum("HiHat", "Hh", "x"))
     score.drumKit.addDrum(Drum.Drum("Crash", "Cr", "x"))
     counter = MeasureCount.counterMaker(4, 16)
     score.insertMeasureByIndex(16, counter = counter)
     score.insertMeasureByIndex(16, counter = counter)
     score.insertMeasureByIndex(16, counter = counter)
     score.addNote(NotePosition(0, 0, 0, 0), "x")
     score.addNote(NotePosition(0, 1, 0, 0), "y")
     score.addNote(NotePosition(0, 2, 0, 0), "z")
     output = self.getOutput(score, settings)
     self.assertEqual(output,
                      ['Tabbed with DrumBurp, a drum tab editor from www.whatang.org',
                       '',
                       'Title     : ',
                       'Artist    : ',
                       'BPM       : 120',
                       'Tabbed by : ',
                       'Date      : ' + self.exportDate,
                       '',
                       'Cr - Crash',
                       'Hh - HiHat',
                       '',
                       'Cr|----------------|----------------|----------------|',
                       'Hh|x---------------|y---------------|z---------------|',
                       '   1e+a2e+a3e+a4e+a 1e+a2e+a3e+a4e+a 1e+a2e+a3e+a4e+a ',
                       '',
                       'Tabbed with DrumBurp, a drum tab editor from www.whatang.org'])
Exemplo n.º 2
0
 def testStaffs(self):
     score = Score()
     settings = ASCIISettings()
     settings.omitEmpty = False
     score.drumKit = DrumKit.DrumKit()
     score.drumKit.addDrum(Drum.Drum("HiHat", "Hh", "x"))
     score.drumKit.addDrum(Drum.Drum("Crash", "Cr", "x"))
     counter = MeasureCount.counterMaker(4, 16)
     score.insertMeasureByIndex(16, counter=counter)
     score.insertMeasureByIndex(16, counter=counter)
     score.insertMeasureByIndex(16, counter=counter)
     score.addNote(NotePosition(0, 0, 0, 0), "x")
     score.addNote(NotePosition(0, 1, 0, 0), "y")
     score.addNote(NotePosition(0, 2, 0, 0), "z")
     score.formatScore(40)
     output = self.getOutput(score, settings)
     self.assertEqual(output, [
         'Tabbed with DrumBurp, a drum tab editor from www.whatang.org', '',
         'Title     : ', 'Artist    : ', 'BPM       : 120', 'Tabbed by : ',
         'Date      : ' + self.exportDate, '', 'Cr - Crash', 'Hh - HiHat',
         '', 'Cr|----------------|----------------|',
         'Hh|x---------------|y---------------|',
         '   1e+a2e+a3e+a4e+a 1e+a2e+a3e+a4e+a ', '',
         'Cr|----------------|', 'Hh|z---------------|',
         '   1e+a2e+a3e+a4e+a ', '',
         'Tabbed with DrumBurp, a drum tab editor from www.whatang.org'
     ])
Exemplo n.º 3
0
 def generateAsciiSettings(self, settings = None):
     if settings is None:
         settings = ASCIISettings()
     settings.metadata = self.metadataVisible
     settings.kitKey = self.kitDataVisible
     settings.printCount = self.beatCountVisible
     settings.omitEmpty = not self.emptyLinesVisible
     return settings
Exemplo n.º 4
0
 def testEmpty(self):
     score = Score()
     settings = ASCIISettings()
     output = self.getOutput(score, settings)
     self.assertEqual(output, [
         'Tabbed with DrumBurp, a drum tab editor from www.whatang.org', '',
         'Title     : ', 'Artist    : ', 'BPM       : 120', 'Tabbed by : ',
         'Date      : ' + self.exportDate, '',
         'Tabbed with DrumBurp, a drum tab editor from www.whatang.org'
     ])
Exemplo n.º 5
0
 def __init__(self, filename, parent=None, settings=None):
     '''
     Constructor
     '''
     super(QAsciiExportDialog, self).__init__(parent)
     self.setupUi(self)
     if settings is None:
         settings = ASCIISettings()
     self._filename = None
     self._setInitialState(filename, settings)
Exemplo n.º 6
0
 def generateAsciiSettings(self, settings=None):
     if settings is None:
         settings = ASCIISettings()
     settings.metadata = self.metadataVisible
     settings.kitKey = self.kitDataVisible
     settings.printCount = self.beatCountVisible
     settings.omitEmpty = not self.emptyLinesVisible
     settings.printCounts = self.beatCountVisible
     return settings
Exemplo n.º 7
0
 def testWithKit(self):
     score = Score()
     settings = ASCIISettings()
     score.drumKit = DrumKit.DrumKit()
     score.drumKit.addDrum(Drum.Drum("HiHat", "Hh", "x"))
     score.drumKit.addDrum(Drum.Drum("Crash", "Cr", "x"))
     output = self.getOutput(score, settings)
     self.assertEqual(output, [
         'Tabbed with DrumBurp, a drum tab editor from www.whatang.org', '',
         'Title     : ', 'Artist    : ', 'BPM       : 120', 'Tabbed by : ',
         'Date      : ' + self.exportDate, '', 'Cr - Crash', 'Hh - HiHat',
         '', 'Tabbed with DrumBurp, a drum tab editor from www.whatang.org'
     ])
Exemplo n.º 8
0
 def getOptions(self):
     settings = ASCIISettings()
     for checkName in settings.checkNames():
         value = getattr(self, checkName + "Check").isChecked()
         setattr(settings, checkName, value)
     return settings
Exemplo n.º 9
0
 def getOptions(self):
     settings = ASCIISettings()
     for checkName in settings.checkNames():
         value = getattr(self, checkName + "Check").isChecked()
         setattr(settings, checkName, value)
     return settings