mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
moved OSC into libardour
git-svn-id: svn://localhost/trunk/ardour2@510 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
69aef2cd91
commit
00a106197a
11 changed files with 113 additions and 81 deletions
30
SConstruct
30
SConstruct
|
|
@ -390,9 +390,6 @@ libraries['pango'].ParseConfig ('pkg-config --cflags --libs pango')
|
|||
libraries['libgnomecanvas2'] = LibraryInfo()
|
||||
libraries['libgnomecanvas2'].ParseConfig ('pkg-config --cflags --libs libgnomecanvas-2.0')
|
||||
|
||||
libraries['glade2'] = LibraryInfo()
|
||||
libraries['glade2'].ParseConfig ('pkg-config --cflags --libs libglade-2.0')
|
||||
|
||||
#libraries['flowcanvas'] = LibraryInfo(LIBS='flowcanvas', LIBPATH='#/libs/flowcanvas', CPPPATH='#libs/flowcanvas')
|
||||
|
||||
libraries['ardour'] = LibraryInfo (LIBS='ardour', LIBPATH='#libs/ardour', CPPPATH='#libs/ardour')
|
||||
|
|
@ -424,10 +421,9 @@ libraries['usb'] = conf.Finish ()
|
|||
libraries['lo'] = LibraryInfo ()
|
||||
|
||||
conf = Configure (libraries['lo'])
|
||||
if conf.CheckLib ('lo', 'lo_server_new'):
|
||||
have_liblo = True
|
||||
else:
|
||||
have_liblo = False
|
||||
if conf.CheckLib ('lo', 'lo_server_new') == False:
|
||||
print "liblo does not appear to be installed."
|
||||
exit (0)
|
||||
|
||||
libraries['lo'] = conf.Finish ()
|
||||
|
||||
|
|
@ -486,8 +482,9 @@ if env['SYSLIBS']:
|
|||
libraries['pangomm'].ParseConfig ('pkg-config --cflags --libs pangomm-1.4')
|
||||
libraries['libgnomecanvasmm'] = LibraryInfo()
|
||||
libraries['libgnomecanvasmm'].ParseConfig ('pkg-config --cflags --libs libgnomecanvasmm-2.6')
|
||||
libraries['libglademm'] = LibraryInfo()
|
||||
libraries['libglademm'].ParseConfig ('pkg-config --cflags --libs libglademm-2.4')
|
||||
|
||||
# libraries['libglademm'] = LibraryInfo()
|
||||
# libraries['libglademm'].ParseConfig ('pkg-config --cflags --libs libglademm-2.4')
|
||||
|
||||
# libraries['flowcanvas'] = LibraryInfo(LIBS='flowcanvas', LIBPATH='#/libs/flowcanvas', CPPPATH='#libs/flowcanvas')
|
||||
libraries['soundtouch'] = LibraryInfo()
|
||||
|
|
@ -535,9 +532,9 @@ else:
|
|||
libraries['soundtouch'] = LibraryInfo(LIBS='soundtouch',
|
||||
LIBPATH='#libs/soundtouch',
|
||||
CPPPATH=['#libs', '#libs/soundtouch'])
|
||||
libraries['libglademm'] = LibraryInfo(LIBS='libglademm',
|
||||
LIBPATH='#libs/libglademm',
|
||||
CPPPATH='#libs/libglademm')
|
||||
# libraries['libglademm'] = LibraryInfo(LIBS='libglademm',
|
||||
# LIBPATH='#libs/libglademm',
|
||||
# CPPPATH='#libs/libglademm')
|
||||
|
||||
coredirs = [
|
||||
'libs/soundtouch',
|
||||
|
|
@ -558,7 +555,6 @@ else:
|
|||
'libs/gtkmm2/atk',
|
||||
'libs/gtkmm2/gdk',
|
||||
'libs/gtkmm2/gtk',
|
||||
'libs/libglademm',
|
||||
'libs/libgnomecanvasmm',
|
||||
# 'libs/flowcanvas',
|
||||
'libs/gtkmm2ext',
|
||||
|
|
@ -571,8 +567,6 @@ if env['SURFACES']:
|
|||
surface_subdirs += [ 'libs/surfaces/generic_midi' ]
|
||||
if have_libusb:
|
||||
surface_subdirs += [ 'libs/surfaces/tranzport' ]
|
||||
if have_liblo:
|
||||
surface_subdirs += [ 'libs/surfaces/osc' ]
|
||||
|
||||
opts.Save('scache.conf', env)
|
||||
Help(opts.GenerateHelpText(env))
|
||||
|
|
@ -850,9 +844,9 @@ for subdir in coredirs:
|
|||
SConscript (subdir + '/SConscript')
|
||||
|
||||
for sublistdir in [subdirs, gtk_subdirs, surface_subdirs]:
|
||||
for subdir in sublistdir:
|
||||
SConscript (subdir + '/SConscript')
|
||||
|
||||
for subdir in sublistdir:
|
||||
SConscript (subdir + '/SConscript')
|
||||
|
||||
# cleanup
|
||||
env.Clean ('scrub', [ 'scache.conf', '.sconf_temp', '.sconsign.dblite', 'config.log'])
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ ladspa_plugin.cc
|
|||
location.cc
|
||||
mtc_slave.cc
|
||||
named_selection.cc
|
||||
osc.cc
|
||||
panner.cc
|
||||
pcm_utils.cc
|
||||
playlist.cc
|
||||
|
|
@ -184,7 +185,7 @@ ardour.Merge ([
|
|||
libraries['pbd3'],
|
||||
libraries['soundtouch'],
|
||||
libraries['midi++2'],
|
||||
libraries['xslt'],
|
||||
libraries['lo'],
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ namespace MIDI {
|
|||
namespace ARDOUR {
|
||||
|
||||
class AudioEngine;
|
||||
class OSC;
|
||||
|
||||
extern OSC* osc;
|
||||
|
||||
static const jack_nframes_t max_frames = JACK_MAX_FRAMES;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ class BasicUI {
|
|||
void toggle_all_rec_enables ();
|
||||
|
||||
protected:
|
||||
ARDOUR::Session& session;
|
||||
BasicUI ();
|
||||
ARDOUR::Session* session;
|
||||
};
|
||||
|
||||
#endif /* __ardour_basic_ui_h__ */
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ CONFIG_VARIABLE(uint32_t, destructive_xfade_msecs, "destructive-xfade-msecs", 2
|
|||
CONFIG_VARIABLE(SampleFormat, native_file_data_format, "native-file-data-format", ARDOUR::FormatFloat)
|
||||
CONFIG_VARIABLE(HeaderFormat, native_file_header_format, "native-file-header-format", ARDOUR::WAVE)
|
||||
CONFIG_VARIABLE(bool, use_tranzport, "use-tranzport", false)
|
||||
CONFIG_VARIABLE(uint32_t, osc_port, "osc-port", 3819)
|
||||
CONFIG_VARIABLE(bool, use_osc, "use-osc", true)
|
||||
|
||||
/* these variables have custom set() methods */
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,12 @@
|
|||
using namespace ARDOUR;
|
||||
|
||||
BasicUI::BasicUI (Session& s)
|
||||
: session (s)
|
||||
: session (&s)
|
||||
{
|
||||
}
|
||||
|
||||
BasicUI::BasicUI ()
|
||||
: session (0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -39,12 +44,12 @@ BasicUI::~BasicUI ()
|
|||
void
|
||||
BasicUI::loop_toggle ()
|
||||
{
|
||||
if (session.get_auto_loop()) {
|
||||
session.request_auto_loop (false);
|
||||
if (session->get_auto_loop()) {
|
||||
session->request_auto_loop (false);
|
||||
} else {
|
||||
session.request_auto_loop (true);
|
||||
if (!session.transport_rolling()) {
|
||||
session.request_transport_speed (1.0);
|
||||
session->request_auto_loop (true);
|
||||
if (!session->transport_rolling()) {
|
||||
session->request_transport_speed (1.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -52,146 +57,146 @@ BasicUI::loop_toggle ()
|
|||
void
|
||||
BasicUI::goto_start ()
|
||||
{
|
||||
session.goto_start ();
|
||||
session->goto_start ();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::goto_end ()
|
||||
{
|
||||
session.goto_end ();
|
||||
session->goto_end ();
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::add_marker ()
|
||||
{
|
||||
jack_nframes_t when = session.audible_frame();
|
||||
session.locations()->add (new Location (when, when, _("unnamed"), Location::IsMark));
|
||||
jack_nframes_t when = session->audible_frame();
|
||||
session->locations()->add (new Location (when, when, _("unnamed"), Location::IsMark));
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::rewind ()
|
||||
{
|
||||
session.request_transport_speed (-2.0f);
|
||||
session->request_transport_speed (-2.0f);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::ffwd ()
|
||||
{
|
||||
session.request_transport_speed (2.0f);
|
||||
session->request_transport_speed (2.0f);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::transport_stop ()
|
||||
{
|
||||
session.request_transport_speed (0.0);
|
||||
session->request_transport_speed (0.0);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::transport_play ()
|
||||
{
|
||||
bool rolling = session.transport_rolling ();
|
||||
bool rolling = session->transport_rolling ();
|
||||
|
||||
if (session.get_auto_loop()) {
|
||||
session.request_auto_loop (false);
|
||||
if (session->get_auto_loop()) {
|
||||
session->request_auto_loop (false);
|
||||
}
|
||||
|
||||
if (session.get_play_range ()) {
|
||||
session.request_play_range (false);
|
||||
if (session->get_play_range ()) {
|
||||
session->request_play_range (false);
|
||||
}
|
||||
|
||||
if (rolling) {
|
||||
session.request_locate (session.last_transport_start(), true);
|
||||
session->request_locate (session->last_transport_start(), true);
|
||||
|
||||
}
|
||||
|
||||
session.request_transport_speed (1.0f);
|
||||
session->request_transport_speed (1.0f);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::rec_enable_toggle ()
|
||||
{
|
||||
switch (session.record_status()) {
|
||||
switch (session->record_status()) {
|
||||
case Session::Disabled:
|
||||
if (session.ntracks() == 0) {
|
||||
if (session->ntracks() == 0) {
|
||||
// string txt = _("Please create 1 or more track\nbefore trying to record.\nCheck the Session menu.");
|
||||
// MessageDialog msg (*editor, txt);
|
||||
// msg.run ();
|
||||
return;
|
||||
}
|
||||
session.maybe_enable_record ();
|
||||
session->maybe_enable_record ();
|
||||
break;
|
||||
case Session::Recording:
|
||||
case Session::Enabled:
|
||||
session.disable_record (true);
|
||||
session->disable_record (true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::save_state ()
|
||||
{
|
||||
session.save_state ("");
|
||||
session->save_state ("");
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::prev_marker ()
|
||||
{
|
||||
Location *location = session.locations()->first_location_before (session.transport_frame());
|
||||
Location *location = session->locations()->first_location_before (session->transport_frame());
|
||||
|
||||
if (location) {
|
||||
session.request_locate (location->start(), session.transport_rolling());
|
||||
session->request_locate (location->start(), session->transport_rolling());
|
||||
} else {
|
||||
session.goto_start ();
|
||||
session->goto_start ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::next_marker ()
|
||||
{
|
||||
Location *location = session.locations()->first_location_after (session.transport_frame());
|
||||
Location *location = session->locations()->first_location_after (session->transport_frame());
|
||||
|
||||
if (location) {
|
||||
session.request_locate (location->start(), session.transport_rolling());
|
||||
session->request_locate (location->start(), session->transport_rolling());
|
||||
} else {
|
||||
session.request_locate (session.current_end_frame());
|
||||
session->request_locate (session->current_end_frame());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::set_transport_speed (float speed)
|
||||
{
|
||||
session.request_transport_speed (speed);
|
||||
session->request_transport_speed (speed);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::undo ()
|
||||
{
|
||||
session.undo (1);
|
||||
session->undo (1);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::redo ()
|
||||
{
|
||||
session.redo (1);
|
||||
session->redo (1);
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_all_rec_enables ()
|
||||
{
|
||||
if (session.get_record_enabled()) {
|
||||
session.record_disenable_all ();
|
||||
if (session->get_record_enabled()) {
|
||||
session->record_disenable_all ();
|
||||
} else {
|
||||
session.record_enable_all ();
|
||||
session->record_enable_all ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_punch_in ()
|
||||
{
|
||||
session.set_punch_in (!session.get_punch_in());
|
||||
session->set_punch_in (!session->get_punch_in());
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::toggle_punch_out ()
|
||||
{
|
||||
session.set_punch_out (!session.get_punch_out());
|
||||
session->set_punch_out (!session->get_punch_out());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ ControlProtocol::~ControlProtocol ()
|
|||
void
|
||||
ControlProtocol::next_track (uint32_t initial_id)
|
||||
{
|
||||
uint32_t limit = session.nroutes();
|
||||
uint32_t limit = session->nroutes();
|
||||
Route* cr = route_table[0];
|
||||
uint32_t id;
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ ControlProtocol::next_track (uint32_t initial_id)
|
|||
}
|
||||
|
||||
while (id < limit) {
|
||||
if ((cr = session.route_by_remote_id (id)) != 0) {
|
||||
if ((cr = session->route_by_remote_id (id)) != 0) {
|
||||
break;
|
||||
}
|
||||
id++;
|
||||
|
|
@ -72,7 +72,7 @@ ControlProtocol::next_track (uint32_t initial_id)
|
|||
if (id == limit) {
|
||||
id = 0;
|
||||
while (id != initial_id) {
|
||||
if ((cr = session.route_by_remote_id (id)) != 0) {
|
||||
if ((cr = session->route_by_remote_id (id)) != 0) {
|
||||
break;
|
||||
}
|
||||
id++;
|
||||
|
|
@ -85,7 +85,7 @@ ControlProtocol::next_track (uint32_t initial_id)
|
|||
void
|
||||
ControlProtocol::prev_track (uint32_t initial_id)
|
||||
{
|
||||
uint32_t limit = session.nroutes() - 1;
|
||||
uint32_t limit = session->nroutes() - 1;
|
||||
Route* cr = route_table[0];
|
||||
uint32_t id;
|
||||
|
||||
|
|
@ -96,13 +96,13 @@ ControlProtocol::prev_track (uint32_t initial_id)
|
|||
}
|
||||
|
||||
if (id == 0) {
|
||||
id = session.nroutes() - 1;
|
||||
id = session->nroutes() - 1;
|
||||
} else {
|
||||
id--;
|
||||
}
|
||||
|
||||
while (id >= 0) {
|
||||
if ((cr = session.route_by_remote_id (id)) != 0) {
|
||||
if ((cr = session->route_by_remote_id (id)) != 0) {
|
||||
break;
|
||||
}
|
||||
id--;
|
||||
|
|
@ -111,7 +111,7 @@ ControlProtocol::prev_track (uint32_t initial_id)
|
|||
if (id < 0) {
|
||||
id = limit;
|
||||
while (id > initial_id) {
|
||||
if ((cr = session.route_by_remote_id (id)) != 0) {
|
||||
if ((cr = session->route_by_remote_id (id)) != 0) {
|
||||
break;
|
||||
}
|
||||
id--;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include <ardour/utils.h>
|
||||
#include <ardour/session.h>
|
||||
#include <ardour/control_protocol_manager.h>
|
||||
#include <ardour/osc.h>
|
||||
|
||||
#include <ardour/mix.h>
|
||||
|
||||
|
|
@ -58,6 +59,7 @@
|
|||
|
||||
ARDOUR::Configuration* ARDOUR::Config = 0;
|
||||
ARDOUR::AudioLibrary* ARDOUR::Library = 0;
|
||||
ARDOUR::OSC* ARDOUR::osc = 0;
|
||||
|
||||
using namespace ARDOUR;
|
||||
using namespace std;
|
||||
|
|
@ -72,6 +74,22 @@ Change ARDOUR::PositionChanged = ARDOUR::new_change ();
|
|||
Change ARDOUR::NameChanged = ARDOUR::new_change ();
|
||||
Change ARDOUR::BoundsChanged = Change (0); // see init(), below
|
||||
|
||||
static int
|
||||
setup_osc ()
|
||||
{
|
||||
/* no real cost to creating this object, and it avoids
|
||||
conditionals anywhere that uses it
|
||||
*/
|
||||
|
||||
osc = new OSC (Config->get_osc_port());
|
||||
|
||||
if (Config->get_use_osc ()) {
|
||||
return osc->start ();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
setup_midi ()
|
||||
{
|
||||
|
|
@ -180,6 +198,10 @@ ARDOUR::init (AudioEngine& engine, bool use_vst, bool try_optimization, void (*s
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (setup_osc ()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef VST_SUPPORT
|
||||
if (Config->get_use_vst() && fst_init (sighandler)) {
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
#include <ardour/crossfade.h>
|
||||
#include <ardour/playlist.h>
|
||||
#include <ardour/click.h>
|
||||
#include <ardour/timestamps.h>
|
||||
#include <ardour/osc.h>
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
|
@ -794,6 +794,10 @@ Session::when_engine_running ()
|
|||
|
||||
_engine.set_session (this);
|
||||
|
||||
/* and to OSC */
|
||||
|
||||
osc->set_session (*this);
|
||||
|
||||
_state_of_the_state = Clean;
|
||||
|
||||
DirtyChanged (); /* EMIT SIGNAL */
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ GenericMidiControlProtocol::set_active (bool yn)
|
|||
void
|
||||
GenericMidiControlProtocol::port_change ()
|
||||
{
|
||||
_port = session.midi_port ();
|
||||
_port = session->midi_port ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -297,14 +297,14 @@ TranzportControlProtocol::show_meter ()
|
|||
void
|
||||
TranzportControlProtocol::show_transport_time ()
|
||||
{
|
||||
jack_nframes_t where = session.transport_frame();
|
||||
jack_nframes_t where = session->transport_frame();
|
||||
|
||||
if (where != last_where) {
|
||||
|
||||
char buf[5];
|
||||
SMPTE_Time smpte;
|
||||
|
||||
session.smpte_time (where, smpte);
|
||||
session->smpte_time (where, smpte);
|
||||
|
||||
if (smpte.negative) {
|
||||
sprintf (buf, "-%02ld:", smpte.hours);
|
||||
|
|
@ -698,25 +698,25 @@ TranzportControlProtocol::update_state ()
|
|||
|
||||
/* global */
|
||||
|
||||
if (session.get_auto_loop()) {
|
||||
if (session->get_auto_loop()) {
|
||||
pending_lights[LightLoop] = true;
|
||||
} else {
|
||||
pending_lights[LightLoop] = false;
|
||||
}
|
||||
|
||||
if (session.get_punch_in() || session.get_punch_out()) {
|
||||
if (session->get_punch_in() || session->get_punch_out()) {
|
||||
pending_lights[LightPunch] = true;
|
||||
} else {
|
||||
pending_lights[LightPunch] = false;
|
||||
}
|
||||
|
||||
if (session.get_record_enabled()) {
|
||||
if (session->get_record_enabled()) {
|
||||
pending_lights[LightRecord] = true;
|
||||
} else {
|
||||
pending_lights[LightRecord] = false;
|
||||
}
|
||||
|
||||
if (session.soloing ()) {
|
||||
if (session->soloing ()) {
|
||||
pending_lights[LightAnysolo] = true;
|
||||
} else {
|
||||
pending_lights[LightAnysolo] = false;
|
||||
|
|
@ -1037,7 +1037,7 @@ TranzportControlProtocol::button_event_tracksolo_press (bool shifted)
|
|||
}
|
||||
|
||||
if (shifted) {
|
||||
session.set_all_solo (!session.soloing());
|
||||
session->set_all_solo (!session->soloing());
|
||||
} else {
|
||||
route_set_soloed (0, !route_get_soloed (0));
|
||||
}
|
||||
|
|
@ -1357,16 +1357,16 @@ void
|
|||
TranzportControlProtocol::shuttle ()
|
||||
{
|
||||
if (_datawheel < WheelDirectionThreshold) {
|
||||
if (session.transport_speed() < 0) {
|
||||
session.request_transport_speed (1.0);
|
||||
if (session->transport_speed() < 0) {
|
||||
session->request_transport_speed (1.0);
|
||||
} else {
|
||||
session.request_transport_speed (session.transport_speed() + 0.1);
|
||||
session->request_transport_speed (session->transport_speed() + 0.1);
|
||||
}
|
||||
} else {
|
||||
if (session.transport_speed() > 0) {
|
||||
session.request_transport_speed (-1.0);
|
||||
if (session->transport_speed() > 0) {
|
||||
session->request_transport_speed (-1.0);
|
||||
} else {
|
||||
session.request_transport_speed (session.transport_speed() - 0.1);
|
||||
session->request_transport_speed (session->transport_speed() - 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue