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

Unified Diff: media/midi/midi_manager_alsa.h

Issue 1007613006: Rename CardInfo to MidiDevice and factor out some device probing logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final fixes Created 5 years, 9 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 | « no previous file | media/midi/midi_manager_alsa.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..67abfc3fb5ca495e396cc73692f70575fd5e29e4 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();
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(
@@ -68,16 +68,25 @@ class MEDIA_EXPORT MidiManagerAlsa : public MidiManager {
std::string alsa_driver_;
std::string udev_id_path_;
std::string udev_id_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(MidiDevice);
};
+ // 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 +95,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_;
« no previous file with comments | « no previous file | media/midi/midi_manager_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698