summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/devices/nld_log.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/netlist/devices/nld_log.h')
-rw-r--r--src/lib/netlist/devices/nld_log.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/lib/netlist/devices/nld_log.h b/src/lib/netlist/devices/nld_log.h
new file mode 100644
index 00000000000..eb3ae97d75e
--- /dev/null
+++ b/src/lib/netlist/devices/nld_log.h
@@ -0,0 +1,58 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * nld_log.h
+ *
+ * Devices supporting analysis and logging
+ *
+ * nld_log:
+ *
+ * +---------+
+ * | ++ |
+ * I | | ==> Log to file "netlist_" + name() + ".log"
+ * | |
+ * +---------+
+ *
+ */
+
+#ifndef NLD_LOG_H_
+#define NLD_LOG_H_
+
+#include "nl_base.h"
+#include "plib/pstream.h"
+
+#define LOG(_name, _I) \
+ NET_REGISTER_DEV(??PG, _name) \
+ NET_CONNECT(_name, I, _I)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+NETLIB_DEVICE(log,
+ ~NETLIB_NAME(log)();
+ analog_input_t m_I;
+protected:
+ pofilestream *m_strm;
+);
+
+#define LOGD(_name, _I, _I2) \
+ NET_REGISTER_DEV(LOGD, _name) \
+ NET_CONNECT(_name, I, _I) \
+ NET_CONNECT(_name, I2, _I2)
+
+NETLIB_DEVICE_DERIVED(logD, log,
+ analog_input_t m_I2;
+);
+
+#if 0
+NETLIB_DEVICE(wav,
+ ~NETLIB_NAME(wav)();
+ analog_input_t m_I;
+private:
+ // FIXME: rewrite sound/wavwrite.h to be an object ...
+ void *m_file;
+);
+#endif
+
+NETLIB_NAMESPACE_DEVICES_END()
+
+#endif /* NLD_LOG_H_ */