13
0

Compare commits

...

10 Commits

14 changed files with 83 additions and 64 deletions

View File

@ -66,7 +66,7 @@ using namespace Gtk;
using namespace std; using namespace std;
TriggerPage::TriggerPage () TriggerPage::TriggerPage ()
: Tabbable (_("Cues"), X_("trigger")) : Tabbable (_("Cues"), X_("trigger"), NULL, true, Tabbable::PaneLayout (Tabbable::PaneRight | Tabbable::PaneBottom))
, _cue_area_frame (0.5, 0, 1.0, 0) , _cue_area_frame (0.5, 0, 1.0, 0)
, _cue_box (16, 16 * TriggerBox::default_triggers_per_box) , _cue_box (16, 16 * TriggerBox::default_triggers_per_box)
, _master_widget (16, 16) , _master_widget (16, 16)
@ -151,19 +151,12 @@ TriggerPage::TriggerPage ()
table->show_all (); table->show_all ();
_parameter_box.pack_start (*table); _parameter_box.pack_start (*table);
_parameter_box.set_no_show_all (); _parameter_box.show ();
/* Top-level Layout */ /* Top-level Layout */
content_app_bar.add (_application_bar); content_app_bar.add (_application_bar);
content_innermost_hbox.add (_pane); content_innermost_hbox.add (_strip_group_box);
content_att_bottom.add (_parameter_box);
_pane.add (_strip_group_box);
/* we cannot `content_midlevel_vbox.remove(_content_att_bottom)` and add it to the _pane
* because visibility updates are not propagated upward, and the pane will not collapse
* when the _parameter_box is hidden
*/
_pane.add (_parameter_box);
content_att_right.add (_sidebar_notebook); content_att_right.add (_sidebar_notebook);
/* Show all */ /* Show all */
@ -224,9 +217,9 @@ TriggerPage::showhide_att_bottom (bool yn)
_show_bottom_pane = yn; _show_bottom_pane = yn;
if (!_show_bottom_pane) { if (!_show_bottom_pane) {
_parameter_box.hide (); Tabbable::showhide_att_bottom (false);
} else if (!Editor::instance ().get_selection ().triggers.empty ()) { } else if (!Editor::instance ().get_selection ().triggers.empty ()) {
_parameter_box.show (); Tabbable::showhide_att_bottom (true);
} }
} }
@ -445,7 +438,7 @@ TriggerPage::rec_enable_changed (Trigger const * trigger)
_midi_trig_box.hide (); _midi_trig_box.hide ();
_midi_editor->viewport().hide (); _midi_editor->viewport().hide ();
_parameter_box.hide (); Tabbable::showhide_att_bottom (false);
TriggerBox& box = trigger->box(); TriggerBox& box = trigger->box();
TriggerReference ref (trigger->boxptr(), trigger->index()); TriggerReference ref (trigger->boxptr(), trigger->index());
@ -469,7 +462,7 @@ TriggerPage::rec_enable_changed (Trigger const * trigger)
} }
if (_show_bottom_pane) { if (_show_bottom_pane) {
_parameter_box.show (); Tabbable::showhide_att_bottom (true);
} }
} }
@ -485,7 +478,7 @@ TriggerPage::selection_changed ()
_midi_trig_box.hide (); _midi_trig_box.hide ();
_midi_editor->viewport().hide (); _midi_editor->viewport().hide ();
_parameter_box.hide (); Tabbable::showhide_att_bottom (false);
if (!selection.triggers.empty ()) { if (!selection.triggers.empty ()) {
TriggerSelection ts = selection.triggers; TriggerSelection ts = selection.triggers;
@ -511,7 +504,7 @@ TriggerPage::selection_changed ()
} }
if (_show_bottom_pane) { if (_show_bottom_pane) {
_parameter_box.show (); Tabbable::showhide_att_bottom (true);
} }
} }
} }

View File

@ -113,7 +113,6 @@ private:
Gtkmm2ext::Bindings* bindings; Gtkmm2ext::Bindings* bindings;
ArdourWidgets::VPane _pane;
Gtk::HBox _strip_group_box; Gtk::HBox _strip_group_box;
Gtk::ScrolledWindow _strip_scroller; Gtk::ScrolledWindow _strip_scroller;
Gtk::HBox _strip_packer; Gtk::HBox _strip_packer;

