aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-01-03 10:58:32 -0500
committerDave Reisner <dreisner@archlinux.org>2013-01-03 10:58:32 -0500
commit6d04ac9ad89293ecc08013d6df97b880ec1e3a69 (patch)
tree2abfbca6bc3cd855cd85288e951a3b5421967216
parent244fa2d8b1ced32fd9f06ea6e44785d2fdd32b3c (diff)
downloadmirror-ponymix-6d04ac9ad89293ecc08013d6df97b880ec1e3a69.tar.gz
mirror-ponymix-6d04ac9ad89293ecc08013d6df97b880ec1e3a69.tar.bz2
mirror-ponymix-6d04ac9ad89293ecc08013d6df97b880ec1e3a69.zip
allow card lookup by index
-rw-r--r--pulse.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/pulse.cc b/pulse.cc
index edd0449..c423c72 100644
--- a/pulse.cc
+++ b/pulse.cc
@@ -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;
}