import log from "loglevel" ; import { IVoiceMeasureReadPlugin } from "../Interfaces/IVoiceMeasureReadPlugin" ; import { VoiceEntry , RhythmInstruction , KeyInstruction } from "../VoiceData" ; export class ReaderPluginManager { private voiceMeasureReadPlugins : IVoiceMeasureReadPlugin [ ] = [ ] ; public addVoiceMeasureReadPlugin ( plugin ) { this . voiceMeasureReadPlugins . push ( plugin ) ; } public processVoiceMeasureReadPlugins ( measureVoiceEntries , activeKey , currentRhythm ) { for ( const plugin of this . voiceMeasureReadPlugins ) { try { plugin . measureReadCalculations ( measureVoiceEntries , activeKey , currentRhythm ) ; } catch ( ex ) { log . info ( "VoiceGenerator.addSingleNote: " , ex ) ; } } } }