mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
3.0-SG catchup merge after git changeover and merge with master (more to do)
This commit is contained in:
parent
712750112d
commit
55c59504ca
36 changed files with 59 additions and 1789 deletions
|
|
@ -276,12 +276,6 @@ AudioRegionView::region_changed (const PropertyChange& what_changed)
|
|||
if (what_changed.contains (ARDOUR::Properties::fade_out_active)) {
|
||||
fade_out_active_changed ();
|
||||
}
|
||||
if (what_changed.contains (ARDOUR::Properties::fade_in_is_xfade)) {
|
||||
fade_in_changed ();
|
||||
}
|
||||
if (what_changed.contains (ARDOUR::Properties::fade_out_is_xfade)) {
|
||||
fade_out_changed ();
|
||||
}
|
||||
if (what_changed.contains (ARDOUR::Properties::envelope_active)) {
|
||||
envelope_active_changed ();
|
||||
}
|
||||
|
|
@ -534,26 +528,6 @@ AudioRegionView::reset_fade_in_shape ()
|
|||
void
|
||||
AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width)
|
||||
{
|
||||
if (dragging()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (audio_region()->fade_in_is_xfade()) {
|
||||
if (fade_in_handle) {
|
||||
fade_in_handle->hide ();
|
||||
fade_in_shape->hide ();
|
||||
}
|
||||
redraw_start_xfade ();
|
||||
return;
|
||||
} else {
|
||||
if (start_xfade_in) {
|
||||
start_xfade_in->hide ();
|
||||
start_xfade_out->hide ();
|
||||
start_xfade_rect->hide ();
|
||||
_start_xfade_visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (fade_in_handle == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -641,27 +615,6 @@ AudioRegionView::reset_fade_out_shape ()
|
|||
void
|
||||
AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width)
|
||||
{
|
||||
if (dragging() && audio_region()->fade_out_is_xfade()) {
|
||||
/* we hide xfades while dragging regions */
|
||||
return;
|
||||
}
|
||||
|
||||
if (audio_region()->fade_out_is_xfade()) {
|
||||
if (fade_out_handle) {
|
||||
fade_out_handle->hide ();
|
||||
fade_out_shape->hide ();
|
||||
}
|
||||
redraw_end_xfade ();
|
||||
return;
|
||||
} else {
|
||||
if (end_xfade_in) {
|
||||
end_xfade_in->hide ();
|
||||
end_xfade_out->hide ();
|
||||
end_xfade_rect->hide ();
|
||||
_end_xfade_visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (fade_out_handle == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,16 +167,6 @@ class AudioRegionView : public RegionView
|
|||
ArdourCanvas::SimpleRect* end_xfade_rect;
|
||||
bool _end_xfade_visible;
|
||||
|
||||
ArdourCanvas::Line *start_xfade_in;
|
||||
ArdourCanvas::Line *start_xfade_out;
|
||||
ArdourCanvas::SimpleRect* start_xfade_rect;
|
||||
bool _start_xfade_visible;
|
||||
|
||||
ArdourCanvas::Line *end_xfade_in;
|
||||
ArdourCanvas::Line *end_xfade_out;
|
||||
ArdourCanvas::SimpleRect* end_xfade_rect;
|
||||
bool _end_xfade_visible;
|
||||
|
||||
boost::shared_ptr<AudioRegionGainLine> gain_line;
|
||||
|
||||
double _amplitude_above_axis;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanv
|
|||
group->property_y() = 0.0;
|
||||
|
||||
line = new ArdourCanvas::Line (*group);
|
||||
line->property_width_pixels() = (guint)3;
|
||||
line->property_width_pixels() = (guint)1;
|
||||
line->set_data ("line", this);
|
||||
|
||||
line->signal_event().connect (sigc::mem_fun (*this, &AutomationLine::event_handler));
|
||||
|
|
@ -997,25 +997,6 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
|
|||
if (_visible && alist->interpolation() != AutomationList::Discrete) {
|
||||
line->show();
|
||||
}
|
||||
|
||||
if (tx >= max_framepos || tx < 0 || tx >= _maximum_time) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* convert x-coordinate to a canvas unit coordinate (this takes
|
||||
* zoom and scroll into account).
|
||||
*/
|
||||
|
||||
tx = trackview.editor().frame_to_unit_unrounded (tx);
|
||||
|
||||
/* convert from canonical view height (0..1.0) to actual
|
||||
* height coordinates (using X11's top-left rooted system)
|
||||
*/
|
||||
|
||||
ty = _height - (ty * _height);
|
||||
|
||||
add_visible_control_point (vp, pi, tx, ty, ai, np);
|
||||
vp++;
|
||||
}
|
||||
|
||||
set_selected_points (trackview.editor().get_selection().points);
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
#include <libgnomecanvas/libgnomecanvas.h>
|
||||
|
||||
#include "gtkmm2ext/rgb_macros.h"
|
||||
|
||||
#include "utils.h"
|
||||
#include "editor_cursors.h"
|
||||
#include "editor.h"
|
||||
|
|
@ -34,7 +32,6 @@ using namespace Gtk;
|
|||
|
||||
EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*))
|
||||
: editor (ed),
|
||||
shade (*editor.cursor_group),
|
||||
canvas_item (*editor.cursor_group),
|
||||
length(1.0)
|
||||
{
|
||||
|
|
@ -49,10 +46,6 @@ EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,Ardour
|
|||
canvas_item.property_arrow_shape_b() = 0.0;
|
||||
canvas_item.property_arrow_shape_c() = 9.0;
|
||||
|
||||
shade.property_points() = points;
|
||||
shade.property_width_pixels() = 7;
|
||||
shade.property_fill_color_rgba() = RGBA_TO_UINT (255, 255, 255, 75);
|
||||
|
||||
canvas_item.set_data ("cursor", this);
|
||||
canvas_item.signal_event().connect (sigc::bind (sigc::mem_fun (ed, callbck), &canvas_item));
|
||||
current_frame = 1; /* force redraw at 0 */
|
||||
|
|
@ -76,7 +69,6 @@ EditorCursor::set_position (framepos_t frame)
|
|||
points.back().set_x (new_pos);
|
||||
|
||||
canvas_item.property_points() = points;
|
||||
shade.property_points() = points;
|
||||
}
|
||||
current_frame = frame;
|
||||
}
|
||||
|
|
@ -87,7 +79,6 @@ EditorCursor::set_length (double units)
|
|||
length = units;
|
||||
points.back().set_y (points.front().get_y() + length);
|
||||
canvas_item.property_points() = points;
|
||||
shade.property_points() = points;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -96,5 +87,4 @@ EditorCursor::set_y_axis (double position)
|
|||
points.front().set_y (position);
|
||||
points.back().set_y (position + length);
|
||||
canvas_item.property_points() = points;
|
||||
shade.property_points() = points;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,7 +233,6 @@ EngineControl::EngineControl ()
|
|||
inputs_label = manage (left_aligned_label (_("Physical input channels:")));
|
||||
basic_packer.attach (*inputs_label, 0, 1, row, row+1, FILL|EXPAND, (AttachOptions) 0);
|
||||
basic_packer.attach (inputs_spinner, 1, 2, row, row+1, FILL|EXPAND, (AttachOptions) 0);
|
||||
cerr << "Packed inputs spinner on row " << row << endl;
|
||||
++row;
|
||||
outputs_label = manage (left_aligned_label (_("Physical output channels:")));
|
||||
basic_packer.attach (*outputs_label, 0, 1, row, row+1, FILL|EXPAND, (AttachOptions) 0);
|
||||
|
|
@ -247,6 +246,7 @@ EngineControl::EngineControl ()
|
|||
basic_packer.attach (*busses_label, 0, 1, row, row+1, FILL|EXPAND, (AttachOptions) 0);
|
||||
basic_packer.attach (busses_spinner, 1, 2, row, row+1, FILL|EXPAND, (AttachOptions) 0);
|
||||
++row;
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||
label = manage (left_aligned_label (_("Number of buffers:")));
|
||||
|
|
@ -717,12 +717,18 @@ EngineControl::engine_running ()
|
|||
}
|
||||
|
||||
jack_status_t status;
|
||||
cerr << "---- PROBE FOR JACK ---\n";
|
||||
|
||||
jack_client_t* c = jack_client_open ("ardourprobe", JackNoStartServer, &status);
|
||||
|
||||
if (status == 0) {
|
||||
cerr << "---- WORKED, close it---\n";
|
||||
jack_client_close (c);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
cerr << "---- FAILED!---\n";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -764,8 +770,11 @@ EngineControl::setup_engine ()
|
|||
return -1;
|
||||
}
|
||||
|
||||
cout << "JACK command: ";
|
||||
|
||||
for (vector<string>::iterator i = args.begin(); i != args.end(); ++i) {
|
||||
jackdrc << (*i) << ' ';
|
||||
cout << (*i) << ' ';
|
||||
}
|
||||
|
||||
jackdrc << endl;
|
||||
|
|
@ -793,6 +802,7 @@ EngineControl::enumerate_devices (const string& driver)
|
|||
devices[driver] = enumerate_coreaudio_devices ();
|
||||
} else if (driver == "SoundGrid") {
|
||||
devices[driver].clear ();
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||
|
||||
|
|
|
|||
|
|
@ -1967,6 +1967,7 @@ MixerStrip::set_button_names ()
|
|||
} else {
|
||||
meter_point_button.set_text ("");
|
||||
}
|
||||
}
|
||||
|
||||
PluginSelector*
|
||||
MixerStrip::plugin_selector()
|
||||
|
|
|
|||
|
|
@ -441,10 +441,6 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi
|
|||
chooser.add_shortcut_folder_uri("file:///Volumes");
|
||||
#endif
|
||||
|
||||
#ifdef FREESOUND
|
||||
mootcher = new Mootcher();
|
||||
#endif
|
||||
|
||||
//add the file chooser
|
||||
|
||||
chooser.set_border_width (12);
|
||||
|
|
@ -904,14 +900,6 @@ SoundFileBrowser::freesound_search()
|
|||
gdk_window_set_cursor (get_window()->gobj(), gdk_cursor_new(GDK_WATCH));
|
||||
freesound_progress_bar.set_fraction(0.0);
|
||||
gdk_flush();
|
||||
for (int page = 1; page <= 99; page++ ) {
|
||||
|
||||
std::string prog;
|
||||
prog = string_compose (_("Page %1, [Stop]->"), page);
|
||||
freesound_progress_bar.set_text(prog);
|
||||
while (Glib::MainContext::get_default()->iteration (false)) {
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
int freesound_n_pages = 1;
|
||||
for (int page = 1; page <= 99 && page <= freesound_n_pages; page++ ) {
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ ArdourStartup::ArdourStartup (bool require_new, const std::string& session_name,
|
|||
|
||||
set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
|
||||
|
||||
#ifdef __APPLE__
|
||||
#if defined(__APPLE__) && !defined(USE_SOUNDGRID)
|
||||
setup_prerelease_page ();
|
||||
#endif
|
||||
if (new_user) {
|
||||
|
|
@ -322,7 +322,7 @@ ArdourStartup::setup_audio_page ()
|
|||
engine_dialog->show_all ();
|
||||
|
||||
audio_page_index = append_page (*engine_dialog);
|
||||
set_page_type (*engine_dialog, (need_session_info ? ASSISTANT_PAGE_CONTENT : ASSISTANT_PAGE_CONFIRM));
|
||||
set_page_type (*engine_dialog, ASSISTANT_PAGE_CONTENT);
|
||||
set_page_title (*engine_dialog, _("Audio / MIDI Setup"));
|
||||
|
||||
/* the default parameters should work, so the page is potentially complete */
|
||||
|
|
@ -664,12 +664,6 @@ void
|
|||
ArdourStartup::on_apply ()
|
||||
{
|
||||
if (engine_dialog) {
|
||||
if (engine_dialog->prepare ()) {
|
||||
/* failure - do not proceed to new page */
|
||||
set_current_page (audio_page_index);
|
||||
return;
|
||||
}
|
||||
|
||||
if (engine_dialog->setup_engine ()) {
|
||||
set_current_page (audio_page_index);
|
||||
return;
|
||||
|
|
@ -703,18 +697,7 @@ ArdourStartup::on_apply ()
|
|||
void
|
||||
ArdourStartup::on_prepare (Gtk::Widget* page)
|
||||
{
|
||||
if (page == &ic_vbox) {
|
||||
|
||||
/* need to check with engine dialog and see if something needs to be done
|
||||
before we move on (SoundGrid)
|
||||
*/
|
||||
|
||||
if (engine_dialog) {
|
||||
if (engine_dialog->prepare ()) {
|
||||
/* failure - do not proceed to new page */
|
||||
}
|
||||
}
|
||||
} else if (page == &session_vbox) {
|
||||
if (page == &session_vbox) {
|
||||
|
||||
if (ic_new_session_button.get_active()) {
|
||||
/* new session requested */
|
||||
|
|
@ -743,7 +726,7 @@ ArdourStartup::on_prepare (Gtk::Widget* page)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1107,71 +1090,6 @@ ArdourStartup::setup_existing_session_page ()
|
|||
set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::setup_existing_session_page ()
|
||||
{
|
||||
recent_session_model = TreeStore::create (recent_session_columns);
|
||||
redisplay_recent_sessions ();
|
||||
|
||||
if (!session_hbox.get_children().empty()) {
|
||||
session_hbox.remove (**session_hbox.get_children().begin());
|
||||
}
|
||||
|
||||
if (session_existing_vbox.get_children().empty()) {
|
||||
|
||||
recent_session_display.set_model (recent_session_model);
|
||||
recent_session_display.append_column (_("Recent Sessions"), recent_session_columns.visible_name);
|
||||
recent_session_display.set_headers_visible (false);
|
||||
recent_session_display.get_selection()->set_mode (SELECTION_BROWSE);
|
||||
|
||||
recent_session_display.get_selection()->signal_changed().connect (sigc::mem_fun (*this, &ArdourStartup::recent_session_row_selected));
|
||||
|
||||
recent_scroller.add (recent_session_display);
|
||||
recent_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
||||
recent_scroller.set_shadow_type (Gtk::SHADOW_IN);
|
||||
|
||||
recent_session_display.show();
|
||||
|
||||
recent_scroller.show();
|
||||
int cnt = redisplay_recent_sessions ();
|
||||
recent_session_display.signal_row_activated().connect (sigc::mem_fun (*this, &ArdourStartup::recent_row_activated));
|
||||
|
||||
if (cnt > 4) {
|
||||
recent_scroller.set_size_request (-1, 300);
|
||||
}
|
||||
|
||||
session_existing_vbox.set_spacing (8);
|
||||
session_existing_vbox.pack_start (recent_scroller, true, true);
|
||||
|
||||
existing_session_chooser.set_title (_("Select session file"));
|
||||
existing_session_chooser.signal_file_set().connect (sigc::mem_fun (*this, &ArdourStartup::existing_session_selected));
|
||||
existing_session_chooser.set_current_folder(poor_mans_glob (Config->get_default_session_parent_dir()));
|
||||
|
||||
FileFilter session_filter;
|
||||
session_filter.add_pattern ("*.ardour");
|
||||
session_filter.set_name (string_compose (_("%1 sessions"), PROGRAM_NAME));
|
||||
existing_session_chooser.add_filter (session_filter);
|
||||
existing_session_chooser.set_filter (session_filter);
|
||||
|
||||
#ifdef GTKOSX
|
||||
existing_session_chooser.add_shortcut_folder ("/Volumes");
|
||||
#endif
|
||||
|
||||
HBox* hbox = manage (new HBox);
|
||||
hbox->set_spacing (4);
|
||||
hbox->pack_start (*manage (new Label (_("Browse:"))), PACK_SHRINK);
|
||||
hbox->pack_start (existing_session_chooser);
|
||||
session_existing_vbox.pack_start (*hbox, false, false);
|
||||
hbox->show_all ();
|
||||
}
|
||||
|
||||
session_existing_vbox.show_all ();
|
||||
session_hbox.pack_start (session_existing_vbox, true, true);
|
||||
|
||||
set_page_title (session_vbox, _("Select a session"));
|
||||
set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
|
||||
}
|
||||
|
||||
void
|
||||
ArdourStartup::more_new_session_options_button_clicked ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -190,10 +190,6 @@ class AudioRegion : public Region
|
|||
PBD::Property<bool> _fade_out_active;
|
||||
/** linear gain to apply to the whole region */
|
||||
PBD::Property<gain_t> _scale_amplitude;
|
||||
PBD::Property<bool> _fade_in_is_xfade;
|
||||
PBD::Property<bool> _fade_out_is_xfade;
|
||||
PBD::Property<bool> _fade_in_is_short;
|
||||
PBD::Property<bool> _fade_out_is_short;
|
||||
|
||||
void register_properties ();
|
||||
void post_set (const PBD::PropertyChange&);
|
||||
|
|
|
|||
|
|
@ -401,7 +401,6 @@ public:
|
|||
double e2; ///< second order loop error
|
||||
double b, c; ///< DLL filter coefficients
|
||||
};
|
||||
#endif
|
||||
|
||||
class MIDIClock_Slave : public Slave {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1412,12 +1412,15 @@ AudioEngine::connect_to_jack (string client_name, string session_uuid)
|
|||
}
|
||||
|
||||
jack_client_name = client_name; /* might be reset below */
|
||||
cerr << "++++++ CONNECTING TO JACK AS " << client_name << endl;
|
||||
#ifdef HAVE_JACK_SESSION
|
||||
if (! session_uuid.empty())
|
||||
if (! session_uuid.empty()) {
|
||||
_jack = jack_client_open (jack_client_name.c_str(), JackSessionID, &status, session_uuid.c_str());
|
||||
else
|
||||
} else {
|
||||
#endif
|
||||
_jack = jack_client_open (jack_client_name.c_str(), JackNullOption, &status, 0);
|
||||
_jack = jack_client_open (jack_client_name.c_str(), JackNullOption, &status, 0);
|
||||
}
|
||||
|
||||
|
||||
if (_jack == NULL) {
|
||||
// error message is not useful here
|
||||
|
|
|
|||
|
|
@ -894,12 +894,6 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
|
|||
}
|
||||
}
|
||||
|
||||
/* legacy a3 */
|
||||
|
||||
if ((prop = child->property ("is-xfade")) != 0) {
|
||||
_fade_in_is_xfade = string_is_affirmative (prop->value());
|
||||
}
|
||||
|
||||
} else if (child->name() == "FadeOut") {
|
||||
|
||||
_fade_out->clear ();
|
||||
|
|
@ -1208,8 +1202,6 @@ void
|
|||
AudioRegion::set_default_fade_in ()
|
||||
{
|
||||
_fade_in_suspended = 0;
|
||||
_fade_in_is_xfade = false;
|
||||
_fade_in_is_short = true;
|
||||
set_fade_in (FadeLinear, 64);
|
||||
}
|
||||
|
||||
|
|
@ -1217,8 +1209,6 @@ void
|
|||
AudioRegion::set_default_fade_out ()
|
||||
{
|
||||
_fade_out_suspended = 0;
|
||||
_fade_out_is_xfade = false;
|
||||
_fade_out_is_short = true;
|
||||
set_fade_out (FadeLinear, 64);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -540,17 +540,3 @@ ARDOUR::get_available_sync_options ()
|
|||
return ret;
|
||||
}
|
||||
|
||||
vector<SyncSource>
|
||||
ARDOUR::get_available_sync_options ()
|
||||
{
|
||||
vector<SyncSource> ret;
|
||||
|
||||
ret.push_back (JACK);
|
||||
ret.push_back (MTC);
|
||||
ret.push_back (MIDIClock);
|
||||
#ifdef HAVE_LTC
|
||||
ret.push_back (LTC);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@
|
|||
#include "ardour/midi_patch_manager.h"
|
||||
#include "ardour/midi_patch_search_path.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
using namespace MIDI;
|
||||
|
|
|
|||
|
|
@ -2413,7 +2413,6 @@ Playlist::raise_region (boost::shared_ptr<Region> region)
|
|||
{
|
||||
set_layer (region, region->layer() + 1.5);
|
||||
relayer ();
|
||||
check_crossfades (region->range ());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2421,7 +2420,6 @@ Playlist::lower_region (boost::shared_ptr<Region> region)
|
|||
{
|
||||
set_layer (region, region->layer() - 1.5);
|
||||
relayer ();
|
||||
check_crossfades (region->range ());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2429,7 +2427,6 @@ Playlist::raise_region_to_top (boost::shared_ptr<Region> region)
|
|||
{
|
||||
set_layer (region, DBL_MAX);
|
||||
relayer ();
|
||||
check_crossfades (region->range ());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2437,7 +2434,6 @@ Playlist::lower_region_to_bottom (boost::shared_ptr<Region> region)
|
|||
{
|
||||
set_layer (region, -0.5);
|
||||
relayer ();
|
||||
check_crossfades (region->range ());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
#include "ardour/port.h"
|
||||
#include "ardour/port_insert.h"
|
||||
#include "ardour/processor.h"
|
||||
#include "ardour/profile.h"
|
||||
#include "ardour/route.h"
|
||||
#include "ardour/route_group.h"
|
||||
#include "ardour/send.h"
|
||||
|
|
|
|||
|
|
@ -141,36 +141,6 @@ legalize_for_path_2X (const string& str)
|
|||
return string (legal);
|
||||
}
|
||||
|
||||
/** take an arbitrary string as an argument, and return a version of it
|
||||
* suitable for use as a path (directory/folder name). This is the Ardour 2.X
|
||||
* version of this code, which used an approach that came to be seen as
|
||||
* problematic: defining the characters that were allowed and replacing all
|
||||
* others with underscores. See legalize_for_path() for the 3.X and later
|
||||
* version.
|
||||
*/
|
||||
|
||||
string
|
||||
legalize_for_path_2X (const string& str)
|
||||
{
|
||||
string::size_type pos;
|
||||
string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=: ";
|
||||
Glib::ustring legal;
|
||||
|
||||
/* this is the one place in Ardour where we need to iterate across
|
||||
* potential multibyte characters, and thus we need Glib::ustring
|
||||
*/
|
||||
|
||||
legal = str;
|
||||
pos = 0;
|
||||
|
||||
while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
|
||||
legal.replace (pos, 1, "_");
|
||||
pos += 1;
|
||||
}
|
||||
|
||||
return string (legal);
|
||||
}
|
||||
|
||||
string
|
||||
bump_name_once (const std::string& name, char delimiter)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ def build(bld):
|
|||
'OSX','BOOST','CURL','DL']
|
||||
obj.use = ['libpbd','libmidipp','libevoral','libvamphost',
|
||||
'libvampplugin','libtaglib','librubberband',
|
||||
'libaudiographer']
|
||||
'libaudiographer','libltc']
|
||||
if bld.is_defined ('HAVE_SOUNDGRID'):
|
||||
obj.uselib += [ 'SOUNDGRID' ]
|
||||
obj.vnum = LIBARDOUR_LIB_VERSION
|
||||
|
|
|
|||
|
|
@ -119,12 +119,6 @@ class PixFader : public Gtk::DrawingArea
|
|||
|
||||
bool _hovering;
|
||||
|
||||
void create_patterns();
|
||||
cairo_pattern_t* pattern;
|
||||
cairo_pattern_t* shine_pattern;
|
||||
|
||||
bool _hovering;
|
||||
|
||||
GdkWindow* grab_window;
|
||||
double grab_loc;
|
||||
double grab_start;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Gtkmm2ext {
|
|||
class SliderController : public Gtkmm2ext::PixFader
|
||||
{
|
||||
public:
|
||||
SliderController (Glib::RefPtr<Gdk::Pixbuf>, Glib::RefPtr<Gdk::Pixbuf>, Gtk::Adjustment* adj, int orientation, int);
|
||||
SliderController (Gtk::Adjustment* adj, int orientation, int, int);
|
||||
|
||||
virtual ~SliderController () {}
|
||||
|
||||
|
|
|
|||
|
|
@ -184,41 +184,6 @@ PixFader::create_patterns ()
|
|||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
void
|
||||
PixFader::create_patterns ()
|
||||
{
|
||||
Gdk::Color c = get_style()->get_fg (get_state());
|
||||
float r, g, b;
|
||||
r = c.get_red_p ();
|
||||
g = c.get_green_p ();
|
||||
b = c.get_blue_p ();
|
||||
|
||||
if (_orien == VERT) {
|
||||
pattern = cairo_pattern_create_linear (0.0, 0.0, get_width(), 0);
|
||||
cairo_pattern_add_color_stop_rgba (pattern, 0, r*0.8,g*0.8,b*0.8, 1.0);
|
||||
cairo_pattern_add_color_stop_rgba (pattern, 1, r*0.6,g*0.6,b*0.6, 1.0);
|
||||
|
||||
shine_pattern = cairo_pattern_create_linear (0.0, 0.0, 15, 0);
|
||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 0, 1,1,1,0.0);
|
||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 0.2, 1,1,1,0.3);
|
||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 0.5, 1,1,1,0.0);
|
||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 1, 1,1,1,0.0);
|
||||
} else {
|
||||
float rheight = get_height();
|
||||
|
||||
pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, rheight);
|
||||
cairo_pattern_add_color_stop_rgba (pattern, 0, r*0.8,g*0.8,b*0.8, 1.0);
|
||||
cairo_pattern_add_color_stop_rgba (pattern, 1, r*0.6,g*0.6,b*0.6, 1.0);
|
||||
|
||||
shine_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, rheight);
|
||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 0, 1,1,1,0.0);
|
||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 0.2, 1,1,1,0.3);
|
||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 0.5, 1,1,1,0.0);
|
||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 1, 1,1,1,0.0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
PixFader::on_expose_event (GdkEventExpose* ev)
|
||||
{
|
||||
|
|
@ -335,14 +300,6 @@ PixFader::on_expose_event (GdkEventExpose* ev)
|
|||
}
|
||||
// }
|
||||
|
||||
// if (Config->get_widget_prelight()) { //pixfader does not have access to config
|
||||
if (_hovering) {
|
||||
Gtkmm2ext::rounded_rectangle (cr, 0, 0, get_width(), get_height(), 3);
|
||||
cairo_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.2);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
// }
|
||||
|
||||
last_drawn = ds;
|
||||
|
||||
return true;
|
||||
|
|
@ -381,21 +338,6 @@ PixFader::on_size_allocate (Gtk::Allocation& alloc)
|
|||
update_unity_position ();
|
||||
}
|
||||
|
||||
void
|
||||
PixFader::on_size_allocate (Gtk::Allocation& alloc)
|
||||
{
|
||||
DrawingArea::on_size_allocate(alloc);
|
||||
if (_orien == VERT) {
|
||||
view.height = span = alloc.get_height();
|
||||
} else {
|
||||
view.width = span = alloc.get_width();
|
||||
}
|
||||
|
||||
update_unity_position ();
|
||||
|
||||
queue_draw ();
|
||||
}
|
||||
|
||||
bool
|
||||
PixFader::on_button_press_event (GdkEventButton* ev)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -125,8 +125,6 @@ public:
|
|||
|
||||
int number() const { return _number; }
|
||||
|
||||
int number() const { return _number; }
|
||||
|
||||
const PatchNameList& patch_name_list() const { return _patch_name_list; }
|
||||
const std::string& patch_list_name() const { return _patch_list_name; }
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@
|
|||
namespace PBD {
|
||||
|
||||
/**
|
||||
* @class The SearchPath class is a helper class for getting a
|
||||
* @class SearchPath
|
||||
*
|
||||
* The SearchPath class is a helper class for getting a
|
||||
* vector of paths contained in a search path string where a
|
||||
* "search path string" contains absolute directory paths
|
||||
* separated by a colon(:) or a semi-colon(;) on windows.
|
||||
|
|
|
|||
|
|
@ -147,10 +147,6 @@ def build(bld):
|
|||
testobj.name = 'libpbd-tests'
|
||||
if sys.platform != 'darwin':
|
||||
testobj.linkflags = ['-lrt']
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
>>>>>>> master
|
||||
|
||||
def shutdown():
|
||||
autowaf.shutdown()
|
||||
|
|
|
|||
|
|
@ -544,15 +544,12 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
|
|||
return 0;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
nlist = nlist.front()->children(); // "MIDIControllable" ...
|
||||
|
||||
if (nlist.empty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
>>>>>>> master
|
||||
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -123,15 +123,12 @@ MIDIControllable::set_controllable (Controllable* c)
|
|||
controllable = c;
|
||||
|
||||
if (controllable) {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
last_controllable_value = controllable->get_value();
|
||||
} else {
|
||||
last_controllable_value = 0.0f; // is there a better value?
|
||||
}
|
||||
|
||||
if (controllable) {
|
||||
>>>>>>> master
|
||||
controllable->Destroyed.connect (controllable_death_connection, MISSING_INVALIDATOR,
|
||||
boost::bind (&MIDIControllable::drop_controllable, this),
|
||||
MidiControlUI::instance());
|
||||
|
|
@ -237,10 +234,6 @@ MIDIControllable::lookup_controllable()
|
|||
void
|
||||
MIDIControllable::drop_controllable ()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
cerr << "removed controllable " << controllable << "\n";
|
||||
=======
|
||||
>>>>>>> master
|
||||
set_controllable (0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
Copyright (C) 2012 Paul Davis
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "ardour/session.h"
|
||||
|
|
|
|||
|
|
@ -150,27 +150,6 @@ MackieControlProtocol::~MackieControlProtocol()
|
|||
}
|
||||
|
||||
_instance = 0;
|
||||
<<<<<<< HEAD
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::~MackieControlProtocol done\n");
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::thread_init ()
|
||||
{
|
||||
struct sched_param rtparam;
|
||||
|
||||
pthread_set_name (X_("MackieControl"));
|
||||
|
||||
PBD::notify_gui_about_thread_creation (X_("gui"), pthread_self(), X_("MackieControl"), 2048);
|
||||
ARDOUR::SessionEvent::create_per_thread_pool (X_("MackieControl"), 128);
|
||||
|
||||
memset (&rtparam, 0, sizeof (rtparam));
|
||||
rtparam.sched_priority = 9; /* XXX should be relative to audio (JACK) thread */
|
||||
|
||||
if (pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam) != 0) {
|
||||
// do we care? not particularly.
|
||||
=======
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::~MackieControlProtocol done\n");
|
||||
}
|
||||
|
|
@ -198,21 +177,12 @@ MackieControlProtocol::midi_connectivity_established ()
|
|||
{
|
||||
for (Surfaces::const_iterator si = surfaces.begin(); si != surfaces.end(); ++si) {
|
||||
(*si)->say_hello ();
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
void
|
||||
MackieControlProtocol::midi_connectivity_established ()
|
||||
{
|
||||
for (Surfaces::const_iterator si = surfaces.begin(); si != surfaces.end(); ++si) {
|
||||
(*si)->say_hello ();
|
||||
=======
|
||||
if (_device_info.no_handshake()) {
|
||||
for (Surfaces::const_iterator si = surfaces.begin(); si != surfaces.end(); ++si) {
|
||||
(*si)->turn_it_on ();
|
||||
}
|
||||
>>>>>>> master
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -289,7 +259,6 @@ MackieControlProtocol::get_sorted_routes()
|
|||
|
||||
if (remote_ids.find (route->remote_control_id()) != remote_ids.end()) {
|
||||
continue;
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
if (route->is_hidden() || route->is_master() || route->is_monitor()) {
|
||||
|
|
@ -323,41 +292,6 @@ MackieControlProtocol::get_sorted_routes()
|
|||
break;
|
||||
}
|
||||
|
||||
=======
|
||||
}
|
||||
|
||||
if (route->is_hidden() || route->is_master() || route->is_monitor()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* don't include locked routes */
|
||||
|
||||
if (route_is_locked_to_strip(route)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (_view_mode) {
|
||||
case Mixer:
|
||||
break;
|
||||
case AudioTracks:
|
||||
break;
|
||||
case Busses:
|
||||
break;
|
||||
case MidiTracks:
|
||||
break;
|
||||
case Dynamics:
|
||||
break;
|
||||
case EQ:
|
||||
break;
|
||||
case Loop:
|
||||
break;
|
||||
case Sends:
|
||||
break;
|
||||
case Plugins:
|
||||
break;
|
||||
}
|
||||
|
||||
>>>>>>> master
|
||||
sorted.push_back (*it);
|
||||
remote_ids.insert (route->remote_control_id());
|
||||
}
|
||||
|
|
@ -506,17 +440,12 @@ MackieControlProtocol::periodic ()
|
|||
|
||||
now_usecs = (now.tv_sec * 1000000) + now.tv_usec;
|
||||
|
||||
<<<<<<< HEAD
|
||||
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
(*s)->periodic (now_usecs);
|
||||
=======
|
||||
{
|
||||
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||
|
||||
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
(*s)->periodic (now_usecs);
|
||||
}
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
update_timecode_display ();
|
||||
|
|
@ -551,11 +480,8 @@ MackieControlProtocol::update_timecode_beats_led()
|
|||
void
|
||||
MackieControlProtocol::update_global_button (int id, LedState ls)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||
|
||||
>>>>>>> master
|
||||
if (!_device_info.has_global_controls()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -574,11 +500,8 @@ MackieControlProtocol::update_global_button (int id, LedState ls)
|
|||
void
|
||||
MackieControlProtocol::update_global_led (int id, LedState ls)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||
|
||||
>>>>>>> master
|
||||
if (!_device_info.has_global_controls()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -615,17 +538,6 @@ MackieControlProtocol::update_surfaces()
|
|||
void
|
||||
MackieControlProtocol::initialize()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
if (!surfaces.front()->active ()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// sometimes the jog wheel is a pot
|
||||
if (_device_info.has_jog_wheel()) {
|
||||
surfaces.front()->blank_jog_ring ();
|
||||
}
|
||||
|
||||
=======
|
||||
{
|
||||
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||
|
||||
|
|
@ -643,7 +555,6 @@ MackieControlProtocol::initialize()
|
|||
}
|
||||
}
|
||||
|
||||
>>>>>>> master
|
||||
// update global buttons and displays
|
||||
|
||||
notify_record_state_changed();
|
||||
|
|
@ -687,99 +598,6 @@ MackieControlProtocol::set_profile (const string& profile_name)
|
|||
}
|
||||
|
||||
map<string,DeviceProfile>::iterator d = DeviceProfile::device_profiles.find (profile_name);
|
||||
<<<<<<< HEAD
|
||||
|
||||
if (d == DeviceProfile::device_profiles.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
_device_profile = d->second;
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::set_device (const string& device_name, bool allow_activation)
|
||||
{
|
||||
map<string,DeviceInfo>::iterator d = DeviceInfo::device_info.find (device_name);
|
||||
|
||||
if (d == DeviceInfo::device_info.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_active) {
|
||||
clear_ports ();
|
||||
surfaces.clear ();
|
||||
}
|
||||
|
||||
_device_info = d->second;
|
||||
|
||||
if (allow_activation) {
|
||||
set_active (true);
|
||||
} else {
|
||||
if (_active) {
|
||||
create_surfaces ();
|
||||
switch_banks (0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::create_surfaces ()
|
||||
{
|
||||
string device_name;
|
||||
surface_type_t stype = mcu;
|
||||
char buf[128];
|
||||
|
||||
if (_device_info.extenders() == 0) {
|
||||
device_name = X_("mackie control");
|
||||
} else {
|
||||
device_name = X_("mackie control #1");
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Create %1 surfaces\n", 1 + _device_info.extenders()));
|
||||
|
||||
for (uint32_t n = 0; n < 1 + _device_info.extenders(); ++n) {
|
||||
|
||||
boost::shared_ptr<Surface> surface (new Surface (*this, device_name, n, stype));
|
||||
surfaces.push_back (surface);
|
||||
|
||||
/* next device will be an extender */
|
||||
|
||||
if (_device_info.extenders() < 2) {
|
||||
device_name = X_("mackie control #2");
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), X_("mackie control #%d"), n+2);
|
||||
device_name = buf;
|
||||
}
|
||||
stype = ext;
|
||||
|
||||
if (!_device_info.uses_ipmidi()) {
|
||||
_input_bundle->add_channel (
|
||||
surface->port().input_port().name(),
|
||||
ARDOUR::DataType::MIDI,
|
||||
session->engine().make_port_name_non_relative (surface->port().input_port().name())
|
||||
);
|
||||
|
||||
_output_bundle->add_channel (
|
||||
surface->port().output_port().name(),
|
||||
ARDOUR::DataType::MIDI,
|
||||
session->engine().make_port_name_non_relative (surface->port().output_port().name())
|
||||
);
|
||||
}
|
||||
|
||||
int fd;
|
||||
MIDI::Port& input_port (surface->port().input_port());
|
||||
|
||||
if ((fd = input_port.selectable ()) >= 0) {
|
||||
Glib::RefPtr<IOSource> psrc = IOSource::create (fd, IO_IN|IO_HUP|IO_ERR);
|
||||
|
||||
psrc->connect (sigc::bind (sigc::mem_fun (this, &MackieControlProtocol::midi_input_handler), &input_port));
|
||||
psrc->attach (main_loop()->get_context());
|
||||
|
||||
// glibmm hack: for now, store only the GSource*
|
||||
|
||||
port_sources.push_back (psrc->gobj());
|
||||
g_source_ref (psrc->gobj());
|
||||
=======
|
||||
|
||||
if (d == DeviceProfile::device_profiles.end()) {
|
||||
return;
|
||||
|
|
@ -813,7 +631,6 @@ MackieControlProtocol::set_device (const string& device_name, bool allow_activat
|
|||
if (_active) {
|
||||
create_surfaces ();
|
||||
switch_banks (0, true);
|
||||
>>>>>>> master
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -821,16 +638,6 @@ MackieControlProtocol::set_device (const string& device_name, bool allow_activat
|
|||
void
|
||||
MackieControlProtocol::create_surfaces ()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
clear_ports ();
|
||||
|
||||
port_connections.drop_connections ();
|
||||
session_connections.drop_connections ();
|
||||
route_connections.drop_connections ();
|
||||
periodic_connection.disconnect ();
|
||||
|
||||
surfaces.clear ();
|
||||
=======
|
||||
string device_name;
|
||||
surface_type_t stype = mcu;
|
||||
char buf[128];
|
||||
|
|
@ -904,7 +711,6 @@ MackieControlProtocol::close()
|
|||
periodic_connection.disconnect ();
|
||||
|
||||
clear_surfaces();
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
XMLNode&
|
||||
|
|
@ -958,7 +764,6 @@ MackieControlProtocol::set_state (const XMLNode & node, int /*version*/)
|
|||
|
||||
if ((prop = node.property (X_("device-name"))) != 0) {
|
||||
set_device (prop->value(), false);
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
if ((prop = node.property (X_("device-profile"))) != 0) {
|
||||
|
|
@ -1009,58 +814,6 @@ MackieControlProtocol::format_timecode_timecode (framepos_t now_frame)
|
|||
Timecode::Time timecode;
|
||||
session->timecode_time (now_frame, timecode);
|
||||
|
||||
=======
|
||||
}
|
||||
|
||||
if ((prop = node.property (X_("device-profile"))) != 0) {
|
||||
set_profile (prop->value());
|
||||
}
|
||||
|
||||
set_active (active);
|
||||
|
||||
if (_active) {
|
||||
switch_banks (bank, true);
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::set_state done\n");
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
string
|
||||
MackieControlProtocol::format_bbt_timecode (framepos_t now_frame)
|
||||
{
|
||||
Timecode::BBT_Time bbt_time;
|
||||
|
||||
session->bbt_time (now_frame, bbt_time);
|
||||
|
||||
// The Mackie protocol spec is built around a BBT time display of
|
||||
//
|
||||
// digits: 888/88/88/888
|
||||
// semantics: BBB/bb/ss/ttt
|
||||
//
|
||||
// The third field is "subdivisions" which is a concept found in Logic
|
||||
// but not present in Ardour. Instead Ardour displays a 4 digit tick
|
||||
// count, which we need to spread across the 5 digits of ss/ttt.
|
||||
|
||||
ostringstream os;
|
||||
|
||||
os << setw(3) << setfill('0') << bbt_time.bars;
|
||||
os << setw(2) << setfill('0') << bbt_time.beats;
|
||||
os << ' ';
|
||||
os << setw(1) << setfill('0') << bbt_time.ticks / 1000;
|
||||
os << setw(3) << setfill('0') << bbt_time.ticks % 1000;
|
||||
|
||||
return os.str();
|
||||
}
|
||||
|
||||
string
|
||||
MackieControlProtocol::format_timecode_timecode (framepos_t now_frame)
|
||||
{
|
||||
Timecode::Time timecode;
|
||||
session->timecode_time (now_frame, timecode);
|
||||
|
||||
>>>>>>> master
|
||||
// According to the Logic docs
|
||||
// digits: 888/88/88/888
|
||||
// Timecode mode: Hours/Minutes/Seconds/Frames
|
||||
|
|
@ -1078,11 +831,8 @@ MackieControlProtocol::format_timecode_timecode (framepos_t now_frame)
|
|||
void
|
||||
MackieControlProtocol::update_timecode_display()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||
|
||||
>>>>>>> master
|
||||
if (surfaces.empty()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1146,7 +896,6 @@ MackieControlProtocol::notify_route_added (ARDOUR::RouteList & rl)
|
|||
|
||||
// make sure remote id changes in the new route are handled
|
||||
typedef ARDOUR::RouteList ARS;
|
||||
<<<<<<< HEAD
|
||||
|
||||
for (ARS::iterator it = rl.begin(); it != rl.end(); ++it) {
|
||||
(*it)->RemoteControlIDChanged.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_remote_id_changed, this), this);
|
||||
|
|
@ -1155,81 +904,6 @@ MackieControlProtocol::notify_route_added (ARDOUR::RouteList & rl)
|
|||
|
||||
void
|
||||
MackieControlProtocol::notify_solo_active_changed (bool active)
|
||||
{
|
||||
boost::shared_ptr<Surface> surface = surfaces.front();
|
||||
|
||||
map<int,Control*>::iterator x = surface->controls_by_device_independent_id.find (Led::RudeSolo);
|
||||
if (x != surface->controls_by_device_independent_id.end()) {
|
||||
Led* rude_solo = dynamic_cast<Led*> (x->second);
|
||||
if (rude_solo) {
|
||||
surface->write (rude_solo->set_state (active ? flashing : off));
|
||||
}
|
||||
=======
|
||||
|
||||
for (ARS::iterator it = rl.begin(); it != rl.end(); ++it) {
|
||||
(*it)->RemoteControlIDChanged.connect (route_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_remote_id_changed, this), this);
|
||||
>>>>>>> master
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
<<<<<<< HEAD
|
||||
MackieControlProtocol::notify_remote_id_changed()
|
||||
{
|
||||
Sorted sorted = get_sorted_routes();
|
||||
uint32_t sz = n_strips();
|
||||
|
||||
// if a remote id has been moved off the end, we need to shift
|
||||
// the current bank backwards.
|
||||
|
||||
if (sorted.size() - _current_initial_bank < sz) {
|
||||
// but don't shift backwards past the zeroth channel
|
||||
switch_banks (max((Sorted::size_type) 0, sorted.size() - sz));
|
||||
} else {
|
||||
// Otherwise just refresh the current bank
|
||||
refresh_current_bank();
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Transport signals
|
||||
///////////////////////////////////////////
|
||||
|
||||
void
|
||||
MackieControlProtocol::notify_loop_state_changed()
|
||||
{
|
||||
update_global_button (Button::Loop, session->get_play_loop());
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::notify_transport_state_changed()
|
||||
{
|
||||
if (!_device_info.has_global_controls()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// switch various play and stop buttons on / off
|
||||
update_global_button (Button::Loop, session->get_play_loop());
|
||||
update_global_button (Button::Play, session->transport_speed() == 1.0);
|
||||
update_global_button (Button::Stop, session->transport_stopped ());
|
||||
update_global_button (Button::Rewind, session->transport_speed() < 0.0);
|
||||
update_global_button (Button::Ffwd, session->transport_speed() > 1.0);
|
||||
|
||||
notify_metering_state_changed ();
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::notify_metering_state_changed()
|
||||
{
|
||||
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
(*s)->notify_metering_state_changed ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::notify_record_state_changed ()
|
||||
=======
|
||||
MackieControlProtocol::notify_solo_active_changed (bool active)
|
||||
{
|
||||
boost::shared_ptr<Surface> surface;
|
||||
|
||||
|
|
@ -1277,70 +951,10 @@ MackieControlProtocol::notify_loop_state_changed()
|
|||
|
||||
void
|
||||
MackieControlProtocol::notify_transport_state_changed()
|
||||
>>>>>>> master
|
||||
{
|
||||
if (!_device_info.has_global_controls()) {
|
||||
return;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
boost::shared_ptr<Surface> surface = surfaces.front();
|
||||
|
||||
/* rec is a tristate */
|
||||
|
||||
map<int,Control*>::iterator x = surface->controls_by_device_independent_id.find (Button::Record);
|
||||
if (x != surface->controls_by_device_independent_id.end()) {
|
||||
Button * rec = dynamic_cast<Button*> (x->second);
|
||||
if (rec) {
|
||||
LedState ls;
|
||||
|
||||
switch (session->record_status()) {
|
||||
case Session::Disabled:
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "record state changed to disabled, LED off\n");
|
||||
ls = off;
|
||||
break;
|
||||
case Session::Recording:
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "record state changed to recording, LED on\n");
|
||||
ls = on;
|
||||
break;
|
||||
case Session::Enabled:
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "record state changed to enabled, LED flashing\n");
|
||||
ls = flashing;
|
||||
break;
|
||||
}
|
||||
|
||||
surface->write (rec->set_state (ls));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list<boost::shared_ptr<ARDOUR::Bundle> >
|
||||
MackieControlProtocol::bundles ()
|
||||
{
|
||||
list<boost::shared_ptr<ARDOUR::Bundle> > b;
|
||||
b.push_back (_input_bundle);
|
||||
b.push_back (_output_bundle);
|
||||
return b;
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::do_request (MackieControlUIRequest* req)
|
||||
{
|
||||
if (req->type == CallSlot) {
|
||||
|
||||
call_slot (MISSING_INVALIDATOR, req->the_slot);
|
||||
|
||||
} else if (req->type == Quit) {
|
||||
|
||||
stop ();
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
MackieControlProtocol::stop ()
|
||||
{
|
||||
BaseUI::quit ();
|
||||
|
||||
=======
|
||||
|
||||
// switch various play and stop buttons on / off
|
||||
update_global_button (Button::Loop, session->get_play_loop());
|
||||
|
|
@ -1431,7 +1045,6 @@ MackieControlProtocol::stop ()
|
|||
{
|
||||
BaseUI::quit ();
|
||||
|
||||
>>>>>>> master
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1603,67 +1216,6 @@ bool
|
|||
MackieControlProtocol::midi_input_handler (IOCondition ioc, MIDI::Port* port)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("something happend on %1\n", port->name()));
|
||||
<<<<<<< HEAD
|
||||
|
||||
if (ioc & ~IO_IN) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ioc & IO_IN) {
|
||||
|
||||
/* Devices using regular JACK MIDI ports will need to have
|
||||
the x-thread FIFO drained to avoid burning endless CPU.
|
||||
|
||||
Devices using ipMIDI have port->selectable() as the same
|
||||
file descriptor that data arrives on, so doing this
|
||||
for them will simply throw all incoming data away.
|
||||
*/
|
||||
|
||||
if (!_device_info.uses_ipmidi()) {
|
||||
CrossThreadChannel::drain (port->selectable());
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("data available on %1\n", port->name()));
|
||||
framepos_t now = session->engine().frame_time();
|
||||
port->parse (now);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::clear_ports ()
|
||||
{
|
||||
_input_bundle->remove_channels ();
|
||||
_output_bundle->remove_channels ();
|
||||
|
||||
for (PortSources::iterator i = port_sources.begin(); i != port_sources.end(); ++i) {
|
||||
g_source_destroy (*i);
|
||||
g_source_unref (*i);
|
||||
}
|
||||
|
||||
port_sources.clear ();
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::set_view_mode (ViewMode m)
|
||||
{
|
||||
_view_mode = m;
|
||||
|
||||
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
(*s)->update_view_mode_display ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::set_flip_mode (bool yn)
|
||||
{
|
||||
_flip_mode = yn;
|
||||
|
||||
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
(*s)->update_flip_mode_display ();
|
||||
=======
|
||||
|
||||
if (ioc & ~IO_IN) {
|
||||
return false;
|
||||
|
|
@ -1714,68 +1266,9 @@ MackieControlProtocol::set_view_mode (ViewMode m)
|
|||
|
||||
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
(*s)->update_view_mode_display ();
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
void
|
||||
MackieControlProtocol::set_master_on_surface_strip (uint32_t surface, uint32_t strip_number)
|
||||
{
|
||||
force_special_route_to_strip (session->master_out(), surface, strip_number);
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::set_monitor_on_surface_strip (uint32_t surface, uint32_t strip_number)
|
||||
{
|
||||
force_special_route_to_strip (session->monitor_out(), surface, strip_number);
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::force_special_route_to_strip (boost::shared_ptr<Route> r, uint32_t surface, uint32_t strip_number)
|
||||
{
|
||||
if (!r) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
if ((*s)->number() == surface) {
|
||||
Strip* strip = (*s)->nth_strip (strip_number);
|
||||
if (strip) {
|
||||
strip->set_route (session->master_out());
|
||||
strip->lock_controls ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::gui_track_selection_changed (ARDOUR::RouteNotificationListPtr rl, bool save_list)
|
||||
{
|
||||
_gui_track_selection_changed (rl.get(), save_list);
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::_gui_track_selection_changed (ARDOUR::RouteNotificationList* rl, bool save_list)
|
||||
{
|
||||
|
||||
/* We need to keep a list of the most recently selected routes around,
|
||||
but we are not allowed to keep shared_ptr<Route> unless we want to
|
||||
handle the complexities of route deletion. So instead, the GUI sends
|
||||
us a notification using weak_ptr<Route>, which we keep a copy
|
||||
of. For efficiency's sake, however, we convert the weak_ptr's into
|
||||
shared_ptr<Route> before passing them to however many surfaces (and
|
||||
thus strips) that we have.
|
||||
*/
|
||||
|
||||
StrongRouteNotificationList srl;
|
||||
|
||||
for (ARDOUR::RouteNotificationList::const_iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||
boost::shared_ptr<ARDOUR::Route> r = (*i).lock();
|
||||
if (r) {
|
||||
srl.push_back (r);
|
||||
=======
|
||||
|
||||
void
|
||||
MackieControlProtocol::set_flip_mode (bool yn)
|
||||
|
|
@ -1817,78 +1310,10 @@ MackieControlProtocol::force_special_route_to_strip (boost::shared_ptr<Route> r,
|
|||
strip->set_route (session->master_out());
|
||||
strip->lock_controls ();
|
||||
}
|
||||
>>>>>>> master
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
(*s)->gui_selection_changed (srl);
|
||||
}
|
||||
|
||||
if (save_list) {
|
||||
_last_selected_routes = *rl;
|
||||
}
|
||||
}
|
||||
|
||||
framepos_t
|
||||
MackieControlProtocol::transport_frame() const
|
||||
{
|
||||
return session->transport_frame();
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::add_down_select_button (int surface, int strip)
|
||||
{
|
||||
_down_select_buttons.insert ((surface<<8)|(strip&0xf));
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::remove_down_select_button (int surface, int strip)
|
||||
{
|
||||
DownButtonList::iterator x = find (_down_select_buttons.begin(), _down_select_buttons.end(), (surface<<8)|(strip&0xf));
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("removing surface %1 strip %2 from down select buttons\n", surface, strip));
|
||||
if (x != _down_select_buttons.end()) {
|
||||
_down_select_buttons.erase (x);
|
||||
} else {
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("surface %1 strip %2 not found in down select buttons\n",
|
||||
surface, strip));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::select_range ()
|
||||
{
|
||||
RouteList routes;
|
||||
|
||||
pull_route_range (_down_select_buttons, routes);
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("select range: found %1 routes\n", routes.size()));
|
||||
|
||||
if (!routes.empty()) {
|
||||
for (RouteList::iterator r = routes.begin(); r != routes.end(); ++r) {
|
||||
|
||||
if (_modifier_state == MODIFIER_CONTROL) {
|
||||
ToggleRouteSelection ((*r)->remote_control_id ());
|
||||
} else {
|
||||
if (r == routes.begin()) {
|
||||
SetRouteSelection ((*r)->remote_control_id());
|
||||
} else {
|
||||
AddRouteToSelection ((*r)->remote_control_id());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::add_down_button (AutomationType a, int surface, int strip)
|
||||
{
|
||||
DownButtonMap::iterator m = _down_buttons.find (a);
|
||||
|
||||
if (m == _down_buttons.end()) {
|
||||
_down_buttons[a] = DownButtonList();
|
||||
=======
|
||||
void
|
||||
MackieControlProtocol::gui_track_selection_changed (ARDOUR::RouteNotificationListPtr rl, bool save_list)
|
||||
{
|
||||
|
|
@ -1976,44 +1401,9 @@ MackieControlProtocol::select_range ()
|
|||
}
|
||||
}
|
||||
}
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
_down_buttons[a].insert ((surface<<8)|(strip&0xf));
|
||||
}
|
||||
|
||||
void
|
||||
MackieControlProtocol::remove_down_button (AutomationType a, int surface, int strip)
|
||||
{
|
||||
DownButtonMap::iterator m = _down_buttons.find (a);
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("removing surface %1 strip %2 from down buttons for %3\n", surface, strip, (int) a));
|
||||
|
||||
if (m == _down_buttons.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
DownButtonList& l (m->second);
|
||||
DownButtonList::iterator x = find (l.begin(), l.end(), (surface<<8)|(strip&0xf));
|
||||
|
||||
if (x != l.end()) {
|
||||
l.erase (x);
|
||||
} else {
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("surface %1 strip %2 not found in down buttons for %3\n",
|
||||
surface, strip, (int) a));
|
||||
}
|
||||
}
|
||||
|
||||
MackieControlProtocol::ControlList
|
||||
MackieControlProtocol::down_controls (AutomationType p)
|
||||
{
|
||||
ControlList controls;
|
||||
RouteList routes;
|
||||
|
||||
DownButtonMap::iterator m = _down_buttons.find (p);
|
||||
|
||||
=======
|
||||
void
|
||||
MackieControlProtocol::add_down_button (AutomationType a, int surface, int strip)
|
||||
{
|
||||
|
|
@ -2056,7 +1446,6 @@ MackieControlProtocol::down_controls (AutomationType p)
|
|||
|
||||
DownButtonMap::iterator m = _down_buttons.find (p);
|
||||
|
||||
>>>>>>> master
|
||||
if (m == _down_buttons.end()) {
|
||||
return controls;
|
||||
}
|
||||
|
|
@ -2131,19 +1520,12 @@ MackieControlProtocol::pull_route_range (DownButtonList& down, RouteList& select
|
|||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("PRR %5 in list %1.%2 - %3.%4\n", first_surface, first_strip, last_surface, last_strip,
|
||||
down.size()));
|
||||
|
||||
<<<<<<< HEAD
|
||||
for (Surfaces::const_iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
|
||||
if ((*s)->number() >= first_surface && (*s)->number() <= last_surface) {
|
||||
|
||||
=======
|
||||
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||
|
||||
for (Surfaces::const_iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
|
||||
|
||||
if ((*s)->number() >= first_surface && (*s)->number() <= last_surface) {
|
||||
|
||||
>>>>>>> master
|
||||
uint32_t fs;
|
||||
uint32_t ls;
|
||||
|
||||
|
|
@ -2195,12 +1577,6 @@ void
|
|||
MackieControlProtocol::ipmidi_restart ()
|
||||
{
|
||||
clear_ports ();
|
||||
<<<<<<< HEAD
|
||||
surfaces.clear ();
|
||||
create_surfaces ();
|
||||
switch_banks (_current_initial_bank, true);
|
||||
needs_ipmidi_restart = false;
|
||||
=======
|
||||
clear_surfaces ();
|
||||
create_surfaces ();
|
||||
switch_banks (_current_initial_bank, true);
|
||||
|
|
@ -2212,5 +1588,4 @@ MackieControlProtocol::clear_surfaces ()
|
|||
{
|
||||
Glib::Threads::Mutex::Lock lm (surfaces_lock);
|
||||
surfaces.clear ();
|
||||
>>>>>>> master
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,10 +136,7 @@ class MackieControlProtocol
|
|||
|
||||
static bool probe();
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
Glib::Threads::Mutex surfaces_lock;
|
||||
>>>>>>> master
|
||||
typedef std::list<boost::shared_ptr<Mackie::Surface> > Surfaces;
|
||||
Surfaces surfaces;
|
||||
|
||||
|
|
@ -299,10 +296,7 @@ class MackieControlProtocol
|
|||
void build_gui ();
|
||||
bool midi_input_handler (Glib::IOCondition ioc, MIDI::Port* port);
|
||||
void clear_ports ();
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
void clear_surfaces ();
|
||||
>>>>>>> master
|
||||
void force_special_route_to_strip (boost::shared_ptr<ARDOUR::Route> r, uint32_t surface, uint32_t strip_number);
|
||||
void build_button_map ();
|
||||
void gui_track_selection_changed (ARDOUR::RouteNotificationListPtr, bool save_list);
|
||||
|
|
|
|||
|
|
@ -429,16 +429,6 @@ MackieControlProtocol::frm_left_press (Button &)
|
|||
// can use first_mark_before/after as well
|
||||
unsigned long elapsed = _frm_left_last.restart();
|
||||
|
||||
<<<<<<< HEAD
|
||||
Location * loc = session->locations()->first_location_before (session->transport_frame());
|
||||
|
||||
// allow a quick double to go past a previous mark
|
||||
if (session->transport_rolling() && elapsed < 500 && loc != 0) {
|
||||
Location * loc_two_back = session->locations()->first_location_before (loc->start());
|
||||
if (loc_two_back != 0)
|
||||
{
|
||||
loc = loc_two_back;
|
||||
=======
|
||||
framepos_t pos = session->locations()->first_mark_before (session->transport_frame());
|
||||
|
||||
// allow a quick double to go past a previous mark
|
||||
|
|
@ -446,22 +436,14 @@ MackieControlProtocol::frm_left_press (Button &)
|
|||
framepos_t pos_two_back = session->locations()->first_mark_before (pos);
|
||||
if (pos_two_back >= 0) {
|
||||
pos = pos_two_back;
|
||||
>>>>>>> master
|
||||
}
|
||||
}
|
||||
|
||||
// move to the location, if it's valid
|
||||
<<<<<<< HEAD
|
||||
if (loc != 0) {
|
||||
session->request_locate (loc->start(), session->transport_rolling());
|
||||
} else {
|
||||
session->request_locate (session->locations()->session_range_location()->start(), session->transport_rolling());
|
||||
=======
|
||||
if (pos >= 0) {
|
||||
session->request_locate (pos, session->transport_rolling());
|
||||
} else {
|
||||
session->request_locate (session->current_start_frame(), session->transport_rolling());
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
return on;
|
||||
|
|
@ -477,21 +459,12 @@ LedState
|
|||
MackieControlProtocol::frm_right_press (Button &)
|
||||
{
|
||||
// can use first_mark_before/after as well
|
||||
<<<<<<< HEAD
|
||||
Location * loc = session->locations()->first_location_after (session->transport_frame());
|
||||
|
||||
if (loc != 0) {
|
||||
session->request_locate (loc->start(), session->transport_rolling());
|
||||
} else {
|
||||
session->request_locate (session->locations()->session_range_location()->end(), session->transport_rolling());
|
||||
=======
|
||||
framepos_t pos = session->locations()->first_mark_after (session->transport_frame());
|
||||
|
||||
if (pos >= 0) {
|
||||
session->request_locate (pos, session->transport_rolling());
|
||||
} else {
|
||||
session->request_locate (session->current_end_frame(), session->transport_rolling());
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
return on;
|
||||
|
|
|
|||
|
|
@ -297,19 +297,11 @@ Strip::notify_gain_changed (bool force_update)
|
|||
control = _fader;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> master
|
||||
boost::shared_ptr<AutomationControl> ac = _route->gain_control();
|
||||
|
||||
float gain_coefficient = ac->get_value();
|
||||
float normalized_position = ac->internal_to_interface (gain_coefficient);
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
|
||||
>>>>>>> master
|
||||
if (force_update || normalized_position != _last_gain_position_written) {
|
||||
|
||||
if (_surface->mcp().flip_mode()) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
<<<<<<< HEAD
|
||||
=======
|
||||
/*
|
||||
Copyright (C) 2012 Paul Davis
|
||||
|
||||
|
|
@ -19,7 +17,6 @@
|
|||
|
||||
*/
|
||||
|
||||
>>>>>>> master
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
|
@ -64,7 +61,6 @@ using ARDOUR::Pannable;
|
|||
using ARDOUR::AutomationControl;
|
||||
|
||||
#define ui_context() MackieControlProtocol::instance() /* a UICallback-derived object that specifies the event loop for signal handling */
|
||||
<<<<<<< HEAD
|
||||
|
||||
// The MCU sysex header.4th byte Will be overwritten
|
||||
// when we get an incoming sysex that identifies
|
||||
|
|
@ -76,19 +72,6 @@ static MidiByteArray mackie_sysex_hdr (5, MIDI::sysex, 0x0, 0x0, 0x66, 0x14);
|
|||
// the device type
|
||||
static MidiByteArray mackie_sysex_hdr_xt (5, MIDI::sysex, 0x0, 0x0, 0x66, 0x15);
|
||||
|
||||
=======
|
||||
|
||||
// The MCU sysex header.4th byte Will be overwritten
|
||||
// when we get an incoming sysex that identifies
|
||||
// the device type
|
||||
static MidiByteArray mackie_sysex_hdr (5, MIDI::sysex, 0x0, 0x0, 0x66, 0x14);
|
||||
|
||||
// The MCU extender sysex header.4th byte Will be overwritten
|
||||
// when we get an incoming sysex that identifies
|
||||
// the device type
|
||||
static MidiByteArray mackie_sysex_hdr_xt (5, MIDI::sysex, 0x0, 0x0, 0x66, 0x15);
|
||||
|
||||
>>>>>>> master
|
||||
static MidiByteArray empty_midi_byte_array;
|
||||
|
||||
Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, uint32_t number, surface_type_t stype)
|
||||
|
|
@ -325,7 +308,6 @@ Surface::blank_jog_ring ()
|
|||
_port->write (pot->set (0.0, false, Pot::spread));
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
float
|
||||
|
|
@ -583,278 +565,6 @@ Surface::host_connection_confirmation (const MidiByteArray & bytes)
|
|||
return MidiByteArray (2, 0x13, 0x00);
|
||||
}
|
||||
|
||||
void
|
||||
Surface::turn_it_on ()
|
||||
{
|
||||
if (_active) {
|
||||
return;
|
||||
if (_mcp.device_info ().has_master_fader ()) {
|
||||
master_gain_changed ();
|
||||
}
|
||||
|
||||
if (_mcp.device_info ().has_global_controls ()) {
|
||||
_mcp.update_global_button (Button::Read, _mcp.metering_active ());
|
||||
_mcp.update_global_button (Button::Stop, _mcp.get_session ().transport_stopped ());
|
||||
_mcp.update_global_button (Button::Play, (_mcp.get_session ().transport_speed () == 1.0f));
|
||||
=======
|
||||
}
|
||||
|
||||
float
|
||||
Surface::scrub_scaling_factor () const
|
||||
{
|
||||
return 100.0;
|
||||
}
|
||||
|
||||
void
|
||||
Surface::connect_to_signals ()
|
||||
{
|
||||
if (!_connected) {
|
||||
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface %1 connecting to signals on port %2\n",
|
||||
number(), _port->input_port().name()));
|
||||
|
||||
MIDI::Parser* p = _port->input_port().parser();
|
||||
|
||||
/* Incoming sysex */
|
||||
p->sysex.connect_same_thread (*this, boost::bind (&Surface::handle_midi_sysex, this, _1, _2, _3));
|
||||
/* V-Pot messages are Controller */
|
||||
p->controller.connect_same_thread (*this, boost::bind (&Surface::handle_midi_controller_message, this, _1, _2));
|
||||
/* Button messages are NoteOn */
|
||||
p->note_on.connect_same_thread (*this, boost::bind (&Surface::handle_midi_note_on_message, this, _1, _2));
|
||||
/* Button messages are NoteOn. libmidi++ sends note-on w/velocity = 0 as note-off so catch them too */
|
||||
p->note_off.connect_same_thread (*this, boost::bind (&Surface::handle_midi_note_on_message, this, _1, _2));
|
||||
/* Fader messages are Pitchbend */
|
||||
uint32_t i;
|
||||
for (i = 0; i < _mcp.device_info().strip_cnt(); i++) {
|
||||
p->channel_pitchbend[i].connect_same_thread (*this, boost::bind (&Surface::handle_midi_pitchbend_message, this, _1, _2, i));
|
||||
>>>>>>> master
|
||||
}
|
||||
// Master fader
|
||||
p->channel_pitchbend[_mcp.device_info().strip_cnt()].connect_same_thread (*this, boost::bind (&Surface::handle_midi_pitchbend_message, this, _1, _2, _mcp.device_info().strip_cnt()));
|
||||
|
||||
_connected = true;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t pb, uint32_t fader_id)
|
||||
{
|
||||
/* Pitchbend messages are fader messages. Nothing in the data we get
|
||||
* from the MIDI::Parser conveys the fader ID, which was given by the
|
||||
* channel ID in the status byte.
|
||||
*
|
||||
* Instead, we have used bind() to supply the fader-within-strip ID
|
||||
* when we connected to the per-channel pitchbend events.
|
||||
*/
|
||||
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface::handle_midi_pitchbend_message on port %3, fader = %1 value = %2\n",
|
||||
fader_id, pb, _number));
|
||||
|
||||
if (_mcp.device_info().no_handshake()) {
|
||||
turn_it_on ();
|
||||
}
|
||||
|
||||
Fader* fader = faders[fader_id];
|
||||
|
||||
if (fader) {
|
||||
Strip* strip = dynamic_cast<Strip*> (&fader->group());
|
||||
float pos = (pb >> 4)/1023.0; // only the top 10 bytes are used
|
||||
if (strip) {
|
||||
strip->handle_fader (*fader, pos);
|
||||
} else {
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "Handling master fader\n");
|
||||
/* master fader */
|
||||
fader->set_value (pos); // alter master gain
|
||||
_port->write (fader->set_position (pos)); // write back value (required for servo)
|
||||
}
|
||||
} else {
|
||||
DEBUG_TRACE (DEBUG::MackieControl, "fader not found\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::handle_midi_note_on_message (MIDI::Parser &, MIDI::EventTwoBytes* ev)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Surface::handle_midi_note_on_message %1 = %2\n", (int) ev->note_number, (int) ev->velocity));
|
||||
|
||||
if (_mcp.device_info().no_handshake()) {
|
||||
turn_it_on ();
|
||||
}
|
||||
|
||||
Button* button = buttons[ev->note_number];
|
||||
|
||||
if (button) {
|
||||
Strip* strip = dynamic_cast<Strip*> (&button->group());
|
||||
|
||||
if (strip) {
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("strip %1 button %2 pressed ? %3\n",
|
||||
strip->index(), button->name(), (ev->velocity > 64)));
|
||||
strip->handle_button (*button, ev->velocity > 64 ? press : release);
|
||||
} else {
|
||||
/* global button */
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("global button %1\n", button->id()));
|
||||
_mcp.handle_button_event (*this, *button, ev->velocity > 64 ? press : release);
|
||||
}
|
||||
} else {
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("no button found for %1\n", (int) ev->note_number));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::handle_midi_controller_message (MIDI::Parser &, MIDI::EventTwoBytes* ev)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("SurfacePort::handle_midi_controller %1 = %2\n", (int) ev->controller_number, (int) ev->value));
|
||||
|
||||
if (_mcp.device_info().no_handshake()) {
|
||||
turn_it_on ();
|
||||
}
|
||||
|
||||
Pot* pot = pots[ev->controller_number];
|
||||
|
||||
// bit 6 gives the sign
|
||||
float sign = (ev->value & 0x40) == 0 ? 1.0 : -1.0;
|
||||
// bits 0..5 give the velocity. we interpret this as "ticks
|
||||
// moved before this message was sent"
|
||||
float ticks = (ev->value & 0x3f);
|
||||
if (ticks == 0) {
|
||||
/* euphonix and perhaps other devices send zero
|
||||
when they mean 1, we think.
|
||||
*/
|
||||
ticks = 1;
|
||||
}
|
||||
float delta = sign * (ticks / (float) 0x3f);
|
||||
|
||||
if (!pot) {
|
||||
if (ev->controller_number == Jog::ID && _jog_wheel) {
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Jog wheel moved %1\n", ticks));
|
||||
_jog_wheel->jog_event (delta);
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Strip* strip = dynamic_cast<Strip*> (&pot->group());
|
||||
if (strip) {
|
||||
strip->handle_pot (*pot, delta);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::handle_midi_sysex (MIDI::Parser &, MIDI::byte * raw_bytes, size_t count)
|
||||
{
|
||||
MidiByteArray bytes (count, raw_bytes);
|
||||
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("handle_midi_sysex: %1\n", bytes));
|
||||
|
||||
if (_mcp.device_info().no_handshake()) {
|
||||
turn_it_on ();
|
||||
}
|
||||
|
||||
/* always save the device type ID so that our outgoing sysex messages
|
||||
* are correct
|
||||
*/
|
||||
|
||||
if (_stype == mcu) {
|
||||
mackie_sysex_hdr[4] = bytes[4];
|
||||
} else {
|
||||
mackie_sysex_hdr_xt[4] = bytes[4];
|
||||
}
|
||||
|
||||
switch (bytes[5]) {
|
||||
case 0x01:
|
||||
/* MCP: Device Ready
|
||||
LCP: Connection Challenge
|
||||
*/
|
||||
if (bytes[4] == 0x10 || bytes[4] == 0x11) {
|
||||
write_sysex (host_connection_query (bytes));
|
||||
} else {
|
||||
if (!_active) {
|
||||
turn_it_on ();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x03: /* LCP Connection Confirmation */
|
||||
if (bytes[4] == 0x10 || bytes[4] == 0x11) {
|
||||
write_sysex (host_connection_confirmation (bytes));
|
||||
_active = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x04: /* LCP: Confirmation Denied */
|
||||
_active = false;
|
||||
break;
|
||||
default:
|
||||
error << "MCP: unknown sysex: " << bytes << endmsg;
|
||||
}
|
||||
}
|
||||
|
||||
static MidiByteArray
|
||||
calculate_challenge_response (MidiByteArray::iterator begin, MidiByteArray::iterator end)
|
||||
{
|
||||
MidiByteArray l;
|
||||
back_insert_iterator<MidiByteArray> back (l);
|
||||
copy (begin, end, back);
|
||||
|
||||
MidiByteArray retval;
|
||||
|
||||
// this is how to calculate the response to the challenge.
|
||||
// from the Logic docs.
|
||||
retval << (0x7f & (l[0] + (l[1] ^ 0xa) - l[3]));
|
||||
retval << (0x7f & ( (l[2] >> l[3]) ^ (l[0] + l[3])));
|
||||
retval << (0x7f & ((l[3] - (l[2] << 2)) ^ (l[0] | l[1])));
|
||||
retval << (0x7f & (l[1] - l[2] + (0xf0 ^ (l[3] << 4))));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
// not used right now
|
||||
MidiByteArray
|
||||
Surface::host_connection_query (MidiByteArray & bytes)
|
||||
{
|
||||
MidiByteArray response;
|
||||
|
||||
if (bytes[4] != 0x10 && bytes[4] != 0x11) {
|
||||
/* not a Logic Control device - no response required */
|
||||
return response;
|
||||
}
|
||||
|
||||
// handle host connection query
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("host connection query: %1\n", bytes));
|
||||
|
||||
if (bytes.size() != 18) {
|
||||
cerr << "expecting 18 bytes, read " << bytes << " from " << _port->input_port().name() << endl;
|
||||
return response;
|
||||
}
|
||||
|
||||
// build and send host connection reply
|
||||
response << 0x02;
|
||||
copy (bytes.begin() + 6, bytes.begin() + 6 + 7, back_inserter (response));
|
||||
response << calculate_challenge_response (bytes.begin() + 6 + 7, bytes.begin() + 6 + 7 + 4);
|
||||
return response;
|
||||
}
|
||||
|
||||
// not used right now
|
||||
MidiByteArray
|
||||
Surface::host_connection_confirmation (const MidiByteArray & bytes)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("host_connection_confirmation: %1\n", bytes));
|
||||
|
||||
// decode host connection confirmation
|
||||
if (bytes.size() != 14) {
|
||||
ostringstream os;
|
||||
os << "expecting 14 bytes, read " << bytes << " from " << _port->input_port().name();
|
||||
throw MackieControlException (os.str());
|
||||
}
|
||||
|
||||
// send version request
|
||||
return MidiByteArray (2, 0x13, 0x00);
|
||||
}
|
||||
|
||||
void
|
||||
Surface::turn_it_on ()
|
||||
{
|
||||
|
|
@ -1212,361 +922,6 @@ Surface::route_is_locked_to_strip (boost::shared_ptr<Route> r) const
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
Surface::notify_metering_state_changed()
|
||||
{
|
||||
for (Strips::const_iterator s = strips.begin(); s != strips.end(); ++s) {
|
||||
(*s)->notify_metering_state_changed ();
|
||||
}
|
||||
|
||||
_active = true;
|
||||
|
||||
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
|
||||
(*s)->notify_all ();
|
||||
}
|
||||
|
||||
update_view_mode_display ();
|
||||
|
||||
if (_mcp.device_info ().has_global_controls ()) {
|
||||
_mcp.update_global_button (Button::Read, _mcp.metering_active ());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::handle_port_inactive (SurfacePort*)
|
||||
{
|
||||
_active = false;
|
||||
}
|
||||
|
||||
void
|
||||
Surface::write_sysex (const MidiByteArray & mba)
|
||||
{
|
||||
if (mba.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
MidiByteArray buf;
|
||||
buf << sysex_hdr() << mba << MIDI::eox;
|
||||
_port->write (buf);
|
||||
}
|
||||
|
||||
void
|
||||
Surface::write_sysex (MIDI::byte msg)
|
||||
{
|
||||
MidiByteArray buf;
|
||||
buf << sysex_hdr() << msg << MIDI::eox;
|
||||
_port->write (buf);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
Surface::n_strips (bool with_locked_strips) const
|
||||
{
|
||||
if (with_locked_strips) {
|
||||
return strips.size();
|
||||
}
|
||||
|
||||
uint32_t n = 0;
|
||||
|
||||
for (Strips::const_iterator it = strips.begin(); it != strips.end(); ++it) {
|
||||
if (!(*it)->locked()) {
|
||||
++n;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
Strip*
|
||||
Surface::nth_strip (uint32_t n) const
|
||||
{
|
||||
if (n > n_strips()) {
|
||||
return 0;
|
||||
}
|
||||
return strips[n];
|
||||
}
|
||||
|
||||
void
|
||||
Surface::zero_all ()
|
||||
{
|
||||
if (_mcp.device_info().has_timecode_display ()) {
|
||||
display_timecode (string (10, '0'), string (10, ' '));
|
||||
}
|
||||
|
||||
if (_mcp.device_info().has_two_character_display()) {
|
||||
show_two_char_display (string (2, '0'), string (2, ' '));
|
||||
}
|
||||
|
||||
if (_mcp.device_info().has_master_fader () && _master_fader) {
|
||||
_port->write (_master_fader->zero ());
|
||||
}
|
||||
|
||||
// zero all strips
|
||||
for (Strips::iterator it = strips.begin(); it != strips.end(); ++it) {
|
||||
(*it)->zero();
|
||||
}
|
||||
|
||||
zero_controls ();
|
||||
}
|
||||
|
||||
void
|
||||
Surface::zero_controls ()
|
||||
{
|
||||
if (!_mcp.device_info().has_global_controls()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// turn off global buttons and leds
|
||||
// global buttons are only ever on mcu_port, so we don't have
|
||||
// to figure out which port.
|
||||
|
||||
for (Controls::iterator it = controls.begin(); it != controls.end(); ++it) {
|
||||
Control & control = **it;
|
||||
if (!control.group().is_strip()) {
|
||||
_port->write (control.zero());
|
||||
}
|
||||
}
|
||||
|
||||
// and the led ring for the master strip
|
||||
blank_jog_ring ();
|
||||
|
||||
_last_master_gain_written = 0.0f;
|
||||
}
|
||||
|
||||
void
|
||||
Surface::periodic (uint64_t now_usecs)
|
||||
{
|
||||
master_gain_changed();
|
||||
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
|
||||
(*s)->periodic (now_usecs);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::write (const MidiByteArray& data)
|
||||
{
|
||||
if (_active) {
|
||||
_port->write (data);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::map_routes (const vector<boost::shared_ptr<Route> >& routes)
|
||||
{
|
||||
vector<boost::shared_ptr<Route> >::const_iterator r;
|
||||
Strips::iterator s = strips.begin();
|
||||
|
||||
for (r = routes.begin(); r != routes.end() && s != strips.end(); ++s) {
|
||||
|
||||
/* don't try to assign routes to a locked strip. it won't
|
||||
use it anyway, but if we do, then we get out of sync
|
||||
with the proposed mapping.
|
||||
*/
|
||||
|
||||
if (!(*s)->locked()) {
|
||||
(*s)->set_route (*r);
|
||||
++r;
|
||||
}
|
||||
}
|
||||
|
||||
for (; s != strips.end(); ++s) {
|
||||
(*s)->set_route (boost::shared_ptr<Route>());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static char
|
||||
translate_seven_segment (char achar)
|
||||
{
|
||||
achar = toupper (achar);
|
||||
|
||||
if (achar >= 0x40 && achar <= 0x60) {
|
||||
return achar - 0x40;
|
||||
} else if (achar >= 0x21 && achar <= 0x3f) {
|
||||
return achar;
|
||||
} else {
|
||||
return 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::show_two_char_display (const std::string & msg, const std::string & dots)
|
||||
{
|
||||
if (_stype != mcu || !_mcp.device_info().has_two_character_display() || msg.length() != 2 || dots.length() != 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
MidiByteArray right (3, 0xb0, 0x4b, 0x00);
|
||||
MidiByteArray left (3, 0xb0, 0x4a, 0x00);
|
||||
|
||||
right[2] = translate_seven_segment (msg[0]) + (dots[0] == '.' ? 0x40 : 0x00);
|
||||
left[2] = translate_seven_segment (msg[1]) + (dots[1] == '.' ? 0x40 : 0x00);
|
||||
|
||||
_port->write (right);
|
||||
_port->write (left);
|
||||
}
|
||||
|
||||
void
|
||||
Surface::show_two_char_display (unsigned int value, const std::string & /*dots*/)
|
||||
{
|
||||
ostringstream os;
|
||||
os << setfill('0') << setw(2) << value % 100;
|
||||
show_two_char_display (os.str());
|
||||
}
|
||||
|
||||
void
|
||||
Surface::display_timecode (const std::string & timecode, const std::string & last_timecode)
|
||||
{
|
||||
if (!_active || !_mcp.device_info().has_timecode_display()) {
|
||||
return;
|
||||
}
|
||||
// if there's no change, send nothing, not even sysex header
|
||||
if (timecode == last_timecode) return;
|
||||
|
||||
// length sanity checking
|
||||
string local_timecode = timecode;
|
||||
|
||||
// truncate to 10 characters
|
||||
if (local_timecode.length() > 10) {
|
||||
local_timecode = local_timecode.substr (0, 10);
|
||||
}
|
||||
|
||||
// pad to 10 characters
|
||||
while (local_timecode.length() < 10) {
|
||||
local_timecode += " ";
|
||||
}
|
||||
|
||||
// translate characters.
|
||||
// Only the characters that actually changed are sent.
|
||||
int position = 0x3f;
|
||||
int i;
|
||||
for (i = local_timecode.length () - 1; i >= 0; i--) {
|
||||
position++;
|
||||
if (local_timecode[i] == last_timecode[i]) {
|
||||
continue;
|
||||
}
|
||||
MidiByteArray retval (2, 0xb0, position);
|
||||
retval << translate_seven_segment (local_timecode[i]);
|
||||
_port->write (retval);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::update_flip_mode_display ()
|
||||
{
|
||||
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
|
||||
(*s)->flip_mode_changed (true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::update_view_mode_display ()
|
||||
{
|
||||
string text;
|
||||
int id = -1;
|
||||
|
||||
if (!_active) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (_mcp.view_mode()) {
|
||||
case MackieControlProtocol::Mixer:
|
||||
show_two_char_display ("Mx");
|
||||
id = Button::Pan;
|
||||
break;
|
||||
case MackieControlProtocol::Dynamics:
|
||||
show_two_char_display ("Dy");
|
||||
id = Button::Dyn;
|
||||
break;
|
||||
case MackieControlProtocol::EQ:
|
||||
show_two_char_display ("EQ");
|
||||
id = Button::Eq;
|
||||
break;
|
||||
case MackieControlProtocol::Loop:
|
||||
show_two_char_display ("LP");
|
||||
id = Button::Loop;
|
||||
break;
|
||||
case MackieControlProtocol::AudioTracks:
|
||||
show_two_char_display ("AT");
|
||||
break;
|
||||
case MackieControlProtocol::MidiTracks:
|
||||
show_two_char_display ("MT");
|
||||
break;
|
||||
case MackieControlProtocol::Sends:
|
||||
show_two_char_display ("Sn");
|
||||
id = Button::Sends;
|
||||
break;
|
||||
case MackieControlProtocol::Plugins:
|
||||
show_two_char_display ("Pl");
|
||||
id = Button::Plugin;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (id >= 0) {
|
||||
|
||||
/* we are attempting to turn a global button/LED on */
|
||||
|
||||
map<int,Control*>::iterator x = controls_by_device_independent_id.find (id);
|
||||
|
||||
if (x != controls_by_device_independent_id.end()) {
|
||||
Button* button = dynamic_cast<Button*> (x->second);
|
||||
if (button) {
|
||||
_port->write (button->set_state (on));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!text.empty()) {
|
||||
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
|
||||
_port->write ((*s)->display (1, text));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::gui_selection_changed (const ARDOUR::StrongRouteNotificationList& routes)
|
||||
{
|
||||
for (Strips::iterator s = strips.begin(); s != strips.end(); ++s) {
|
||||
(*s)->gui_selection_changed (routes);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Surface::say_hello ()
|
||||
{
|
||||
/* wakeup for Mackie Control */
|
||||
MidiByteArray wakeup (7, MIDI::sysex, 0x00, 0x00, 0x66, 0x14, 0x00, MIDI::eox);
|
||||
_port->write (wakeup);
|
||||
wakeup[4] = 0x15; /* wakup Mackie XT */
|
||||
_port->write (wakeup);
|
||||
wakeup[4] = 0x10; /* wakupe Logic Control */
|
||||
_port->write (wakeup);
|
||||
wakeup[4] = 0x11; /* wakeup Logic Control XT */
|
||||
_port->write (wakeup);
|
||||
}
|
||||
|
||||
void
|
||||
Surface::next_jog_mode ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Surface::set_jog_mode (JogWheel::Mode)
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
Surface::route_is_locked_to_strip (boost::shared_ptr<Route> r) const
|
||||
{
|
||||
for (Strips::const_iterator s = strips.begin(); s != strips.end(); ++s) {
|
||||
if ((*s)->route() == r && (*s)->locked()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
Surface::notify_metering_state_changed()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -146,12 +146,8 @@ public:
|
|||
void next_jog_mode ();
|
||||
void set_jog_mode (Mackie::JogWheel::Mode);
|
||||
|
||||
<<<<<<< HEAD
|
||||
void notify_metering_state_changed();
|
||||
=======
|
||||
void notify_metering_state_changed();
|
||||
void turn_it_on ();
|
||||
>>>>>>> master
|
||||
|
||||
protected:
|
||||
|
||||
|
|
@ -175,10 +171,6 @@ public:
|
|||
void init_strips (uint32_t n);
|
||||
void setup_master ();
|
||||
void master_gain_changed ();
|
||||
<<<<<<< HEAD
|
||||
void turn_it_on ();
|
||||
=======
|
||||
>>>>>>> master
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,10 +112,7 @@ int
|
|||
SurfacePort::write (const MidiByteArray & mba)
|
||||
{
|
||||
if (mba.empty()) {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("port %1 asked to write an empty MBA\n", output_port().name()));
|
||||
>>>>>>> master
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,38 +75,6 @@ if ($platform eq "osx") {
|
|||
$mouse_modifier_map{$winkey} => 'Win';
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
%keycodes = (
|
||||
'asciicircum' => '\\verb=^=',
|
||||
'apostrophe' => '\'',
|
||||
'bracketleft' => '[',
|
||||
'bracketright' => ']',
|
||||
'braceleft' => '\\{',
|
||||
'braceright' => '\\}',
|
||||
'backslash' => '$\\backslash$',
|
||||
'slash' => '/',
|
||||
'rightanglebracket' => '>',
|
||||
'leftanglebracket' => '<',
|
||||
'ampersand' => '\\&',
|
||||
'comma' => ',',
|
||||
'period' => '.',
|
||||
'semicolon' => ';',
|
||||
'colon' => ':',
|
||||
'equal' => '=',
|
||||
'minus' => '-',
|
||||
'plus' => '+',
|
||||
'grave' => '`',
|
||||
'rightarrow' => '$\rightarrow$',
|
||||
'leftarrow' => '$\\leftarrow$',
|
||||
'uparrow' => '$\\uparrow$',
|
||||
'downarrow' => '$\\downarrow$',
|
||||
'Page_Down' => 'Page Down',
|
||||
'Page_Up' => 'Page Up',
|
||||
'space' => 'space',
|
||||
'KP_' => 'KP$\_$',
|
||||
'greater' => '>',
|
||||
'less' => '<',
|
||||
=======
|
||||
%keycodes = ();
|
||||
|
||||
if ($html) {
|
||||
|
|
@ -177,7 +145,6 @@ if ($html) {
|
|||
'KP_' => 'KP$\_$',
|
||||
'greater' => '>',
|
||||
'less' => '<',
|
||||
>>>>>>> master
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
104
wscript
104
wscript
|
|
@ -7,22 +7,17 @@ import string
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
<<<<<<< HEAD
|
||||
# Variables for 'waf dist'
|
||||
VERSION = '3.0rc1'
|
||||
=======
|
||||
#
|
||||
|
||||
# build scripts need to find the right platform specific version
|
||||
#
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
OSX_VERSION = '3.0beta6'
|
||||
VERSION = '3.0beta6'
|
||||
OSX_VERSION = '3.0-SG-beta6'
|
||||
VERSION = '3.0-SG-beta6'
|
||||
else:
|
||||
LINUX_VERSION = '3.0'
|
||||
VERSION = '3.0'
|
||||
LINUX_VERSION = '3.0-SG'
|
||||
VERSION = '3.0-SG'
|
||||
|
||||
>>>>>>> master
|
||||
APPNAME = 'Ardour3'
|
||||
|
||||
# Mandatory variables
|
||||
|
|
@ -52,11 +47,7 @@ children = [
|
|||
'export',
|
||||
'midi_maps',
|
||||
'mcp',
|
||||
<<<<<<< HEAD
|
||||
'manual'
|
||||
=======
|
||||
'patchfiles'
|
||||
>>>>>>> master
|
||||
]
|
||||
|
||||
i18n_children = [
|
||||
|
|
@ -86,20 +77,7 @@ def fetch_gcc_version (CC):
|
|||
def fetch_git_revision ():
|
||||
cmd = "LANG= git describe --tags HEAD"
|
||||
output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
|
||||
<<<<<<< HEAD
|
||||
o = output[0].decode('utf-8')
|
||||
rev = o.replace ("commit", "git")[0:10]
|
||||
for line in output:
|
||||
try:
|
||||
if "git-svn-id" in line:
|
||||
line = line.split('@')[1].split(' ')
|
||||
rev = line[0]
|
||||
break
|
||||
except:
|
||||
pass
|
||||
=======
|
||||
rev = output[0].decode('utf-8')
|
||||
>>>>>>> master
|
||||
return rev
|
||||
|
||||
def create_stored_revision():
|
||||
|
|
@ -158,15 +136,10 @@ def set_compiler_flags (conf,opt):
|
|||
conf.env['build_target'] = 'leopard'
|
||||
elif re.search ("^10[.]", version) != None:
|
||||
conf.env['build_target'] = 'snowleopard'
|
||||
<<<<<<< HEAD
|
||||
else:
|
||||
conf.env['build_target'] = 'lion'
|
||||
=======
|
||||
elif re.search ("^11[.]", version) != None:
|
||||
conf.env['build_target'] = 'lion'
|
||||
else:
|
||||
conf.env['build_target'] = 'mountainlion'
|
||||
>>>>>>> master
|
||||
else:
|
||||
if re.search ("x86_64", cpu) != None:
|
||||
conf.env['build_target'] = 'x86_64'
|
||||
|
|
@ -421,11 +394,8 @@ def options(opt):
|
|||
help='Compile with Boost shared pointer debugging')
|
||||
opt.add_option('--depstack-root', type='string', default='~', dest='depstack_root',
|
||||
help='Directory/folder where dependency stack trees (gtk, a3) can be found (defaults to ~)')
|
||||
<<<<<<< HEAD
|
||||
opt.add_option('--soundgrid', action='store_true', default=True, dest='soundgrid',
|
||||
help='Compile with support for Waves SoundGrid')
|
||||
=======
|
||||
>>>>>>> master
|
||||
opt.add_option('--dist-target', type='string', default='auto', dest='dist_target',
|
||||
help='Specify the target for cross-compiling [auto,none,x86,i386,i686,x86_64,powerpc,tiger,leopard]')
|
||||
opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
|
||||
|
|
@ -466,11 +436,7 @@ def options(opt):
|
|||
# help='Compile with support for Frontier Designs Tranzport (if libusb is available)')
|
||||
opt.add_option('--universal', action='store_true', default=False, dest='universal',
|
||||
help='Compile as universal binary (OS X ONLY, requires that external libraries are universal)')
|
||||
<<<<<<< HEAD
|
||||
opt.add_option('--generic', action='store_true', default=True, dest='generic',
|
||||
=======
|
||||
opt.add_option('--generic', action='store_true', default=False, dest='generic',
|
||||
>>>>>>> master
|
||||
help='Compile with -arch i386 (OS X ONLY)')
|
||||
opt.add_option('--versioned', action='store_true', default=False, dest='versioned',
|
||||
help='Add revision information to executable name inside the build directory')
|
||||
|
|
@ -511,42 +477,6 @@ def configure(conf):
|
|||
print('Please use a different version or re-configure with --debug')
|
||||
exit (1)
|
||||
|
||||
<<<<<<< HEAD
|
||||
# libintl may or may not be trivially locatable. On OS X this is always
|
||||
# true. On Linux it will depend on whether we're on a normal Linux distro,
|
||||
# in which case libintl.h is going to be available in /usr/include and
|
||||
# the library itself is part of glibc, or on a bare-bones build system
|
||||
# where we need to pick it up from the GTK dependency stack.
|
||||
#
|
||||
user_gtk_root = os.path.expanduser (Options.options.depstack_root + '/gtk/inst')
|
||||
pkg_config_path = os.getenv('PKG_CONFIG_PATH')
|
||||
if not os.path.isfile ('/usr/include/libintl.h') or (pkg_config_path is not None and pkg_config_path.find (user_gtk_root) >= 0):
|
||||
# XXXX hack hack hack
|
||||
prefinclude = ''.join ([ '-I', user_gtk_root + '/include'])
|
||||
preflib = ''.join ([ '-L', user_gtk_root + '/lib'])
|
||||
conf.env.append_value('CFLAGS', [ prefinclude ])
|
||||
conf.env.append_value('CXXFLAGS', [prefinclude ])
|
||||
conf.env.append_value('LINKFLAGS', [ preflib ])
|
||||
conf.define ('NEED_INTL', 1)
|
||||
autowaf.display_msg(conf, 'Will use explicit linkage against libintl in ' + user_gtk_root, 'yes')
|
||||
else:
|
||||
autowaf.display_msg(conf, 'Will use explicit linkage against libintl in ', 'no')
|
||||
|
||||
user_ardour_root = os.path.expanduser (Options.options.depstack_root + '/a3/inst')
|
||||
if pkg_config_path is not None and os.getenv('PKG_CONFIG_PATH').find (user_ardour_root) >= 0:
|
||||
# XXXX hack hack hack
|
||||
prefinclude = ''.join ([ '-I', user_ardour_root + '/include'])
|
||||
preflib = ''.join ([ '-L', user_ardour_root + '/lib'])
|
||||
conf.env.append_value('CFLAGS', [ prefinclude ])
|
||||
conf.env.append_value('CXXFLAGS', [prefinclude ])
|
||||
conf.env.append_value('LINKFLAGS', [ preflib ])
|
||||
autowaf.display_msg(conf, 'Will build against private Ardour dependency stack in ' + user_ardour_root, 'yes')
|
||||
else:
|
||||
autowaf.display_msg(conf, 'Will build against private Ardour dependency stack', 'no')
|
||||
|
||||
sg_tree = os.path.expanduser (Options.options.depstack_root + '/ardour/3.0-SG/soundgrid')
|
||||
|
||||
=======
|
||||
# systems with glibc have libintl builtin. systems without require explicit
|
||||
# linkage against libintl.
|
||||
#
|
||||
|
|
@ -584,7 +514,6 @@ def configure(conf):
|
|||
else:
|
||||
autowaf.display_msg(conf, 'Will build against private Ardour dependency stack', 'no')
|
||||
|
||||
>>>>>>> master
|
||||
if sys.platform == 'darwin':
|
||||
|
||||
# this is required, potentially, for anything we link and then relocate into a bundle
|
||||
|
|
@ -600,17 +529,6 @@ def configure(conf):
|
|||
conf.define ('TOP_MENUBAR',1)
|
||||
conf.define ('GTKOSX',1)
|
||||
|
||||
<<<<<<< HEAD
|
||||
# Define OSX as a uselib to use when compiling
|
||||
# on Darwin to add all applicable flags at once
|
||||
#
|
||||
conf.env.append_value('CXXFLAGS_OSX', '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040')
|
||||
conf.env.append_value('CFLAGS_OSX', '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040')
|
||||
conf.env.append_value('CXXFLAGS_OSX', '-mmacosx-version-min=10.4')
|
||||
conf.env.append_value('CFLAGS_OSX', '-mmacosx-version-min=10.4')
|
||||
|
||||
=======
|
||||
>>>>>>> master
|
||||
# It would be nice to be able to use this to force back-compatibility with 10.4
|
||||
# but even by the time of 11, the 10.4 SDK is no longer available in any normal
|
||||
# way.
|
||||
|
|
@ -653,9 +571,10 @@ def configure(conf):
|
|||
conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Carbon'])
|
||||
else:
|
||||
print ('No Carbon support available for this build\n')
|
||||
<<<<<<< HEAD
|
||||
|
||||
if Options.options.soundgrid:
|
||||
sg_tree = os.path.expanduser (Options.options.depstack_root + '/ardour/3.0-SG/soundgrid')
|
||||
|
||||
conf.env.append_value ('CXXFLAGS_SOUNDGRID',
|
||||
[ '-D__MACOS__',
|
||||
'-DUSE_SOUNDGRID',
|
||||
|
|
@ -680,8 +599,6 @@ def configure(conf):
|
|||
conf.check_cxx (header_name='WavesMixerAPI/1.0/WavesMixerAPI.h',
|
||||
mandatory=True, use='SOUNDGRID')
|
||||
conf.define('HAVE_SOUNDGRID', 1)
|
||||
=======
|
||||
>>>>>>> master
|
||||
|
||||
if Options.options.boost_include != '':
|
||||
conf.env.append_value('CXXFLAGS', '-I' + Options.options.boost_include)
|
||||
|
|
@ -712,11 +629,7 @@ def configure(conf):
|
|||
autowaf.check_pkg(conf, 'giomm-2.4', uselib_store='GIOMM', atleast_version='2.2')
|
||||
autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL', atleast_version='7.0.0')
|
||||
|
||||
<<<<<<< HEAD
|
||||
conf.check_cc(function_name='dlopen', header_name='dlfcn.h', linkflags='-ldl', uselib_store='DL')
|
||||
=======
|
||||
conf.check_cc(function_name='dlopen', header_name='dlfcn.h', lib='dl', uselib_store='DL')
|
||||
>>>>>>> master
|
||||
|
||||
# Tell everyone that this is a waf build
|
||||
|
||||
|
|
@ -866,8 +779,5 @@ def i18n_po(bld):
|
|||
def i18n_mo(bld):
|
||||
bld.recurse (i18n_children)
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
def tarball(bld):
|
||||
create_stored_revision()
|
||||
>>>>>>> master
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue