mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 04:39:33 +01:00
new mini, standalone MIDI beatbox/live looper
This is for experiments with loop sequencing, MIDI region generation and superclock stuff
This commit is contained in:
parent
cec84d242d
commit
70def122de
5 changed files with 617 additions and 0 deletions
77
tools/bb/gui.cc
Normal file
77
tools/bb/gui.cc
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
#include "bb.h"
|
||||
#include "gui.h"
|
||||
|
||||
BBGUI::BBGUI (int* argc, char** argv[], jack_client_t* j, BeatBox* bb)
|
||||
: jack (j)
|
||||
, bbox (bb)
|
||||
, main (argc, argv)
|
||||
, quantize_off (quantize_group, "None")
|
||||
, quantize_32nd (quantize_group, "ThirtySecond")
|
||||
, quantize_16th (quantize_group, "Sixteenth")
|
||||
, quantize_8th (quantize_group, "Eighth")
|
||||
, quantize_quarter (quantize_group, "Quarter")
|
||||
, quantize_half (quantize_group, "Half")
|
||||
, quantize_whole (quantize_group, "Whole")
|
||||
, play_button ("Run")
|
||||
, clear_button ("Clear")
|
||||
{
|
||||
quantize_off.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &BBGUI::set_quantize), 0));
|
||||
quantize_32nd.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &BBGUI::set_quantize), 32));
|
||||
quantize_16th.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &BBGUI::set_quantize), 16));
|
||||
quantize_8th.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &BBGUI::set_quantize), 8));
|
||||
quantize_quarter.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &BBGUI::set_quantize), 4));
|
||||
quantize_half.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &BBGUI::set_quantize), 2));
|
||||
quantize_whole.signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &BBGUI::set_quantize), 1));
|
||||
|
||||
quantize_button_box.pack_start (quantize_off);
|
||||
quantize_button_box.pack_start (quantize_32nd);
|
||||
quantize_button_box.pack_start (quantize_16th);
|
||||
quantize_button_box.pack_start (quantize_8th);
|
||||
quantize_button_box.pack_start (quantize_quarter);
|
||||
quantize_button_box.pack_start (quantize_half);
|
||||
quantize_button_box.pack_start (quantize_whole);
|
||||
|
||||
play_button.signal_toggled().connect (sigc::mem_fun (*this, &BBGUI::toggle_play));
|
||||
clear_button.signal_clicked().connect (sigc::mem_fun (*this, &BBGUI::clear));
|
||||
|
||||
misc_button_box.pack_start (play_button);
|
||||
misc_button_box.pack_start (clear_button);
|
||||
|
||||
global_vbox.pack_start (misc_button_box);
|
||||
global_vbox.pack_start (quantize_button_box, true, true);
|
||||
window.add (global_vbox);
|
||||
window.show_all ();
|
||||
}
|
||||
|
||||
BBGUI::~BBGUI ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
BBGUI::run ()
|
||||
{
|
||||
window.show ();
|
||||
main.run ();
|
||||
}
|
||||
|
||||
void
|
||||
BBGUI::set_quantize (int divisor)
|
||||
{
|
||||
bbox->set_quantize (divisor);
|
||||
}
|
||||
|
||||
void
|
||||
BBGUI::clear ()
|
||||
{
|
||||
bbox->clear ();
|
||||
}
|
||||
|
||||
void
|
||||
BBGUI::toggle_play ()
|
||||
{
|
||||
if (bbox->running()) {
|
||||
bbox->stop ();
|
||||
} else {
|
||||
bbox->start ();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue