summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-12-02 17:34:05 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-12-02 17:34:05 +0000
commit6e3190e17c83b468abf262618e7341b778819d85 (patch)
treec1f589f06a89a1b211f7fad86ac0a86749aac0ba
parent4fc93e9381c44e4a7f1be787727a65caacae50aa (diff)
define ARCH_X86 even on x86_64 (untested!); giso's patch for control surface track indexing; carl's patches for insert-time and double-click on redirect boxes
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4279 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--SConstruct7
-rw-r--r--gtk2_ardour/editor_ops.cc37
-rw-r--r--gtk2_ardour/plugin_selector.h2
-rw-r--r--gtk2_ardour/redirect_box.cc6
-rw-r--r--libs/ardour/ardour/automation_event.h1
-rw-r--r--libs/ardour/ardour/route.h2
-rw-r--r--libs/ardour/automation_event.cc17
-rw-r--r--libs/ardour/io.cc1
-rw-r--r--libs/ardour/route.cc45
-rw-r--r--libs/surfaces/control_protocol/control_protocol.cc10
10 files changed, 106 insertions, 22 deletions
diff --git a/SConstruct b/SConstruct
index 8996672211..e7df3c76b6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -706,7 +706,12 @@ elif ((re.search ("i[0-9]86", config[config_cpu]) != None) or (re.search ("x86_6
build_host_supports_sse = 0
- if (re.search ("i[0-9]86", config[config_cpu]) != None):
+ #
+ # ARCH_X86 means anything in the x86 family from i386 to x86_64
+ # USE_X86_64_ASM is used to distingush 32 and 64 bit assembler
+ #
+
+ if (re.search ("(i[0-9]86|x86_64)", config[config_cpu]) != None):
debug_flags.append ("-DARCH_X86")
opt_flags.append ("-DARCH_X86")
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 51cb8b6f2d..6b867500ae 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -36,7 +36,6 @@
#include <gtkmm2ext/window_title.h>
#include <gtkmm2ext/popup.h>
-
#include <ardour/audioengine.h>
#include <ardour/session.h>
#include <ardour/audioplaylist.h>
@@ -6014,26 +6013,34 @@ Editor::insert_time (nframes64_t pos, nframes64_t frames, InsertTimeOption opt,
begin_reversible_command (_("insert time"));
for (TrackSelection::iterator x = selection->tracks.begin(); x != selection->tracks.end(); ++x) {
+ /* regions */
boost::shared_ptr<Playlist> pl = (*x)->playlist();
- if (!pl) {
- continue;
- }
-
- XMLNode &before = pl->get_state();
+ if (pl) {
- if (opt == SplitIntersected) {
- pl->split (pos);
+ XMLNode &before = pl->get_state();
+
+ if (opt == SplitIntersected) {
+ pl->split (pos);
+ }
+
+ pl->shift (pos, frames, (opt == MoveIntersected), ignore_music_glue);
+
+ XMLNode &after = pl->get_state();
+
+ session->add_command (new MementoCommand<Playlist> (*pl, &before, &after));
+ commit = true;
+ }
+
+ /* automation */
+ RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (*x);
+ if (rtav) {
+ rtav->route ()->shift (pos, frames);
+ commit = true;
}
-
- pl->shift (pos, frames, (opt == MoveIntersected), ignore_music_glue);
-
- XMLNode &after = pl->get_state();
-
- session->add_command (new MementoCommand<Playlist> (*pl, &before, &after));
- commit = true;
}
+ /* markers */
if (markers_too) {
bool moved = false;
XMLNode& before (session->locations()->get_state());
diff --git a/gtk2_ardour/plugin_selector.h b/gtk2_ardour/plugin_selector.h
index c2f657679f..ab5495b348 100644
--- a/gtk2_ardour/plugin_selector.h
+++ b/gtk2_ardour/plugin_selector.h
@@ -46,6 +46,7 @@ class PluginSelector : public ArdourDialog
void on_show ();
Gtk::Menu& plugin_menu ();
+ void show_manager ();
private:
PluginInterestedObject* interested_object;
@@ -125,7 +126,6 @@ class PluginSelector : public ArdourDialog
void plugin_chosen_from_menu (const ARDOUR::PluginInfoPtr&);
Gtk::Menu* _menu;
- void show_manager ();
};
#endif // __ardour_plugin_selector_h__
diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc
index b6c5694dcf..2a696e2d2e 100644
--- a/gtk2_ardour/redirect_box.cc
+++ b/gtk2_ardour/redirect_box.cc
@@ -303,6 +303,12 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev)
// this is purely informational but necessary
RedirectSelected (redirect); // emit
+
+ } else if (!redirect && ev->button == 1 && ev->type == GDK_2BUTTON_PRESS) {
+
+ choose_plugin ();
+ _plugin_selector.show_manager ();
+
}
return ret;
diff --git a/libs/ardour/ardour/automation_event.h b/libs/ardour/ardour/automation_event.h
index b9c243fa37..02b306c355 100644
--- a/libs/ardour/ardour/automation_event.h
+++ b/libs/ardour/ardour/automation_event.h
@@ -108,6 +108,7 @@ class AutomationList : public PBD::StatefulDestructible
void erase (iterator, iterator);
void move_range (iterator start, iterator end, double, double);
void modify (iterator, double, double);
+ void shift (nframes64_t, nframes64_t);
AutomationList* cut (double, double);
AutomationList* copy (double, double);
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index f80eb45fc7..0ac50f4452 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -106,6 +106,8 @@ class Route : public IO
/* end of vfunc-based API */
+ void shift (nframes64_t, nframes64_t);
+
/* override IO::set_gain() to provide group control */
void set_gain (gain_t val, void *src);
diff --git a/libs/ardour/automation_event.cc b/libs/ardour/automation_event.cc
index 3e257d2b7a..44cba83f38 100644
--- a/libs/ardour/automation_event.cc
+++ b/libs/ardour/automation_event.cc
@@ -1426,3 +1426,20 @@ AutomationList::set_state (const XMLNode& node)
return 0;
}
+void
+AutomationList::shift (nframes64_t pos, nframes64_t frames)
+{
+ {
+ Glib::Mutex::Lock lm (lock);
+
+ for (iterator i = begin (); i != end (); ++i) {
+ if ((*i)->when >= pos) {
+ (*i)->when += frames;
+ }
+ }
+
+ mark_dirty ();
+ }
+
+ maybe_signal_changed ();
+}
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index da0529b9c6..865814b114 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -2806,3 +2806,4 @@ IO::set_active (bool yn)
active_changed(); /* EMIT SIGNAL */
}
+
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 41ba51b0d1..edfcaa7962 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -25,6 +25,7 @@
#include <pbd/xml++.h>
#include <pbd/enumwriter.h>
#include <pbd/stacktrace.h>
+#include <pbd/memento_command.h>
#include <ardour/timestamps.h>
#include <ardour/buffer.h>
@@ -2614,3 +2615,47 @@ Route::set_pending_declick (int declick)
}
}
+
+/** Shift automation forwards from a particular place, thereby inserting time.
+ * Adds undo commands for any shifts that are performed.
+ *
+ * @param pos Position to start shifting from.
+ * @param frames Amount to shift forwards by.
+ */
+
+void
+Route::shift (nframes64_t pos, nframes64_t frames)
+{
+ /* gain automation */
+ XMLNode &before = _gain_automation_curve.get_state ();
+ _gain_automation_curve.shift (pos, frames);
+ XMLNode &after = _gain_automation_curve.get_state ();
+ _session.add_command (new MementoCommand<AutomationList> (_gain_automation_curve, &before, &after));
+
+ /* pan automation */
+ for (std::vector<StreamPanner*>::iterator i = _panner->begin (); i != _panner->end (); ++i) {
+ Curve & c = (*i)->automation ();
+ XMLNode &before = c.get_state ();
+ c.shift (pos, frames);
+ XMLNode &after = c.get_state ();
+ _session.add_command (new MementoCommand<AutomationList> (c, &before, &after));
+ }
+
+ /* redirect automation */
+ {
+ Glib::RWLock::ReaderLock lm (redirect_lock);
+ for (RedirectList::iterator i = _redirects.begin (); i != _redirects.end (); ++i) {
+
+ set<uint32_t> a;
+ (*i)->what_has_automation (a);
+
+ for (set<uint32_t>::const_iterator j = a.begin (); j != a.end (); ++j) {
+ AutomationList & al = (*i)->automation_list (*j);
+ XMLNode &before = al.get_state ();
+ al.shift (pos, frames);
+ XMLNode &after = al.get_state ();
+ _session.add_command (new MementoCommand<AutomationList> (al, &before, &after));
+ }
+ }
+ }
+}
diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc
index 8456654f20..6565342944 100644
--- a/libs/surfaces/control_protocol/control_protocol.cc
+++ b/libs/surfaces/control_protocol/control_protocol.cc
@@ -70,14 +70,14 @@ ControlProtocol::next_track (uint32_t initial_id)
id++;
}
- while (id < limit) {
+ while (id <= limit) {
if ((cr = session->route_by_remote_id (id)) != 0) {
break;
}
id++;
}
- if (id == limit) {
+ if (id >= limit) {
id = 0;
while (id != initial_id) {
if ((cr = session->route_by_remote_id (id)) != 0) {
@@ -93,9 +93,9 @@ 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();
boost::shared_ptr<Route> cr = route_table[0];
- uint32_t id;
+ int32_t id;
if (cr) {
id = cr->remote_control_id ();
@@ -104,7 +104,7 @@ ControlProtocol::prev_track (uint32_t initial_id)
}
if (id == 0) {
- id = session->nroutes() - 1;
+ id = limit;
} else {
id--;
}