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

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

Issue 942243002: Web MIDI: blink API update to support MIDIPortState (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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') | public/platform/WebMIDIAccessorClient.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 void MIDIAccessor::startSession() 58 void MIDIAccessor::startSession()
59 { 59 {
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 // FIXME: Remove obsolete interfaces that use isActive.
68 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version, bool isActive) 69 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version, bool isActive)
69 { 70 {
70 m_client->didAddInputPort(id, manufacturer, name, version, isActive); 71 m_client->didAddInputPort(id, manufacturer, name, version, isActive);
71 } 72 }
72 73
73 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version, bool isActive) 74 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version, bool isActive)
74 { 75 {
75 m_client->didAddOutputPort(id, manufacturer, name, version, isActive); 76 m_client->didAddOutputPort(id, manufacturer, name, version, isActive);
76 } 77 }
77 78
79 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version, MIDIPortState state)
80 {
81 m_client->didAddInputPort(id, manufacturer, name, version, state != MIDIPort StateDisconnected);
82 }
83
84 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version, MIDIPortState state)
85 {
86 m_client->didAddOutputPort(id, manufacturer, name, version, state != MIDIPor tStateDisconnected);
87 }
88
89 // FIXME: Remove obsolete interfaces that use isActive.
78 void MIDIAccessor::didSetInputPortState(unsigned portIndex, bool isActive) 90 void MIDIAccessor::didSetInputPortState(unsigned portIndex, bool isActive)
79 { 91 {
80 m_client->didSetInputPortState(portIndex, isActive); 92 m_client->didSetInputPortState(portIndex, isActive);
81 } 93 }
82 94
83 void MIDIAccessor::didSetOutputPortState(unsigned portIndex, bool isActive) 95 void MIDIAccessor::didSetOutputPortState(unsigned portIndex, bool isActive)
84 { 96 {
85 m_client->didSetOutputPortState(portIndex, isActive); 97 m_client->didSetOutputPortState(portIndex, isActive);
86 } 98 }
87 99
100 void MIDIAccessor::didSetInputPortState(unsigned portIndex, MIDIPortState state)
101 {
102 m_client->didSetInputPortState(portIndex, state != MIDIPortStateDisconnected );
103 }
104
105 void MIDIAccessor::didSetOutputPortState(unsigned portIndex, MIDIPortState state )
106 {
107 m_client->didSetOutputPortState(portIndex, state != MIDIPortStateDisconnecte d);
108 }
109
88 void MIDIAccessor::didStartSession(bool success, const WebString& error, const W ebString& message) 110 void MIDIAccessor::didStartSession(bool success, const WebString& error, const W ebString& message)
89 { 111 {
90 m_client->didStartSession(success, error, message); 112 m_client->didStartSession(success, error, message);
91 } 113 }
92 114
93 void MIDIAccessor::didReceiveMIDIData(unsigned portIndex, const unsigned char* d ata, size_t length, double timeStamp) 115 void MIDIAccessor::didReceiveMIDIData(unsigned portIndex, const unsigned char* d ata, size_t length, double timeStamp)
94 { 116 {
95 m_client->didReceiveMIDIData(portIndex, data, length, timeStamp); 117 m_client->didReceiveMIDIData(portIndex, data, length, timeStamp);
96 } 118 }
97 119
98 } // namespace blink 120 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIAccessor.h ('k') | public/platform/WebMIDIAccessorClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698