Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dConnectDevicePlugin/dConnectDeviceMidi/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This software includes the following work that is distributed in the Apache License 2.0.
- javax.sound.midi-for-Android (https://github.com/kshoji/javax.sound.midi-for-Android)
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
CustomTableRow.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.content.Context;
Expand All @@ -7,6 +13,11 @@
import android.widget.TableRow;
import android.widget.TextView;

/**
* テーブル行表示.
*
* @author NTT DOCOMO, INC.
*/
public class CustomTableRow extends TableRow {

private String mItemTitle;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
DConnectMidiBleSettingsActivity.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import androidx.fragment.app.Fragment;
Expand All @@ -7,6 +13,11 @@
import org.deviceconnect.android.deviceplugin.midi.fragment.SummaryFragment;
import org.deviceconnect.android.ui.activity.DConnectSettingPageFragmentActivity;

/**
* BLE 設定画面.
*
* @author NTT DOCOMO, INC.
*/
public class DConnectMidiBleSettingsActivity extends DConnectSettingPageFragmentActivity {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
DConnectMidiDeviceService.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.bluetooth.BluetoothDevice;
Expand Down Expand Up @@ -44,6 +50,11 @@
import java.util.List;
import java.util.logging.Logger;

/**
* MIDI デバイス操作用サービス.
*
* author NTT DOCOMO, INC.
*/
public class DConnectMidiDeviceService extends DConnectService implements MidiMessageSender {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
DConnectMidiServiceDetailActivity.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.app.Activity;
Expand All @@ -8,6 +14,8 @@

/**
* MIDI プラグインのサービス詳細情報画面.
*
* @author NTT DOCOMO, INC.
*/
public class DConnectMidiServiceDetailActivity extends Activity {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
DConnectMidiServiceListActivity.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.app.Activity;
Expand All @@ -14,6 +20,8 @@

/**
* MIDI プラグインのサービス一覧画面.
*
* @author NTT DOCOMO, INC.
*/
public class DConnectMidiServiceListActivity extends DConnectServiceListActivity {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
/*
DConnectMidiSettingsListActivity.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;

/**
* MIDI プラグイン設定リスト画面.
*
* @author NTT DOCOMO, INC.
*/
public class DConnectMidiSettingsListActivity extends FragmentActivity {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
/*
MidiDemoInstaller.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.content.Context;

import org.deviceconnect.android.deviceplugin.demo.DemoInstaller;

/**
* MIDI デモインストーラ.
*
* @author NTT DOCOMO, INC.
*/
public class MidiDemoInstaller extends DemoInstaller {

public MidiDemoInstaller(Context context) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
/*
MidiDemoSettingActivity.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;

/**
* デモページ設定画面.
*
* @author NTT DOCOMO, INC.
*/
public class MidiDemoSettingActivity extends FragmentActivity {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
MidiDeviceManager.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.bluetooth.BluetoothDevice;
Expand All @@ -20,6 +26,11 @@
import java.util.Set;
import java.util.logging.Logger;

/**
* MIDI デバイス管理クラス.
*
* @author NTT DOCOMO, INC.
*/
public class MidiDeviceManager {

private final Logger mLogger = Logger.getLogger("midi-plugin");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
MidiInputBuffer.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.media.midi.MidiInputPort;
Expand All @@ -7,6 +13,11 @@
import java.io.IOException;
import java.nio.ByteBuffer;

/**
* MIDI 受信バッファ.
*
* @author NTT DOCOMO, INC.
*/
class MidiInputBuffer {

private static final int BUFFER_SIZE = 1024;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
/*
MidiMessageSender.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import org.deviceconnect.android.deviceplugin.midi.core.MidiMessage;

import java.io.IOException;

/**
* MIDI メッセージ送信インターフェース.
*
* @author NTT DOCOMO, INC.
*/
public interface MidiMessageSender {
void send(int port, MidiMessage message) throws IOException;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
MidiMessageService.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.bluetooth.BluetoothDevice;
Expand Down Expand Up @@ -26,6 +32,8 @@

/**
* MIDI プラグイン本体.
*
* @author NTT DOCOMO, INC.
*/
public class MidiMessageService extends DConnectMessageService {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
MidiMessageServiceProvider.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.app.Service;

import org.deviceconnect.android.message.DConnectMessageServiceProvider;

/**
* DConnectMessageServiceProvider の実装.
*
* @param <T> サービスの拡張クラス
* @author NTT DOCOMO, INC.
*/
public class MidiMessageServiceProvider<T extends Service> extends DConnectMessageServiceProvider<Service> {
@SuppressWarnings("unchecked")
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
ServiceInfo.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi;

import android.media.midi.MidiDeviceInfo;
Expand All @@ -8,6 +14,11 @@
import java.util.ArrayList;
import java.util.List;

/**
* MIDI デバイス操作用サービスについての情報の構造体.
*
* @author NTT DOCOMO, INC.
*/
public class ServiceInfo implements Parcelable {

public enum Direction {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
BleEnableActivity.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi.ble.activity;

import android.app.Activity;
Expand All @@ -7,6 +13,11 @@
import android.os.Bundle;
import android.os.ResultReceiver;

/**
* BLE デバイス接続画面.
*
* @author NTT DOCOMO, INC.
*/
public class BleEnableActivity extends Activity {
private static final String EXTRA_CALLBACK = "EXTRA_CALLBACK";
private static final int REQUEST_CODE = 123456789;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
ChannelVoiceMessage.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi.core;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/*
ControlChangeMessage.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi.core;

import java.nio.ByteBuffer;

/**
* コントロール・チェンジ・メッセージ.
*
* @author NTT DOCOMO, INC.
*/
public class ControlChangeMessage extends ChannelVoiceMessage {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/*
MidiMessage.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi.core;

import java.nio.ByteBuffer;

/**
* MIDI メッセージ.
*
* @author NTT DOCOMO, INC.
*/
public abstract class MidiMessage {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
/*
MidiMessageParser.java
Copyright (c) 2020 NTT DOCOMO,INC.
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
package org.deviceconnect.android.deviceplugin.midi.core;

/**
* MIDI メッセージ解析クラス.
*
* 与えられたバイト配列を MIDI メッセージとして解析し、
* その結果を {@link MidiMessage} オブジェクトで返す.
*
* @author NTT DOCOMO, INC.
*/
public class MidiMessageParser {

Expand Down
Loading