13
0

various changes to get Push 2 surface support functional after inheriting from MIDISurface

This commit is contained in:
Paul Davis 2022-10-14 14:41:36 -06:00
parent 99712e7585
commit e5bbccef28
5 changed files with 38 additions and 10 deletions

View File

@ -42,7 +42,7 @@ export ARDOUR_DLL_PATH=$libs
export GTK_PATH=~/.ardour3:$libs/clearlooks-newer
export VAMP_PATH=$libs/vamp-plugins:$libs/vamp-pyin${VAMP_PATH:+:$VAMP_PATH}
export LD_LIBRARY_PATH=$libs/ptformat:$libs/qm-dsp:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/widgets:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/audiographer:$libs/temporal:$libs/libltc:$libs/canvas:$libs/waveview:$libs/ardouralsautil${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=$libs/ptformat:$libs/qm-dsp:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/surfaces/midi_surface:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/widgets:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/audiographer:$libs/temporal:$libs/libltc:$libs/canvas:$libs/waveview:$libs/ardouralsautil${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
# DYLD_LIBRARY_PATH is for darwin.
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH

View File

@ -33,6 +33,8 @@ using namespace ARDOUR;
using namespace Glib;
using namespace PBD;
#include "pbd/abstract_ui.cc" // instantiate template
MIDISurface::MIDISurface (ARDOUR::Session& s, std::string const & namestr, std::string const & port_prefix, bool use_pad_filter)
: ControlProtocol (s, namestr)
, AbstractUI<MidiSurfaceRequest> (namestr)
@ -41,12 +43,34 @@ MIDISurface::MIDISurface (ARDOUR::Session& s, std::string const & namestr, std::
, port_name_prefix (port_prefix)
, _connection_state (ConnectionState (0))
{
}
MIDISurface::~MIDISurface ()
{
/* leave it all up to derived classes, because ordering it hard. */
}
void
MIDISurface::port_setup ()
{
ports_acquire ();
ARDOUR::AudioEngine::instance()->PortRegisteredOrUnregistered.connect (port_connections, MISSING_INVALIDATOR, boost::bind (&MIDISurface::port_registration_handler, this), this);
ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connections, MISSING_INVALIDATOR, boost::bind (&MIDISurface::connection_handler, this, _1, _2, _3, _4, _5), this);
port_registration_handler ();
}
void
MIDISurface::drop ()
{
/* do this before stopping the event loop, so that we don't get any notifications */
port_connections.drop_connections ();
stop_using_device ();
device_release ();
ports_release ();
}
int
MIDISurface::ports_acquire ()
{
@ -392,13 +416,14 @@ MIDISurface::stop_using_device ()
return 0;
}
void
MIDISurface::drop ()
std::list<boost::shared_ptr<ARDOUR::Bundle> >
MIDISurface::bundles ()
{
/* do this before stopping the event loop, so that we don't get any notifications */
port_connections.drop_connections ();
std::list<boost::shared_ptr<ARDOUR::Bundle> > b;
stop_using_device ();
device_release ();
ports_release ();
if (_output_bundle) {
b.push_back (_output_bundle);
}
return b;
}

View File

@ -18,6 +18,7 @@
#define ABSTRACT_UI_EXPORTS
#include "pbd/abstract_ui.h"
#include "control_protocol/control_protocol.h"
#include "midi++/types.h"
@ -125,4 +126,5 @@ class MIDISurface : public ARDOUR::ControlProtocol
virtual void device_release () = 0;
void drop ();
void port_setup ();
};

View File

@ -90,7 +90,7 @@ row_interval_semitones (const Push2::RowInterval row_interval, const bool inkey)
case Push2::Fifth:
return 7;
case Push2::Sequential:
return inkey ? 12 : 8;
return inkey ? 12 : 8;
}
return 5;
@ -138,6 +138,7 @@ Push2::Push2 (ARDOUR::Session& s)
_splash_layout = new SplashLayout (*this, *session, "splash");
run_event_loop ();
port_setup ();
}
Push2::~Push2 ()

View File

@ -42,7 +42,7 @@ def build(bld):
obj.name = 'libardour_push2'
obj.target = 'ardour_push2'
obj.uselib = 'CAIROMM PANGOMM USB GTKMM SIGCPP XML OSX'
obj.use = 'libardour libardour_cp lib_midisurface libgtkmm2ext libpbd libevoral libcanvas libtemporal'
obj.use = 'libardour libardour_cp libardour_midisurface libgtkmm2ext libpbd libevoral libcanvas libtemporal'
obj.install_path = os.path.join(bld.env['LIBDIR'], 'surfaces')
def shutdown():