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 "CJACKPortChoiceDialog.h"
22
23 #include <stdlib.h>
24
25 FXDEFMAP(CJACKPortChoiceDialog) CJACKPortChoiceDialogMap[]=
26 {
27 // Message_Type ID Message_Handler
28 //FXMAPFUNC(SEL_COMMAND, CJACKPortChoiceDialog::ID_WHICH_BUTTON, CJACKPortChoiceDialog::onRadioButton),
29 };
30
31
FXIMPLEMENT(CJACKPortChoiceDialog,FXModalDialogBox,CJACKPortChoiceDialogMap,ARRAYNUMBER (CJACKPortChoiceDialogMap))32 FXIMPLEMENT(CJACKPortChoiceDialog,FXModalDialogBox,CJACKPortChoiceDialogMap,ARRAYNUMBER(CJACKPortChoiceDialogMap))
33
34
35
36 // ----------------------------------------
37
38
39 CJACKPortChoiceDialog::CJACKPortChoiceDialog(FXWindow *mainWindow) :
40 FXModalDialogBox(mainWindow,N_("JACK Port Selection"),0,0,FXModalDialogBox::ftVertical)
41 {
42 messageLabel=new FXLabel(getFrame(),"",NULL,LAYOUT_CENTER_X);
43 portNamesComboBox=new FXComboBox(getFrame(),10,NULL,0,COMBOBOX_NORMAL|LAYOUT_CENTER_X|FRAME_SUNKEN|FRAME_THICK|COMBOBOX_STATIC);
44 portNamesComboBox->setNumVisible(8);
45 }
46
~CJACKPortChoiceDialog()47 CJACKPortChoiceDialog::~CJACKPortChoiceDialog()
48 {
49 }
50
show(const string message,const vector<string> portNames)51 bool CJACKPortChoiceDialog::show(const string message,const vector<string> portNames)
52 {
53 messageLabel->setText(message.c_str());
54 portNamesComboBox->clearItems();
55 for(size_t t=0;t<portNames.size();t++)
56 portNamesComboBox->appendItem(portNames[t].c_str());
57
58 if(execute(PLACEMENT_SCREEN))
59 return true;
60 return false;
61 }
62
getPortName() const63 const string CJACKPortChoiceDialog::getPortName() const
64 {
65 return portNamesComboBox->getText().text();
66 }
67
68