Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: Source/modules/webmidi/MIDIAccessor.cpp

Issue 649683006: Web MIDI: add blink APIs to notify device connection events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address a comment at #21 Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/webmidi/MIDIAccessor.h ('k') | Source/modules/webmidi/MIDIAccessorClient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 m_accessor->startSession(); 60 m_accessor->startSession();
61 } 61 }
62 62
63 void MIDIAccessor::sendMIDIData(unsigned portIndex, const unsigned char* data, s ize_t length, double timeStamp) 63 void MIDIAccessor::sendMIDIData(unsigned portIndex, const unsigned char* data, s ize_t length, double timeStamp)
64 { 64 {
65 m_accessor->sendMIDIData(portIndex, data, length, timeStamp); 65 m_accessor->sendMIDIData(portIndex, data, length, timeStamp);
66 } 66 }
67 67
68 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version) 68 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version)
69 { 69 {
70 m_client->didAddInputPort(id, manufacturer, name, version); 70 m_client->didAddInputPort(id, manufacturer, name, version, true);
71 } 71 }
72 72
73 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version) 73 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version)
74 { 74 {
75 m_client->didAddOutputPort(id, manufacturer, name, version); 75 m_client->didAddOutputPort(id, manufacturer, name, version, true);
76 }
77
78 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version, bool isActive)
79 {
80 m_client->didAddInputPort(id, manufacturer, name, version, isActive);
81 }
82
83 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version, bool isActive)
84 {
85 m_client->didAddOutputPort(id, manufacturer, name, version, isActive);
86 }
87
88 void MIDIAccessor::didSetInputPortState(unsigned portIndex, bool isActive)
89 {
90 m_client->didSetInputPortState(portIndex, isActive);
91 }
92
93 void MIDIAccessor::didSetOutputPortState(unsigned portIndex, bool isActive)
94 {
95 m_client->didSetOutputPortState(portIndex, isActive);
76 } 96 }
77 97
78 void MIDIAccessor::didStartSession(bool success, const WebString& error, const W ebString& message) 98 void MIDIAccessor::didStartSession(bool success, const WebString& error, const W ebString& message)
79 { 99 {
80 m_client->didStartSession(success, error, message); 100 m_client->didStartSession(success, error, message);
81 } 101 }
82 102
83 void MIDIAccessor::didReceiveMIDIData(unsigned portIndex, const unsigned char* d ata, size_t length, double timeStamp) 103 void MIDIAccessor::didReceiveMIDIData(unsigned portIndex, const unsigned char* d ata, size_t length, double timeStamp)
84 { 104 {
85 m_client->didReceiveMIDIData(portIndex, data, length, timeStamp); 105 m_client->didReceiveMIDIData(portIndex, data, length, timeStamp);
86 } 106 }
87 107
88 } // namespace blink 108 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIAccessor.h ('k') | Source/modules/webmidi/MIDIAccessorClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698