mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
Trigger Page: add an audition-synth selector to Clip Picker
This commit is contained in:
parent
e2c550bcdd
commit
d22269f59f
2 changed files with 28 additions and 3 deletions
|
|
@ -65,6 +65,7 @@ TriggerClipPicker::TriggerClipPicker ()
|
||||||
: _fcd (_("Select Sample Folder"), FILE_CHOOSER_ACTION_SELECT_FOLDER)
|
: _fcd (_("Select Sample Folder"), FILE_CHOOSER_ACTION_SELECT_FOLDER)
|
||||||
, _seek_slider (0, 1000, 1)
|
, _seek_slider (0, 1000, 1)
|
||||||
, _autoplay_btn (_("Auto-play"))
|
, _autoplay_btn (_("Auto-play"))
|
||||||
|
, _auditioner_combo (InstrumentSelector::ForAuditioner)
|
||||||
, _clip_library_listed (false)
|
, _clip_library_listed (false)
|
||||||
, _ignore_list_dir (false)
|
, _ignore_list_dir (false)
|
||||||
, _seeking (false)
|
, _seeking (false)
|
||||||
|
|
@ -122,6 +123,9 @@ TriggerClipPicker::TriggerClipPicker ()
|
||||||
_autoplay_btn.set_can_focus(false);
|
_autoplay_btn.set_can_focus(false);
|
||||||
_autoplay_btn.signal_toggled ().connect (sigc::mem_fun (*this, &TriggerClipPicker::autoplay_toggled));
|
_autoplay_btn.signal_toggled ().connect (sigc::mem_fun (*this, &TriggerClipPicker::autoplay_toggled));
|
||||||
|
|
||||||
|
auditioner_combo_changed();
|
||||||
|
_auditioner_combo.signal_changed().connect(sigc::mem_fun(*this, &TriggerClipPicker::auditioner_combo_changed) );
|
||||||
|
|
||||||
ArdourWidgets::set_tooltip (_play_btn, _("Audition selected clip"));
|
ArdourWidgets::set_tooltip (_play_btn, _("Audition selected clip"));
|
||||||
ArdourWidgets::set_tooltip (_stop_btn, _("Stop the audition"));
|
ArdourWidgets::set_tooltip (_stop_btn, _("Stop the audition"));
|
||||||
ArdourWidgets::set_tooltip (_open_library_btn, _("Open clip library folder"));
|
ArdourWidgets::set_tooltip (_open_library_btn, _("Open clip library folder"));
|
||||||
|
|
@ -133,7 +137,8 @@ TriggerClipPicker::TriggerClipPicker ()
|
||||||
_auditable.attach (_autoplay_btn, 2, 3, 0, 1, EXPAND | FILL, SHRINK);
|
_auditable.attach (_autoplay_btn, 2, 3, 0, 1, EXPAND | FILL, SHRINK);
|
||||||
_auditable.attach (_show_plugin_btn, 3, 4, 0, 1, SHRINK, SHRINK);
|
_auditable.attach (_show_plugin_btn, 3, 4, 0, 1, SHRINK, SHRINK);
|
||||||
_auditable.attach (_open_library_btn, 4, 5, 0, 1, SHRINK, SHRINK);
|
_auditable.attach (_open_library_btn, 4, 5, 0, 1, SHRINK, SHRINK);
|
||||||
_auditable.attach (_seek_slider, 0, 5, 1, 2, EXPAND | FILL, SHRINK);
|
_auditable.attach (_auditioner_combo, 0, 2, 1, 2, SHRINK, SHRINK);
|
||||||
|
_auditable.attach (_seek_slider, 0, 4, 2, 3, EXPAND | FILL, SHRINK);
|
||||||
_auditable.set_border_width (4);
|
_auditable.set_border_width (4);
|
||||||
_auditable.set_spacings (4);
|
_auditable.set_spacings (4);
|
||||||
|
|
||||||
|
|
@ -193,6 +198,15 @@ TriggerClipPicker::~TriggerClipPicker ()
|
||||||
_idle_connection.disconnect ();
|
_idle_connection.disconnect ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TriggerClipPicker::auditioner_combo_changed()
|
||||||
|
{
|
||||||
|
if (_session) {
|
||||||
|
_session->the_auditioner()->set_audition_synth_info( _auditioner_combo.selected_instrument() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TriggerClipPicker::parameter_changed (std::string const& p)
|
TriggerClipPicker::parameter_changed (std::string const& p)
|
||||||
{
|
{
|
||||||
|
|
@ -915,8 +929,15 @@ TriggerClipPicker::audition_processors_changed ()
|
||||||
{
|
{
|
||||||
if (!_session || _session->deletion_in_progress () || !_session->the_auditioner ()) {
|
if (!_session || _session->deletion_in_progress () || !_session->the_auditioner ()) {
|
||||||
_show_plugin_btn.set_sensitive (false);
|
_show_plugin_btn.set_sensitive (false);
|
||||||
|
set_tooltip (_show_plugin_btn, "You must first play one midi file to show the plugin's GUI");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
boost::shared_ptr<PluginInsert> plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (_session->the_auditioner ()->the_instrument ());
|
|
||||||
_show_plugin_btn.set_sensitive (plugin_insert != 0);
|
if (_session && _session->the_auditioner ()->get_audition_synth_info()) {
|
||||||
|
boost::shared_ptr<PluginInsert> plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (_session->the_auditioner ()->the_instrument ());
|
||||||
|
if (plugin_insert) {
|
||||||
|
set_tooltip (_show_plugin_btn, "Show the selected audition-instrument's GUI");
|
||||||
|
_show_plugin_btn.set_sensitive (true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
#include "widgets/ardour_dropdown.h"
|
#include "widgets/ardour_dropdown.h"
|
||||||
#include "widgets/ardour_button.h"
|
#include "widgets/ardour_button.h"
|
||||||
|
|
||||||
|
#include "instrument_selector.h"
|
||||||
|
|
||||||
class PluginUIWindow;
|
class PluginUIWindow;
|
||||||
|
|
||||||
|
|
@ -80,6 +81,7 @@ private:
|
||||||
void open_library ();
|
void open_library ();
|
||||||
bool seek_button_press (GdkEventButton*);
|
bool seek_button_press (GdkEventButton*);
|
||||||
bool seek_button_release (GdkEventButton*);
|
bool seek_button_release (GdkEventButton*);
|
||||||
|
void auditioner_combo_changed ();
|
||||||
|
|
||||||
ArdourWidgets::ArdourDropdown _dir;
|
ArdourWidgets::ArdourDropdown _dir;
|
||||||
Gtk::FileChooserDialog _fcd;
|
Gtk::FileChooserDialog _fcd;
|
||||||
|
|
@ -110,6 +112,8 @@ private:
|
||||||
Gtk::HScale _seek_slider;
|
Gtk::HScale _seek_slider;
|
||||||
Gtk::CheckButton _autoplay_btn;
|
Gtk::CheckButton _autoplay_btn;
|
||||||
|
|
||||||
|
InstrumentSelector _auditioner_combo;
|
||||||
|
|
||||||
std::string _current_path;
|
std::string _current_path;
|
||||||
std::string _clip_library_dir;
|
std::string _clip_library_dir;
|
||||||
bool _clip_library_listed;
|
bool _clip_library_listed;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue