Chromium Code Reviews| Index: media/midi/midi_manager_alsa.h |
| diff --git a/media/midi/midi_manager_alsa.h b/media/midi/midi_manager_alsa.h |
| index 86eb18decd49f8e3398b3b49e238a24b1acef9c7..5ebb3a6af47c07a9b1566829ef64eb3f5cbdb7df 100644 |
| --- a/media/midi/midi_manager_alsa.h |
| +++ b/media/midi/midi_manager_alsa.h |
| @@ -36,14 +36,15 @@ class MEDIA_EXPORT MidiManagerAlsa : public MidiManager { |
| private: |
| FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, ExtractManufacturer); |
| - FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, UdevEscape); |
| - class CardInfo { |
| + class MidiDevice { |
| public: |
| - CardInfo(const MidiManagerAlsa* outer, |
| - const std::string& alsa_name, const std::string& alsa_longname, |
| - const std::string& alsa_driver, int card_index); |
| - ~CardInfo(); |
| + MidiDevice(const MidiManagerAlsa* outer, |
| + const std::string& alsa_name, |
| + const std::string& alsa_longname, |
| + const std::string& alsa_driver, |
| + int card_index); |
| + ~MidiDevice(); |
|
Takashi Toyoshima
2015/03/16 07:22:08
Can you just remove the destructor?
Since it does
Adam Goode
2015/03/16 20:30:54
When I do this I get:
In file included from ../..
|
| const std::string alsa_name() const; |
| const std::string manufacturer() const; |
| @@ -53,7 +54,6 @@ class MEDIA_EXPORT MidiManagerAlsa : public MidiManager { |
| private: |
| FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, ExtractManufacturer); |
| - FRIEND_TEST_ALL_PREFIXES(MidiManagerAlsaTest, UdevEscape); |
| // Extracts the manufacturer using heuristics and a variety of sources. |
| static std::string ExtractManufacturerString( |
| @@ -70,14 +70,21 @@ class MEDIA_EXPORT MidiManagerAlsa : public MidiManager { |
| std::string udev_id_id_; |
|
Takashi Toyoshima
2015/03/16 07:22:08
It seems we forgot to add DISALLOW_COPY_AND_ASSIGN
Adam Goode
2015/03/16 20:30:54
done
|
| }; |
| + // Returns an ordered vector of all the rawmidi devices on the system. |
| + ScopedVector<MidiDevice> AllMidiDevices(); |
| + |
| + // Enumerate all the ports for initial setup. |
| + void EnumeratePorts(); |
| + |
| // An internal callback that runs on MidiSendThread. |
| void SendMidiData(uint32 port_index, |
| const std::vector<uint8>& data); |
| - void EventReset(); |
| + void ScheduleEventLoop(); |
| void EventLoop(); |
| + void ProcessSingleEvent(snd_seq_event_t* event, double timestamp); |
| - // Alsa seq handles. |
| + // ALSA seq handles. |
| snd_seq_t* in_client_; |
| snd_seq_t* out_client_; |
| int out_client_id_; |
| @@ -86,11 +93,11 @@ class MEDIA_EXPORT MidiManagerAlsa : public MidiManager { |
| int in_port_; |
| std::vector<int> out_ports_; |
| - // Mapping from Alsa client:port to our index. |
| + // Mapping from ALSA client:port to our index. |
| typedef std::map<int, uint32> SourceMap; |
| SourceMap source_map_; |
| - // Alsa event <-> MIDI coders. |
| + // ALSA event <-> MIDI coders. |
| snd_midi_event_t* decoder_; |
| typedef std::vector<snd_midi_event_t*> EncoderList; |
| EncoderList encoders_; |