344 |
if(!llFSI.isEmpty()) subscribe("FX_SEND_INFO"); |
if(!llFSI.isEmpty()) subscribe("FX_SEND_INFO"); |
345 |
if(!llSC.isEmpty()) subscribe("STREAM_COUNT"); |
if(!llSC.isEmpty()) subscribe("STREAM_COUNT"); |
346 |
if(!llVC.isEmpty()) subscribe("VOICE_COUNT"); |
if(!llVC.isEmpty()) subscribe("VOICE_COUNT"); |
347 |
|
if(!llTSC.isEmpty()) subscribe("TOTAL_STREAM_COUNT"); |
348 |
if(!llTVC.isEmpty()) subscribe("TOTAL_VOICE_COUNT"); |
if(!llTVC.isEmpty()) subscribe("TOTAL_VOICE_COUNT"); |
349 |
if(!llMIMC.isEmpty()) subscribe("MIDI_INSTRUMENT_MAP_COUNT"); |
if(!llMIMC.isEmpty()) subscribe("MIDI_INSTRUMENT_MAP_COUNT"); |
350 |
if(!llMIMI.isEmpty()) subscribe("MIDI_INSTRUMENT_MAP_INFO"); |
if(!llMIMI.isEmpty()) subscribe("MIDI_INSTRUMENT_MAP_INFO"); |
486 |
private final Vector<ItemInfoListener> llMIDI = new Vector<ItemInfoListener>(); |
private final Vector<ItemInfoListener> llMIDI = new Vector<ItemInfoListener>(); |
487 |
private final Vector<StreamCountListener> llSC = new Vector<StreamCountListener>(); |
private final Vector<StreamCountListener> llSC = new Vector<StreamCountListener>(); |
488 |
private final Vector<VoiceCountListener> llVC = new Vector<VoiceCountListener>(); |
private final Vector<VoiceCountListener> llVC = new Vector<VoiceCountListener>(); |
489 |
|
private final Vector<TotalStreamCountListener> llTSC = new Vector<TotalStreamCountListener>(); |
490 |
private final Vector<TotalVoiceCountListener> llTVC = new Vector<TotalVoiceCountListener>(); |
private final Vector<TotalVoiceCountListener> llTVC = new Vector<TotalVoiceCountListener>(); |
491 |
|
|
492 |
/** MIDI instrument map count listeners */ |
/** MIDI instrument map count listeners */ |
524 |
!llMIDI.isEmpty() || |
!llMIDI.isEmpty() || |
525 |
!llSC.isEmpty() || |
!llSC.isEmpty() || |
526 |
!llVC.isEmpty() || |
!llVC.isEmpty() || |
527 |
|
!llTSC.isEmpty() || |
528 |
!llTVC.isEmpty() || |
!llTVC.isEmpty() || |
529 |
!llMIMC.isEmpty() || |
!llMIMC.isEmpty() || |
530 |
!llMIMI.isEmpty() || |
!llMIMI.isEmpty() || |
665 |
} catch(NumberFormatException x) { |
} catch(NumberFormatException x) { |
666 |
getLogger().log(Level.WARNING, "Unknown CHANNEL_INFO format", x); |
getLogger().log(Level.WARNING, "Unknown CHANNEL_INFO format", x); |
667 |
} |
} |
668 |
|
} else if(s.startsWith("TOTAL_STREAM_COUNT:")) { |
669 |
|
try { |
670 |
|
s = s.substring("TOTAL_STREAM_COUNT:".length()); |
671 |
|
int i = Integer.parseInt(s); |
672 |
|
TotalStreamCountEvent e = new TotalStreamCountEvent(this, i); |
673 |
|
for(TotalStreamCountListener l : llTSC) l.totalStreamCountChanged(e); |
674 |
|
} catch(NumberFormatException x) { |
675 |
|
getLogger().log ( |
676 |
|
Level.WARNING, "Unknown TOTAL_STREAM_COUNT format", x |
677 |
|
); |
678 |
|
} |
679 |
} else if(s.startsWith("TOTAL_VOICE_COUNT:")) { |
} else if(s.startsWith("TOTAL_VOICE_COUNT:")) { |
680 |
try { |
try { |
681 |
s = s.substring("TOTAL_VOICE_COUNT:".length()); |
s = s.substring("TOTAL_VOICE_COUNT:".length()); |
1148 |
/** |
/** |
1149 |
* Registers the specified listener for receiving event messages. |
* Registers the specified listener for receiving event messages. |
1150 |
* Listeners can be registered regardless of the connection state. |
* Listeners can be registered regardless of the connection state. |
1151 |
|
* @param l The <code>TotalStreamCountListener</code> to register. |
1152 |
|
*/ |
1153 |
|
public synchronized void |
1154 |
|
addTotalStreamCountListener(TotalStreamCountListener l) { |
1155 |
|
if(llTSC.isEmpty()) subscribe("TOTAL_STREAM_COUNT"); |
1156 |
|
llTSC.add(l); |
1157 |
|
} |
1158 |
|
|
1159 |
|
/** |
1160 |
|
* Removes the specified listener. |
1161 |
|
* Listeners can be removed regardless of the connection state. |
1162 |
|
* @param l The <code>TotalStreamCountListener</code> to remove. |
1163 |
|
*/ |
1164 |
|
public synchronized void |
1165 |
|
removeTotalStreamCountListener(TotalStreamCountListener l) { |
1166 |
|
boolean b = llTSC.remove(l); |
1167 |
|
if(b && llTSC.isEmpty()) unsubscribe("TOTAL_STREAM_COUNT"); |
1168 |
|
} |
1169 |
|
|
1170 |
|
/** |
1171 |
|
* Registers the specified listener for receiving event messages. |
1172 |
|
* Listeners can be registered regardless of the connection state. |
1173 |
* @param l The <code>TotalVoiceCountListener</code> to register. |
* @param l The <code>TotalVoiceCountListener</code> to register. |
1174 |
*/ |
*/ |
1175 |
public synchronized void |
public synchronized void |
4907 |
} |
} |
4908 |
|
|
4909 |
/** |
/** |
4910 |
|
* Gets the current number of all active streams. |
4911 |
|
* @return The current number of all active streams. |
4912 |
|
* @throws IOException If some I/O error occurs. |
4913 |
|
* @throws LscpException If LSCP protocol corruption occurs. |
4914 |
|
* @throws LSException If some other error occurs. |
4915 |
|
*/ |
4916 |
|
public synchronized int |
4917 |
|
getTotalStreamCount() throws IOException, LscpException, LSException { |
4918 |
|
verifyConnection(); |
4919 |
|
out.writeLine("GET TOTAL_STREAM_COUNT"); |
4920 |
|
if(getPrintOnlyMode()) return -1; |
4921 |
|
|
4922 |
|
String s = getSingleLineResultSet().getResult(); |
4923 |
|
return parseInt(s); |
4924 |
|
} |
4925 |
|
|
4926 |
|
/** |
4927 |
* Gets the current number of all active voices. |
* Gets the current number of all active voices. |
4928 |
* @return The current number of all active voices. |
* @return The current number of all active voices. |
4929 |
* @throws IOException If some I/O error occurs. |
* @throws IOException If some I/O error occurs. |