Skip to content

Commit

Permalink
Rename as WebMidiNanokontrol to match package name. Cache .scene.
Browse files Browse the repository at this point in the history
  • Loading branch information
rektide committed Apr 6, 2018
1 parent 08e5919 commit 2e3739b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions web-midi-nanokontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const transport= {
record: 45
}

export class NanoKontrol2{
export class WebMidiNanokontrol{
static get Group(){
return group
}
Expand Down Expand Up @@ -82,7 +82,11 @@ export class NanoKontrol2{
consumeOutput( optionalOutputName){
return this._consume( optionalOutputName, "outputs")
}
async dumpScene( optionalName, optionalInputName){
async readScene( optionalName, optionalInputName){
if( this.scene){
return this.scene
}

// get output midi
var
output= await this.consumeOutput( optionalName),
Expand All @@ -101,10 +105,9 @@ export class NanoKontrol2{

// wait for scene dump
var scene= await readResponse
scene.data= decode( scene.data)
return scene
this.scene= decode( scene.data)
return this.scene
}

async readOne( messageKlass, optionalInputName){
var port= this.consumeInput( optionalInputName)
if( port.then){
Expand All @@ -118,4 +121,4 @@ function portOpenFilter( msg, {eventType}= {}){
return msg.port&& msg.port.connection=== "open"&& msg.port.state=== "connected"
}

export default NanoKontrol2
export default WebMidiNanokontrol

0 comments on commit 2e3739b

Please sign in to comment.