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 aChannelStatuswith the current number of uses at 0.ChannelStatus(int initialUses)Constructs aChannelStatuswith a specific number of current uses.
-
Method Summary
Modifier and Type Method Description voidaddUse()Adds one to the number of times this channel is being used.intgetUses()Retrieves the number of times this channel is in use.booleaninUse()Checks whether or not the channel is currently in use.voidremoveUse()Subtracts one from the number of times this channel is being used.
-
-
-
Constructor Detail
-
ChannelStatus
public ChannelStatus()
Constructs aChannelStatuswith the current number of uses at 0.
-
ChannelStatus
public ChannelStatus(int initialUses)
Constructs aChannelStatuswith 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:
trueif uses is greater than 0, otherwisefalse
-
getUses
public int getUses()
Retrieves the number of times this channel is in use.- Returns:
- number of uses
-
-