You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
2.1 KiB

4 years ago
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
11 months ago
Copyright 2022, Nils Hilbricht, Germany ( )
4 years ago
4 years ago
This file is part of the Laborejo Software Suite ( ),
4 years ago
4 years ago
Laborejo2 is free software: you can redistribute it and/or modify
4 years ago
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <>.
import logging; logger = logging.getLogger(__name__);"import")
4 years ago
from template.qtgui.constantsAndConfigs import ConstantsAndConfigs as TemplateConstantsAndConfigs
4 years ago
import engine.api as api
from PyQt5 import QtGui
class ConstantsAndConfigs(TemplateConstantsAndConfigs):
4 years ago
def __init__(self):
4 years ago
self.ticksToPixelRatio = 128*3*5 #bigger value means less space between notes #api.D128 and 128*3*5 is also good. This gets changed during runtime as "Stretch Factor". Also: the QSettings save and reload this on a per-file basis.
#a quarter note has 53760 ticks. that is 53760 / 1920 = 28 pixels.
self.stafflineGap = 7 #it is 7 because it is an odd number, which has a middle. 123 4 567 which translates 1:1 to pixels.
self.beamHeight = 2
self.magicPixel = 4
self.negativeMagicPixel = -2
self.trackHeight = self.stafflineGap * 10
self.trackHeight = self.stafflineGap * 12
self.noteHeadMode = True #False means rectangle noteheads
4 years ago
self.availableEditModes = ("notation", "cc", "block")
self.ccViewValue = 0 #0-127. Only has effect if ccView is True
self.ccViewCallbacks = [] #list of functions. For example the main Window CC spin box and the block Editor CC spin box.
constantsAndConfigs = ConstantsAndConfigs() #singleton