Loading...
Searching...
No Matches
gx_sequencer_settings.h
Go to the documentation of this file.
/*
* Copyright (C) 2017 Hermann Meyer, Andreas Degert
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#ifndef SRC_HEADERS_GX_SEQUENCER_SETTINGS_H_
#define SRC_HEADERS_GX_SEQUENCER_SETTINGS_H_
#include <string>
namespace gx_seq {
class Drums {
public:
gx_engine::SeqParameter *p;
Gtk::Box* box;
Drums(gx_engine::SeqParameter *pa)
: p(pa) {}
~Drums() {}
};
class UPresetListStore: public Gtk::ListStore {
public:
class UPresetListColumns : public Gtk::TreeModel::ColumnRecord {
public:
Gtk::TreeModelColumn<Glib::ustring> name;
UPresetListColumns() { add(name); }
} col;
private:
UPresetListStore(): Gtk::ListStore(), col() {
set_column_types(col);
}
public:
static Glib::RefPtr<UPresetListStore> create() {
return Glib::RefPtr<UPresetListStore>(new UPresetListStore);
}
};
/****************************************************************
** PluginPresetConnectWindow
*/
class PluginPresetConnectWindow: public Gtk::Window {
private:
Glib::RefPtr<UPresetListStore> upresetliststore;
gx_engine::GxMachineBase& machine;
Gtk::TreeView *treeview;
Gtk::Button *connectbutton;
void on_connect();
void on_selection_changed();
virtual bool on_key_press_event(GdkEventKey *event);
static PluginPresetConnectWindow* create_from_builder(
BaseObjectType* cobject, Glib::RefPtr<gx_gui::GxBuilder> bld,
gx_engine::GxMachineBase& machine);
PluginPresetConnectWindow(BaseObjectType* cobject,
Glib::RefPtr<gx_gui::GxBuilder> bld, gx_engine::GxMachineBase& machine);
public:
~PluginPresetConnectWindow();
static PluginPresetConnectWindow *create(gx_engine::GxMachineBase& machine);
void run();
};
/****************************************************************
** Sequencer Parameter Window
*/
class SEQWindow: public sigc::trackable {
private:
gx_engine::GxMachineBase& machine;
Glib::RefPtr<gx_gui::GxBuilder> builder;
std::vector<Drums> drums;
Drums tom;
Drums tom1;
Drums tom2;
Drums kick;
Drums snare;
Drums hat;
bool is_active;
// widget pointers
Gtk::Window* gtk_window;
Gtk::Viewport *vp;
Gtk::Label *preset_label;
Gtk::Box *preset_button;
Gxw::Switch *add_button;
Gxw::Regler *seq_pos;
Gxw::Regler *seq_count;
Gxw::Regler *seq_tact;
Gxw::Switch *next_preset;
Gxw::Switch *previus_preset;
Gxw::Switch *set_step;
Gxw::Switch *set_fstep;
Gxw::Switch *set_sync;
Gxw::Switch *reset_step;
Gtk::Label *step_label;
Gxw::ValueDisplay *step_value;
// signal functions
void on_window_hide();
void on_preset_popup_clicked();
void on_selection_done(Gtk::Menu *presetMenu);
bool get_sequencer_pos(Gxw::Regler * regler, const std::string id);
bool on_key_press_event(GdkEventKey *event);
void check_preset_label();
void seq_changed(const gx_engine::GxSeqSettings* seqc, Gtk::Box *box);
void make_state(gx_engine::GxSeqSettings& seqc, std::vector<int> seq);
void on_seq_button_clicked(Gtk::Box *box, gx_engine::SeqParameter *p);
void on_seq_button_clicked_set(Gtk::Box *box, gx_engine::SeqParameter *p);
void on_sec_length_changed(bool update);
void on_sec_tact_changed();
void append_seq_block(Gtk::Box * box, gx_engine::SeqParameter *p, int r, int r_save);
void remove_seq_block(Gtk::Box * box, int r);
void reset_control(Glib::ustring id, float value);
int append_sequence(const gx_engine::GxSeqSettings* seqc, gx_engine::SeqParameter *p, std::vector<int> *sequence);
void make_preset_button(Gtk::Box *box);
void scroll_playhead(float value);
void append_plugin_preset(Glib::ustring name);
void append_plugin_preset_set(Glib::ustring name);
void on_preset_add_clicked();
void on_next_preset();
void on_next_preset_set();
void on_previus_preset();
void on_previus_preset_set();
void connect_midi();
void on_set_step();
void on_set_fstep();
void on_sync_stepper();
void on_reset_stepper();
void init_connect();
void init_sequences(gx_engine::SeqParameter *p, Gtk::Box* _box);
SEQWindow(const Glib::RefPtr<gx_gui::GxBuilder>& builder, gx_engine::SeqParameter *tomp_,
gx_engine::SeqParameter *tomp1_, gx_engine::SeqParameter *tomp2_,
gx_engine::SeqParameter *kickp_, gx_engine::SeqParameter *snarep_,
gx_engine::SeqParameter *hatp_, gx_engine::GxMachineBase& machine_);
public:
void reload_and_show();
static SEQWindow *create(const std::string& unit_id, gx_engine::GxMachineBase& machine);
~SEQWindow();
};
} /* end of gx_seq namespace*/
#endif // SRC_HEADERS_GX_SEQUENCER_SETTINGS_H_
gx_engine::GxMachineBase
Definition machine.h:59
gx_engine::GxSeqSettings
Definition gx_internal_plugins.h:226
gx_seq::Drums
Definition gx_sequencer_settings.h:29
gx_seq::Drums::~Drums
~Drums()
Definition gx_sequencer_settings.h:35
gx_seq::Drums::Drums
Drums(gx_engine::SeqParameter *pa)
Definition gx_sequencer_settings.h:33
gx_seq::Drums::p
gx_engine::SeqParameter * p
Definition gx_sequencer_settings.h:31
gx_seq::Drums::box
Gtk::Box * box
Definition gx_sequencer_settings.h:32
gx_seq::PluginPresetConnectWindow::on_connect
void on_connect()
gx_seq::PluginPresetConnectWindow::upresetliststore
Glib::RefPtr< UPresetListStore > upresetliststore
Definition gx_sequencer_settings.h:61
gx_seq::PluginPresetConnectWindow::connectbutton
Gtk::Button * connectbutton
Definition gx_sequencer_settings.h:64
gx_seq::PluginPresetConnectWindow::machine
gx_engine::GxMachineBase & machine
Definition gx_sequencer_settings.h:62
gx_seq::PluginPresetConnectWindow::treeview
Gtk::TreeView * treeview
Definition gx_sequencer_settings.h:63
gx_seq::PluginPresetConnectWindow::on_key_press_event
virtual bool on_key_press_event(GdkEventKey *event)
gx_seq::PluginPresetConnectWindow::~PluginPresetConnectWindow
~PluginPresetConnectWindow()
gx_seq::PluginPresetConnectWindow::run
void run()
gx_seq::PluginPresetConnectWindow::PluginPresetConnectWindow
PluginPresetConnectWindow(BaseObjectType *cobject, Glib::RefPtr< gx_gui::GxBuilder > bld, gx_engine::GxMachineBase &machine)
gx_seq::PluginPresetConnectWindow::create
static PluginPresetConnectWindow * create(gx_engine::GxMachineBase &machine)
gx_seq::PluginPresetConnectWindow::on_selection_changed
void on_selection_changed()
gx_seq::PluginPresetConnectWindow::create_from_builder
static PluginPresetConnectWindow * create_from_builder(BaseObjectType *cobject, Glib::RefPtr< gx_gui::GxBuilder > bld, gx_engine::GxMachineBase &machine)
gx_seq::SEQWindow::append_plugin_preset_set
void append_plugin_preset_set(Glib::ustring name)
gx_seq::SEQWindow::check_preset_label
void check_preset_label()
gx_seq::SEQWindow::step_value
Gxw::ValueDisplay * step_value
Definition gx_sequencer_settings.h:112
gx_seq::SEQWindow::on_next_preset
void on_next_preset()
gx_seq::SEQWindow::remove_seq_block
void remove_seq_block(Gtk::Box *box, int r)
gx_seq::SEQWindow::previus_preset
Gxw::Switch * previus_preset
Definition gx_sequencer_settings.h:106
gx_seq::SEQWindow::SEQWindow
SEQWindow(const Glib::RefPtr< gx_gui::GxBuilder > &builder, gx_engine::SeqParameter *tomp_, gx_engine::SeqParameter *tomp1_, gx_engine::SeqParameter *tomp2_, gx_engine::SeqParameter *kickp_, gx_engine::SeqParameter *snarep_, gx_engine::SeqParameter *hatp_, gx_engine::GxMachineBase &machine_)
gx_seq::SEQWindow::on_preset_popup_clicked
void on_preset_popup_clicked()
gx_seq::SEQWindow::on_previus_preset
void on_previus_preset()
gx_seq::SEQWindow::preset_button
Gtk::Box * preset_button
Definition gx_sequencer_settings.h:100
gx_seq::SEQWindow::set_sync
Gxw::Switch * set_sync
Definition gx_sequencer_settings.h:109
gx_seq::SEQWindow::reload_and_show
void reload_and_show()
gx_seq::SEQWindow::on_set_fstep
void on_set_fstep()
gx_seq::SEQWindow::~SEQWindow
~SEQWindow()
gx_seq::SEQWindow::tom
Drums tom
Definition gx_sequencer_settings.h:88
gx_seq::SEQWindow::add_button
Gxw::Switch * add_button
Definition gx_sequencer_settings.h:101
gx_seq::SEQWindow::tom2
Drums tom2
Definition gx_sequencer_settings.h:90
gx_seq::SEQWindow::append_plugin_preset
void append_plugin_preset(Glib::ustring name)
gx_seq::SEQWindow::on_sync_stepper
void on_sync_stepper()
gx_seq::SEQWindow::next_preset
Gxw::Switch * next_preset
Definition gx_sequencer_settings.h:105
gx_seq::SEQWindow::on_previus_preset_set
void on_previus_preset_set()
gx_seq::SEQWindow::append_seq_block
void append_seq_block(Gtk::Box *box, gx_engine::SeqParameter *p, int r, int r_save)
gx_seq::SEQWindow::drums
std::vector< Drums > drums
Definition gx_sequencer_settings.h:87
gx_seq::SEQWindow::make_preset_button
void make_preset_button(Gtk::Box *box)
gx_seq::SEQWindow::create
static SEQWindow * create(const std::string &unit_id, gx_engine::GxMachineBase &machine)
gx_seq::SEQWindow::tom1
Drums tom1
Definition gx_sequencer_settings.h:89
gx_seq::SEQWindow::on_sec_tact_changed
void on_sec_tact_changed()
gx_seq::SEQWindow::vp
Gtk::Viewport * vp
Definition gx_sequencer_settings.h:98
gx_seq::SEQWindow::seq_pos
Gxw::Regler * seq_pos
Definition gx_sequencer_settings.h:102
gx_seq::SEQWindow::on_sec_length_changed
void on_sec_length_changed(bool update)
gx_seq::SEQWindow::on_window_hide
void on_window_hide()
gx_seq::SEQWindow::preset_label
Gtk::Label * preset_label
Definition gx_sequencer_settings.h:99
gx_seq::SEQWindow::reset_control
void reset_control(Glib::ustring id, float value)
gx_seq::SEQWindow::reset_step
Gxw::Switch * reset_step
Definition gx_sequencer_settings.h:110
gx_seq::SEQWindow::on_set_step
void on_set_step()
gx_seq::SEQWindow::on_next_preset_set
void on_next_preset_set()
gx_seq::SEQWindow::scroll_playhead
void scroll_playhead(float value)
gx_seq::SEQWindow::step_label
Gtk::Label * step_label
Definition gx_sequencer_settings.h:111
gx_seq::SEQWindow::make_state
void make_state(gx_engine::GxSeqSettings &seqc, std::vector< int > seq)
gx_seq::SEQWindow::append_sequence
int append_sequence(const gx_engine::GxSeqSettings *seqc, gx_engine::SeqParameter *p, std::vector< int > *sequence)
gx_seq::SEQWindow::gtk_window
Gtk::Window * gtk_window
Definition gx_sequencer_settings.h:97
gx_seq::SEQWindow::kick
Drums kick
Definition gx_sequencer_settings.h:91
gx_seq::SEQWindow::seq_count
Gxw::Regler * seq_count
Definition gx_sequencer_settings.h:103
gx_seq::SEQWindow::hat
Drums hat
Definition gx_sequencer_settings.h:93
gx_seq::SEQWindow::set_fstep
Gxw::Switch * set_fstep
Definition gx_sequencer_settings.h:108
gx_seq::SEQWindow::builder
Glib::RefPtr< gx_gui::GxBuilder > builder
Definition gx_sequencer_settings.h:86
gx_seq::SEQWindow::on_key_press_event
bool on_key_press_event(GdkEventKey *event)
gx_seq::SEQWindow::on_reset_stepper
void on_reset_stepper()
gx_seq::SEQWindow::on_selection_done
void on_selection_done(Gtk::Menu *presetMenu)
gx_seq::SEQWindow::on_seq_button_clicked
void on_seq_button_clicked(Gtk::Box *box, gx_engine::SeqParameter *p)
gx_seq::SEQWindow::seq_changed
void seq_changed(const gx_engine::GxSeqSettings *seqc, Gtk::Box *box)
gx_seq::SEQWindow::init_sequences
void init_sequences(gx_engine::SeqParameter *p, Gtk::Box *_box)
gx_seq::SEQWindow::connect_midi
void connect_midi()
gx_seq::SEQWindow::seq_tact
Gxw::Regler * seq_tact
Definition gx_sequencer_settings.h:104
gx_seq::SEQWindow::is_active
bool is_active
Definition gx_sequencer_settings.h:94
gx_seq::SEQWindow::on_preset_add_clicked
void on_preset_add_clicked()
gx_seq::SEQWindow::on_seq_button_clicked_set
void on_seq_button_clicked_set(Gtk::Box *box, gx_engine::SeqParameter *p)
gx_seq::SEQWindow::init_connect
void init_connect()
gx_seq::SEQWindow::snare
Drums snare
Definition gx_sequencer_settings.h:92
gx_seq::SEQWindow::set_step
Gxw::Switch * set_step
Definition gx_sequencer_settings.h:107
gx_seq::SEQWindow::machine
gx_engine::GxMachineBase & machine
Definition gx_sequencer_settings.h:85
gx_seq::SEQWindow::get_sequencer_pos
bool get_sequencer_pos(Gxw::Regler *regler, const std::string id)
gx_seq::UPresetListStore::UPresetListColumns::name
Gtk::TreeModelColumn< Glib::ustring > name
Definition gx_sequencer_settings.h:42
gx_seq::UPresetListStore::UPresetListColumns::UPresetListColumns
UPresetListColumns()
Definition gx_sequencer_settings.h:43
gx_seq::UPresetListStore::create
static Glib::RefPtr< UPresetListStore > create()
Definition gx_sequencer_settings.h:50
gx_seq::UPresetListStore::UPresetListStore
UPresetListStore()
Definition gx_sequencer_settings.h:46
gx_seq::UPresetListStore::col
gx_seq::UPresetListStore::UPresetListColumns col
gx_engine::SeqParameter
ParameterV< GxSeqSettings > SeqParameter
Definition gx_internal_plugins.h:273
gx_seq
Definition gx_sequencer_settings.h:27