|
@@ -5,12 +5,13 @@ from PyQt5.QtCore import Qt, QThread, pyqtSignal
|
|
|
from PyQt5.QtGui import QPixmap
|
|
from PyQt5.QtGui import QPixmap
|
|
|
from PyQt5 import uic
|
|
from PyQt5 import uic
|
|
|
import keyboard
|
|
import keyboard
|
|
|
-from ly import * #LilyPondFile, LilyPondFormat
|
|
|
|
|
|
|
+from ly import *
|
|
|
import ly.document
|
|
import ly.document
|
|
|
import ly.cli.command
|
|
import ly.cli.command
|
|
|
import ly.cli.main
|
|
import ly.cli.main
|
|
|
#from ly import ly.transposition ?
|
|
#from ly import ly.transposition ?
|
|
|
-from abjad import *
|
|
|
|
|
|
|
+from abjad import LilyPondFile, Pitch, Note
|
|
|
|
|
+import re
|
|
|
|
|
|
|
|
class SheetMusicEditor(QDialog):
|
|
class SheetMusicEditor(QDialog):
|
|
|
class KeyboardListener(QThread):
|
|
class KeyboardListener(QThread):
|
|
@@ -69,7 +70,7 @@ class SheetMusicEditor(QDialog):
|
|
|
self.a_button.clicked.connect(lambda: self.add_note_to_file("a'"))
|
|
self.a_button.clicked.connect(lambda: self.add_note_to_file("a'"))
|
|
|
self.b_button.clicked.connect(lambda: self.add_note_to_file("b'"))
|
|
self.b_button.clicked.connect(lambda: self.add_note_to_file("b'"))
|
|
|
|
|
|
|
|
- self.lineEdit(self.change_title)
|
|
|
|
|
|
|
+ #self.lineEdit(self.change_title)
|
|
|
line_edit = QLineEdit()
|
|
line_edit = QLineEdit()
|
|
|
line_edit.textChanged.connect(lambda text: change_title(title=text))
|
|
line_edit.textChanged.connect(lambda text: change_title(title=text))
|
|
|
#tady takové divné, ten první a třetí řádek spolu neinteragují hezky
|
|
#tady takové divné, ten první a třetí řádek spolu neinteragují hezky
|
|
@@ -211,9 +212,8 @@ class SheetMusicEditor(QDialog):
|
|
|
lilypond_file.add_item(self.musicEdit.toPlainText())
|
|
lilypond_file.add_item(self.musicEdit.toPlainText())
|
|
|
|
|
|
|
|
# Save LilyPond file
|
|
# Save LilyPond file
|
|
|
- lilypond_format = LilyPondFormat()
|
|
|
|
|
with open(filename, 'w') as f:
|
|
with open(filename, 'w') as f:
|
|
|
- f.write(lilypond_format(lilypond_file))
|
|
|
|
|
|
|
+ f.write(lilypond_file)
|
|
|
|
|
|
|
|
def openFile(self):
|
|
def openFile(self):
|
|
|
# Get filename from user
|
|
# Get filename from user
|
|
@@ -237,4 +237,4 @@ if __name__ == '__main__':
|
|
|
app = QApplication(sys.argv)
|
|
app = QApplication(sys.argv)
|
|
|
editor = SheetMusicEditor()
|
|
editor = SheetMusicEditor()
|
|
|
editor.show()
|
|
editor.show()
|
|
|
- sys.exit(app.exec_())
|
|
|
|
|
|
|
+ sys.exit(app.exec_())
|