mmi-js
Version:
Multi-Modal Input Library for voice, gesture, and traditional inputs.
31 lines (25 loc) • 744 B
JavaScript
import VoiceInput from './VoiceInput.js';
import GestureInput from './GestureInput.js';
import TraditionalInput from './TraditionalInput.js';
import EventBus from './EventBus.js';
class MMIManager {
constructor({ voice = false, gesture = false, traditional = true } = {}) {
this.eventBus = new EventBus();
if (voice) {
this.voiceInput = new VoiceInput(this.eventBus);
}
if (gesture) {
this.gestureInput = new GestureInput(this.eventBus);
}
if (traditional) {
this.traditionalInput = new TraditionalInput(this.eventBus);
}
}
on(event, callback) {
this.eventBus.on(event, callback);
}
off(event, callback) {
this.eventBus.off(event, callback);
}
}
export default MMIManager;