2007-10-11 21:54:35 -04:00
|
|
|
#ifndef __ardour_gtk_key_editor_h__
|
|
|
|
#define __ardour_gtk_key_editor_h__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2008-01-10 17:22:29 -05:00
|
|
|
#include <gtkmm/buttonbox.h>
|
2007-10-11 21:54:35 -04:00
|
|
|
#include <gtkmm/treeview.h>
|
|
|
|
#include <gtkmm/treestore.h>
|
|
|
|
#include <gtkmm/scrolledwindow.h>
|
|
|
|
#include <glibmm/ustring.h>
|
|
|
|
|
|
|
|
#include "ardour_dialog.h"
|
|
|
|
|
|
|
|
class KeyEditor : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
KeyEditor ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-10-11 21:54:35 -04:00
|
|
|
protected:
|
|
|
|
void on_show ();
|
|
|
|
void on_unmap ();
|
2007-10-12 18:30:25 -04:00
|
|
|
bool on_key_press_event (GdkEventKey*);
|
2007-10-11 21:54:35 -04:00
|
|
|
bool on_key_release_event (GdkEventKey*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct KeyEditorColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
KeyEditorColumns () {
|
|
|
|
add (action);
|
|
|
|
add (binding);
|
|
|
|
add (path);
|
2007-10-12 18:30:25 -04:00
|
|
|
add (bindable);
|
2007-10-11 21:54:35 -04:00
|
|
|
}
|
|
|
|
Gtk::TreeModelColumn<Glib::ustring> action;
|
|
|
|
Gtk::TreeModelColumn<std::string> binding;
|
|
|
|
Gtk::TreeModelColumn<std::string> path;
|
2007-10-12 18:30:25 -04:00
|
|
|
Gtk::TreeModelColumn<bool> bindable;
|
2007-10-11 21:54:35 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
Gtk::ScrolledWindow scroller;
|
|
|
|
Gtk::TreeView view;
|
|
|
|
Glib::RefPtr<Gtk::TreeStore> model;
|
|
|
|
KeyEditorColumns columns;
|
2008-01-10 17:22:29 -05:00
|
|
|
Gtk::Button unbind_button;
|
|
|
|
Gtk::HButtonBox unbind_box;
|
|
|
|
|
|
|
|
void unbind ();
|
2007-10-11 21:54:35 -04:00
|
|
|
|
2007-10-12 18:30:25 -04:00
|
|
|
bool can_bind;
|
|
|
|
guint last_state;
|
|
|
|
|
2007-10-11 21:54:35 -04:00
|
|
|
void action_selected ();
|
|
|
|
void populate ();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk_key_editor_h__ */
|