Class MidiProcessor.ChannelStatus
- java.lang.Object
-
- com.github.noahr_atc.midisplitter.MidiProcessor.ChannelStatus
-
- Enclosing class:
- MidiProcessor
protected static class MidiProcessor.ChannelStatus extends Object
Represents whether or not a MIDI channel is available, as well as how many notes need to be turned off before the will be available.- Since:
- 2020-03-08
-
-
Constructor Summary
Constructors Constructor Description ChannelStatus()
Constructs aChannelStatus
with the current number of uses at 0.ChannelStatus(int initialUses)
Constructs aChannelStatus
with a specific number of current uses.
-
Method Summary
Modifier and Type Method Description void
addUse()
Adds one to the number of times this channel is being used.int
getUses()
Retrieves the number of times this channel is in use.boolean
inUse()
Checks whether or not the channel is currently in use.void
removeUse()
Subtracts one from the number of times this channel is being used.
-
-
-
Constructor Detail
-
ChannelStatus
public ChannelStatus()
Constructs aChannelStatus
with the current number of uses at 0.
-
ChannelStatus
public ChannelStatus(int initialUses)
Constructs aChannelStatus
with a specific number of current uses.- Parameters:
initialUses
- the number of times this channel is currently being used
-
-
Method Detail
-
addUse
public void addUse()
Adds one to the number of times this channel is being used.
-
removeUse
public void removeUse()
Subtracts one from the number of times this channel is being used. When all uses are subtracted, the channel is considered available.
-
inUse
public boolean inUse()
Checks whether or not the channel is currently in use.- Returns:
true
if uses is greater than 0, otherwisefalse
-
getUses
public int getUses()
Retrieves the number of times this channel is in use.- Returns:
- number of uses
-
-