Logo Search packages:      
Sourcecode: jacktrip version File versions  Download package

ProcessPlugin.h

Go to the documentation of this file.
//*****************************************************************
/*
  JackTrip: A System for High-Quality Audio Network Performance
  over the Internet

  Copyright (c) 2008 Juan-Pablo Caceres, Chris Chafe.
  SoundWIRE group at CCRMA, Stanford University.
  
  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 OR COPYRIGHT
  HOLDERS 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.
*/
//*****************************************************************

/**
 * \file ProcessPlugin.h
 * \author Juan-Pablo Caceres
 * \date July 2008
 */

#ifndef __PROCESSPLUGIN_H__
#define __PROCESSPLUGIN_H__

#include <jack/jack.h>
#include <QObject>

/** \brief Interface for the process plugins to add to the JACK callback process in 
 * JackAudioInterface
 *
 * This class contains the same methods of the FAUST dsp class. A mydsp class can inherit from
 * this class the same way it inherits from dsp. Subclass should implement all methods
 * except init, which is optional for processing that are sampling rate dependent or 
 * that need specific initialization.
 */
00052 class ProcessPlugin : public QObject
{
public:

  /// \brief The Class Constructor
00057   ProcessPlugin() {};
  /// \brief The Class Destructor
00059   virtual ~ProcessPlugin() {};
  
  /// \brief Return Number of Input Channels
  virtual int getNumInputs() = 0;
  /// \brief Return Number of Output Channels
  virtual int getNumOutputs() = 0;

  //virtual void buildUserInterface(UI* interface) = 0;

  /** \brief Do proper Initialization of members and class instances. By default this
   * initializes the Sampling Frequency. If a class instance depends on the
   * sampling frequency, it should be initialize here.
   */
00072   virtual void init(int samplingRate) { fSamplingFreq = samplingRate; };
  
  /// \brief Compute process
  virtual void compute(int nframes, float** inputs, float** outputs) = 0;
  
protected:
00078   int fSamplingFreq; ///< Faust Data member, Sampling Rate
};

#endif

Generated by  Doxygen 1.6.0   Back to index