Essentia  2.1-beta6-dev
ringbufferinput.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
3  *
4  * This file is part of Essentia
5  *
6  * Essentia is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License as published by the Free
8  * Software Foundation (FSF), either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the Affero GNU General Public License
17  * version 3 along with this program. If not, see http://www.gnu.org/licenses/
18  */
19 
20 #ifndef ESSENTIA_STREAMING_RINGBUFFERINPUT_H
21 #define ESSENTIA_STREAMING_RINGBUFFERINPUT_H
22 
23 #include "../streamingalgorithm.h"
24 
25 namespace essentia {
26 namespace streaming {
27 
28 class RingBufferInput : public Algorithm {
29  protected:
32 
33  public:
36 
37  void add(Real* inputData, int size);
38 
40 
41  void shouldStop(bool stop) {
42  E_DEBUG(EExecution, "RBI should stop...");
43  }
44 
46  declareParameter("bufferSize", "the size of the ringbuffer", "", 8192);
47  }
48 
49  void configure();
50  void reset();
51 
52  static const char* name;
53  static const char* category;
54  static const char* description;
55 
56 };
57 
58 } // namespace streaming
59 } // namespace essentia
60 
61 #endif // ESSENTIA_STREAMING_RINGBUFFERINPUT_H
void declareParameter(const std::string &name, const std::string &desc, const std::string &range, const Parameter &defaultValue)
Definition: streamingalgorithm.h:140
Definition: ringbufferimpl.h:107
Definition: ringbufferinput.h:28
void shouldStop(bool stop)
Definition: ringbufferinput.h:41
static const char * category
Definition: ringbufferinput.h:53
class RingBufferImpl * _impl
Definition: ringbufferinput.h:31
static const char * description
Definition: ringbufferinput.h:54
void add(Real *inputData, int size)
static const char * name
Definition: ringbufferinput.h:52
void declareParameters()
Definition: ringbufferinput.h:45
Source< Real > _output
Definition: ringbufferinput.h:30
#define E_DEBUG(module, msg)
Definition: debugging.h:157
AlgorithmStatus
Definition: streamingalgorithm.h:106
Definition: algorithm.h:28
float Real
Definition: types.h:69
@ EExecution
Definition: debugging.h:47