From 476a82d1c431c26f71286a2d904144bfa5468101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goran=20Meki=C4=87?= Date: Fri, 29 Dec 2017 21:52:17 +0100 Subject: Enable OSS midi in --- drumgizmo/input/ossmidi.cc | 50 ++++++++++++++++++++++++++++++++++++++++++++++ drumgizmo/input/ossmidi.h | 25 +++++++++++++++++++++++ 2 files changed, 75 insertions(+) (limited to 'drumgizmo') diff --git a/drumgizmo/input/ossmidi.cc b/drumgizmo/input/ossmidi.cc index 16c2e2d..024415e 100644 --- a/drumgizmo/input/ossmidi.cc +++ b/drumgizmo/input/ossmidi.cc @@ -25,4 +25,54 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include "ossmidi.h" +#include + + +OSSInputEngine::OSSInputEngine() +{ +} + +OSSInputEngine::~OSSInputEngine() +{ +} + +bool OSSInputEngine::init(const Instruments& instruments) +{ + return true; +} + +void OSSInputEngine::setParm(const std::string& parm, const std::string& value) +{ + if(parm == "dev") + { + dev = value; + std::cout << "dev = " << dev << std::endl; + } +} + +bool OSSInputEngine::start() +{ + return true; +} + +void OSSInputEngine::stop() +{ +} + +void OSSInputEngine::pre() +{ +} + +void OSSInputEngine::run(size_t pos, size_t len, std::vector& events) +{ +} + +void OSSInputEngine::post() +{ +} + +bool OSSInputEngine::isFreewheeling() const +{ + return false; +} diff --git a/drumgizmo/input/ossmidi.h b/drumgizmo/input/ossmidi.h index a5f64b6..41cfb2b 100644 --- a/drumgizmo/input/ossmidi.h +++ b/drumgizmo/input/ossmidi.h @@ -25,3 +25,28 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #pragma once +#include + +class OSSInputEngine + : public AudioInputEngine +{ +public: + OSSInputEngine(); + ~OSSInputEngine(); + + // based on AudioInputEngine + bool init(const Instruments& instruments) override; + void setParm(const std::string& parm, const std::string& value) override; + bool start() override; + void stop() override; + void pre() override; + void run(size_t pos, size_t len, std::vector& events) override; + void post() override; + bool isFreewheeling() const override; + +private: + std::string dev; + int fd; + std::size_t pos; + std::vector events; +}; -- cgit v1.2.3