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

Unified Diff: trunk/src/media/midi/midi_manager.cc

Issue 17334006: Revert 207983 "Implement Web MIDI API back-end" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/media/midi/midi_manager.h ('k') | trunk/src/media/midi/midi_manager_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/media/midi/midi_manager.cc
===================================================================
--- trunk/src/media/midi/midi_manager.cc (revision 207988)
+++ trunk/src/media/midi/midi_manager.cc (working copy)
@@ -1,67 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "media/midi/midi_manager.h"
-
-namespace media {
-
-#if !defined(OS_MACOSX)
-// TODO(crogers): implement MIDIManager for other platforms.
-MIDIManager* MIDIManager::Create() {
- return NULL;
-}
-#endif
-
-MIDIManager::MIDIManager()
- : initialized_(false) {
-}
-
-MIDIManager::~MIDIManager() {}
-
-bool MIDIManager::RequestAccess(MIDIManagerClient* client, int access) {
- // TODO(crogers): determine if user prompt is necessary here.
- // For now, simply don't allow sysex.
- if (access != kNoSystemExclusive)
- return false;
-
- // Lazily initialize the MIDI back-end.
- if (!initialized_)
- initialized_ = Initialize();
-
- if (initialized_) {
- base::AutoLock auto_lock(clients_lock_);
- clients_.insert(client);
- }
-
- return initialized_;
-}
-
-void MIDIManager::ReleaseAccess(MIDIManagerClient* client) {
- base::AutoLock auto_lock(clients_lock_);
- ClientList::iterator i = clients_.find(client);
- if (i != clients_.end())
- clients_.erase(i);
-}
-
-void MIDIManager::AddInputPort(const MIDIPortInfo& info) {
- input_ports_.push_back(info);
-}
-
-void MIDIManager::AddOutputPort(const MIDIPortInfo& info) {
- output_ports_.push_back(info);
-}
-
-void MIDIManager::ReceiveMIDIData(
- int port_index,
- const uint8* data,
- size_t length,
- double timestamp) {
- base::AutoLock auto_lock(clients_lock_);
-
- // TODO(crogers): Filter out sysex.
- for (ClientList::iterator i = clients_.begin(); i != clients_.end(); ++i)
- (*i)->ReceiveMIDIData(port_index, data, length, timestamp);
-};
-
-} // namespace media
« no previous file with comments | « trunk/src/media/midi/midi_manager.h ('k') | trunk/src/media/midi/midi_manager_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698