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

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

Issue 950643002: Web MIDI: complete blink API update to support MIDIPortState (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@midi_api_1
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.
69 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version, bool isActive)
70 {
71 m_client->didAddInputPort(id, manufacturer, name, version, isActive);
72 }
73
74 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version, bool isActive)
75 {
76 m_client->didAddOutputPort(id, manufacturer, name, version, isActive);
77 }
78
79 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version, MIDIPortState state) 68 void MIDIAccessor::didAddInputPort(const WebString& id, const WebString& manufac turer, const WebString& name, const WebString& version, MIDIPortState state)
80 { 69 {
70 // FIXME: Update to support complete MIDIPortState in MIDIPort.
81 m_client->didAddInputPort(id, manufacturer, name, version, state != MIDIPort StateDisconnected); 71 m_client->didAddInputPort(id, manufacturer, name, version, state != MIDIPort StateDisconnected);
82 } 72 }
83 73
84 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version, MIDIPortState state) 74 void MIDIAccessor::didAddOutputPort(const WebString& id, const WebString& manufa cturer, const WebString& name, const WebString& version, MIDIPortState state)
85 { 75 {
76 // FIXME: Update to support complete MIDIPortState in MIDIPort.
86 m_client->didAddOutputPort(id, manufacturer, name, version, state != MIDIPor tStateDisconnected); 77 m_client->didAddOutputPort(id, manufacturer, name, version, state != MIDIPor tStateDisconnected);
87 } 78 }
88 79
89 // FIXME: Remove obsolete interfaces that use isActive.
90 void MIDIAccessor::didSetInputPortState(unsigned portIndex, bool isActive)
91 {
92 m_client->didSetInputPortState(portIndex, isActive);
93 }
94
95 void MIDIAccessor::didSetOutputPortState(unsigned portIndex, bool isActive)
96 {
97 m_client->didSetOutputPortState(portIndex, isActive);
98 }
99
100 void MIDIAccessor::didSetInputPortState(unsigned portIndex, MIDIPortState state) 80 void MIDIAccessor::didSetInputPortState(unsigned portIndex, MIDIPortState state)
101 { 81 {
82 // FIXME: Update to support complete MIDIPortState in MIDIPort.
102 m_client->didSetInputPortState(portIndex, state != MIDIPortStateDisconnected ); 83 m_client->didSetInputPortState(portIndex, state != MIDIPortStateDisconnected );
103 } 84 }
104 85
105 void MIDIAccessor::didSetOutputPortState(unsigned portIndex, MIDIPortState state ) 86 void MIDIAccessor::didSetOutputPortState(unsigned portIndex, MIDIPortState state )
106 { 87 {
88 // FIXME: Update to support complete MIDIPortState in MIDIPort.
107 m_client->didSetOutputPortState(portIndex, state != MIDIPortStateDisconnecte d); 89 m_client->didSetOutputPortState(portIndex, state != MIDIPortStateDisconnecte d);
108 } 90 }
109 91
110 void MIDIAccessor::didStartSession(bool success, const WebString& error, const W ebString& message) 92 void MIDIAccessor::didStartSession(bool success, const WebString& error, const W ebString& message)
111 { 93 {
112 m_client->didStartSession(success, error, message); 94 m_client->didStartSession(success, error, message);
113 } 95 }
114 96
115 void MIDIAccessor::didReceiveMIDIData(unsigned portIndex, const unsigned char* d ata, size_t length, double timeStamp) 97 void MIDIAccessor::didReceiveMIDIData(unsigned portIndex, const unsigned char* d ata, size_t length, double timeStamp)
116 { 98 {
117 m_client->didReceiveMIDIData(portIndex, data, length, timeStamp); 99 m_client->didReceiveMIDIData(portIndex, data, length, timeStamp);
118 } 100 }
119 101
120 } // namespace blink 102 } // 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