diff options
author | Dave Reisner <dreisner@archlinux.org> | 2013-01-03 10:58:32 -0500 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2013-01-03 10:58:32 -0500 |
commit | 6d04ac9ad89293ecc08013d6df97b880ec1e3a69 (patch) | |
tree | 2abfbca6bc3cd855cd85288e951a3b5421967216 | |
parent | 244fa2d8b1ced32fd9f06ea6e44785d2fdd32b3c (diff) | |
download | mirror-ponymix-6d04ac9ad89293ecc08013d6df97b880ec1e3a69.tar.gz mirror-ponymix-6d04ac9ad89293ecc08013d6df97b880ec1e3a69.tar.bz2 mirror-ponymix-6d04ac9ad89293ecc08013d6df97b880ec1e3a69.zip |
allow card lookup by index
-rw-r--r-- | pulse.cc | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -150,6 +150,9 @@ Card* PulseClient::GetCard(const uint32_t& index) { } Card* PulseClient::GetCard(const string& name) { + long val; + if (xstrtol(name.c_str(), &val) == 0) return GetCard(val); + for (Card& card : cards_) { if (card.name_ == name) return &card; } |