1 /*
2  * Copyright (C) 2002 - David W. Durham
3  *
4  * This file is part of ReZound, an audio editing application.
5  *
6  * ReZound is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published
8  * by the Free Software Foundation; either version 2 of the License,
9  * or (at your option) any later version.
10  *
11  * ReZound is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
19  */
20 
21 #ifndef __CBalanceAction_H__
22 #define __CBalanceAction_H__
23 
24 #include "../../../config/common.h"
25 
26 #include "../AAction.h"
27 #include "../CGraphParamValueNode.h"
28 
29 class CBalanceAction : public AAction
30 {
31 public:
32 	enum BalanceTypes
33 	{
34 		btStrictBalance=0,
35 		bt1xPan=1,
36 		bt2xPan=2
37 	};
38 
39 	CBalanceAction(const AActionFactory *factory,const CActionSound *actionSound,const CGraphParamValueNodeList &balanceCurve,const unsigned channelA,const unsigned channelB,const BalanceTypes balanceType);
40 	virtual ~CBalanceAction();
41 
42 	static const string getBalanceTypeExplanation();
43 
44 protected:
45 	bool doActionSizeSafe(CActionSound *actionSound,bool prepareForUndo);
46 	void undoActionSizeSafe(const CActionSound *actionSound);
47 	CanUndoResults canUndo(const CActionSound *actionSound) const;
48 
49 private:
50 	const CGraphParamValueNodeList balanceCurve;
51 	const unsigned channelA,channelB;
52 	const BalanceTypes balanceType;
53 };
54 
55 
56 class CSimpleBalanceActionFactory : public AActionFactory
57 {
58 public:
59 	CSimpleBalanceActionFactory(AActionDialog *channelSelectDialog,AActionDialog *dialog);
60 	virtual ~CSimpleBalanceActionFactory();
61 
62 	CBalanceAction *manufactureAction(const CActionSound *actionSound,const CActionParameters *actionParameters) const;
63 };
64 
65 class CCurvedBalanceActionFactory : public AActionFactory
66 {
67 public:
68 	CCurvedBalanceActionFactory(AActionDialog *channelSelectDialog,AActionDialog *dialog);
69 	virtual ~CCurvedBalanceActionFactory();
70 
71 	CBalanceAction *manufactureAction(const CActionSound *actionSound,const CActionParameters *actionParameters) const;
72 };
73 
74 #endif
75