2017-04-05 05:04:16 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ardour_surfaces_fp8strip_h_
|
|
|
|
#define _ardour_surfaces_fp8strip_h_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
|
|
#include "pbd/signals.h"
|
2017-04-14 07:57:14 -04:00
|
|
|
#include "pbd/controllable.h"
|
2017-04-05 05:04:16 -04:00
|
|
|
|
|
|
|
#include "fp8_base.h"
|
|
|
|
#include "fp8_button.h"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Stripable;
|
|
|
|
class AutomationControl;
|
|
|
|
class PeakMeter;
|
|
|
|
class ReadOnlyControl;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ArdourSurface {
|
|
|
|
|
|
|
|
class FP8Strip
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FP8Strip (FP8Base& b, uint8_t id);
|
|
|
|
~FP8Strip ();
|
|
|
|
|
|
|
|
FP8ButtonInterface& solo_button () { return _solo; }
|
|
|
|
FP8ButtonInterface& mute_button () { return _mute; }
|
|
|
|
FP8ButtonInterface& selrec_button () { return _selrec; }
|
|
|
|
FP8ButtonInterface& recarm_button () { return *_selrec.button_shift(); }
|
|
|
|
FP8ButtonInterface& select_button () { return *_selrec.button(); }
|
|
|
|
|
|
|
|
bool midi_touch (bool t);
|
|
|
|
bool midi_fader (float val);
|
|
|
|
|
|
|
|
void initialize (); // call only when connected, sends midi
|
|
|
|
|
|
|
|
void set_select_cb (boost::function<void ()>&);
|
|
|
|
|
|
|
|
enum DisplayMode {
|
|
|
|
Stripables,
|
|
|
|
PluginSelect, // no clock display
|
|
|
|
PluginParam, // param value
|
2017-04-14 07:57:14 -04:00
|
|
|
SendDisplay, // param value + select-bar
|
2017-04-05 05:04:16 -04:00
|
|
|
};
|
|
|
|
|
2017-04-14 07:57:14 -04:00
|
|
|
void set_periodic_display_mode (DisplayMode m);
|
2017-04-05 05:04:16 -04:00
|
|
|
|
|
|
|
// convenience function to call all set_XXX_controllable
|
|
|
|
void set_stripable (boost::shared_ptr<ARDOUR::Stripable>, bool panmode);
|
2017-04-14 07:57:14 -04:00
|
|
|
void set_text_line (uint8_t, std::string const&, bool inv = false);
|
2017-04-05 05:04:16 -04:00
|
|
|
|
|
|
|
enum CtrlMask {
|
|
|
|
CTRL_FADER = 0x001,
|
|
|
|
CTRL_MUTE = 0x002,
|
|
|
|
CTRL_SOLO = 0x004,
|
|
|
|
CTRL_REC = 0x004,
|
|
|
|
CTRL_PAN = 0x008,
|
|
|
|
CTRL_SELECT = 0x010,
|
2017-04-14 07:57:14 -04:00
|
|
|
CTRL_TEXT0 = 0x100,
|
|
|
|
CTRL_TEXT1 = 0x200,
|
|
|
|
CTRL_TEXT2 = 0x400,
|
|
|
|
CTRL_TEXT3 = 0x800,
|
2017-04-05 05:04:16 -04:00
|
|
|
|
|
|
|
CTRL_TEXT = 0xf00,
|
|
|
|
CTRL_ALL = 0xfff,
|
|
|
|
};
|
|
|
|
|
|
|
|
void unset_controllables (int which = CTRL_ALL);
|
|
|
|
|
2017-04-14 16:46:41 -04:00
|
|
|
void set_fader_controllable (boost::shared_ptr<ARDOUR::AutomationControl>);
|
|
|
|
void set_mute_controllable (boost::shared_ptr<ARDOUR::AutomationControl>);
|
|
|
|
void set_solo_controllable (boost::shared_ptr<ARDOUR::AutomationControl>);
|
|
|
|
void set_rec_controllable (boost::shared_ptr<ARDOUR::AutomationControl>);
|
|
|
|
void set_pan_controllable (boost::shared_ptr<ARDOUR::AutomationControl>);
|
|
|
|
void set_select_controllable (boost::shared_ptr<ARDOUR::AutomationControl>);
|
2017-04-05 05:04:16 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
FP8Base& _base;
|
|
|
|
uint8_t _id;
|
|
|
|
FP8MomentaryButton _solo;
|
|
|
|
FP8MomentaryButton _mute;
|
|
|
|
FP8ARMSensitiveButton _selrec;
|
|
|
|
|
|
|
|
bool _touching;
|
|
|
|
|
|
|
|
PBD::ScopedConnection _base_connection; // periodic
|
|
|
|
PBD::ScopedConnectionList _button_connections;
|
|
|
|
|
|
|
|
boost::shared_ptr<ARDOUR::Stripable> _stripable;
|
|
|
|
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> _fader_ctrl;
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> _mute_ctrl;
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> _solo_ctrl;
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> _rec_ctrl;
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> _pan_ctrl;
|
2017-04-14 16:46:41 -04:00
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> _x_select_ctrl;
|
2017-04-05 05:04:16 -04:00
|
|
|
|
|
|
|
PBD::ScopedConnection _fader_connection;
|
|
|
|
PBD::ScopedConnection _mute_connection;
|
|
|
|
PBD::ScopedConnection _solo_connection;
|
|
|
|
PBD::ScopedConnection _rec_connection;
|
|
|
|
PBD::ScopedConnection _pan_connection;
|
2017-04-14 16:46:41 -04:00
|
|
|
PBD::ScopedConnection _x_select_connection;
|
2017-04-05 05:04:16 -04:00
|
|
|
|
|
|
|
boost::shared_ptr<ARDOUR::PeakMeter> _peak_meter;
|
|
|
|
boost::shared_ptr<ARDOUR::ReadOnlyControl> _redux_ctrl;
|
2017-04-14 16:46:41 -04:00
|
|
|
|
|
|
|
void set_x_select_controllable (boost::shared_ptr<ARDOUR::AutomationControl>);
|
2017-04-05 05:04:16 -04:00
|
|
|
boost::function<void ()> _select_plugin_functor;
|
|
|
|
|
2017-04-18 09:01:54 -04:00
|
|
|
void drop_automation_controls ();
|
|
|
|
|
2017-04-14 07:57:14 -04:00
|
|
|
PBD::Controllable::GroupControlDisposition group_mode () const;
|
|
|
|
|
2017-04-05 05:04:16 -04:00
|
|
|
/* notifications, update view */
|
|
|
|
void notify_fader_changed ();
|
|
|
|
void notify_solo_changed ();
|
|
|
|
void notify_mute_changed ();
|
|
|
|
void notify_rec_changed ();
|
|
|
|
void notify_pan_changed ();
|
2017-04-14 16:46:41 -04:00
|
|
|
void notify_x_select_changed ();
|
2017-04-05 05:04:16 -04:00
|
|
|
|
|
|
|
/* actions, update model */
|
|
|
|
void set_mute (bool);
|
|
|
|
void set_solo (bool);
|
|
|
|
void set_select ();
|
|
|
|
void set_recarm ();
|
|
|
|
|
|
|
|
/* periodic poll, update view */
|
|
|
|
void periodic_update_fader ();
|
|
|
|
void periodic_update_meter ();
|
|
|
|
void periodic_update_timecode ();
|
|
|
|
void periodic ();
|
|
|
|
|
|
|
|
/* cache */
|
|
|
|
unsigned short _last_fader;
|
|
|
|
uint8_t _last_meter;
|
|
|
|
uint8_t _last_redux;
|
2017-04-14 07:57:14 -04:00
|
|
|
uint8_t _last_barpos;
|
2017-04-05 05:04:16 -04:00
|
|
|
|
|
|
|
/* display */
|
|
|
|
void set_strip_mode (uint8_t, bool clear = false);
|
|
|
|
void set_bar_mode (uint8_t);
|
|
|
|
|
|
|
|
uint8_t _strip_mode;
|
|
|
|
uint8_t _bar_mode;
|
|
|
|
DisplayMode _displaymode;
|
|
|
|
std::string _last_line[4];
|
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace */
|
|
|
|
#endif /* _ardour_surfaces_fp8strip_h_ */
|