View File

@ -106,12 +106,24 @@ public:
#if defined(_MSC_VER) /* && (_MSC_VER < 1900) #if defined(_MSC_VER) /* && (_MSC_VER < 1900)
* Regarding the note (below) it was initially * Regarding the note (below) it was initially
* thought that this got fixed in VS2015 - but * thought that this got fixed in VS2015 - but
* in fact it's still faulty (JE - Feb 2021) */ * in fact it's still faulty (JE - Feb 2021).
* 2024-09-03 update: Faulty compile up to
* VS2022 17.4. From there it compiles but does
* not link with the exception of the arm64
* platform. This quirk is actually a bug that
* Microsoft seems to have failed to
* acknowledge as such for years judging from
* web search results about MSVC's std::map,
* and have not even fixed correctly when they
* tried.
*/
/* Use the older (heap based) mapping for early versions of MSVC. /* Use the older (heap based) mapping for early versions of MSVC.
* In fact it might be safer to use this for all MSVC builds - as * In fact it might be safer to use this for all MSVC builds. It
* our StackAllocator class depends on 'boost::aligned_storage' * was thought that this was related to issues with
* which is known to be troublesome with Visual C++ :- * boost::aligned_storage, but actually it seems to be that there
* https://www.boost.org/doc/libs/1_65_0/libs/type_traits/doc/html/boost_typetraits/reference/aligned_storage.html * are bugs in the std::map implementation of MSVC that are being
* triggered, messing with the copy constructor of
* PBD::StackAllocator.
*/ */
typedef std::map<uint32_t, uint32_t> TypeMapping; typedef std::map<uint32_t, uint32_t> TypeMapping;
typedef std::map<DataType, TypeMapping> Mappings; typedef std::map<DataType, TypeMapping> Mappings;

View File

