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 __CChannelSelectDialog_H__
22 #define __CChannelSelectDialog_H__
23 
24 #include "../../config/common.h"
25 #include "fox_compat.h"
26 
27 
28 class CChannelSelectDialog;
29 
30 #include "FXModalDialogBox.h"
31 #include "../backend/AActionDialog.h"
32 #include "../backend/CActionSound.h"
33 
34 extern CChannelSelectDialog *gChannelSelectDialog;
35 
36 /*
37  * This is the implementation of AActionDialog that the backend
38  * asks to show whenever there is a question of what channels to
39  * apply to action to...   This dialog's show method returns
40  * true if the user press okay.. or false if they hit cancel.
41  *
42  * The show method upon returning true should have also set
43  * actionSound's doChannel values according to the checkboxes
44  * on the dialog
45  */
46 class CChannelSelectDialog : public FXModalDialogBox, public AActionDialog
47 {
48 	FXDECLARE(CChannelSelectDialog);
49 public:
50 	CChannelSelectDialog(FXWindow *mainWindow);
51 	virtual ~CChannelSelectDialog();
52 
53 	bool show(CActionSound *actionSound,CActionParameters *actionParameters);
54 	void hide();
55 
setTitle(const string title)56 	void setTitle(const string title) { };
57 
58 	enum
59 	{
60 		ID_DEFAULT_BUTTON=FXModalDialogBox::ID_LAST,
61 		ID_CLEAR_BUTTON,
62 	};
63 
64 	long onDefaultButton(FXObject *sender,FXSelector sel,void *ptr);
65 	long onClearButton(FXObject *sender,FXSelector sel,void *ptr);
66 
67 protected:
CChannelSelectDialog()68 	CChannelSelectDialog() {}
69 
70 private:
71 	const CActionSound *actionSound;
72 
73 	FXLabel *label;
74 	FXCheckButton *checkBoxes[MAX_CHANNELS];
75 
76 };
77 
78 #endif
79