1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006-2015 Andreas Persson |
* Copyright (C) 2006-2017 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
22 |
|
|
23 |
#include <vector> |
#include <vector> |
24 |
|
|
25 |
|
#include "compat.h" |
26 |
|
|
27 |
|
#include <gtkmm/box.h> |
28 |
#include <gtkmm/drawingarea.h> |
#include <gtkmm/drawingarea.h> |
|
#include <gtkmm/uimanager.h> |
|
29 |
#include <gdkmm/window.h> |
#include <gdkmm/window.h> |
30 |
#include <gtkmm/menu.h> |
#include <gtkmm/menu.h> |
31 |
|
|
32 |
|
#if USE_GTKMM_BUILDER |
33 |
|
# include <gtkmm/builder.h> |
34 |
|
#else |
35 |
|
# include <gtkmm/uimanager.h> // deprecated in gtkmm >= 3.21.4 |
36 |
|
#endif |
37 |
|
|
38 |
#include "dimensionmanager.h" |
#include "dimensionmanager.h" |
39 |
#include "paramedit.h" |
#include "paramedit.h" |
40 |
#include "compat.h" |
#include "compat.h" |
41 |
|
|
42 |
#include <gig.h> |
#ifdef LIBGIG_HEADER_FILE |
43 |
|
# include LIBGIG_HEADER_FILE(gig.h) |
44 |
|
#else |
45 |
|
# include <gig.h> |
46 |
|
#endif |
47 |
|
|
48 |
enum virt_keyboard_mode_t { |
enum virt_keyboard_mode_t { |
49 |
VIRT_KEYBOARD_MODE_NORMAL, |
VIRT_KEYBOARD_MODE_NORMAL, |
72 |
|
|
73 |
void set_instrument(gig::Instrument* instrument); |
void set_instrument(gig::Instrument* instrument); |
74 |
|
|
75 |
|
// ATM only used for painting auto selected regions with gray hatched pattern |
76 |
|
void setModifyAllRegions(bool b); |
77 |
|
|
78 |
sigc::signal<void>& signal_region_selected(); |
sigc::signal<void>& signal_region_selected(); |
79 |
sigc::signal<void>& signal_instrument_changed(); |
sigc::signal<void>& signal_instrument_changed(); |
80 |
|
|
89 |
|
|
90 |
gig::Region* get_region() { return region; } |
gig::Region* get_region() { return region; } |
91 |
void set_region(gig::Region* region); |
void set_region(gig::Region* region); |
92 |
|
void select_next_region(); |
93 |
|
void select_prev_region(); |
94 |
|
|
95 |
void on_note_on_event(int key, int velocity); |
void on_note_on_event(int key, int velocity); |
96 |
void on_note_off_event(int key, int velocity); |
void on_note_off_event(int key, int velocity); |
97 |
|
|
98 |
Gtk::HBox m_VirtKeybPropsBox; |
HBox m_VirtKeybPropsBox; |
99 |
|
|
100 |
protected: |
protected: |
101 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
109 |
|
|
110 |
gig::Region* get_region(int key); |
gig::Region* get_region(int key); |
111 |
|
|
112 |
Gdk::RGBA activeKeyColor, red, grey1, white, black; |
Gdk::RGBA activeKeyColor, blue, grey1, white, black; |
113 |
|
Glib::RefPtr<Gdk::Pixbuf> blueHatchedPatternARGB; |
114 |
|
Cairo::RefPtr<Cairo::SurfacePattern> blueHatchedSurfacePattern; |
115 |
|
|
116 |
sigc::signal<void> region_selected; |
sigc::signal<void> region_selected; |
117 |
sigc::signal<void> instrument_changed; |
sigc::signal<void> instrument_changed; |
141 |
void update_after_resize(); |
void update_after_resize(); |
142 |
void update_after_move(int pos); |
void update_after_move(int pos); |
143 |
void invalidate_key(int key); |
void invalidate_key(int key); |
144 |
|
void on_show_tooltips_changed(); |
145 |
|
|
146 |
// returns the leftmost pixel of a key |
// returns the leftmost pixel of a key |
147 |
int key_to_x(double k, int w) const { |
int key_to_x(double k, int w) const { |
185 |
|
|
186 |
int h1; |
int h1; |
187 |
|
|
188 |
|
// ATM only used for painting auto selected regions with gray hatched pattern |
189 |
|
bool modifyallregions; |
190 |
|
|
191 |
Gtk::Menu* popup_menu_inside_region; |
Gtk::Menu* popup_menu_inside_region; |
192 |
Gtk::Menu* popup_menu_outside_region; |
Gtk::Menu* popup_menu_outside_region; |
193 |
void show_region_properties(); |
void show_region_properties(); |
197 |
void on_dimension_manager_changed(); |
void on_dimension_manager_changed(); |
198 |
int new_region_pos; |
int new_region_pos; |
199 |
|
|
200 |
Glib::RefPtr<Gtk::ActionGroup> actionGroup; |
Glib::RefPtr<ActionGroup> actionGroup; |
201 |
|
#if USE_GTKMM_BUILDER |
202 |
|
Glib::RefPtr<Gtk::Builder> uiManager; |
203 |
|
#else |
204 |
Glib::RefPtr<Gtk::UIManager> uiManager; |
Glib::RefPtr<Gtk::UIManager> uiManager; |
205 |
|
#endif |
206 |
|
|
207 |
// properties of the virtual keyboard |
// properties of the virtual keyboard |
208 |
ChoiceEntry<virt_keyboard_mode_t> m_VirtKeybModeChoice; |
ChoiceEntry<virt_keyboard_mode_t> m_VirtKeybModeChoice; |