Ejemplo n.º 1
0
    def __init__(self, parent=None):
        super(GridPR, self).__init__(parent)
        # self.width
        self.setGeometry(64, 20, 511, 421)
        self.setObjectName("prGrid")

        self.gridWidth = 200

        self.gridBlackWhite = GridBlackWhite(self)
        self.gridBlackWhite.setGeometry(QtCore.QRect(0, 0, const.PIANO_ROLL_GRID_WIDTH, const.PIANO_ROLL_RANGE))
        self.gridBlackWhite.setObjectName("grid")
Ejemplo n.º 2
0
class GridPR(Sprite):
    def __init__(self, parent=None):
        super(GridPR, self).__init__(parent)
        # self.width
        self.setGeometry(64, 20, 511, 421)
        self.setObjectName("prGrid")

        self.gridWidth = 200

        self.gridBlackWhite = GridBlackWhite(self)
        self.gridBlackWhite.setGeometry(QtCore.QRect(0, 0, const.PIANO_ROLL_GRID_WIDTH, const.PIANO_ROLL_RANGE))
        self.gridBlackWhite.setObjectName("grid")

    def addJNote(self, jVO):
        self.addChild(JNote(jVO))

    def setRange(self, bottom, top):
        pass
        # override event

    def paintEvent(self, event):
        pass

    def keyPressEvent(self, QKeyEvent):
        pass

    def keyReleaseEvent(self, QKeyEvent):
        pass

    def mousePressEvent(self, QMouseEvent):
        # if QMouseEvent.modifiers() == Qt.ShiftModifier:
        #    print 'shift'
        #    self.isKeyPress_SHIFT = True
        #    pass
        print self, "mousePressEvent", QMouseEvent.modifiers(), self.setFocus()
        pass

    def setGridWidth(self, w):
        self.gridBlackWhite.resize(w, const.PIANO_ROLL_RANGE)

    def zoom_v(self, z):
        self.gridBlackWhite.zoom_v = z
        for n in self.children:
            if n:
                n.move(n.x(), n.pitch_y * z)
        self.update()

    def zoom_h(self, z):
        self.zoom_h += z