Sampled Instrument Player with static and monolithic design. All instruments are built-in.
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.

85 lines
3.4 KiB

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
Copyright 2021, Nils Hilbricht, Germany ( )
This file is part of the Laborejo Software Suite ( ),
This application is free software: you can redistribute it and/or modify
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;"import {}".format(__file__))
#Standard Library Modules
import os.path
#Third Party Modules
from PyQt5 import QtWidgets, QtCore, QtGui
#Template Modules
from template.qtgui.mainwindow import MainWindow as TemplateMainWindow
from import Menu
from template.qtgui.about import About
#Our modules
import engine.api as api
from .instrument import InstrumentTreeController
class MainWindow(TemplateMainWindow):
def __init__(self):
"""The order of calls is very important.
The split ploint is calling the super.__init. Some functions need to be called before,
some after.
For example:
The about dialog is created in the template main window init. So we need to set additional
help texts before that init.
#Inject more help texts in the templates About "Did You Know" field.
#About.didYouKnow is a class variable.
#Make the first three words matter!
#Do not start them all with "You can..." or "...that you can", in response to the Did you know? title.
#We use injection into the class and not a parameter because this dialog gets shown by creating an object. We can't give the parameters when this is shown via the mainWindow menu.
About.didYouKnow = [
QtCore.QCoreApplication.translate("About", "There is no way to load your own instruments into this program. If you create your own instruments and would like them to be included please contact the developers for a collaboration.")
] + About.didYouKnow
#make the search bar smaller
self.ui.search_groupBox.setMinimumSize(30, 1)
self.instrumentTreeController = InstrumentTreeController(parentMainWindow=self)
self.start() #This shows the GUI, or not, depends on the NSM gui save setting. We need to call that after the menu, otherwise the about dialog will block and then we get new menu entries, which looks strange.
def setupMenu(self):
"""In its own function purely for readability"""
#New menu entries and template-menu overrides"actionAbout", lambda: print("About Dialog Menu deactivated")) #deactivates the original function"menuEdit", "actionNils", "Nils", lambda: print("Merle"))"actionNils", lambda: print("Override"))
def zoom(self, scaleFactor:float):
def stretchXCoordinates(self, factor):