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.
51 lines
1.9 KiB
51 lines
1.9 KiB
6 years ago
|
#! /usr/bin/env python3
|
||
|
# -*- coding: utf-8 -*-
|
||
|
"""
|
||
|
Copyright 2018, Nils Hilbricht, Germany ( https://www.hilbricht.net )
|
||
|
|
||
|
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
|
||
|
more specifically its template base application.
|
||
|
|
||
|
The Template Base 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
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
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 <http://www.gnu.org/licenses/>.
|
||
|
"""
|
||
|
|
||
|
import logging; logging.info("import {}".format(__file__))
|
||
|
|
||
|
from template.engine.data import Data as TemplateData
|
||
|
import template.engine.sequencer
|
||
|
|
||
|
class Data(template.engine.sequencer.Score):
|
||
|
"""There must always be a Data class in a file main.py.
|
||
|
Simply inheriting from engine.data.Data is easiest.
|
||
|
|
||
|
You need to match the init parameters of your parent class. They vary from class to class
|
||
|
of course. Simply copy and paste them from your Data parent class
|
||
|
|
||
|
There is also engine.sequencer.Score and engine.sampler_sf2.Sf2"""
|
||
|
|
||
|
def __init__(self, parentSession, tracks=None, tempoMap=None):
|
||
|
super().__init__(parentSession, tracks, tempoMap)
|
||
|
self.addTrack("Welt")
|
||
|
|
||
|
class Track(template.engine.sequencer.TemplateTrack):
|
||
|
def __repr__(self) -> str:
|
||
|
return f"Client Example Track: {self.name}"
|
||
|
|
||
|
def __init__(self, parentScore, name=None):
|
||
|
super().__init__(parentScore, name)
|
||
|
print (self)
|
||
|
|
||
|
#Dependency Injections.
|
||
|
template.engine.sequencer.Track = Track #Score will look for Track in its module.
|