summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_port_dialog.cc
blob: 2bb686d70bd46dfcb61e92722260410d3a557c25 (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
#include <string>
#include <sigc++/bind.h>
#include <gtkmm/stock.h>

#include <pbd/convert.h>
#include <gtkmm2ext/utils.h>

#include "midi_port_dialog.h"

#include "i18n.h"

using namespace std;
using namespace PBD;
using namespace Gtk;
using namespace Gtkmm2ext;
using namespace sigc;

static const char* mode_strings[] = { "duplex", "output", "input",  (char*) 0 };

MidiPortDialog::MidiPortDialog ()
	: ArdourDialog ("midi_port_dialog"),
	  port_label (_("Port name"))
	
{
	vector<string> str = internationalize (PACKAGE, mode_strings);
	set_popdown_strings (port_mode_combo, str);
	port_mode_combo.set_active_text (str.front());

	hpacker.pack_start (port_label);
	hpacker.pack_start (port_name);
	hpacker.pack_start (port_mode_combo);

	port_label.show ();
	port_name.show ();
	port_mode_combo.show ();
	hpacker.show ();

	get_vbox()->pack_start (hpacker);

	port_name.signal_activate().connect (mem_fun (*this, &MidiPortDialog::entry_activated));

	add_button (Stock::ADD, RESPONSE_ACCEPT);
	add_button (Stock::CANCEL, RESPONSE_CANCEL);
}

void
MidiPortDialog::entry_activated ()
{
	response (RESPONSE_ACCEPT);
}

MidiPortDialog::~MidiPortDialog ()
{

}