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

Side by Side Diff: media/midi/midi_manager_win.cc

Issue 2404443002: Web MIDI: use midi_service.mojom for media::midi::Result (Closed)
Patch Set: yhirano@ review Created 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/midi/midi_manager_win.h" 5 #include "media/midi/midi_manager_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <ks.h> 8 #include <ks.h>
9 #include <ksmedia.h> 9 #include <ksmedia.h>
10 #include <mmreg.h> 10 #include <mmreg.h>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "device/usb/usb_ids.h" 45 #include "device/usb/usb_ids.h"
46 #include "media/midi/midi_manager_winrt.h" 46 #include "media/midi/midi_manager_winrt.h"
47 #include "media/midi/midi_message_queue.h" 47 #include "media/midi/midi_message_queue.h"
48 #include "media/midi/midi_message_util.h" 48 #include "media/midi/midi_message_util.h"
49 #include "media/midi/midi_port_info.h" 49 #include "media/midi/midi_port_info.h"
50 #include "media/midi/midi_switches.h" 50 #include "media/midi/midi_switches.h"
51 51
52 namespace midi { 52 namespace midi {
53 namespace { 53 namespace {
54 54
55 using mojom::Result;
56
55 static const size_t kBufferLength = 32 * 1024; 57 static const size_t kBufferLength = 32 * 1024;
56 58
57 // We assume that nullpter represents an invalid MIDI handle. 59 // We assume that nullpter represents an invalid MIDI handle.
58 const HMIDIIN kInvalidMidiInHandle = nullptr; 60 const HMIDIIN kInvalidMidiInHandle = nullptr;
59 const HMIDIOUT kInvalidMidiOutHandle = nullptr; 61 const HMIDIOUT kInvalidMidiOutHandle = nullptr;
60 62
61 std::string GetInErrorMessage(MMRESULT result) { 63 std::string GetInErrorMessage(MMRESULT result) {
62 wchar_t text[MAXERRORLENGTH]; 64 wchar_t text[MAXERRORLENGTH];
63 MMRESULT get_result = midiInGetErrorText(result, text, arraysize(text)); 65 MMRESULT get_result = midiInGetErrorText(result, text, arraysize(text));
64 if (get_result != MMSYSERR_NOERROR) { 66 if (get_result != MMSYSERR_NOERROR) {
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 1195
1194 MidiManager* MidiManager::Create() { 1196 MidiManager* MidiManager::Create() {
1195 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 1197 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
1196 switches::kDisableWinrtMidiApi) && 1198 switches::kDisableWinrtMidiApi) &&
1197 base::win::GetVersion() >= base::win::VERSION_WIN10) 1199 base::win::GetVersion() >= base::win::VERSION_WIN10)
1198 return new MidiManagerWinrt(); 1200 return new MidiManagerWinrt();
1199 return new MidiManagerWin(); 1201 return new MidiManagerWin();
1200 } 1202 }
1201 1203
1202 } // namespace midi 1204 } // namespace midi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698