@Override public void onDeviceStatusChanged(final MidiDeviceStatus status) { MidiDeviceInfo info = status.getDeviceInfo(); BluetoothMidiDeviceTracker tracker = mOpenDeviceListAdapter .getDevice(info); if (tracker != null) { tracker.outputOpenCount = 0; for (int i = 0; i < info.getOutputPortCount(); i++) { tracker.outputOpenCount += status .getOutputPortOpenCount(i); } tracker.inputOpenCount = 0; for (int i = 0; i < info.getInputPortCount(); i++) { tracker.inputOpenCount += status.isInputPortOpen(i) ? 1 : 0; } mOpenDeviceListAdapter.notifyDataSetChanged(); } } }, new android.os.Handler(Looper.getMainLooper()));
/** * This will get called when clients connect or disconnect. * Log device information. */ @Override public void onDeviceStatusChanged(MidiDeviceStatus status) { if (mScopeLogger != null) { if (status.isInputPortOpen(0)) { mScopeLogger.log("=== connected ==="); String text = MidiPrinter.formatDeviceInfo( status.getDeviceInfo()); mScopeLogger.log(text); } else { mScopeLogger.log("--- disconnected ---"); } } } }
/** * This will get called when clients connect or disconnect. */ @Override public void onDeviceStatusChanged(MidiDeviceStatus status) { if (status.isInputPortOpen(0) && !mSynthStarted) { mSynthEngine.start(); mSynthStarted = true; } else if (!status.isInputPortOpen(0) && mSynthStarted) { mSynthEngine.stop(); mSynthStarted = false; } }
/** * This will get called when clients connect or disconnect. * Log device information. */ @Override public void onDeviceStatusChanged(MidiDeviceStatus status) { if (mScopeLogger != null) { if (status.isInputPortOpen(0)) { mScopeLogger.log("=== connected ==="); String text = MidiPrinter.formatDeviceInfo( status.getDeviceInfo()); mScopeLogger.log(text); } else { mScopeLogger.log("--- disconnected ---"); } } } }
/** * This will get called when clients connect or disconnect. */ @Override public void onDeviceStatusChanged(MidiDeviceStatus status) { if (status.isInputPortOpen(0) && !mSynthStarted) { mSynthEngine.start(); mSynthStarted = true; } else if (!status.isInputPortOpen(0) && mSynthStarted){ mSynthEngine.stop(); mSynthStarted = false; } }
MidiDeviceInfo info = status.getDeviceInfo(); Log.i(MidiConstants.TAG, "MidiPortSelector.onDeviceStatusChanged status = " + status + ", mType = " + mType MidiPortWrapper wrapper = new MidiPortWrapper(info, mType, i); if (!wrapper.equals(mCurrentWrapper)) { if (status.isInputPortOpen(i)) { // busy? if (!mBusyPorts.contains(wrapper)) {
MidiDeviceInfo info = status.getDeviceInfo(); Log.i(MidiConstants.TAG, "MidiPortSelector.onDeviceStatusChanged status = " + status + ", mType = " + mType MidiPortWrapper wrapper = new MidiPortWrapper(info, mType, i); if (!wrapper.equals(mCurrentWrapper)) { if (status.isInputPortOpen(i)) { // busy? if (!mBusyPorts.contains(wrapper)) {
MidiDeviceInfo info = status.getDeviceInfo(); Log.i(MidiConstants.TAG, "MidiPortSelector.onDeviceStatusChanged status = " + status + ", mType = " + mType MidiPortWrapper wrapper = new MidiPortWrapper(info, mType, i); if (!wrapper.equals(mCurrentWrapper)) { if (status.isInputPortOpen(i)) { // busy? if (!mBusyPorts.contains(wrapper)) {