@ -26,6 +26,7 @@
#include "evoral/Event.h" #include "evoral/Event.h"
using namespace std; using namespace std;
using namespace std::placeholders;
namespace Evoral { namespace Evoral {

View File

@ -19,7 +19,6 @@
#ifndef PBD_STACK_ALLOCATOR_H #ifndef PBD_STACK_ALLOCATOR_H
#define PBD_STACK_ALLOCATOR_H #define PBD_STACK_ALLOCATOR_H
#include <boost/type_traits/aligned_storage.hpp>
#include <limits> #include <limits>
#include "pbd/libpbd_visibility.h" #include "pbd/libpbd_visibility.h"
@ -61,22 +60,22 @@ public:
}; };
StackAllocator () StackAllocator ()
: _ptr ((pointer)&_buf) : _ptr (_buf.data())
{ } { }
StackAllocator (const StackAllocator&) StackAllocator (const StackAllocator&)
: _ptr ((pointer)&_buf) : StackAllocator ()
{ } { }
template <typename U, size_t other_capacity> template <typename U, size_t other_capacity>
StackAllocator (const StackAllocator<U, other_capacity>&) StackAllocator (const StackAllocator<U, other_capacity>&)
: _ptr ((pointer)&_buf) : StackAllocator ()
{ } { }
/* inspired by http://howardhinnant.github.io/stack_alloc.h */ /* inspired by http://howardhinnant.github.io/stack_alloc.h */
pointer allocate (size_type n, void* hint = 0) pointer allocate (size_type n, void* hint = 0)
{ {
if ((pointer)&_buf + stack_capacity >= _ptr + n) { if (_buf.data() + stack_capacity >= _ptr + n) {
DEBUG_STACK_ALLOC ("Allocate %ld item(s) of size %zu on the stack\n", n, sizeof (T)); DEBUG_STACK_ALLOC ("Allocate %ld item(s) of size %zu on the stack\n", n, sizeof (T));
pointer rv = _ptr; pointer rv = _ptr;
_ptr += n; _ptr += n;
@ -108,12 +107,12 @@ public:
bool operator== (StackAllocator const& a) const bool operator== (StackAllocator const& a) const
{ {
return &_buf == &a._buf; return _buf.data() == a._buf.data();
} }
bool operator!= (StackAllocator const& a) const bool operator!= (StackAllocator const& a) const
{ {
return &_buf != &a._buf; return _buf.data() != a._buf.data();
} }
template <class U> template <class U>
@ -147,12 +146,10 @@ private:
bool pointer_in_buffer (pointer const p) bool pointer_in_buffer (pointer const p)
{ {
return ((pointer const)&_buf <= p && p < (pointer const)&_buf + stack_capacity); return (_buf.data() <= p && p < _buf.data() + stack_capacity);
} }
typedef typename boost::aligned_storage<sizeof (T) * stack_capacity, 16>::type align_t; alignas(16) std::array<value_type, stack_capacity> _buf;
align_t _buf;
pointer _ptr; pointer _ptr;
}; };

View File

@ -42,9 +42,8 @@ void
Receiver::listen_to (Transmitter &transmitter) Receiver::listen_to (Transmitter &transmitter)
{ {
/* odd syntax here because boost's placeholders (_1, _2) are in an /* odd syntax here because std's placeholders (_1, _2) are in an
anonymous namespace which causes ambiguity with sigc++ (and will also anonymous namespace which causes ambiguity with sigc++
do so with std::placeholder in the C++11 future
*/ */
transmitter.sender().connect_same_thread (connections, std::bind (&Receiver::receive, this, std::placeholders::_1, std::placeholders::_2)); transmitter.sender().connect_same_thread (connections, std::bind (&Receiver::receive, this, std::placeholders::_1, std::placeholders::_2));

View File

@ -1144,6 +1144,7 @@ MackieControlProtocol::latch_press (MACKIE_NAMESPACE::Button&)
MACKIE_NAMESPACE::LedState MACKIE_NAMESPACE::LedState
MackieControlProtocol::latch_release (MACKIE_NAMESPACE::Button&) MackieControlProtocol::latch_release (MACKIE_NAMESPACE::Button&)
{ {
set_automation_state (ARDOUR::Latch);
return none; return none;
} }
MACKIE_NAMESPACE::LedState MACKIE_NAMESPACE::LedState

View File

@ -17,8 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "boost/lambda/lambda.hpp"
#include "pbd/control_math.h" #include "pbd/control_math.h"
#include "ardour/track.h" #include "ardour/track.h"

View File

@ -17,8 +17,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "boost/lambda/lambda.hpp"
#include "pbd/control_math.h" #include "pbd/control_math.h"
#include "ardour/amp.h" #include "ardour/amp.h"

View File

@ -19,8 +19,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "boost/lambda/lambda.hpp"
#include "pbd/control_math.h" #include "pbd/control_math.h"
#include <glibmm.h> #include <glibmm.h>

View File

@ -19,8 +19,6 @@
*/ */
#include <vector> #include <vector>
#include "boost/lambda/lambda.hpp"
#include "pbd/control_math.h" #include "pbd/control_math.h"
#include "ardour/session.h" #include "ardour/session.h"

View File

@ -81,7 +81,7 @@ Tabbable::default_layout ()
left_attachment_button.set_sensitive (0 != (_panelayout & (PaneLeft | AttLeft))); left_attachment_button.set_sensitive (0 != (_panelayout & (PaneLeft | AttLeft)));
right_attachment_button.set_sensitive (0 != (_panelayout & PaneRight)); right_attachment_button.set_sensitive (0 != (_panelayout & PaneRight));
bottom_attachment_button.set_sensitive (0 != (_panelayout & AttBottom)); bottom_attachment_button.set_sensitive (0 != (_panelayout & (PaneBottom | AttBottom)));
content_attachment_hbox.set_border_width(3); content_attachment_hbox.set_border_width(3);
content_attachment_hbox.set_spacing(3); content_attachment_hbox.set_spacing(3);
@ -106,18 +106,25 @@ Tabbable::default_layout ()
#endif #endif
Widget* midlevel = 0 == (_panelayout & PaneBottom) ? (Widget*)&content_midlevel_vbox : (Widget*)&content_midlevel_vpane;
if (_panelayout & PaneLeft) { if (_panelayout & PaneLeft) {
_content_vbox.pack_start (content_left_pane, true, true); _content_vbox.pack_start (content_left_pane, true, true);
content_left_pane.add (content_att_left); content_left_pane.add (content_att_left);
content_left_pane.add (content_midlevel_vbox); content_left_pane.add (*midlevel);
} else { } else {
_content_vbox.pack_start (content_hbox, true, true); _content_vbox.pack_start (content_hbox, true, true);
content_hbox.pack_start (content_att_left, false, false); content_hbox.pack_start (content_att_left, false, false);
content_hbox.pack_start (content_midlevel_vbox, true, true); content_hbox.pack_start (*midlevel, true, true);
} }
if (_panelayout & PaneBottom) {
content_midlevel_vpane.add (content_right_pane);
content_midlevel_vpane.add (content_att_bottom);
} else {
content_midlevel_vbox.pack_start (content_right_pane, true, true); content_midlevel_vbox.pack_start (content_right_pane, true, true);
content_midlevel_vbox.pack_start (content_att_bottom, false, false); content_midlevel_vbox.pack_start (content_att_bottom, false, false);
}
content_right_pane.add (content_inner_vbox); content_right_pane.add (content_inner_vbox);
@ -141,6 +148,12 @@ Tabbable::default_layout ()
content_left_pane.set_check_divider_position (true); content_left_pane.set_check_divider_position (true);
content_left_pane.set_divider (0, 0.15); content_left_pane.set_divider (0, 0.15);
if (_panelayout & PaneBottom) {
content_midlevel_vpane.set_child_minsize (content_right_pane, 300);
}
content_midlevel_vpane.set_check_divider_position (true);
content_midlevel_vpane.set_divider (0, 0.85);
_content_vbox.show_all(); _content_vbox.show_all();
} }
@ -433,8 +446,15 @@ Tabbable::get_state() const
node.set_property (X_("tabbed"), tabbed()); node.set_property (X_("tabbed"), tabbed());
if (_panelayout & PaneRight) {
node.set_property (string_compose("%1%2", _menu_name, X_("-rightpane-pos")).c_str(), content_right_pane.get_divider ()); node.set_property (string_compose("%1%2", _menu_name, X_("-rightpane-pos")).c_str(), content_right_pane.get_divider ());
}
if (_panelayout & PaneLeft) {
node.set_property (string_compose("%1%2", _menu_name, X_("-leftpane-pos")).c_str(), content_left_pane.get_divider ()); node.set_property (string_compose("%1%2", _menu_name, X_("-leftpane-pos")).c_str(), content_left_pane.get_divider ());
}
if (_panelayout & PaneBottom) {
node.set_property (string_compose("%1%2", _menu_name, X_("-bottompane-pos")).c_str(), content_midlevel_vpane.get_divider ());
}
return node; return node;
} }
@ -466,6 +486,10 @@ Tabbable::set_state (const XMLNode& node, int version)
fract = std::max (.05f, std::min (.95f, fract)); fract = std::max (.05f, std::min (.95f, fract));
content_left_pane.set_divider (0, fract); content_left_pane.set_divider (0, fract);
} }
if ( window_node->get_property (string_compose("%1%2", _menu_name, X_("-bottompane-pos")).c_str(), fract) ) {
fract = std::max (.05f, std::min (.95f, fract));
content_midlevel_vpane.set_divider (0, fract);
}
} }

