diff vamp-client/AutoPlugin.h @ 118:ff3fd8d1b2dc

Boilerplate comments
author Chris Cannam <c.cannam@qmul.ac.uk>
date Thu, 27 Oct 2016 12:01:37 +0100
parents d74dfc11927c
children 5876f3e9c677
line wrap: on
line diff
--- a/vamp-client/AutoPlugin.h	Thu Oct 27 11:40:57 2016 +0100
+++ b/vamp-client/AutoPlugin.h	Thu Oct 27 12:01:37 2016 +0100
@@ -1,4 +1,37 @@
 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+/*
+  Piper C++
+
+  An API for audio analysis and feature extraction plugins.
+
+  Centre for Digital Music, Queen Mary, University of London.
+  Copyright 2006-2016 Chris Cannam and QMUL.
+  
+  Permission is hereby granted, free of charge, to any person
+  obtaining a copy of this software and associated documentation
+  files (the "Software"), to deal in the Software without
+  restriction, including without limitation the rights to use, copy,
+  modify, merge, publish, distribute, sublicense, and/or sell copies
+  of the Software, and to permit persons to whom the Software is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be
+  included in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
+  ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+  CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+  Except as contained in this notice, the names of the Centre for
+  Digital Music; Queen Mary, University of London; and Chris Cannam
+  shall not be used in advertising or otherwise to promote the sale,
+  use or other dealings in this Software without prior written
+  authorization.
+*/
 
 #ifndef PIPER_AUTO_PLUGIN_H
 #define PIPER_AUTO_PLUGIN_H
@@ -15,47 +48,47 @@
 {
 public:
     AutoPlugin(std::string serverName,
-	       std::string pluginKey,
-	       float inputSampleRate,
-	       int adapterFlags) :
-	Vamp::Plugin(inputSampleRate),
-	m_transport(serverName),
-	m_client(&m_transport)
+               std::string pluginKey,
+               float inputSampleRate,
+               int adapterFlags) :
+        Vamp::Plugin(inputSampleRate),
+        m_transport(serverName),
+        m_client(&m_transport)
     {
-	LoadRequest req;
-	req.pluginKey = pluginKey;
-	req.inputSampleRate = inputSampleRate;
-	req.adapterFlags = adapterFlags;
-	LoadResponse resp = m_client.loadPlugin(req);
-	m_plugin = resp.plugin;
+        LoadRequest req;
+        req.pluginKey = pluginKey;
+        req.inputSampleRate = inputSampleRate;
+        req.adapterFlags = adapterFlags;
+        LoadResponse resp = m_client.loadPlugin(req);
+        m_plugin = resp.plugin;
     }
 
     virtual ~AutoPlugin() {
-	delete m_plugin;
+        delete m_plugin;
     }
 
     bool isOK() const {
-	return (m_plugin != nullptr);
+        return (m_plugin != nullptr);
     }
     
     virtual std::string getIdentifier() const {
-	return getPlugin()->getIdentifier();
+        return getPlugin()->getIdentifier();
     }
 
     virtual std::string getName() const {
-	return getPlugin()->getName();
+        return getPlugin()->getName();
     }
 
     virtual std::string getDescription() const {
-	return getPlugin()->getDescription();
+        return getPlugin()->getDescription();
     }
 
     virtual std::string getMaker() const {
-	return getPlugin()->getMaker();
+        return getPlugin()->getMaker();
     }
 
     virtual std::string getCopyright() const {
-	return getPlugin()->getCopyright();
+        return getPlugin()->getCopyright();
     }
 
     virtual int getPluginVersion() const {
@@ -63,15 +96,15 @@
     }
 
     virtual ParameterList getParameterDescriptors() const {
-	return getPlugin()->getParameterDescriptors();
+        return getPlugin()->getParameterDescriptors();
     }
 
     virtual float getParameter(std::string name) const {
-	return getPlugin()->getParameter(name);
+        return getPlugin()->getParameter(name);
     }
 
     virtual void setParameter(std::string name, float value) {
-	getPlugin()->setParameter(name, value);
+        getPlugin()->setParameter(name, value);
     }
 
     virtual ProgramList getPrograms() const {
@@ -83,50 +116,50 @@
     }
     
     virtual void selectProgram(std::string program) {
-	getPlugin()->selectProgram(program);
+        getPlugin()->selectProgram(program);
     }
 
     virtual bool initialise(size_t inputChannels,
                             size_t stepSize,
                             size_t blockSize) {
-	return getPlugin()->initialise(inputChannels, stepSize, blockSize);
+        return getPlugin()->initialise(inputChannels, stepSize, blockSize);
     }
 
     virtual void reset() {
-	getPlugin()->reset();
+        getPlugin()->reset();
     }
 
     virtual InputDomain getInputDomain() const {
-	return getPlugin()->getInputDomain();
+        return getPlugin()->getInputDomain();
     }
 
     virtual size_t getPreferredBlockSize() const {
-	return getPlugin()->getPreferredBlockSize();
+        return getPlugin()->getPreferredBlockSize();
     }
 
     virtual size_t getPreferredStepSize() const {
-	return getPlugin()->getPreferredStepSize();
+        return getPlugin()->getPreferredStepSize();
     }
 
     virtual size_t getMinChannelCount() const {
-	return getPlugin()->getMinChannelCount();
+        return getPlugin()->getMinChannelCount();
     }
 
     virtual size_t getMaxChannelCount() const {
-	return getPlugin()->getMaxChannelCount();
+        return getPlugin()->getMaxChannelCount();
     }
 
     virtual OutputList getOutputDescriptors() const {
-	return getPlugin()->getOutputDescriptors();
+        return getPlugin()->getOutputDescriptors();
     }
 
     virtual FeatureSet process(const float *const *inputBuffers,
-			       Vamp::RealTime timestamp) {
-	return getPlugin()->process(inputBuffers, timestamp);
+                               Vamp::RealTime timestamp) {
+        return getPlugin()->process(inputBuffers, timestamp);
     }
 
     virtual FeatureSet getRemainingFeatures() {
-	return getPlugin()->getRemainingFeatures();
+        return getPlugin()->getRemainingFeatures();
     }
 
 private:
@@ -134,11 +167,11 @@
     CapnpRRClient m_client;
     Vamp::Plugin *m_plugin;
     Vamp::Plugin *getPlugin() const {
-	if (!m_plugin) {
-	    throw std::logic_error
-		("Plugin load failed (should have called AutoPlugin::isOK)");
-	}
-	return m_plugin;
+        if (!m_plugin) {
+            throw std::logic_error
+                ("Plugin load failed (should have called AutoPlugin::isOK)");
+        }
+        return m_plugin;
     }
 };