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>
|
2009-08-20 17:38:59 -04:00
|
|
|
#include <gtkmm2ext/window_title.h>
|
2007-08-06 10:19:19 -04:00
|
|
|
|
|
|
|
#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 ()
|
2009-08-20 17:38:59 -04:00
|
|
|
: ArdourDialog ("add MIDI port dialog")
|
|
|
|
, 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"));
|
|
|
|
|
|
|
|
WindowTitle title(Glib::get_application_name());
|
|
|
|
title += _("Add MIDI port");
|
|
|
|
set_title(title.get_string());
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
port_name.signal_activate().connect (mem_fun (*this, &MidiPortDialog::entry_activated));
|
|
|
|
|
|
|
|
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 ()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|