summaryrefslogtreecommitdiff
path: root/orkbasecxx/TapeProcessor.h
blob: 54f5eca54ac7632314e1723a6588828dd55799e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Oreka -- A media capture and retrieval platform
 * 
 * Copyright (C) 2005, orecx LLC
 *
 * http://www.orecx.com
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License.
 * Please refer to http://www.gnu.org/copyleft/gpl.html
 *
 */
#ifndef __TAPEPROCESSOR_H__
#define __TAPEPROCESSOR_H__

//#include <list>
//#include "ace/Singleton.h"
#include "AudioCapture.h"
#include "AudioTape.h"
#include "dll.h"
#include "OrkBase.h"


class DLL_IMPORT_EXPORT_ORKBASE TapeProcessor;

typedef boost::shared_ptr<TapeProcessor> TapeProcessorRef;

/** TapeProcessor Interface
 *  a Tape Processor is a black box that takes Audio Tapes as an input and 
 *  processes them.
 */
class DLL_IMPORT_EXPORT_ORKBASE TapeProcessor
{
public:
	TapeProcessor();

	virtual CStdString __CDECL__ GetName() = 0;
	virtual TapeProcessorRef __CDECL__ Instanciate() = 0;
	virtual void __CDECL__ AddAudioTape(AudioTapeRef&) = 0;

	void SetNextProcessor(TapeProcessorRef& nextProcessor);
	void RunNextProcessor(AudioTapeRef&);

protected:
	TapeProcessorRef m_nextProcessor;
};

//===================================================================
/** TapeProcessor Registry
*/
class DLL_IMPORT_EXPORT_ORKBASE TapeProcessorRegistry
{
public:
	static TapeProcessorRegistry* instance();
	void RegisterTapeProcessor(TapeProcessorRef& TapeProcessor);
	TapeProcessorRef GetNewTapeProcessor(CStdString& TapeProcessorName);

	void RunProcessingChain(AudioTapeRef&);
	void CreateProcessingChain();
private:
	TapeProcessorRegistry();
	static TapeProcessorRegistry* m_singleton;

	std::list<TapeProcessorRef> m_TapeProcessors;
	TapeProcessorRef m_firstTapeProcessor;
};

#endif