1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_MIDI_MIDI_MANAGER_ALSA_H_
6 #define MEDIA_MIDI_MIDI_MANAGER_ALSA_H_
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/threading/thread.h"
14 #include "media/midi/midi_manager.h"
18 class MidiManagerAlsa
: public MidiManager
{
21 virtual ~MidiManagerAlsa();
23 // MidiManager implementation.
24 virtual void StartInitialization() OVERRIDE
;
25 virtual void DispatchSendMidiData(MidiManagerClient
* client
,
27 const std::vector
<uint8
>& data
,
28 double timestamp
) OVERRIDE
;
35 std::vector
<scoped_refptr
<MidiDeviceInfo
> > in_devices_
;
36 std::vector
<scoped_refptr
<MidiDeviceInfo
> > out_devices_
;
37 base::Thread send_thread_
;
38 base::Thread event_thread_
;
40 // Used for shutting down the |event_thread_| safely.
42 // Used for polling input MIDI ports and |pipe_fd_| in |event_thread_|.
43 std::vector
<struct pollfd
> poll_fds_
;
45 DISALLOW_COPY_AND_ASSIGN(MidiManagerAlsa
);
50 #endif // MEDIA_MIDI_MIDI_MANAGER_ALSA_H_