This source file includes following definitions.
- create
- startSession
- sendMIDIData
- didAddInputPort
- didAddOutputPort
- didStartSession
- didReceiveMIDIData
#include "config.h"
#include "modules/webmidi/MIDIAccessor.h"
#include "modules/webmidi/MIDIAccessorClient.h"
#include "public/platform/Platform.h"
#include "wtf/text/WTFString.h"
using blink::WebString;
namespace WebCore {
PassOwnPtr<MIDIAccessor> MIDIAccessor::create(MIDIAccessorClient* client)
{
return adoptPtr(new MIDIAccessor(client));
}
MIDIAccessor::MIDIAccessor(MIDIAccessorClient* client)
: m_client(client)
{
ASSERT(client);
m_accessor = adoptPtr(blink::Platform::current()->createMIDIAccessor(this));
ASSERT(m_accessor);
}
void MIDIAccessor::startSession()
{
m_accessor->startSession();
}
void MIDIAccessor::sendMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp)
{
m_accessor->sendMIDIData(portIndex, data, length, timeStamp);
}
void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufacturer, const WebString& name, const WebString& version)
{
m_client->didAddInputPort(id, manufacturer, name, version);
}
void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufacturer, const WebString& name, const WebString& version)
{
m_client->didAddOutputPort(id, manufacturer, name, version);
}
void MIDIAccessor::didStartSession(bool success)
{
m_client->didStartSession(success);
}
void MIDIAccessor::didReceiveMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp)
{
m_client->didReceiveMIDIData(portIndex, data, length, timeStamp);
}
}