--- gigedit/trunk/src/gigedit/regionchooser.h 2008/01/04 19:42:45 1623 +++ gigedit/trunk/src/gigedit/regionchooser.h 2011/03/06 07:51:04 2169 @@ -1,5 +1,5 @@ /* -*- c++ -*- - * Copyright (C) 2006-2008 Andreas Persson + * Copyright (C) 2006-2011 Andreas Persson * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -23,15 +23,21 @@ #include #include -#include #include #include #include #include "dimensionmanager.h" +#include "paramedit.h" +#include "compat.h" #include +enum virt_keyboard_mode_t { + VIRT_KEYBOARD_MODE_NORMAL, + VIRT_KEYBOARD_MODE_CHORD +}; + class SortedRegions { private: std::vector regions; @@ -63,22 +69,28 @@ sigc::signal& signal_region_to_be_changed(); sigc::signal& signal_region_changed_signal(); + sigc::signal& signal_keyboard_key_hit(); + sigc::signal& signal_keyboard_key_released(); + gig::Region* get_region() { return region; } + void on_note_on_event(int key, int velocity); + void on_note_off_event(int key, int velocity); + + Gtk::HBox m_VirtKeybPropsBox; + protected: - virtual void on_realize(); +#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 virtual bool on_expose_event(GdkEventExpose* e); - virtual void on_size_request(GtkRequisition* requisition); +#endif + virtual bool on_draw(const Cairo::RefPtr& cr); virtual bool on_button_press_event(GdkEventButton* event); virtual bool on_button_release_event(GdkEventButton* event); virtual bool on_motion_notify_event(GdkEventMotion* event); gig::Region* get_region(int key); - Glib::RefPtr gc; - Gdk::Color blue, red, grey1; - - void draw_region(int from, int to, const Gdk::Color& color); + Gdk::RGBA activeKeyColor, red, grey1, white, black; sigc::signal region_selected; sigc::signal instrument_changed; @@ -89,10 +101,16 @@ sigc::signal region_to_be_changed_signal; sigc::signal region_changed_signal; + sigc::signal keyboard_key_hit_signal; + sigc::signal keyboard_key_released_signal; + gig::Instrument* instrument; gig::Region* region; SortedRegions regions; + bool is_black_key(int key); + void draw_key(int key, const Gdk::RGBA& color); + void draw_digit(int key); void motion_resize_region(int x, int y); void motion_move_region(int x, int y); @@ -137,6 +155,14 @@ Glib::RefPtr actionGroup; Glib::RefPtr uiManager; + // properties of the virtaul keyboard + ChoiceEntry m_VirtKeybModeChoice; + Gtk::Label m_VirtKeybVelocityLabelDescr; + Gtk::Label m_VirtKeybVelocityLabel; + Gtk::Label m_VirtKeybOffVelocityLabelDescr; + Gtk::Label m_VirtKeybOffVelocityLabel; + int currentActiveKey; + DimensionManager dimensionManager; };