#include "ardour/panner_shell.h"
#include "ardour/session.h"
-#include "ardour_ui.h"
+#include "widgets/tooltips.h"
+
#include "panner_ui.h"
#include "panner2d.h"
#include "gui_thread.h"
#include "stereo_panner.h"
#include "timers.h"
#include "mono_panner.h"
+#include "ui_config.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace ARDOUR;
, _current_nins (-1)
, _current_uri ("")
, _send_mode (false)
- , pan_automation_style_button ("")
, pan_automation_state_button ("")
, _panner_list()
{
pan_astate_menu = 0;
pan_astyle_menu = 0;
in_pan_update = false;
- _stereo_panner = 0;
+ _stereo_panner = 0;
_mono_panner = 0;
- _ignore_width_change = false;
- _ignore_position_change = false;
+ _ignore_width_change = false;
+ _ignore_position_change = false;
- pan_automation_style_button.set_name ("MixerAutomationModeButton");
pan_automation_state_button.set_name ("MixerAutomationPlaybackButton");
- ARDOUR_UI::instance()->set_tip (pan_automation_state_button, _("Pan automation mode"));
- ARDOUR_UI::instance()->set_tip (pan_automation_style_button, _("Pan automation type"));
+ ArdourWidgets::set_tooltip (pan_automation_state_button, _("Pan automation mode"));
//set_size_request_to_display_given_text (pan_automation_state_button, X_("O"), 2, 2);
- //set_size_request_to_display_given_text (pan_automation_style_button, X_("0"), 2, 2);
- pan_automation_style_button.unset_flags (Gtk::CAN_FOCUS);
pan_automation_state_button.unset_flags (Gtk::CAN_FOCUS);
- pan_automation_style_button.signal_button_press_event().connect (sigc::mem_fun(*this, &PannerUI::pan_automation_style_button_event), false);
pan_automation_state_button.signal_button_press_event().connect (sigc::mem_fun(*this, &PannerUI::pan_automation_state_button_event), false);
pan_vbox.set_spacing (2);
void
PannerUI::set_panner (boost::shared_ptr<PannerShell> ps, boost::shared_ptr<Panner> p)
{
- /* note that the panshell might not change here (i.e. ps == _panshell)
- */
+ /* note that the panshell might not change here (i.e. ps == _panshell)
+ */
connections.drop_connections ();
delete pan_astate_menu;
pan_astate_menu = 0;
- _panshell = ps;
+ _panshell = ps;
_panner = p;
delete twod_panner;
twod_panner = 0;
- delete _stereo_panner;
- _stereo_panner = 0;
+ delete _stereo_panner;
+ _stereo_panner = 0;
- delete _mono_panner;
- _mono_panner = 0;
+ delete _mono_panner;
+ _mono_panner = 0;
if (!_panner) {
return;
_panshell->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::panshell_changed, this), gui_context());
- /* new panner object, force complete reset of panner GUI
- */
+ /* new panner object, force complete reset of panner GUI
+ */
- _current_nouts = 0;
- _current_nins = 0;
+ _current_nouts = 0;
+ _current_nins = 0;
- setup_pan ();
+ setup_pan ();
update_pan_sensitive ();
pan_automation_state_changed ();
}
void
PannerUI::on_size_allocate (Allocation& a)
{
- HBox::on_size_allocate (a);
+ HBox::on_size_allocate (a);
}
void
delete pan_menu;
delete pan_astyle_menu;
delete pan_astate_menu;
- delete _stereo_panner;
- delete _mono_panner;
+ delete _stereo_panner;
+ delete _mono_panner;
}
void
return;
}
- _current_nins = nins;
- _current_nouts = nouts;
- _current_uri = _panshell->panner_gui_uri();
+ _current_nins = nins;
+ _current_nouts = nouts;
+ _current_uri = _panshell->panner_gui_uri();
- container_clear (pan_vbox);
+ container_clear (pan_vbox);
- delete twod_panner;
- twod_panner = 0;
- delete _stereo_panner;
- _stereo_panner = 0;
+ delete twod_panner;
+ twod_panner = 0;
+ delete _stereo_panner;
+ _stereo_panner = 0;
delete _mono_panner;
_mono_panner = 0;
return;
}
- const float scale = std::max (1.f, ARDOUR_UI::ui_scale);
+ const float scale = std::max (1.f, UIConfiguration::instance().get_ui_scale());
if (_current_uri == "http://ardour.org/plugin/panner_2in2out#ui")
{
void
PannerUI::start_touch (boost::weak_ptr<AutomationControl> wac)
{
- boost::shared_ptr<AutomationControl> ac = wac.lock();
- if (!ac) {
- return;
- }
- ac->start_touch (ac->session().transport_frame());
+ boost::shared_ptr<AutomationControl> ac = wac.lock();
+ if (!ac) {
+ return;
+ }
+ ac->start_touch (ac->session().transport_frame());
}
void
PannerUI::stop_touch (boost::weak_ptr<AutomationControl> wac)
{
- boost::shared_ptr<AutomationControl> ac = wac.lock();
- if (!ac) {
- return;
- }
- ac->stop_touch (false, ac->session().transport_frame());
+ boost::shared_ptr<AutomationControl> ac = wac.lock();
+ if (!ac) {
+ return;
+ }
+ ac->stop_touch (ac->session().transport_frame());
}
bool
void
PannerUI::effective_pan_display ()
{
- if (_stereo_panner) {
- _stereo_panner->queue_draw ();
- } else if (_mono_panner) {
- _mono_panner->queue_draw ();
- } else if (twod_panner) {
- twod_panner->queue_draw ();
- }
+ if (_stereo_panner) {
+ _stereo_panner->queue_draw ();
+ } else if (_mono_panner) {
+ _mono_panner->queue_draw ();
+ } else if (twod_panner) {
+ twod_panner->queue_draw ();
+ }
}
void
{
bool const sensitive = !(_panner->pannable()->automation_state() & Play);
- pan_vbox.set_sensitive (sensitive);
+ pan_vbox.set_sensitive (sensitive);
- if (big_window) {
- big_window->set_sensitive (sensitive);
- }
+ if (big_window) {
+ big_window->set_sensitive (sensitive);
+ }
}
gint
return TRUE;
}
-gint
-PannerUI::pan_automation_style_button_event (GdkEventButton *ev)
-{
- if (ev->type == GDK_BUTTON_RELEASE) {
- return TRUE;
- }
-
- switch (ev->button) {
- case 1:
- if (pan_astyle_menu == 0) {
- build_astyle_menu ();
- }
- pan_astyle_menu->popup (1, ev->time);
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-void
-PannerUI::pan_automation_style_changed ()
-{
- ENSURE_GUI_THREAD (*this, &PannerUI::pan_automation_style_changed)
-
- switch (_width) {
- case Wide:
- pan_automation_style_button.set_label (astyle_string(_panner->automation_style()));
- break;
- case Narrow:
- pan_automation_style_button.set_label (short_astyle_string(_panner->automation_style()));
- break;
- }
-}
-
void
PannerUI::pan_automation_state_changed ()
{
- boost::shared_ptr<Pannable> pannable (_panner->pannable());
+ boost::shared_ptr<Pannable> pannable (_panner->pannable());
switch (_width) {
case Wide:
- pan_automation_state_button.set_label (astate_string(pannable->automation_state()));
+ pan_automation_state_button.set_label (astate_string(pannable->automation_state()));
break;
case Narrow:
- pan_automation_state_button.set_label (short_astate_string(pannable->automation_state()));
+ pan_automation_state_button.set_label (short_astate_string(pannable->automation_state()));
break;
}
bool x = (pannable->automation_state() != ARDOUR::Off);
if (pan_automation_state_button.get_active() != x) {
- ignore_toggle = true;
+ ignore_toggle = true;
pan_automation_state_button.set_active (x);
ignore_toggle = false;
}
return sstr;
}
-string
-PannerUI::astyle_string (AutoStyle style)
-{
- return _astyle_string (style, false);
-}
-
-string
-PannerUI::short_astyle_string (AutoStyle style)
-{
- return _astyle_string (style, true);
-}
-
-string
-PannerUI::_astyle_string (AutoStyle style, bool shrt)
-{
- if (style & Trim) {
- return _("Trim");
- } else {
- /* XXX it might different in different languages */
-
- return (shrt ? _("Abs") : _("Abs"));
- }
-}
-
void
PannerUI::show_width ()
{