mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-27 10:50:23 -04:00
30 lines
654 B
Go
30 lines
654 B
Go
package compiler
|
|
|
|
import "github.com/vsariola/sointu/vm"
|
|
|
|
type FeatureSetMacros struct {
|
|
vm.FeatureSet
|
|
}
|
|
|
|
func (p *FeatureSetMacros) HasOp(instruction string) bool {
|
|
_, ok := p.Opcode(instruction)
|
|
return ok
|
|
}
|
|
|
|
func (p *FeatureSetMacros) GetOp(instruction string) int {
|
|
v, _ := p.Opcode(instruction)
|
|
return v
|
|
}
|
|
|
|
func (p *FeatureSetMacros) Stereo(unitType string) bool {
|
|
return p.SupportsParamValue(unitType, "stereo", 1)
|
|
}
|
|
|
|
func (p *FeatureSetMacros) Mono(unitType string) bool {
|
|
return p.SupportsParamValue(unitType, "stereo", 0)
|
|
}
|
|
|
|
func (p *FeatureSetMacros) StereoAndMono(unitType string) bool {
|
|
return p.Stereo(unitType) && p.Mono(unitType)
|
|
}
|