summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct60
-rw-r--r--gtk2_ardour/ardour_ui.cc70
-rw-r--r--gtk2_ardour/ardour_ui.h13
-rw-r--r--gtk2_ardour/editor.cc59
-rw-r--r--gtk2_ardour/editor.h4
-rw-r--r--gtk2_ardour/editor_mouse.cc18
-rw-r--r--gtk2_ardour/public_editor.h4
-rw-r--r--gtk2_ardour/time_axis_view.cc2
-rw-r--r--libs/ardour/session_state.cc4
9 files changed, 59 insertions, 175 deletions
diff --git a/SConstruct b/SConstruct
index 9bbd2c7a24..93b02296c7 100644
--- a/SConstruct
+++ b/SConstruct
@@ -29,40 +29,40 @@ subst_dict = { }
# Command-line options
#
-opts = Options('scache.conf')
-opts.AddOptions(
+opts = Variables('scache.conf')
+opts.AddVariables(
('ARCH', 'Set architecture-specific compilation flags by hand (all flags as 1 argument)',''),
('WINDOWS_KEY', 'Set X Modifier (Mod1,Mod2,Mod3,Mod4,Mod5) for "Windows" key', 'Mod4><Super'),
('PROGRAM_NAME', 'Set program name (default is "Ardour")', 'Ardour'),
- BoolOption('AUDIOUNITS', 'Compile with Apple\'s AudioUnit library. (experimental)', 0),
- BoolOption('COREAUDIO', 'Compile with Apple\'s CoreAudio library', 0),
- BoolOption('GTKOSX', 'Compile for use with GTK-OSX, not GTK-X11', 0),
- BoolOption('OLDFONTS', 'Old school font sizes', 0),
- BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 0),
- BoolOption('STL_DEBUG', 'Set to build with Standard Template Library Debugging', 0),
- PathOption('DESTDIR', 'Set the intermediate install "prefix"', '/'),
- EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'tiger', 'panther', 'leopard', 'none' ), ignorecase=2),
- BoolOption('DMALLOC', 'Compile and link using the dmalloc library', 0),
- BoolOption('EXTRA_WARN', 'Compile with -Wextra, -ansi, and -pedantic. Might break compilation. For pedants', 0),
- BoolOption('FFT_ANALYSIS', 'Include FFT analysis window', 1),
- BoolOption('FREESOUND', 'Include Freesound database lookup', 0),
- BoolOption('FPU_OPTIMIZATION', 'Build runtime checked assembler code', 1),
- BoolOption('LIBLO', 'Compile with support for liblo library', 1),
- BoolOption('NLS', 'Set to turn on i18n support', 1),
- PathOption('PREFIX', 'Set the install "prefix"', '/usr/local'),
- BoolOption('SURFACES', 'Build support for control surfaces', 1),
- BoolOption('WIIMOTE', 'Build the wiimote control surface', 0),
('DIST_LIBDIR', 'Explicitly set library dir. If not set, Fedora-style defaults are used (typically lib or lib64)', ''),
- BoolOption('SYSLIBS', 'USE AT YOUR OWN RISK: CANCELS ALL SUPPORT FROM ARDOUR AUTHORS: Use existing system versions of various libraries instead of internal ones', 0),
- BoolOption('UNIVERSAL', 'Compile as universal binary. Requires that external libraries are already universal.', 0),
- BoolOption('VERSIONED', 'Add revision information to ardour/gtk executable name inside the build directory', 0),
- BoolOption('VST', 'Compile with support for VST', 0),
- BoolOption('LV2', 'Compile with support for LV2 (if slv2 is available)', 1),
- BoolOption('GPROFILE', 'Compile with support for gprofile (Developers only)', 0),
- BoolOption('FREEDESKTOP', 'Install MIME type, icons and .desktop file as per the freedesktop.org spec (requires xdg-utils and shared-mime-info). "scons uninstall" removes associations in desktop database', 0),
- BoolOption('TRANZPORT', 'Compile with support for Frontier Designs (if libusb is available)', 1),
- BoolOption('AUBIO', "Use Paul Brossier's aubio library for feature detection (if available)", 1),
- BoolOption('AUSTATE', "Build with support for AU settings & presets saving/loading", 0)
+ PathVariable('DESTDIR', 'Set the intermediate install "prefix"', '/'),
+ PathVariable('PREFIX', 'Set the install "prefix"', '/usr/local'),
+ EnumVariable('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'tiger', 'panther', 'leopard', 'none' ), ignorecase=2),
+ BoolVariable('AUDIOUNITS', 'Compile with Apple\'s AudioUnit library. (experimental)', 0),
+ BoolVariable('COREAUDIO', 'Compile with Apple\'s CoreAudio library', 0),
+ BoolVariable('GTKOSX', 'Compile for use with GTK-OSX, not GTK-X11', 0),
+ BoolVariable('OLDFONTS', 'Old school font sizes', 0),
+ BoolVariable('DEBUG', 'Set to build with debugging information and no optimizations', 0),
+ BoolVariable('STL_DEBUG', 'Set to build with Standard Template Library Debugging', 0),
+ BoolVariable('DMALLOC', 'Compile and link using the dmalloc library', 0),
+ BoolVariable('EXTRA_WARN', 'Compile with -Wextra, -ansi, and -pedantic. Might break compilation. For pedants', 0),
+ BoolVariable('FFT_ANALYSIS', 'Include FFT analysis window', 1),
+ BoolVariable('FREESOUND', 'Include Freesound database lookup', 0),
+ BoolVariable('FPU_OPTIMIZATION', 'Build runtime checked assembler code', 1),
+ BoolVariable('LIBLO', 'Compile with support for liblo library', 1),
+ BoolVariable('NLS', 'Set to turn on i18n support', 1),
+ BoolVariable('SURFACES', 'Build support for control surfaces', 1),
+ BoolVariable('WIIMOTE', 'Build the wiimote control surface', 0),
+ BoolVariable('SYSLIBS', 'USE AT YOUR OWN RISK: CANCELS ALL SUPPORT FROM ARDOUR AUTHORS: Use existing system versions of various libraries instead of internal ones', 0),
+ BoolVariable('UNIVERSAL', 'Compile as universal binary. Requires that external libraries are already universal.', 0),
+ BoolVariable('VERSIONED', 'Add revision information to ardour/gtk executable name inside the build directory', 0),
+ BoolVariable('VST', 'Compile with support for VST', 0),
+ BoolVariable('LV2', 'Compile with support for LV2 (if slv2 is available)', 1),
+ BoolVariable('GPROFILE', 'Compile with support for gprofile (Developers only)', 0),
+ BoolVariable('FREEDESKTOP', 'Install MIME type, icons and .desktop file as per the freedesktop.org spec (requires xdg-utils and shared-mime-info). "scons uninstall" removes associations in desktop database', 0),
+ BoolVariable('TRANZPORT', 'Compile with support for Frontier Designs (if libusb is available)', 1),
+ BoolVariable('AUBIO', "Use Paul Brossier's aubio library for feature detection (if available)", 1),
+ BoolVariable('AUSTATE', "Build with support for AU settings & presets saving/loading", 0)
)
#----------------------------------------------------------------------
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index d9a7fd4595..a0cbfb91de 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -66,6 +66,7 @@
#include <ardour/recent_sessions.h>
#include <ardour/port.h>
#include <ardour/audio_track.h>
+#include <ardour/control_protocol_manager.h>
typedef uint64_t microseconds_t;
@@ -927,8 +928,6 @@ ARDOUR_UI::update_buffer_load ()
c = session->capture_load ();
p = session->playback_load ();
- push_buffer_stats (c, p);
-
snprintf (buf, sizeof (buf), _("Buffers p:%" PRIu32 "%% c:%" PRIu32 "%%"),
session->playback_load(), session->capture_load());
buffer_load_label.set_text (buf);
@@ -2710,6 +2709,20 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na
goto out;
}
+ /* Now the session been created, add the transport controls */
+ new_session->add_controllable(&roll_controllable);
+ new_session->add_controllable(&stop_controllable);
+ new_session->add_controllable(&goto_start_controllable);
+ new_session->add_controllable(&goto_end_controllable);
+ new_session->add_controllable(&auto_loop_controllable);
+ new_session->add_controllable(&play_selection_controllable);
+ new_session->add_controllable(&rec_controllable);
+
+ /* Once the transport controlls have been added, the ControlProtocolManager
+ is okay to instantiate the various protocols. */
+ BootMessage (_("Reset Control Protocols"));
+ ControlProtocolManager::instance().set_session (*new_session);
+
connect_to_session (new_session);
Config->set_current_owner (ConfigVariableBase::Interface);
@@ -3272,62 +3285,11 @@ What you would like to do?\n"));
}
void
-ARDOUR_UI::push_buffer_stats (uint32_t capture, uint32_t playback)
-{
- time_t now;
- time (&now);
-
- while (disk_buffer_stats.size() > 60) {
- disk_buffer_stats.pop_front ();
- }
-
- disk_buffer_stats.push_back (DiskBufferStat (now, capture, playback));
-}
-
-void
-ARDOUR_UI::write_buffer_stats ()
-{
- std::ofstream fout;
- struct tm tm;
- char buf[64];
- char path[PATH_MAX+1]; int fd;
-
- strcpy (path, "ardourBufferingXXXXXX");
-
- if ((fd = mkstemp (path )) < 0) {
- cerr << X_("cannot find temporary name for ardour buffer stats") << endl;
- return;
- }
-
- fout.open (path);
- close (fd);
-
- if (!fout) {
- cerr << string_compose (X_("cannot open file %1 for ardour buffer stats"), path) << endl;
- return;
- }
-
- for (list<DiskBufferStat>::iterator i = disk_buffer_stats.begin(); i != disk_buffer_stats.end(); ++i) {
- localtime_r (&(*i).when, &tm);
- strftime (buf, sizeof (buf), "%T", &tm);
- fout << buf << ' ' << (*i).capture << ' ' << (*i).playback << endl;
- }
-
- disk_buffer_stats.clear ();
-
- fout.close ();
-
- cerr << "buffering statistics can be found in: " << path << endl;
-}
-
-void
ARDOUR_UI::disk_overrun_handler ()
{
ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
- write_buffer_stats ();
-
if (!have_disk_speed_dialog_displayed) {
have_disk_speed_dialog_displayed = true;
MessageDialog* msg = new MessageDialog (*editor, _("\
@@ -3347,8 +3309,6 @@ ARDOUR_UI::disk_underrun_handler ()
ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
- write_buffer_stats ();
-
if (!have_disk_speed_dialog_displayed) {
have_disk_speed_dialog_displayed = true;
MessageDialog* msg = new MessageDialog (*editor,
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 6e0889db9a..8c84e331e5 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -659,19 +659,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
ARDOUR::microseconds_t last_peak_grab;
ARDOUR::microseconds_t last_shuttle_request;
- struct DiskBufferStat {
- time_t when;
- uint32_t capture;
- uint32_t playback;
-
- DiskBufferStat (time_t w, uint32_t c, uint32_t p)
- : when (w), capture (c), playback (p) {}
- };
-
- std::list<DiskBufferStat> disk_buffer_stats;
- void push_buffer_stats (uint32_t, uint32_t);
- void write_buffer_stats ();
-
bool have_disk_speed_dialog_displayed;
void disk_speed_dialog_gone (int ignored_response, Gtk::MessageDialog*);
void disk_overrun_handler ();
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 525ab9c7e6..80d3659370 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -4946,65 +4946,6 @@ Editor::first_idle ()
_have_idled = true;
}
-void
-Editor::start_resize_line_ops ()
-{
-#if 0
- old_resize_line_y = -1;
- resize_line_y = -1;
- need_resize_line = true;
-#endif
-}
-
-void
-Editor::end_resize_line_ops ()
-{
-#if 0
- need_resize_line = false;
-
- if (old_resize_line_y >= 0) {
- Gdk::Rectangle r (0, old_resize_line_y, (int) canvas_width, 3);
- Glib::RefPtr<Gdk::Window> win = get_window();
- cerr << "Final invalidation at " << old_resize_line_y << endl;
- win->invalidate_rect (r, false);
- }
-#endif
-}
-
-void
-Editor::queue_draw_resize_line (int at)
-{
-#if 0
- Glib::RefPtr<Gdk::Window> win = get_window();
-
- resize_line_y = at;
-
- if (win && canvas_width) {
-
- int controls_width = controls_layout.get_width();
- int xroot, discard;
-
- controls_layout.get_window()->get_origin (xroot, discard);
-
- if (old_resize_line_y >= 0) {
-
- /* redraw where it used to be */
-
-
- Gdk::Rectangle r (0, old_resize_line_y - 1, controls_width + (int) canvas_width, 3);
- win->invalidate_rect (r, true);
- cerr << "invalidate " << xroot << "," << old_resize_line_y - 1 << ' '
- << controls_width + canvas_width << " x 3\n";
- }
-
- /* draw where it is */
-
- Gdk::Rectangle r (0, at - 1, controls_width + (int) canvas_width, 3);
- win->invalidate_rect (r, true);
- }
-#endif
-}
-
bool
Editor::on_expose_event (GdkEventExpose* ev)
{
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 7ecab10283..eaa52398d2 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -403,10 +403,6 @@ class Editor : public PublicEditor
void goto_visual_state (uint32_t);
void save_visual_state (uint32_t);
- void queue_draw_resize_line (int at);
- void start_resize_line_ops ();
- void end_resize_line_ops ();
-
protected:
void map_transport_state ();
void map_position_change (nframes64_t);
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index c239a98d52..363dbd3b03 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -620,10 +620,10 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
case SelectionItem:
if (Keyboard::modifier_state_contains
- (event->button.state, Keyboard::ModifierMask(Keyboard::SecondaryModifier))) {
+ (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier))) {
// contains and not equals because I can't use alt as a modifier alone.
start_selection_grab (item, event);
- } else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
+ } else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) {
/* grab selection for moving */
start_selection_op (item, event, SelectionMove);
} else {
@@ -3981,6 +3981,8 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
drag_info.x_constrained = !drag_info.x_constrained;
}
+ cerr << "drag done, copy ? " << drag_info.copy << " x-const ? " << drag_info.x_constrained << endl;
+
if (drag_info.copy) {
if (drag_info.x_constrained) {
op_string = _("fixed time region copy");
@@ -4019,8 +4021,10 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
++i;
continue;
}
+
+ cerr << "drag delta = " << drag_delta << " rpos was " << rv->region()->position() << endl;
- if (changed_position && !drag_info.x_constrained) {
+ if (changed_position && !drag_info.x_constrained && (mouse_mode != MouseRange)) {
where = rv->region()->position() - drag_delta;
} else {
where = rv->region()->position();
@@ -4055,6 +4059,8 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
session->add_command (new MementoCommand<Playlist>(*to_playlist, &to_playlist->get_state(), 0));
}
+ cerr << "Adding region @ " << new_region->position() << " at " << where << endl;
+
to_playlist->add_region (new_region, where);
c.disconnect ();
@@ -4118,7 +4124,9 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
insert_result = modified_playlists.insert (from_playlist);
if (insert_result.second) {
- session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0));
+ if (mouse_mode != MouseRange) {
+ session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0));
+ }
}
from_playlist->remove_region ((rv->region()));
@@ -4386,6 +4394,8 @@ Editor::start_selection_grab (ArdourCanvas::Item* item, GdkEvent* event)
return;
}
+ cerr << "got " << new_regions.size() << " regions in selection grab\n";
+
/* XXX fix me one day to use all new regions */
boost::shared_ptr<Region> region (new_regions.front());
diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h
index 737ae75f6f..690c0a235b 100644
--- a/gtk2_ardour/public_editor.h
+++ b/gtk2_ardour/public_editor.h
@@ -221,10 +221,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
virtual bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*) = 0;
virtual bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*) = 0;
- virtual void queue_draw_resize_line (int at) = 0;
- virtual void start_resize_line_ops () = 0;
- virtual void end_resize_line_ops () = 0;
-
static const int window_border_width;
static const int container_border_width;
static const int vertical_spacing;
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index 69f3e376ed..c0b6a697ad 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -1210,7 +1210,6 @@ TimeAxisView::resizer_button_press (GdkEventButton* event)
{
resize_drag_start = event->y_root;
resize_idle_target = current_height();
- editor.start_resize_line_ops ();
if (resizer_motion_signal) {
resizer_motion_signal.disconnect ();
}
@@ -1222,7 +1221,6 @@ bool
TimeAxisView::resizer_button_release (GdkEventButton* ev)
{
resize_drag_start = -1;
- editor.end_resize_line_ops ();
resizer_motion_signal.disconnect ();
return true;
}
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 5d164c9a81..ded4dc426d 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -349,10 +349,6 @@ Session::second_stage_init (bool new_session)
/* initial program change will be delivered later; see ::config_changed() */
- BootMessage (_("Reset Control Protocols"));
-
- ControlProtocolManager::instance().set_session (*this);
-
if (new_session) {
_end_location_is_free = true;
} else {