aboutsummaryrefslogtreecommitdiffstats
path: root/src/OutputUHD.h
diff options
context:
space:
mode:
authorMatthias P. Braendli (think) <matthias@mpb.li>2012-08-16 17:45:04 +0200
committerMatthias P. Braendli (think) <matthias@mpb.li>2012-08-16 17:45:04 +0200
commit521ee81560be5d065bd090002a2c6b92a322a034 (patch)
treed4e575707616c423e602ede9118aef88a5b31f83 /src/OutputUHD.h
parentf419f8cb2e3768789cb23593cfa7c850acc0fe72 (diff)
downloaddabmod-521ee81560be5d065bd090002a2c6b92a322a034.tar.gz
dabmod-521ee81560be5d065bd090002a2c6b92a322a034.tar.bz2
dabmod-521ee81560be5d065bd090002a2c6b92a322a034.zip
crc-dabmod: RemoteControl simplifications
Diffstat (limited to 'src/OutputUHD.h')
-rw-r--r--src/OutputUHD.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/OutputUHD.h b/src/OutputUHD.h
index 23d0e4c..6d2df55 100644
--- a/src/OutputUHD.h
+++ b/src/OutputUHD.h
@@ -44,11 +44,14 @@ DESCRIPTION:
#include <boost/thread/thread.hpp>
#include <boost/thread/barrier.hpp>
#include <boost/shared_ptr.hpp>
+#include <list>
+#include <string>
#include "Log.h"
#include "ModOutput.h"
#include "EtiReader.h"
#include "TimestampDecoder.h"
+#include "RemoteControl.h"
#include <stdio.h>
#include <sys/types.h>
@@ -136,7 +139,7 @@ class UHDWorker {
};
-class OutputUHD: public ModOutput {
+class OutputUHD: public ModOutput, public RemoteControl {
public:
OutputUHD(const char* device,
unsigned sampleRate,
@@ -155,6 +158,37 @@ class OutputUHD: public ModOutput {
myEtiReader = etiReader;
}
+ /*********** REMOTE CONTROL ***************/
+ virtual std::string get_rc_name() { return "uhd"; }
+
+ /* Tell the controllable to enrol at the given controller /
+ virtual void enrol_at(BaseRemoteController& controller) {
+ controller.enrol(this);
+ } // */
+
+ /* Return a list of possible parameters that can be set */
+ list<string> get_supported_parameters() {
+ list<string> parameterlist;
+ for (list< vector<string> >::iterator it = parameters_.begin(); it != parameters_.end(); it++) {
+ parameterlist.push_back((*it)[0]);
+ }
+ return parameterlist;
+ }
+
+ /* Return a mapping of the descriptions of all parameters */
+ virtual std::list< std::vector<std::string> > get_parameter_descriptions() = 0;
+
+ /* Base function to set parameters. */
+ virtual void set_parameter(string parameter, string value) = 0;
+
+ /* Convenience functions for other common types */
+ virtual void set_parameter(string parameter, double value) = 0;
+ virtual void set_parameter(string parameter, long value) = 0;
+
+ /* Getting a parameter always returns a string. */
+ virtual string get_parameter(string parameter) = 0;
+
+
protected:
Logger& myLogger;
EtiReader *myEtiReader;
@@ -172,6 +206,9 @@ class OutputUHD: public ModOutput {
bool enable_sync;
size_t lastLen;
+
+
+ /*********** REMOTE CONTROL ***************/
};