#include "media/midi/midi_manager.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
namespace midi {
namespace {
Sample;
PortState;
Result;
enum class Usage { … };
enum class SendReceiveUsage { … };
void ReportUsage(Usage usage) { … }
}
MidiManager::MidiManager(MidiService* service) : … { … }
MidiManager::~MidiManager() { … }
#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) && \
!(defined(USE_ALSA) && defined(USE_UDEV)) && !BUILDFLAG(IS_ANDROID)
MidiManager* MidiManager::Create(MidiService* service) {
ReportUsage(Usage::CREATED_ON_UNSUPPORTED_PLATFORMS);
return new MidiManager(service);
}
#endif
void MidiManager::StartSession(MidiManagerClient* client) { … }
bool MidiManager::EndSession(MidiManagerClient* client) { … }
bool MidiManager::HasOpenSession() { … }
void MidiManager::DispatchSendMidiData(MidiManagerClient* client,
uint32_t port_index,
const std::vector<uint8_t>& data,
base::TimeTicks timestamp) { … }
void MidiManager::EndAllSessions() { … }
void MidiManager::StartInitialization() { … }
void MidiManager::CompleteInitialization(Result result) { … }
void MidiManager::AddInputPort(const mojom::PortInfo& info) { … }
void MidiManager::AddOutputPort(const mojom::PortInfo& info) { … }
void MidiManager::SetInputPortState(uint32_t port_index, PortState state) { … }
void MidiManager::SetOutputPortState(uint32_t port_index, PortState state) { … }
mojom::PortState MidiManager::GetOutputPortState(uint32_t port_index) { … }
void MidiManager::AccumulateMidiBytesSent(MidiManagerClient* client, size_t n) { … }
void MidiManager::ReceiveMidiData(uint32_t port_index,
const uint8_t* data,
size_t length,
base::TimeTicks timestamp) { … }
size_t MidiManager::GetClientCountForTesting() { … }
size_t MidiManager::GetPendingClientCountForTesting() { … }
}