X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fhub.cpp;h=cbf9f78a689e083d79057945ba84eb218aba3685;hb=1023b38fa278cea71fba3d2881e1bfde930cd025;hp=6a78882c06273f209830253202acc79c8aa96f84;hpb=821cea8627597a5458c1cb02c0652384bb3431a4;p=libs%2Fgui.git diff --git a/source/input/hub.cpp b/source/input/hub.cpp index 6a78882..cbf9f78 100644 --- a/source/input/hub.cpp +++ b/source/input/hub.cpp @@ -1,7 +1,9 @@ +#include #include -#include #include "hub.h" +using namespace std; + namespace Msp { namespace Input { @@ -24,7 +26,7 @@ std::string Hub::get_button_name(unsigned btn) const { unsigned dev_index = btn>>12; if(dev_index>=devices.size()) - throw InvalidParameterValue("Button does not exist"); + throw invalid_argument("Hub::get_button_name"); const Device &dev = *devices[dev_index]; return dev.get_name()+": "+dev.get_button_name(btn&0xFFF); @@ -34,7 +36,7 @@ std::string Hub::get_axis_name(unsigned axis) const { unsigned dev_index = axis>>12; if(dev_index>=devices.size()) - throw InvalidParameterValue("Axis does not exist"); + throw invalid_argument("Hub::get_axis_name"); const Device &dev = *devices[dev_index]; return dev.get_name()+": "+dev.get_axis_name(axis&0xFFF);