]> git.tdb.fi Git - libs/gui.git/commitdiff
Add set_source method to Control
authorMikko Rasa <tdb@tdb.fi>
Mon, 10 Mar 2008 10:57:51 +0000 (10:57 +0000)
committerMikko Rasa <tdb@tdb.fi>
Mon, 10 Mar 2008 10:57:51 +0000 (10:57 +0000)
source/input/control.cpp
source/input/control.h

index 8ddcdd772cf2af96cc7e7f51f42e978edebe87cd..0519d8fe42117a1f7304a3daa30fbefbce787f6d 100644 (file)
@@ -87,6 +87,18 @@ void Control::cancel_capture()
        connect_signals();
 }
 
+void Control::set_source(Device &d, ControlSrcType t, unsigned i)
+{
+       set_source(ControlSource(d, t, i));
+}
+
+void Control::set_source(const ControlSource &s)
+{
+       notify_callbacks();
+       src=s;
+       connect_signals();
+}
+
 void Control::connect_signals()
 {
        switch(src.type)
index f7146b47f4502345d8d00a01988fb4b36cc78f3c..1ee21c8af072f5e305710c28597055d50482382b 100644 (file)
@@ -67,6 +67,8 @@ public:
 
        void capture(Device &);
        void cancel_capture();
+       void set_source(Device &, ControlSrcType, unsigned);
+       void set_source(const ControlSource &);
        const ControlSource &get_source() const { return src; }
 protected:
        virtual void on_press() =0;