bug: selection after control change w/ split.
This commit is contained in:
@@ -62,7 +62,7 @@ pstage:stage3
|
|||||||
a lv2:Plugin ,
|
a lv2:Plugin ,
|
||||||
lv2:SimulatorPlugin ;
|
lv2:SimulatorPlugin ;
|
||||||
|
|
||||||
doap:name "TooB2 Power Stage";
|
doap:name "TooB Power Stage";
|
||||||
|
|
||||||
doap:license <https://two-play.com/TooB/licenses/isc> ;
|
doap:license <https://two-play.com/TooB/licenses/isc> ;
|
||||||
doap:maintainer <http://two-play.com/rerdavies#me> ;
|
doap:maintainer <http://two-play.com/rerdavies#me> ;
|
||||||
@@ -70,7 +70,7 @@ pstage:stage3
|
|||||||
lv2:microVersion 1 ;
|
lv2:microVersion 1 ;
|
||||||
|
|
||||||
mod:brand "TooB";
|
mod:brand "TooB";
|
||||||
mod:label "Power Stage 2.0";
|
mod:label "Power Stage";
|
||||||
lv2:requiredFeature urid:map ;
|
lv2:requiredFeature urid:map ;
|
||||||
lv2:optionalFeature lv2:hardRTCapable;
|
lv2:optionalFeature lv2:hardRTCapable;
|
||||||
lv2:extensionData state:interface;
|
lv2:extensionData state:interface;
|
||||||
|
|||||||
Binary file not shown.
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<http://two-play.com/plugins/toob-freeverb>
|
<http://two-play.com/plugins/toob-freeverb>
|
||||||
a lv2:Plugin ,
|
a lv2:Plugin ,
|
||||||
lv2:SimulatorPlugin ;
|
lv2:ReverbPlugin ;
|
||||||
doap:name "TooB Freeverb" ,
|
doap:name "TooB Freeverb" ,
|
||||||
"TooB Freeverb"@en-gb-gb
|
"TooB Freeverb"@en-gb-gb
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -12,13 +12,6 @@
|
|||||||
rdfs:seeAlso <ToobML.ttl> .
|
rdfs:seeAlso <ToobML.ttl> .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<http://two-play.com/plugins/toob-power-stage> a lv2:Plugin ;
|
|
||||||
lv2:binary <ToobAmp.so> ;
|
|
||||||
rdfs:seeAlso <PowerStage.ttl> .
|
|
||||||
|
|
||||||
<http://two-play.com/plugins/toob-power-stage-2> a lv2:Plugin ;
|
<http://two-play.com/plugins/toob-power-stage-2> a lv2:Plugin ;
|
||||||
lv2:binary <ToobAmp.so> ;
|
lv2:binary <ToobAmp.so> ;
|
||||||
rdfs:seeAlso <PowerStage2.ttl> .
|
rdfs:seeAlso <PowerStage2.ttl> .
|
||||||
|
|||||||
+5
-16
@@ -116,11 +116,7 @@ export const MainPage =
|
|||||||
super(props);
|
super(props);
|
||||||
this.model = PiPedalModelFactory.getInstance();
|
this.model = PiPedalModelFactory.getInstance();
|
||||||
let pedalboard = this.model.pedalBoard.get();
|
let pedalboard = this.model.pedalBoard.get();
|
||||||
let selectedPedal = -1;
|
let selectedPedal = pedalboard.getFirstSelectableItem();
|
||||||
if (pedalboard.items.length !== 0)
|
|
||||||
{
|
|
||||||
selectedPedal = pedalboard.items[0].instanceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
selectedPedal: selectedPedal,
|
selectedPedal: selectedPedal,
|
||||||
@@ -196,18 +192,11 @@ export const MainPage =
|
|||||||
}
|
}
|
||||||
onPedalBoardChanged(value: PedalBoard) {
|
onPedalBoardChanged(value: PedalBoard) {
|
||||||
let selectedItem = -1;
|
let selectedItem = -1;
|
||||||
for (let i = 0; i < value.items.length; ++i)
|
if (value.hasItem(this.state.selectedPedal))
|
||||||
{
|
{
|
||||||
if (this.state.selectedPedal === value.items[i].instanceId)
|
selectedItem = this.state.selectedPedal;
|
||||||
{
|
} else {
|
||||||
selectedItem = this.state.selectedPedal;
|
selectedItem = value.getFirstSelectableItem();
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// if no selection the current pedalboard, reset to the first item.
|
|
||||||
if (selectedItem === -1)
|
|
||||||
{
|
|
||||||
selectedItem = value.items[0].instanceId;
|
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
pedalBoard: value,
|
pedalBoard: value,
|
||||||
|
|||||||
@@ -272,6 +272,33 @@ export class PedalBoard implements Deserializable<PedalBoard> {
|
|||||||
yield v.value;
|
yield v.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasItem(instanceId: number): boolean
|
||||||
|
{
|
||||||
|
let it = this.itemsGenerator();
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
let v = it.next();
|
||||||
|
if (v.done) break;
|
||||||
|
if (v.value.instanceId === instanceId)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getFirstSelectableItem(): number
|
||||||
|
{
|
||||||
|
if (this.items.length !== 0)
|
||||||
|
{
|
||||||
|
return this.items[0].instanceId;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
maybeGetItem(instanceId: number): PedalBoardItem | null{
|
maybeGetItem(instanceId: number): PedalBoardItem | null{
|
||||||
let it = this.itemsGenerator();
|
let it = this.itemsGenerator();
|
||||||
while (true)
|
while (true)
|
||||||
|
|||||||
Reference in New Issue
Block a user