Guitarix
gx_sequencer_settings.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
3  * Copyright (C) 2011 Pete Shorthose
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #ifndef SRC_HEADERS_GX_SEQUENCER_SETTINGS_H_
23 #define SRC_HEADERS_GX_SEQUENCER_SETTINGS_H_
24 
25 
26 #include <string>
27 
28 namespace gx_seq {
29 
30 /****************************************************************
31  ** Sequencer Parameter Window
32  */
33 
34 class SEQWindow: public sigc::trackable {
35  private:
36  gx_engine::GxMachineBase& machine;
37  Glib::RefPtr<gx_gui::GxBuilder> builder;
38 
43 
44  // widget pointers
45  Gtk::Window* gtk_window;
46  Gtk::HBox* tom_box;
47  Gtk::HBox* kick_box;
48  Gtk::HBox* snare_box;
49  Gtk::HBox* hat_box;
50  Gtk::HBox *preset_button;
51  Gxw::Regler *seq_pos;
52  Gxw::Regler *seq_count;
53 
54  // signal functions
55  void on_window_hide();
56  void on_preset_popup_clicked();
57  bool get_sequencer_pos(Gxw::Regler * regler, const std::string id);
58  bool on_key_press_event(GdkEventKey *event);
59  void seq_changed(const gx_engine::GxSeqSettings* seqc, Gtk::HBox *box);
60  void make_state(gx_engine::GxSeqSettings& seqc, std::vector<int> seq);
61  void on_seq_button_clicked(Gtk::HBox *box, gx_engine::SeqParameter *p);
62  void on_sec_length_changed(bool update);
63  void append_seq_block(Gtk::HBox * box, gx_engine::SeqParameter *p, int r, int r_save);
64  void remove_seq_block(Gtk::HBox * box, int r);
65  void make_preset_button(Gtk::HBox *box);
66 
67  void init_connect();
68  SEQWindow(const Glib::RefPtr<gx_gui::GxBuilder>& builder, gx_engine::SeqParameter *tomp_,
71  ~SEQWindow();
72 
73 public:
74  void reload_and_show();
75  static SEQWindow *create(const std::string& unit_id, gx_engine::GxMachineBase& machine);
76 };
77 
78 } /* end of gx_seq namespace*/
79 #endif // SRC_HEADERS_GX_SEQUENCER_SETTINGS_H_
static SEQWindow * create(const std::string &unit_id, gx_engine::GxMachineBase &machine)