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

Side by Side Diff: public/platform/WebMIDIAccessorClient.h

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.cpp ('k') | no next file » | 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 27 matching lines...) Expand all
38 class WebMIDIAccessorClient { 38 class WebMIDIAccessorClient {
39 public: 39 public:
40 enum MIDIPortState { 40 enum MIDIPortState {
41 MIDIPortStateDisconnected, 41 MIDIPortStateDisconnected,
42 MIDIPortStateConnected, 42 MIDIPortStateConnected,
43 MIDIPortStateOpened, 43 MIDIPortStateOpened,
44 }; 44 };
45 45
46 // didAddInputPort() and didAddOutputPort() can be called before and after 46 // didAddInputPort() and didAddOutputPort() can be called before and after
47 // didStartSession() is called. But |id| should be unique in each function. 47 // didStartSession() is called. But |id| should be unique in each function.
48 // FIXME: Remove obsolete interfaces that use isActive.
49 virtual void didAddInputPort(const WebString& id, const WebString& manufactu rer, const WebString& name, const WebString& version, bool isActive) = 0;
50 virtual void didAddOutputPort(const WebString& id, const WebString& manufact urer, const WebString& name, const WebString& version, bool isActive) = 0;
51 virtual void didAddInputPort(const WebString& id, const WebString& manufactu rer, const WebString& name, const WebString& version, MIDIPortState) = 0; 48 virtual void didAddInputPort(const WebString& id, const WebString& manufactu rer, const WebString& name, const WebString& version, MIDIPortState) = 0;
52 virtual void didAddOutputPort(const WebString& id, const WebString& manufact urer, const WebString& name, const WebString& version, MIDIPortState) = 0; 49 virtual void didAddOutputPort(const WebString& id, const WebString& manufact urer, const WebString& name, const WebString& version, MIDIPortState) = 0;
53 // didSetInputPortState() and didSetOutputPortState() should not be called 50 // didSetInputPortState() and didSetOutputPortState() should not be called
54 // until didStartSession() is called. 51 // until didStartSession() is called.
55 // FIXME: Remove obsolete interfaces that use isActive.
56 virtual void didSetInputPortState(unsigned portIndex, bool isActive) = 0;
57 virtual void didSetOutputPortState(unsigned portIndex, bool isActive) = 0;
58 virtual void didSetInputPortState(unsigned portIndex, MIDIPortState) = 0; 52 virtual void didSetInputPortState(unsigned portIndex, MIDIPortState) = 0;
59 virtual void didSetOutputPortState(unsigned portIndex, MIDIPortState) = 0; 53 virtual void didSetOutputPortState(unsigned portIndex, MIDIPortState) = 0;
60 54
61 virtual void didStartSession(bool success, const WebString& error, const Web String& message) = 0; 55 virtual void didStartSession(bool success, const WebString& error, const Web String& message) = 0;
62 56
63 // |timeStamp| is in milliseconds according to the Web MIDI API. 57 // |timeStamp| is in milliseconds according to the Web MIDI API.
64 virtual void didReceiveMIDIData(unsigned portIndex, const unsigned char* dat a, size_t length, double timeStamp) = 0; 58 virtual void didReceiveMIDIData(unsigned portIndex, const unsigned char* dat a, size_t length, double timeStamp) = 0;
65 59
66 protected: 60 protected:
67 virtual ~WebMIDIAccessorClient() { } 61 virtual ~WebMIDIAccessorClient() { }
68 }; 62 };
69 63
70 } // namespace blink 64 } // namespace blink
71 65
72 #endif // WebMIDIAccessorClient_h 66 #endif // WebMIDIAccessorClient_h
OLDNEW
« no previous file with comments | « Source/modules/webmidi/MIDIAccessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698