/tags/rel-0-4-3/FreeSpeech/data-flow/include/FrameOperation.h

# · C++ Header · 67 lines · 21 code · 15 blank · 31 comment · 0 complexity · 37b01f92707016534f9308054f5f6e71 MD5 · raw file

  1. // Copyright (C) 1999 Jean-Marc Valin
  2. //
  3. // This program is free software; you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation; either version 2, or (at your option)
  6. // any later version.
  7. //
  8. // This program is distributed in the hope that it will be useful, but
  9. // WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. // General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this file. If not, write to the Free Software Foundation,
  15. // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  16. #ifndef FRAME_OPERATION_H
  17. #define FRAME_OPERATION_H
  18. #include "Node.h"
  19. #include "Object.h"
  20. #include "Vector.h"
  21. #include "BufferedNode.h"
  22. /**Class for nodes that operate on frames (typically audio)
  23. @author Jean-Marc Valin
  24. @version 1.0
  25. */
  26. class FrameOperation : public BufferedNode {
  27. protected:
  28. /**Length of output frames*/
  29. int outputLength;
  30. /**Output buffer*/
  31. ObjectRef output;
  32. /**outputID*/
  33. int outputID;
  34. public:
  35. /**Constructor, takes the name of the node and a set of parameters*/
  36. FrameOperation(string nodeName, const ParameterSet &params);
  37. /**Class specific initialization routine.
  38. Each class will call its subclass specificInitialize() method*/
  39. virtual void specificInitialize();
  40. /**Class reset routine.
  41. Each class will call its superclass reset() method*/
  42. virtual void reset();
  43. /***/
  44. virtual void initializeBuffers();
  45. /**Ask for the node's output which ID (number) is output_id
  46. and for the 'count' iteration */
  47. virtual void calculate(int output_id, int count, Buffer &buf) {throw "I'm fucked up";}
  48. protected:
  49. /**Default constructor, should not be used*/
  50. FrameOperation() {throw new GeneralException("FrameOperation copy constructor should not be called",__FILE__,__LINE__);}
  51. };
  52. #endif