View File

@ -49,16 +49,15 @@ class LIBWIDGETS_API Tabbable : public Gtkmm2ext::WindowProxy
{ {
public: public:
enum PaneLayout { enum PaneLayout {
NoPanes = 0x0, ///< disable all attachment buttons, do not pack any panes or attachments NoPanes = 0x00, ///< disable all attachment buttons, do not pack any panes or attachments
PaneLeft = 0x1, ///< left side attachment is a resizable pane PaneLeft = 0x01, ///< left side attachment is a resizable pane
PaneRight = 0x2, ///< pack a resizable Pane on the right-side PaneRight = 0x02, ///< pack a resizable Pane on the right-side
AttBottom = 0x4, ///< bottom is a fixed size EBox attachment PaneBottom = 0x04, ///< bottom Ebox is a resizable Pane
PaneLeftBtm = 0x5, AttLeft = 0x08, ///< if PaneLeft is not set, pack a fixed size Ebox on the left (Editor-Mixer)
PaneRightBtm = 0x6, AttBottom = 0x10, ///< bottom is a fixed size EBox attachment
AttLeft = 0x8, ///< if PaneLeft is not set, pack a fixed size Ebox on the left (Editor-Mixer)
}; };
Tabbable (const std::string& user_visible_name, std::string const & untranslated_name, Gtk::Widget* top = NULL, bool tabbed_by_default = true, PaneLayout pl = PaneRightBtm); Tabbable (const std::string& user_visible_name, std::string const & untranslated_name, Gtk::Widget* top = NULL, bool tabbed_by_default = true, PaneLayout pl = PaneRight);
~Tabbable (); ~Tabbable ();
void add_to_notebook (Gtk::Notebook& notebook); void add_to_notebook (Gtk::Notebook& notebook);
@ -130,7 +129,7 @@ protected:
* | | * | |
* | +--content_hbox--OR--content_left_pane--------------------------------------------------------+ | * | +--content_hbox--OR--content_left_pane--------------------------------------------------------+ |
* | | | | * | | | |
* | | +--att_left--+ +--content_midlevel_vbox-------------------------------------------------+ | | * | | +--att_left--+ +--content_midlevel_vbox--OR-content_midlevel_vpane----------------------+ | |
* | | $ (EBOX) | | +--content_right_pane------------------------------------------------+ | | | * | | $ (EBOX) | | +--content_right_pane------------------------------------------------+ | | |
* | | | | | | +--content_inner_vbox-----------------+ +--content_right_vbox--+ | | | | * | | | | | | +--content_inner_vbox-----------------+ +--content_right_vbox--+ | | | |
* | | | O | | | | | | | | | | | * | | | O | | | | | | | | | | |
@ -147,7 +146,8 @@ protected:
* | | | | N | | | +---------------------------------+ | | +------------------+ | | | | | * | | | | N | | | +---------------------------------+ | | +------------------+ | | | | |
* | | | (STRIP) | E | | +-------------------------------------+ +----------------------+ | | | | * | | | (STRIP) | E | | +-------------------------------------+ +----------------------+ | | | |
* | | | |<->| +--------------------------------------------------------------------+ | | | * | | | |<->| +--------------------------------------------------------------------+ | | |
* | | | | | | | | * | | | | | 🡅 OPTIONAL 🡅 | | |
* | | | | | 🡇 PANE 🡇 | | |
* | | | | | +-content_att_bottom-------------------------------------------------+ | | | * | | | | | +-content_att_bottom-------------------------------------------------+ | | |
* | | | | | $ (EBOX) | | | | * | | | | | $ (EBOX) | | | |
* | | | | | | OPTIONAL BOTTOM (PROPERTIES) | | | | * | | | | | | OPTIONAL BOTTOM (PROPERTIES) | | | |
@ -171,6 +171,7 @@ protected:
HPane content_left_pane; HPane content_left_pane;
Gtk::HBox content_hbox; Gtk::HBox content_hbox;
EventBoxExt content_att_left; /* a placeholder for the mixer strip, if you want one */ EventBoxExt content_att_left; /* a placeholder for the mixer strip, if you want one */
VPane content_midlevel_vpane;
Gtk::VBox content_midlevel_vbox; Gtk::VBox content_midlevel_vbox;
HPane content_right_pane; HPane content_right_pane;
Gtk::VBox content_inner_vbox; Gtk::VBox content_inner_vbox;

View File

@ -23,7 +23,7 @@ class Rx1
public: public:
Rx1 (Tx& sender) Rx1 (Tx& sender)
{ {
sender.sig1.connect_same_thread (_connection, boost::bind (&Rx1::cb, this, _1)); sender.sig1.connect_same_thread (_connection, std::bind (&Rx1::cb, this, _1));
} }
private: private:
@ -87,7 +87,7 @@ class Rx2 : public PBD::ScopedConnectionList
public: public:
Rx2 (Tx& sender) Rx2 (Tx& sender)
{ {
sender.sig1.connect (*this, &_ir, boost::bind (&Rx2::cb, this, _1), &event_loop); sender.sig1.connect (*this, &_ir, std::bind (&Rx2::cb, this, _1), &event_loop);
} }
private: private: