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 #include "CCrossfadeEdgesDialog.h"
22 
23 #include "settings.h"
24 
25 #include "../backend/CActionParameters.h"
26 
27 CCrossfadeEdgesDialog *gCrossfadeEdgesDialog=NULL;
28 
29 
CCrossfadeEdgesDialog(FXWindow * mainWindow)30 CCrossfadeEdgesDialog::CCrossfadeEdgesDialog(FXWindow *mainWindow) :
31 	CActionParamDialog(mainWindow)
32 {
33 	CActionParamDialog::setTitle(N_("Crossfade Edges Settings"));
34 
35 	setMargin(130);
36 
37 	void *p=newVertPanel(NULL);
38 		addNumericTextEntry(p,N_("Crossfade Start Edge"),"ms",gCrossfadeStartTime,0,10000,_("milliseconds"));
39 		addNumericTextEntry(p,N_("Crossfade Stop Edge"),"ms",gCrossfadeStopTime,0,10000,_("milliseconds"));
40 
41 		vector<string> fadeMethods;
42 			fadeMethods.push_back(N_("Linear Fade"));
43 			fadeMethods.push_back(N_("Parabolic Fade")); // a more industry standard term for this??? it means a gain x^2 where 0<=x<=1
44 		addComboTextEntry(p,N_("Crossfade Fade Method"),fadeMethods,CActionParamDialog::cpvtAsInteger,_("Linear will maintain a constant gain of 1.0\nParabolic sounds a bit more natural\nFor very quick fades (less than 250ms) linear is recommended"));
45 
46 }
47 
~CCrossfadeEdgesDialog()48 CCrossfadeEdgesDialog::~CCrossfadeEdgesDialog()
49 {
50 }
51 
showIt()52 void CCrossfadeEdgesDialog::showIt()
53 {
54 	CActionParameters actionParameters(NULL);
55 	setValue(0,gCrossfadeStartTime);
56 	setValue(1,gCrossfadeStopTime);
57 	setValue(2,gCrossfadeFadeMethod);
58 	if(CActionParamDialog::show(NULL,&actionParameters))
59 	{
60 		gCrossfadeStartTime=actionParameters.getValue<double>("Crossfade Start Edge");
61 		gCrossfadeStopTime=actionParameters.getValue<double>("Crossfade Stop Edge");
62 		gCrossfadeFadeMethod=(CrossfadeFadeMethods)actionParameters.getValue<unsigned>("Crossfade Fade Method");
63 	}
64 }
65 
66