midi_output_port_android.h 799 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef MEDIA_MIDI_MIDI_OUTPUT_PORT_ANDROID_H_
  5. #define MEDIA_MIDI_MIDI_OUTPUT_PORT_ANDROID_H_
  6. #include <jni.h>
  7. #include <stdint.h>
  8. #include <vector>
  9. #include "base/android/scoped_java_ref.h"
  10. namespace midi {
  11. class MidiOutputPortAndroid final {
  12. public:
  13. MidiOutputPortAndroid(JNIEnv* env, jobject raw);
  14. ~MidiOutputPortAndroid();
  15. // Returns the when the operation succeeds or the port is already open.
  16. bool Open();
  17. void Close();
  18. void Send(const std::vector<uint8_t>& data);
  19. private:
  20. base::android::ScopedJavaGlobalRef<jobject> raw_port_;
  21. };
  22. } // namespace midi
  23. #endif // MEDIA_MIDI_MIDI_OUTPUT_PORT_ANDROID_H_