2007-08-06 10:19:19 -04:00
|
|
|
#include <string>
|
|
|
|
#include <sigc++/bind.h>
|
|
|
|
#include <gtkmm/stock.h>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/convert.h"
|
2007-08-06 10:19:19 -04:00
|
|
|
#include <gtkmm2ext/utils.h>
|
|
|
|
|
|
|
|
#include "midi_port_dialog.h"
|
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace PBD;
|
|
|
|
using namespace Gtk;
|
|
|
|
using namespace Gtkmm2ext;
|
|
|
|
|
|
|
|
static const char* mode_strings[] = { "duplex", "output", "input", (char*) 0 };
|
|
|
|
|
|
|
|
MidiPortDialog::MidiPortDialog ()
|
2010-05-02 19:54:25 -04:00
|
|
|
: ArdourDialog (_("Add MIDI Port"))
|
2009-08-20 17:38:59 -04:00
|
|
|
, port_label (_("Port name:"))
|
2007-08-06 10:19:19 -04:00
|
|
|
{
|
2009-08-20 17:38:59 -04:00
|
|
|
set_modal (true);
|
|
|
|
set_skip_taskbar_hint (true);
|
|
|
|
set_resizable (false);
|
|
|
|
set_position (Gtk::WIN_POS_MOUSE);
|
|
|
|
set_name (N_("MidiPortDialog"));
|
|
|
|
|
2007-08-06 10:19:19 -04:00
|
|
|
vector<string> str = internationalize (PACKAGE, mode_strings);
|
|
|
|
set_popdown_strings (port_mode_combo, str);
|
|
|
|
port_mode_combo.set_active_text (str.front());
|
|
|
|
|
2009-08-20 17:38:59 -04:00
|
|
|
hpacker.set_spacing (6);
|
|
|
|
hpacker.set_border_width (5);
|
|
|
|
|
2007-08-06 10:19:19 -04:00
|
|
|
hpacker.pack_start (port_label);
|
|
|
|
hpacker.pack_start (port_name);
|
|
|
|
hpacker.pack_start (port_mode_combo);
|
|
|
|
|
|
|
|
get_vbox()->pack_start (hpacker);
|
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
port_name.signal_activate().connect (sigc::mem_fun (*this, &MidiPortDialog::entry_activated));
|
2007-08-06 10:19:19 -04:00
|
|
|
|
|
|
|
add_button (Stock::CANCEL, RESPONSE_CANCEL);
|
2009-05-13 20:13:27 -04:00
|
|
|
add_button (Stock::ADD, RESPONSE_ACCEPT);
|
2009-08-20 17:38:59 -04:00
|
|
|
|
|
|
|
show_all_children ();
|
2007-08-06 10:19:19 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MidiPortDialog::entry_activated ()
|
|
|
|
{
|
|
|
|
response (RESPONSE_ACCEPT);
|
|
|
|
}
|
|
|
|
|
|
|
|
MidiPortDialog::~MidiPortDialog ()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|