diff --git a/SConstruct b/SConstruct
index cb070e2ec5..746809a3c0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -27,6 +27,7 @@ subst_dict = { }
opts = Options('scache.conf')
opts.AddOptions(
('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'),
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),
@@ -37,7 +38,7 @@ opts.AddOptions(
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', 0),
+ BoolOption('FFT_ANALYSIS', 'Include FFT analysis window', 1),
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),
@@ -49,6 +50,7 @@ opts.AddOptions(
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)
)
@@ -441,7 +443,7 @@ deps = \
'samplerate' : '0.1.0',
'raptor' : '1.4.2',
'lrdf' : '0.4.0',
- 'jack' : '0.101.1',
+ 'jack' : '0.109.0',
'libgnomecanvas-2.0' : '2.0'
}
@@ -525,7 +527,7 @@ if env['FFT_ANALYSIS']:
conf = Configure(libraries['fftw3'])
if conf.CheckHeader ('fftw3.h') == False:
- print ('FFT Analysis cannot be compiled without the FFTW3 headers, which do not seem to be installed')
+ print ('Ardour cannot be compiled without the FFTW3 headers, which do not seem to be installed')
sys.exit (1)
conf.Finish()
@@ -561,6 +563,9 @@ libraries['glib2'].ParseConfig ('pkg-config --cflags --libs gobject-2.0')
libraries['glib2'].ParseConfig ('pkg-config --cflags --libs gmodule-2.0')
libraries['glib2'].ParseConfig ('pkg-config --cflags --libs gthread-2.0')
+libraries['freetype2'] = LibraryInfo()
+libraries['freetype2'].ParseConfig ('pkg-config --cflags --libs freetype2')
+
libraries['gtk2'] = LibraryInfo()
libraries['gtk2'].ParseConfig ('pkg-config --cflags --libs gtk+-2.0')
@@ -922,6 +927,26 @@ else:
libraries['dmalloc'] = conf.Finish ()
+#
+# ensure FREEDESKTOP target is doable..
+#
+
+conf = env.Configure ()
+if env['FREEDESKTOP']:
+ have_update_mime_database = conf.TryAction (Action ('update-mime-database -v'))
+ if have_update_mime_database[0] != 1:
+ print "Warning. You have no update-mime-database command in your PATH. FREEDESKTOP is now disabled."
+ env['FREEDESKTOP'] = 0
+ have_gtk_update_icon_cache = conf.TryAction (Action ('gtk-update-icon-cache -?'))
+ if have_gtk_update_icon_cache[0] != 1:
+ print "Warning. You have no gtk-update-icon-cache command in your PATH. FREEDESKTOP is now disabled."
+ env['FREEDESKTOP'] = 0
+ have_update_desktop_database = conf.TryAction (Action ('update-desktop-database -?'))
+ if have_update_desktop_database[0] != 1:
+ print "Warning. You have no update-desktop-database command in your PATH. FREEDESKTOP is now disabled."
+ env['FREEDESKTOP'] = 0
+env = conf.Finish()
+
#
# Audio/MIDI library (needed for MIDI, since audio is all handled via JACK)
#
@@ -1279,7 +1304,8 @@ the_revision = env.Command ('frobnicatory_decoy', [], create_stored_revision)
remove_ardour = env.Command ('frobnicatory_decoy2', [],
[ Delete ('$PREFIX/etc/ardour3'),
Delete ('$PREFIX/lib/ardour3'),
- Delete ('$PREFIX/bin/ardour3')])
+ Delete ('$PREFIX/bin/ardour3'),
+ Delete ('$PREFIX/share/ardour3')])
env.Alias('revision', the_revision)
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour3'), 'ardour_system.rc'))
diff --git a/ardour.rc.in b/ardour.rc.in
index 5c35fd45aa..90da0fd640 100644
--- a/ardour.rc.in
+++ b/ardour.rc.in
@@ -41,6 +41,7 @@
+
diff --git a/ardour_system_sae.rc b/ardour_system_sae.rc
new file mode 100644
index 0000000000..551ee61fca
--- /dev/null
+++ b/ardour_system_sae.rc
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript
index 0d145e9a82..473ba61b08 100644
--- a/gtk2_ardour/SConscript
+++ b/gtk2_ardour/SConscript
@@ -36,6 +36,7 @@ gtkardour.Merge ([
libraries['fftw3'],
libraries['fftw3f'],
libraries['flac'],
+ libraries['freetype2'],
libraries['gdkmm2'],
libraries['glib2'],
libraries['glibmm2'],
@@ -410,12 +411,12 @@ if gtkardour['GTKOSX'] and gtkardour['NATIVE_OSX_KEYS']:
keybindings_dict['%WINDOW%'] = 'Mod1'
else:
#
- # Ctrl, Alt, Shift, Mod3(Meta)
+ # Ctrl, Alt, Shift, Mod4(Super/Windows/Hyper)
#
keybindings_dict['%PRIMARY%'] = 'Ctrl'
keybindings_dict['%SECONDARY%'] = 'Alt'
keybindings_dict['%TERTIARY%'] = 'Shift'
- keybindings_dict['%LEVEL4%'] = 'Mod2'
+ keybindings_dict['%LEVEL4%'] = env['WINDOWS_KEY']
keybindings_dict['%WINDOW%'] = 'Alt'
for b in [ 'SAE-de', 'mnemonic-us', 'ergonomic-us' ]:
@@ -472,9 +473,41 @@ env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour3'), 'SAE-de
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour3'), 'splash.png'))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour3', 'pixmaps'), pixmap_files))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour3', 'icons'), icon_files))
-
env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], []))
-
+
+# This will install icons and MIME type as per freedesktop.org specs. #
+if env['FREEDESKTOP']:
+ desktop_icon_install_prefix = install_prefix + '/share/icons/hicolor'
+ # Install the desktop icons to the default locations #
+ env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '16x16', 'apps', 'ardour2.png'), 'icons/ardour_icon_16px.png'))
+ env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '22x22', 'apps', 'ardour2.png'), 'icons/ardour_icon_22px.png'))
+ env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '32x32', 'apps', 'ardour2.png'), 'icons/ardour_icon_32px.png'))
+ env.Alias('install', env.InstallAs(os.path.join(desktop_icon_install_prefix, '48x48', 'apps', 'ardour2.png'), 'icons/ardour_icon_48px.png'))
+ # Install the mime type xml file and its icon #
+ env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'mime', 'packages'), 'ardour2.xml'))
+ env.Alias('install', env.Install(os.path.join(desktop_icon_install_prefix, '48x48', 'mimetypes'), 'icons/application-x-ardour2.png'))
+ env.Alias('install', env.Command (os.path.join(install_prefix, 'share', 'mime'), [], 'update-mime-database $TARGET'))
+ # Update the icon cache #
+ env.Alias('install', env.Command (desktop_icon_install_prefix, [], 'touch --no-create $TARGET'))
+ env.Alias('install', env.Command (desktop_icon_install_prefix, [], 'gtk-update-icon-cache $TARGET'))
+ # Make the ardour2.desktop file and install it #
+ env.Alias('install', env.Command ('ardour2.desktop', 'ardour2.desktop.in', 'cat $SOURCES > $TARGET'))
+ env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'applications'), 'ardour2.desktop'))
+ env.Alias('install', env.Command (os.path.join(install_prefix, 'share', 'applications'), [], 'update-desktop-database $TARGET'))
+ # uninstall target.. needed to run update-mime-database and update-desktop-database after removal. #`
+ remove_desktop_files = env.Command ('another_frobnicatory_decoy', [],
+ [ Delete (install_prefix + '/share/mime/packages/ardour2.xml'),
+ Delete (install_prefix + '/share/applications/ardour2.desktop'),
+ Delete (desktop_icon_install_prefix + '/16x16/apps/ardour2.png'),
+ Delete (desktop_icon_install_prefix + '/22x22/apps/ardour2.png'),
+ Delete (desktop_icon_install_prefix + '/32x32/apps/ardour2.png'),
+ Delete (desktop_icon_install_prefix + '/48x48/apps/ardour2.png'),
+ Delete (desktop_icon_install_prefix + '/48x48/mimetypes/application-x-ardour2.png'),
+ Action ('update-mime-database ' + install_prefix + '/share/mime'),
+ Action ('gtk-update-icon-cache ' + desktop_icon_install_prefix),
+ Action ('update-desktop-database ' + install_prefix + '/share/applications')])
+ env.Alias('uninstall', remove_desktop_files)
+
#dist
env.Alias ('tarball', env.Distribute (env['DISTTREE'],
[ 'SConscript',
@@ -488,7 +521,9 @@ env.Alias ('tarball', env.Distribute (env['DISTTREE'],
'ardour-sae-ansi.bindings.in',
'ardour-sae-de.bindings.in',
'ardour3_ui_default.conf',
- 'editor_xpms'
+ 'editor_xpms',
+ 'ardour2.xml',
+ 'ardour2.desktop.in'
] +
gtkardour_files +
vst_files +
diff --git a/gtk2_ardour/about.cc b/gtk2_ardour/about.cc
index a76fc3c619..9a1c0d0d45 100644
--- a/gtk2_ardour/about.cc
+++ b/gtk2_ardour/about.cc
@@ -158,6 +158,7 @@ static const char* authors[] = {
N_("Colin Fletcher"),
N_("Roland Stigge"),
N_("Audun Halland"),
+ N_("Armand Klenk"),
0
};
diff --git a/gtk2_ardour/analysis_window.cc b/gtk2_ardour/analysis_window.cc
index 708d92ee56..8f84febbba 100644
--- a/gtk2_ardour/analysis_window.cc
+++ b/gtk2_ardour/analysis_window.cc
@@ -41,9 +41,8 @@
using namespace ARDOUR;
using namespace PBD;
-AnalysisWindow::AnalysisWindow()
- : ArdourDialog(_("analysis window")),
-
+AnalysisWindow::AnalysisWindow() :
+
source_selection_label (_("Signal source")),
source_selection_ranges_rb (_("Selected ranges")),
source_selection_regions_rb (_("Selected regions")),
@@ -51,9 +50,15 @@ AnalysisWindow::AnalysisWindow()
display_model_label (_("Display model")),
display_model_composite_separate_rb (_("Composite graphs for each track")),
display_model_composite_all_tracks_rb (_("Composite graph of all tracks")),
+
+ show_minmax_button (_("Show frequency power range")),
+ show_normalized_button (_("Normalize values")),
- fft_graph (2048)
+ fft_graph (16384)
{
+ set_name(_("FFT analysis window"));
+ set_title(_("FFT analysis window"));
+
track_list_ready = false;
// Left side: track list + controls
@@ -124,17 +129,31 @@ AnalysisWindow::AnalysisWindow()
bind ( mem_fun(*this, &AnalysisWindow::display_model_changed), &display_model_composite_all_tracks_rb));
}
- vbox.pack_start(hseparator2, false, false);
+ // Analyze button
refresh_button.set_name("EditorGTKButton");
- refresh_button.set_label(_("Analyze data"));
+ refresh_button.set_label(_("Re-analyze data"));
refresh_button.signal_clicked().connect ( bind ( mem_fun(*this, &AnalysisWindow::analyze_data), &refresh_button));
vbox.pack_start(refresh_button, false, false, 10);
+
+
+ // Feature checkboxes
+
+ // minmax
+ show_minmax_button.signal_toggled().connect( mem_fun(*this, &AnalysisWindow::show_minmax_changed));
+ vbox.pack_start(show_minmax_button, false, false);
+
+ // normalize
+ show_normalized_button.signal_toggled().connect( mem_fun(*this, &AnalysisWindow::show_normalized_changed));
+ vbox.pack_start(show_normalized_button, false, false);
+
+
+
- hbox.pack_start(vbox);
+ hbox.pack_start(vbox, Gtk::PACK_SHRINK);
// Analysis window on the right
fft_graph.ensure_style();
@@ -144,22 +163,9 @@ AnalysisWindow::AnalysisWindow()
// And last we pack the hbox
- get_vbox()->pack_start(hbox);
-
- hbox.show();
- vbox.show();
- track_list.show();
- source_selection_label.show();
- source_selection_ranges_rb.show();
- source_selection_regions_rb.show();
- hseparator1.show();
- display_model_label.show();
- display_model_composite_separate_rb.show();
- display_model_composite_all_tracks_rb.show();
- hseparator2.show();
- refresh_button.show();
-
- //get_vbox()->show();
+ add(hbox);
+ show_all();
+ track_list.show_all();
}
AnalysisWindow::~AnalysisWindow()
@@ -167,6 +173,18 @@ AnalysisWindow::~AnalysisWindow()
}
+void
+AnalysisWindow::show_minmax_changed()
+{
+ fft_graph.set_show_minmax(show_minmax_button.get_active());
+}
+
+void
+AnalysisWindow::show_normalized_changed()
+{
+ fft_graph.set_show_normalized(show_normalized_button.get_active());
+}
+
void
AnalysisWindow::set_rangemode()
{
diff --git a/gtk2_ardour/analysis_window.h b/gtk2_ardour/analysis_window.h
index cd1243bb6a..45752c4a34 100644
--- a/gtk2_ardour/analysis_window.h
+++ b/gtk2_ardour/analysis_window.h
@@ -31,6 +31,7 @@
#include
#include
#include
+#include
#include
@@ -42,7 +43,7 @@
#include "fft_result.h"
-class AnalysisWindow : public ArdourDialog
+class AnalysisWindow : public Gtk::Window
{
public:
AnalysisWindow ();
@@ -55,12 +56,18 @@ class AnalysisWindow : public ArdourDialog
void analyze ();
+ const void set_session(ARDOUR::Session *session) { _session = session; };
+
private:
+ ARDOUR::Session *_session;
+
void clear_tracklist();
void source_selection_changed (Gtk::RadioButton *);
void display_model_changed (Gtk::RadioButton *);
+ void show_minmax_changed ();
+ void show_normalized_changed ();
void analyze_data (Gtk::Button *);
@@ -88,7 +95,8 @@ class AnalysisWindow : public ArdourDialog
Gtk::TreeView track_list;
Gtk::Label source_selection_label;
-
+
+
Gtk::RadioButton source_selection_ranges_rb;
Gtk::RadioButton source_selection_regions_rb;
@@ -98,9 +106,13 @@ class AnalysisWindow : public ArdourDialog
Gtk::RadioButton display_model_composite_separate_rb;
Gtk::RadioButton display_model_composite_all_tracks_rb;
- Gtk::HSeparator hseparator2;
-
Gtk::Button refresh_button;
+
+
+ Gtk::CheckButton show_minmax_button;
+ Gtk::CheckButton show_normalized_button;
+
+
// The graph
FFTGraph fft_graph;
diff --git a/gtk2_ardour/ardour-sae.menus b/gtk2_ardour/ardour-sae.menus
index e8b8a20b5e..0c84bcc114 100644
--- a/gtk2_ardour/ardour-sae.menus
+++ b/gtk2_ardour/ardour-sae.menus
@@ -11,7 +11,6 @@
-
+
+
-
+
+
+
-
-
-
+
-
@@ -126,11 +133,14 @@
+
+
+
-
-
+
@@ -275,7 +275,7 @@
-
+
@@ -298,7 +298,7 @@
-
+
@@ -456,6 +456,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gtk2_ardour/ardour2.desktop.in b/gtk2_ardour/ardour2.desktop.in
new file mode 100644
index 0000000000..b5911e89b4
--- /dev/null
+++ b/gtk2_ardour/ardour2.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Ardour
+Comment=Ardour Digital Audio Workstation
+Exec=ardour2
+Icon=ardour2
+Terminal=false
+MimeType=application/x-ardour2;
+Type=Application
+Categories=AudioVideo;Audio;X-Recorders;X-Multitrack;X-Jack;
diff --git a/gtk2_ardour/ardour2.xml b/gtk2_ardour/ardour2.xml
new file mode 100644
index 0000000000..dd1c46ecf2
--- /dev/null
+++ b/gtk2_ardour/ardour2.xml
@@ -0,0 +1,8 @@
+
+
+
+
+ Ardour session file
+
+
+
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index f7a6c43b0f..421906fbfc 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -36,7 +36,6 @@
#include
#include
-#include
#include
#include
#include
@@ -208,8 +207,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
have_disk_speed_dialog_displayed = false;
session_loaded = false;
last_speed_displayed = -1.0f;
-
- sys::path key_bindings_file;
+ ignore_dual_punch = false;
last_configure_time.tv_sec = 0;
last_configure_time.tv_usec = 0;
@@ -256,6 +254,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
keyboard = new Keyboard;
+ reset_dpi();
+
starting.connect (mem_fun(*this, &ARDOUR_UI::startup));
stopping.connect (mem_fun(*this, &ARDOUR_UI::shutdown));
@@ -641,7 +641,6 @@ ARDOUR_UI::startup ()
}
BootMessage (_("Ardour is ready for use"));
-
show ();
}
@@ -2245,6 +2244,28 @@ ARDOUR_UI::loading_message (const std::string& msg)
flush_pending ();
}
+void
+ARDOUR_UI::idle_load (const Glib::ustring& path)
+{
+ if (session) {
+ if (Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) {
+ /* /path/to/foo => /path/to/foo, foo */
+ load_session (path, basename_nosuffix (path));
+ } else {
+ /* /path/to/foo/foo.ardour => /path/to/foo, foo */
+ load_session (Glib::path_get_dirname (path), basename_nosuffix (path));
+ }
+ } else {
+ ARDOUR_COMMAND_LINE::session_name = path;
+ if (new_session_dialog) {
+ /* make it break out of Dialog::run() and
+ start again.
+ */
+ new_session_dialog->response (1);
+ }
+ }
+}
+
bool
ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be_new)
{
@@ -2252,8 +2273,10 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
Glib::ustring session_name;
Glib::ustring session_path;
Glib::ustring template_name;
+ int response;
- int response = Gtk::RESPONSE_NONE;
+ begin:
+ response = Gtk::RESPONSE_NONE;
if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
@@ -2297,6 +2320,13 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
/* handle possible negative responses */
switch (response) {
+ case 1:
+ /* sent by idle_load, meaning restart the whole process again */
+ new_session_dialog->hide();
+ new_session_dialog->reset();
+ goto begin;
+ break;
+
case Gtk::RESPONSE_CANCEL:
case Gtk::RESPONSE_DELETE_EVENT:
if (!session) {
@@ -2475,7 +2505,6 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na
}
loading_message (_("Please wait while Ardour loads your session"));
- disable_screen_updates ();
try {
new_session = new Session (*engine, path, snap_name, mix_template);
@@ -2547,7 +2576,6 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na
session->set_clean ();
}
- enable_screen_updates ();
flush_pending ();
retval = 0;
@@ -3249,6 +3277,11 @@ ARDOUR_UI::first_idle ()
if (session) {
session->allow_auto_play (true);
}
+
+ if (editor) {
+ editor->first_idle();
+ }
+
Keyboard::set_can_save_keybindings (true);
return false;
}
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index d35d87a423..0eb02d8821 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -100,6 +100,7 @@ namespace ALSA {
#define FRAME_NAME "BaseFrame"
extern sigc::signal ColorsChanged;
+extern sigc::signal DPIReset;
class ARDOUR_UI : public Gtkmm2ext::UI
{
@@ -116,7 +117,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void show_about ();
void hide_about ();
- int load_session (const Glib::ustring & path, const Glib::ustring& snapshot, Glib::ustring mix_template = Glib::ustring());
+ void idle_load (const Glib::ustring& path);
+ int load_session (const Glib::ustring& path, const Glib::ustring& snapshot, Glib::ustring mix_template = Glib::ustring());
bool session_loaded;
int build_session (const Glib::ustring& path, const Glib::ustring& snapshot,
uint32_t ctl_chns,
@@ -249,6 +251,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void toggle_clocking ();
void toggle_auto_play ();
void toggle_auto_input ();
+ void toggle_punch ();
+ void unset_dual_punch ();
+ bool ignore_dual_punch;
void toggle_punch_in ();
void toggle_punch_out ();
void toggle_auto_return ();
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index ca0615cbef..959d5fc128 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -881,6 +881,7 @@ ARDOUR_UI::editor_realized ()
set_size_request_to_display_given_text (speed_display_box, _("-0.55"), 2, 2);
const guint32 FUDGE = 25; // Combo's are stupid - they steal space from the entry for the button
set_size_request_to_display_given_text (shuttle_style_button, _("sprung"), 2+FUDGE, 10);
+ reset_dpi();
}
void
diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc
index 0d410cd526..32b9f5adc7 100644
--- a/gtk2_ardour/ardour_ui_dialogs.cc
+++ b/gtk2_ardour/ardour_ui_dialogs.cc
@@ -80,7 +80,6 @@ ARDOUR_UI::connect_to_session (Session *s)
/* there are never any selections on startup */
- ActionManager::set_sensitive (ActionManager::region_selection_sensitive_actions, false);
ActionManager::set_sensitive (ActionManager::time_selection_sensitive_actions, false);
ActionManager::set_sensitive (ActionManager::track_selection_sensitive_actions, false);
ActionManager::set_sensitive (ActionManager::line_selection_sensitive_actions, false);
@@ -182,6 +181,7 @@ ARDOUR_UI::unload_session (bool hide_stuff)
if (hide_stuff) {
editor->hide ();
mixer->hide ();
+ theme_manager->hide ();
}
second_connection.disconnect ();
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index 6f2ead2b79..65457068d2 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -86,7 +86,6 @@ ARDOUR_UI::install_actions ()
ActionManager::register_action (main_actions, X_("Session"), _("Session"));
ActionManager::register_action (main_actions, X_("Files"), _("Import/Export"));
- ActionManager::register_action (main_actions, X_("Regions"), _("Regions"));
ActionManager::register_action (main_actions, X_("Cleanup"), _("Cleanup"));
ActionManager::register_action (main_actions, X_("Sync"), _("Sync"));
ActionManager::register_action (main_actions, X_("Options"), _("Options"));
@@ -189,7 +188,7 @@ ARDOUR_UI::install_actions ()
/* these actions are intended to be shared across all windows */
common_actions = ActionGroup::create (X_("Common"));
- ActionManager::register_action (main_actions, X_("Windows"), _("Windows"));
+ ActionManager::register_action (main_actions, X_("WindowMenu"), _("Window"));
ActionManager::register_action (common_actions, X_("Quit"), _("Quit"), (mem_fun(*this, &ARDOUR_UI::finish)));
/* windows visibility actions */
@@ -332,6 +331,9 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_toggle_action (transport_actions, X_("TogglePunchOut"), _("Punch Out"), mem_fun(*this, &ARDOUR_UI::toggle_punch_out));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
+ act = ActionManager::register_toggle_action (transport_actions, X_("TogglePunch"), _("Punch In/Out"), mem_fun(*this, &ARDOUR_UI::toggle_punch));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (transport_actions, X_("ToggleClick"), _("Click"), mem_fun(*this, &ARDOUR_UI::toggle_click));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index 6b1eb3e299..4b75e59614 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -391,6 +391,52 @@ ARDOUR_UI::toggle_session_auto_loop ()
}
}
+void
+ARDOUR_UI::unset_dual_punch ()
+{
+ Glib::RefPtr action = ActionManager::get_action ("Transport", "TogglePunch");
+
+ if (action) {
+ Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(action);
+ if (tact) {
+ ignore_dual_punch = true;
+ tact->set_active (false);
+ ignore_dual_punch = false;
+ }
+ }
+}
+
+void
+ARDOUR_UI::toggle_punch ()
+{
+ if (ignore_dual_punch) {
+ return;
+ }
+
+ Glib::RefPtr action = ActionManager::get_action ("Transport", "TogglePunch");
+
+ if (action) {
+
+ Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(action);
+
+ if (!tact) {
+ return;
+ }
+
+ /* drive the other two actions from this one */
+
+ Glib::RefPtr in_action = ActionManager::get_action ("Transport", "TogglePunchIn");
+ Glib::RefPtr out_action = ActionManager::get_action ("Transport", "TogglePunchOut");
+
+ if (in_action && out_action) {
+ Glib::RefPtr tiact = Glib::RefPtr::cast_dynamic(in_action);
+ Glib::RefPtr toact = Glib::RefPtr::cast_dynamic(out_action);
+ tiact->set_active (tact->get_active());
+ toact->set_active (tact->get_active());
+ }
+ }
+}
+
void
ARDOUR_UI::toggle_punch_in ()
{
@@ -1015,10 +1061,13 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
} else if (PARAM_IS ("send-mtc")) {
ActionManager::map_some_state ("options", "SendMTC", &Configuration::get_send_mtc);
+ cerr << "Send MMC = " << Config->get_send_mmc() << endl;
} else if (PARAM_IS ("send-mmc")) {
+
ActionManager::map_some_state ("options", "SendMMC", &Configuration::get_send_mmc);
+ cerr << "Send MMC = " << Config->get_send_mmc() << endl;
} else if (PARAM_IS ("use-osc")) {
@@ -1034,6 +1083,8 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
} else if (PARAM_IS ("mmc-control")) {
ActionManager::map_some_state ("options", "UseMMC", &Configuration::get_mmc_control);
+ cerr << "Use MMC = " << Config->get_mmc_control() << endl;
+
} else if (PARAM_IS ("midi-feedback")) {
ActionManager::map_some_state ("options", "SendMIDIfeedback", &Configuration::get_midi_feedback);
} else if (PARAM_IS ("do-not-record-plugins")) {
@@ -1056,8 +1107,14 @@ ARDOUR_UI::parameter_changed (const char* parameter_name)
ActionManager::map_some_state ("options", "ToggleTapeMachineMode", &Configuration::get_tape_machine_mode);
} else if (PARAM_IS ("punch-out")) {
ActionManager::map_some_state ("Transport", "TogglePunchOut", &Configuration::get_punch_out);
+ if (!Config->get_punch_out()) {
+ unset_dual_punch ();
+ }
} else if (PARAM_IS ("punch-in")) {
ActionManager::map_some_state ("Transport", "TogglePunchIn", &Configuration::get_punch_in);
+ if (!Config->get_punch_in()) {
+ unset_dual_punch ();
+ }
} else if (PARAM_IS ("clicking")) {
ActionManager::map_some_state ("Transport", "ToggleClick", &Configuration::get_clicking);
} else if (PARAM_IS ("jack-time-master")) {
diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm
index 4dfa62275a..3f71f126f5 100644
--- a/gtk2_ardour/au_pluginui.mm
+++ b/gtk2_ardour/au_pluginui.mm
@@ -341,8 +341,6 @@ AUPluginUI::get_nswindow ()
void
AUPluginUI::activate ()
{
- cerr << "AUPluginUI:: activate!\n";
- return;
if (carbon_window && cocoa_parent) {
cerr << "APP activated, activate carbon window " << insert->name() << endl;
_activating_from_app = true;
@@ -392,7 +390,7 @@ AUPluginUI::carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event)
break;
case kEventWindowHandleDeactivate:
- cerr << "carbon window for " << insert->name() << " deactivated\n";
+ cerr << "carbon window for " << insert->name() << " would have been deactivated\n";
// never deactivate the carbon window
return noErr;
break;
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index 787f70a993..e1b80cc073 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -500,15 +500,21 @@ AudioClock::set_frames (nframes_t when, bool force)
sprintf (buf, "%.3fK", rate/1000.0f);
}
- frames_upper_info_label->set_text (buf);
+ if (frames_upper_info_label->get_text() != buf) {
+ frames_upper_info_label->set_text (buf);
+ }
float vid_pullup = Config->get_video_pullup();
if (vid_pullup == 0.0) {
- frames_lower_info_label->set_text(_("none"));
+ if (frames_lower_info_label->get_text () != _("none")) {
+ frames_lower_info_label->set_text(_("none"));
+ }
} else {
sprintf (buf, "%-6.4f", vid_pullup);
- frames_lower_info_label->set_text (buf);
+ if (frames_lower_info_label->get_text() != buf) {
+ frames_lower_info_label->set_text (buf);
+ }
}
}
}
@@ -598,7 +604,9 @@ AudioClock::set_smpte (nframes_t when, bool force)
sprintf (buf, "%.2f", smpte_frames);
}
- smpte_upper_info_label->set_text (buf);
+ if (smpte_upper_info_label->get_text() != buf) {
+ smpte_upper_info_label->set_text (buf);
+ }
if ((fabs(smpte_frames - 29.97) < 0.0001) || smpte_frames == 30) {
if (session->smpte_drop_frames()) {
@@ -611,7 +619,9 @@ AudioClock::set_smpte (nframes_t when, bool force)
buf[0] = '\0';
}
- smpte_lower_info_label->set_text (buf);
+ if (smpte_lower_info_label->get_text() != buf) {
+ smpte_lower_info_label->set_text (buf);
+ }
}
}
@@ -632,9 +642,13 @@ AudioClock::set_bbt (nframes_t when, bool force)
if (bbt_upper_info_label) {
TempoMap::Metric m (session->tempo_map().metric_at (when));
sprintf (buf, "%-5.2f", m.tempo().beats_per_minute());
- bbt_lower_info_label->set_text (buf);
+ if (bbt_lower_info_label->get_text() != buf) {
+ bbt_lower_info_label->set_text (buf);
+ }
sprintf (buf, "%g|%g", m.meter().beats_per_bar(), m.meter().note_divisor());
- bbt_upper_info_label->set_text (buf);
+ if (bbt_upper_info_label->get_text() != buf) {
+ bbt_upper_info_label->set_text (buf);
+ }
}
}
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index a98958f8a8..c9943e1e96 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -143,7 +143,7 @@ AudioRegionView::init (Gdk::Color& basic_color, bool wfd)
}
compute_colors (basic_color);
-
+
create_waves ();
fade_in_shape = new ArdourCanvas::Polygon (*group);
@@ -800,7 +800,7 @@ AudioRegionView::set_envelope_visible (bool yn)
void
AudioRegionView::create_waves ()
{
- //cerr << "AudioRegionView::create_waves() called on " << this << endl;//DEBUG
+ // cerr << "AudioRegionView::create_waves() called on " << this << endl;//DEBUG
RouteTimeAxisView& atv (*(dynamic_cast(&trackview))); // ick
if (!atv.get_diskstream()) {
diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h
index 01ec7c95ce..10b0254337 100644
--- a/gtk2_ardour/audio_region_view.h
+++ b/gtk2_ardour/audio_region_view.h
@@ -63,6 +63,8 @@ class AudioRegionView : public RegionView
boost::shared_ptr audio_region() const;
void set_y_position_and_height (double, double);
+ void create_waves ();
+
void set_samples_per_unit (double);
void set_amplitude_above_axis (gdouble spp);
@@ -72,8 +74,8 @@ class AudioRegionView : public RegionView
void set_envelope_visible (bool);
void set_waveform_visible (bool yn);
- void set_waveform_shape (WaveformShape);
- void set_waveform_scale (WaveformScale);
+ void set_waveform_shape (Editing::WaveformShape);
+ void set_waveform_scale (Editing::WaveformScale);
bool waveform_rectified() const { return _flags & WaveformRectified; }
bool waveform_logscaled() const { return _flags & WaveformLogScaled; }
@@ -150,7 +152,6 @@ class AudioRegionView : public RegionView
void region_scale_amplitude_changed ();
void region_renamed ();
- void create_waves ();
void create_one_wave (uint32_t, bool);
void manage_zero_line ();
void peaks_ready_handler (uint32_t);
diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc
index a21de27b46..08ac532319 100644
--- a/gtk2_ardour/audio_streamview.cc
+++ b/gtk2_ardour/audio_streamview.cc
@@ -466,8 +466,9 @@ AudioStreamView::set_show_waveforms (bool yn)
{
for (list::iterator i = region_views.begin(); i != region_views.end(); ++i) {
AudioRegionView* const arv = dynamic_cast(*i);
- if (arv)
+ if (arv) {
arv->set_waveform_visible (yn);
+ }
}
}
diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h
index bd56b371a3..326a05f240 100644
--- a/gtk2_ardour/audio_streamview.h
+++ b/gtk2_ardour/audio_streamview.h
@@ -26,7 +26,7 @@
#include
#include
-#include "enums.h"
+#include "editing.h"
#include "simplerect.h"
#include "streamview.h"
@@ -57,10 +57,10 @@ class AudioStreamView : public StreamView
AudioStreamView (AudioTimeAxisView&);
~AudioStreamView ();
- void set_waveform_shape (WaveformShape);
- WaveformShape get_waveform_shape () const { return _waveform_shape; }
- void set_waveform_scale (WaveformScale);
- WaveformScale get_waveform_scale () const { return _waveform_scale; }
+ void set_waveform_shape (Editing::WaveformShape);
+ Editing::WaveformShape get_waveform_shape () const { return _waveform_shape; }
+ void set_waveform_scale (Editing::WaveformScale);
+ Editing::WaveformScale get_waveform_scale () const { return _waveform_scale; }
int set_samples_per_unit (gdouble spp);
@@ -106,8 +106,8 @@ class AudioStreamView : public StreamView
CrossfadeViewList crossfade_views;
bool crossfades_visible;
- WaveformShape _waveform_shape;
- WaveformScale _waveform_scale;
+ Editing::WaveformShape _waveform_shape;
+ Editing::WaveformScale _waveform_scale;
map, bool> rec_data_ready_map;
};
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 34566d4de2..8eea568b7b 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -73,7 +73,6 @@ using namespace PBD;
using namespace Gtk;
using namespace Editing;
-
AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::shared_ptr rt, Canvas& canvas)
: AxisView(sess)
, RouteTimeAxisView(ed, sess, rt, canvas)
@@ -115,16 +114,29 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
/* ask for notifications of any new RegionViews */
_view->RegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
- _view->attach ();
- }
- post_construct ();
+ if (!editor.have_idled()) {
+ /* first idle will do what we need */
+ } else {
+ first_idle ();
+ }
+
+ } else {
+ post_construct ();
+ }
}
AudioTimeAxisView::~AudioTimeAxisView ()
{
}
+void
+AudioTimeAxisView::first_idle ()
+{
+ _view->attach ();
+ post_construct ();
+}
+
AudioStreamView*
AudioTimeAxisView::audio_view()
{
@@ -457,24 +469,26 @@ AudioTimeAxisView::update_control_names ()
{
if (is_audio_track()) {
if (_route->active()) {
- controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
controls_base_selected_name = "AudioTrackControlsBaseSelected";
controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
} else {
- controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
}
} else {
if (_route->active()) {
- controls_ebox.set_name ("BusControlsBaseUnselected");
controls_base_selected_name = "BusControlsBaseSelected";
controls_base_unselected_name = "BusControlsBaseUnselected";
} else {
- controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
controls_base_selected_name = "BusControlsBaseInactiveSelected";
controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
}
}
+
+ if (get_selected()) {
+ controls_ebox.set_name (controls_base_selected_name);
+ } else {
+ controls_ebox.set_name (controls_base_unselected_name);
+ }
}
diff --git a/gtk2_ardour/audio_time_axis.h b/gtk2_ardour/audio_time_axis.h
index cb19be0b75..565d7cda9f 100644
--- a/gtk2_ardour/audio_time_axis.h
+++ b/gtk2_ardour/audio_time_axis.h
@@ -36,6 +36,7 @@
#include "ardour_dialog.h"
#include "route_ui.h"
#include "enums.h"
+#include "editing.h"
#include "route_time_axis.h"
#include "canvas.h"
@@ -83,6 +84,11 @@ class AudioTimeAxisView : public RouteTimeAxisView
void create_automation_child (ARDOUR::Parameter param, bool show);
+ void first_idle ();
+
+ void set_waveform_shape (Editing::WaveformShape);
+ void set_waveform_scale (Editing::WaveformScale);
+
private:
friend class AudioStreamView;
friend class AudioRegionView;
@@ -93,9 +99,7 @@ class AudioTimeAxisView : public RouteTimeAxisView
Gtk::Menu* build_mode_menu();
void toggle_show_waveforms ();
- void set_waveform_shape (WaveformShape);
void toggle_waveforms ();
- void set_waveform_scale (WaveformScale);
void show_all_automation ();
void show_existing_automation ();
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index d5805aa3af..81e4d34989 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -462,6 +462,12 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
double tx = points[pi].x;
double ty = points[pi].y;
+
+ if (isnan (tx) || isnan (ty)) {
+ warning << string_compose (_("Ignoring illegal points on AutomationLine \"%1\""),
+ _name) << endmsg;
+ continue;
+ }
/* now ensure that the control_points vector reflects the current curve
state, but don't plot control points too close together. also, don't
@@ -1059,7 +1065,7 @@ AutomationLine::reset_callback (const AutomationList& events)
AutomationList::const_iterator ai;
for (ai = events.const_begin(); ai != events.const_end(); ++ai) {
-
+
double translated_y = (*ai)->value;
model_to_view_y (translated_y);
diff --git a/gtk2_ardour/canvas-imageframe.c b/gtk2_ardour/canvas-imageframe.c
index e0f0f2f743..1f0e7e877b 100644
--- a/gtk2_ardour/canvas-imageframe.c
+++ b/gtk2_ardour/canvas-imageframe.c
@@ -456,8 +456,6 @@ static void
gnome_canvas_imageframe_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
int x, int y, int width, int height)
{
- fprintf(stderr, "please don't use the CanvasImageFrame item in a non-aa Canvas\n") ;
- abort() ;
}
static double
diff --git a/gtk2_ardour/canvas-simpleline.c b/gtk2_ardour/canvas-simpleline.c
index b65693a548..576eedc369 100644
--- a/gtk2_ardour/canvas-simpleline.c
+++ b/gtk2_ardour/canvas-simpleline.c
@@ -1,5 +1,6 @@
#include
#include
+#include
#include
#include "canvas-simpleline.h"
@@ -400,15 +401,54 @@ gnome_canvas_simpleline_draw (GnomeCanvasItem *item,
int width, int height)
{
GnomeCanvasSimpleLine *simpleline;
+ cairo_t* cr;
+ double ulx;
+ double uly;
+ double lrx;
+ double lry;
simpleline = GNOME_CANVAS_SIMPLELINE (item);
- if (parent_class->draw) {
- (* parent_class->draw) (item, drawable, x, y, width, height);
+ cr = gdk_cairo_create (drawable);
+
+ if (x > simpleline->bbox_ulx) {
+ ulx = x;
+ } else {
+ ulx = simpleline->bbox_ulx;
}
- fprintf (stderr, "please don't use the CanvasSimpleLine item in a non-aa Canvas\n");
- abort ();
+ if (y > simpleline->bbox_uly) {
+ uly = y;
+ } else {
+ uly = simpleline->bbox_uly;
+ }
+
+ if (x + width > simpleline->bbox_lrx) {
+ lrx = simpleline->bbox_lrx;
+ } else {
+ lrx = x + width;
+ }
+
+ if (y + height > simpleline->bbox_lry) {
+ lry = simpleline->bbox_lry;
+ } else {
+ lry = y + height;
+ }
+
+ ulx -= x;
+ uly -= y;
+ lrx -= x;
+ lry -= y;
+
+ cairo_set_source_rgba (cr,
+ simpleline->r/255.0,
+ simpleline->g/255.0,
+ simpleline->b/255.0,
+ simpleline->a/255.0);
+ cairo_set_line_width (cr, 1);
+ cairo_move_to (cr, ulx+0.5, uly+0.5);
+ cairo_line_to (cr, lrx+0.5, lry+0.5);
+ cairo_stroke (cr);
}
static void
@@ -433,17 +473,17 @@ gnome_canvas_simpleline_point (GnomeCanvasItem *item, double x, double y, int cx
*actual_item = item;
- /* Find the bounds for the rectangle plus its outline width */
+ /* Find the bounds for the line plus its outline width */
gnome_canvas_simpleline_bounds (item, &x1, &y1, &x2, &y2);
- /* Is point inside rectangle */
+ /* Is point inside line */
if ((x >= x1) && (y >= y1) && (x <= x2) && (y <= y2)) {
return 0.0;
}
- /* Point is outside rectangle */
+ /* Point is outside line */
if (x < x1)
dx = x1 - x;
diff --git a/gtk2_ardour/canvas-simplerect.c b/gtk2_ardour/canvas-simplerect.c
index d50943f0c3..91649b64bb 100644
--- a/gtk2_ardour/canvas-simplerect.c
+++ b/gtk2_ardour/canvas-simplerect.c
@@ -1,5 +1,6 @@
#include
#include
+#include
#include
#include "canvas-simplerect.h"
@@ -287,7 +288,7 @@ gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x1, y1, &simplerect->bbox_ulx, &simplerect->bbox_uly);
gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x2, y2, &simplerect->bbox_lrx, &simplerect->bbox_lry);
- /* now queue redraws for changed areas */
+ /* now queue redraws for changed areas */
if (item->x1 == old_x1 && item->x2 == old_x2) {
@@ -714,12 +715,111 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
static void
gnome_canvas_simplerect_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height)
+ GdkDrawable *drawable,
+ int x, int y,
+ int width, int height)
{
- fprintf (stderr, "please don't use the CanvasSimpleRect item in a non-aa Canvas\n");
- abort ();
+ GnomeCanvasSimpleRect *simplerect;
+ cairo_t* cr;
+ double ulx;
+ double uly;
+ double lrx;
+ double lry;
+
+ simplerect = GNOME_CANVAS_SIMPLERECT (item);
+
+ cr = gdk_cairo_create (drawable);
+
+ if (x > simplerect->bbox_ulx) {
+ ulx = x;
+ } else {
+ ulx = simplerect->bbox_ulx;
+ }
+
+ if (y > simplerect->bbox_uly) {
+ uly = y;
+ } else {
+ uly = simplerect->bbox_uly;
+ }
+
+ if (x + width > simplerect->bbox_lrx) {
+ lrx = simplerect->bbox_lrx;
+ } else {
+ lrx = x + width;
+ }
+
+ if (y + height > simplerect->bbox_lry) {
+ lry = simplerect->bbox_lry;
+ } else {
+ lry = y + height;
+ }
+
+ ulx -= x;
+ uly -= y;
+ lrx -= x;
+ lry -= y;
+
+ cairo_rectangle (cr, ulx, uly, lrx - ulx, lry - uly);
+
+ if (simplerect->fill) {
+ cairo_set_source_rgba (cr,
+ simplerect->fill_r/255.0,
+ simplerect->fill_g/255.0,
+ simplerect->fill_b/255.0,
+ simplerect->fill_a/255.0);
+ cairo_fill (cr);
+ }
+
+ if (simplerect->outline_what && simplerect->outline_pixels) {
+
+#define x_in_range(a) (x <= (a) && (a) < x + width)
+#define y_in_range(a) (y <= (a) && (a) < y + height)
+
+ cairo_set_line_width (cr, simplerect->outline_pixels);
+
+ cairo_set_source_rgb (cr,
+ simplerect->outline_r/255.0,
+ simplerect->outline_g/255.0,
+ simplerect->outline_b/255.0);
+
+ if (simplerect->outline_what & 0x1) {
+ /* left edge, if visible */
+ if (x_in_range (simplerect->bbox_ulx)) {
+ cairo_move_to (cr, ulx+0.5, uly+0.5);
+ cairo_line_to (cr, ulx+0.5, lry+0.5);
+ cairo_stroke (cr);
+ }
+ }
+
+ if (simplerect->outline_what & 0x2) {
+ /* right edge, if visible */
+ if (x_in_range (simplerect->bbox_lrx)) {
+ cairo_move_to (cr, lrx+0.5, uly+0.5);
+ cairo_line_to (cr, lrx+0.5, lry+0.5);
+ cairo_stroke (cr);
+ }
+ }
+
+ if (simplerect->outline_what & 0x4) {
+ /* top edge */
+ if (y_in_range (simplerect->bbox_uly)) {
+ cairo_move_to (cr, ulx+0.5, uly+0.5);
+ cairo_line_to (cr, lrx+0.5, uly+0.5);
+ cairo_stroke (cr);
+ }
+ }
+
+ if (simplerect->outline_what & 0x8) {
+ /* bottom edge */
+ if (y_in_range (simplerect->bbox_lry)) {
+ cairo_move_to (cr, ulx+0.5, lry+0.5);
+ cairo_line_to (cr, lrx+0.5, lry+0.5);
+ cairo_stroke (cr);
+ }
+ }
+ }
+
+ cairo_destroy (cr);
}
static double
diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c
index 2f721dc8d6..dee5706c51 100644
--- a/gtk2_ardour/canvas-waveview.c
+++ b/gtk2_ardour/canvas-waveview.c
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
#include
#include
@@ -1600,22 +1601,228 @@ gnome_canvas_waveview_render (GnomeCanvasItem *item,
static void
gnome_canvas_waveview_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
- int x, int y,
- int width, int height)
+ GdkDrawable *drawable,
+ int x, int y,
+ int width, int height)
{
GnomeCanvasWaveView *waveview;
+ cairo_t* cr;
+ gulong s1, s2;
+ int cache_index;
+ double zbegin, zend;
+ gboolean rectify;
+ double n;
+ double origin;
+ double clip_length;
+ double xoff;
+ double yoff;
+ double ulx;
+ double uly;
+ double lrx;
+ double lry;
waveview = GNOME_CANVAS_WAVEVIEW (item);
- if (parent_class->draw) {
- (* parent_class->draw) (item, drawable, x, y, width, height);
+ /* compute intersection of Drawable area and waveview,
+ in canvas coordinate space
+ */
+
+ if (x > waveview->bbox_ulx) {
+ ulx = x;
+ zbegin = ulx;
+ } else {
+ ulx = waveview->bbox_ulx;
+ zbegin = ulx + 1;
}
- fprintf (stderr, "please don't use the CanvasWaveView item in a non-aa Canvas\n");
- abort ();
+ if (y > waveview->bbox_uly) {
+ uly = y;
+ } else {
+ uly = waveview->bbox_uly;
+ }
+
+ if (x + width > waveview->bbox_lrx) {
+ lrx = waveview->bbox_lrx;
+ zend = lrx - 1;
+ } else {
+ lrx = x + width;
+ zend = lrx;
+ }
+
+ if (y + height > waveview->bbox_lry) {
+ lry = waveview->bbox_lry;
+ } else {
+ lry = y + height;
+ }
+
+ /* figure out which samples we need for the resulting intersection */
+
+ s1 = floor ((ulx - waveview->bbox_ulx) * waveview->samples_per_unit) ;
+
+ if (lrx == waveview->bbox_lrx) {
+ /* This avoids minor rounding errors when we have the
+ entire region visible.
+ */
+ s2 = waveview->samples;
+ } else {
+ s2 = s1 + floor ((lrx - ulx) * waveview->samples_per_unit);
+ }
+
+ /* translate back to buffer coordinate space */
+
+ ulx -= x;
+ uly -= y;
+ lrx -= x;
+ lry -= y;
+ zbegin -= x;
+ zend -= x;
+
+ /* don't rectify at single-sample zoom */
+ if(waveview->rectified && waveview->samples_per_unit > 1.0) {
+ rectify = TRUE;
+ } else {
+ rectify = FALSE;
+ }
+
+ clip_length = MIN(5,(waveview->height/4));
+
+ cr = gdk_cairo_create (drawable);
+ cairo_set_line_width (cr, 0.5);
+
+ origin = waveview->bbox_uly - y + waveview->half_height;
+
+ cairo_rectangle (cr, ulx, uly, lrx - ulx, lry - uly);
+ cairo_clip (cr);
+
+ if (waveview->cache_updater && waveview->reload_cache_in_render) {
+ waveview->cache->start = 0;
+ waveview->cache->end = 0;
+ waveview->reload_cache_in_render = FALSE;
+ }
+
+ cache_index = gnome_canvas_waveview_ensure_cache (waveview, s1, s2);
+
+#if 0
+ printf ("%p r (%d,%d)(%d,%d)[%d x %d] bbox (%d,%d)(%d,%d)[%d x %d]"
+ " draw (%.1f,%.1f)(%.1f,%.1f)[%.1f x %.1f] s= %lu..%lu\n",
+ waveview,
+ x, y,
+ x + width,
+ y + height,
+ width,
+ height,
+ waveview->bbox_ulx,
+ waveview->bbox_uly,
+ waveview->bbox_lrx,
+ waveview->bbox_lry,
+ waveview->bbox_lrx - waveview->bbox_ulx,
+ waveview->bbox_lry - waveview->bbox_uly,
+ ulx, uly,
+ lrx, lry,
+ lrx - ulx,
+ lry - uly,
+ s1, s2);
+#endif
+
+ /* draw the top half */
+
+ for (xoff = ulx; xoff < lrx; xoff++) {
+ double max, min;
+
+ max = waveview->cache->data[cache_index].max;
+ min = waveview->cache->data[cache_index].min;
+
+ if (min <= -1.0) {
+ min = -1.0;
+ }
+
+ if (max >= 1.0) {
+ max = 1.0;
+ }
+
+ if (rectify) {
+ if (fabs (min) > fabs (max)) {
+ max = fabs (min);
+ }
+ }
+
+ yoff = origin - (waveview->half_height * max) + 0.5;
+
+ if (n == ulx) {
+ cairo_move_to (cr, xoff+0.5, yoff);
+ } else {
+ cairo_line_to (cr, xoff+0.5, yoff);
+ }
+
+ cache_index++;
+ }
+
+ /* from the final top point, move out of the clip zone */
+
+ cairo_line_to (cr, xoff + 10, yoff);
+
+ /* now draw the bottom half */
+
+ for (--xoff, --cache_index; xoff >= ulx; --xoff) {
+ double min;
+
+ min = waveview->cache->data[cache_index].min;
+
+ if (min <= -1.0) {
+ min = -1.0;
+ }
+
+ yoff = origin - (waveview->half_height * min) + 0.5;
+
+ cairo_line_to (cr, xoff+0.5, yoff);
+ cache_index--;
+ }
+
+ /* from the final lower point, move out of the clip zone */
+
+ cairo_line_to (cr, xoff - 10, yoff);
+
+ /* close path to fill */
+
+ cairo_close_path (cr);
+
+ /* fill and stroke */
+
+ cairo_set_source_rgba (cr,
+ (waveview->fill_r/255.0),
+ (waveview->fill_g/255.0),
+ (waveview->fill_b/255.0),
+ (waveview->fill_a/255.0));
+ cairo_fill_preserve (cr);
+ cairo_set_source_rgba (cr,
+ (waveview->wave_r/255.0),
+ (waveview->wave_g/255.0),
+ (waveview->wave_b/255.0),
+ (waveview->wave_a/255.0));
+ cairo_stroke (cr);
+
+ cairo_destroy (cr);
}
+#if 0
+ if (clip_max || clip_min) {
+ cairo_set_source_rgba (cr, waveview->clip_r, waveview->clip_g, waveview->clip_b, waveview->clip_a);
+ }
+
+ if (clip_max) {
+ cairo_move_to (cr, xoff, yoff1);
+ cairo_line_to (cr, xoff, yoff1 + clip_length);
+ cairo_stroke (cr);
+ }
+
+ if (clip_min) {
+ cairo_move_to (cr, xoff, yoff2);
+ cairo_line_to (cr, xoff, yoff2 - clip_length);
+ cairo_stroke (cr);
+ }
+
+#endif
+
static void
gnome_canvas_waveview_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y2)
{
diff --git a/gtk2_ardour/canvas.h b/gtk2_ardour/canvas.h
index 9fa737258c..8df2674db7 100644
--- a/gtk2_ardour/canvas.h
+++ b/gtk2_ardour/canvas.h
@@ -25,6 +25,7 @@ namespace Gnome {
class Item;
class Group;
class Canvas;
+ class Rect;
class SimpleRect;
class SimpleLine;
class Polygon;
diff --git a/gtk2_ardour/cocoacarbon.mm b/gtk2_ardour/cocoacarbon.mm
index 75141d34f6..75df481186 100644
--- a/gtk2_ardour/cocoacarbon.mm
+++ b/gtk2_ardour/cocoacarbon.mm
@@ -27,6 +27,7 @@
#include
#include
+#include
sigc::signal ApplicationActivationChanged;
static EventHandlerRef application_event_handler_ref;
@@ -40,18 +41,51 @@ handle_reopen_application (const AppleEvent *inAppleEvent,
AppleEvent *outAppleEvent,
long inHandlerRefcon)
{
- cerr << "reopen app\n";
+ return noErr;
+}
+
+
+static OSErr
+handle_print_documents (const AppleEvent *inAppleEvent,
+ AppleEvent *outAppleEvent,
+ long inHandlerRefcon)
+{
+ return noErr;
+}
+
+
+static OSErr
+handle_open_documents (const AppleEvent *inAppleEvent,
+ AppleEvent *outAppleEvent,
+ long inHandlerRefcon)
+{
+ AEDescList docs;
+
+ if (AEGetParamDesc(inAppleEvent, keyDirectObject, typeAEList, &docs) == noErr) {
+ long n = 0;
+ AECountItems(&docs, &n);
+ UInt8 strBuffer[PATH_MAX+1];
+
+ /* ardour only opens 1 session at a time */
+
+ FSRef ref;
+
+ if (AEGetNthPtr(&docs, 1, typeFSRef, 0, 0, &ref, sizeof(ref), 0) == noErr) {
+ if (FSRefMakePath(&ref, strBuffer, sizeof(strBuffer)) == noErr) {
+ Glib::ustring utf8_path ((const char*) strBuffer);
+ ARDOUR_UI::instance()->idle_load (utf8_path);
+ }
+ }
+ }
+
return noErr;
}
static OSErr
-handle_quit_application (const AppleEvent *inAppleEvent,
+handle_open_application (const AppleEvent *inAppleEvent,
AppleEvent *outAppleEvent,
long inHandlerRefcon)
{
- cerr << "quit app\n";
- ARDOUR_UI::instance()->quit ();
-
return noErr;
}
@@ -79,12 +113,6 @@ application_event_handler (EventHandlerCallRef nextHandlerRef, EventRef event, v
void
ARDOUR_UI::platform_specific ()
{
- AEInstallEventHandler (kCoreEventClass, kAEReopenApplication,
- handle_reopen_application, 0, true);
-
- AEInstallEventHandler (kCoreEventClass, kAEQuitApplication,
- handle_quit_application, 0, true);
-
Gtk::Widget* widget = ActionManager::get_widget ("/ui/Main/Session/Quit");
if (widget) {
ige_mac_menu_set_quit_menu_item ((GtkMenuItem*) widget->gobj());
@@ -97,9 +125,26 @@ ARDOUR_UI::platform_specific ()
ige_mac_menu_add_app_menu_item (group, (GtkMenuItem*) widget->gobj(), 0);
}
widget = ActionManager::get_widget ("/ui/Main/Session/ToggleOptionsEditor");
+
if (widget) {
ige_mac_menu_add_app_menu_item (group, (GtkMenuItem*) widget->gobj(), 0);
}
+}
+
+void
+ARDOUR_UI::platform_setup ()
+{
+ AEInstallEventHandler (kCoreEventClass, kAEOpenDocuments,
+ handle_open_documents, 0, true);
+
+ AEInstallEventHandler (kCoreEventClass, kAEOpenApplication,
+ handle_open_application, 0, true);
+
+ AEInstallEventHandler (kCoreEventClass, kAEReopenApplication,
+ handle_reopen_application, 0, true);
+
+ AEInstallEventHandler (kCoreEventClass, kAEPrintDocuments,
+ handle_print_documents, 0, true);
EventTypeSpec applicationEventTypes[] = {
{kEventClassApplication, kEventAppActivated },
@@ -110,11 +155,6 @@ ARDOUR_UI::platform_specific ()
InstallApplicationEventHandler (ehUPP, sizeof(applicationEventTypes) / sizeof(EventTypeSpec),
applicationEventTypes, 0, &application_event_handler_ref);
-}
-
-void
-ARDOUR_UI::platform_setup ()
-{
if (!ARDOUR_COMMAND_LINE::finder_invoked_ardour) {
/* if invoked from the command line, make sure we're visible */
@@ -122,3 +162,4 @@ ARDOUR_UI::platform_setup ()
[NSApp activateIgnoringOtherApps:1];
}
}
+
diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc
index 03d03c3d10..a4e7281870 100644
--- a/gtk2_ardour/crossfade_edit.cc
+++ b/gtk2_ardour/crossfade_edit.cc
@@ -925,17 +925,6 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1, 0));
fade_out_presets->push_back (p);
- // p = new Preset ("regout.xpm");
- p = new Preset ("crossfade_out_constant");
- p->push_back (PresetPoint (0, 1));
- p->push_back (PresetPoint (0.228111, 0.988889));
- p->push_back (PresetPoint (0.347926, 0.972222));
- p->push_back (PresetPoint (0.529954, 0.886111));
- p->push_back (PresetPoint (0.753456, 0.658333));
- p->push_back (PresetPoint (0.9262673, 0.308333));
- p->push_back (PresetPoint (1, 0));
- fade_out_presets->push_back (p);
-
// p = new Preset ("loout.xpm");
p = new Preset ("crossfade_out_transition");
p->push_back (PresetPoint (0, 1));
@@ -947,6 +936,17 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1, 0));
fade_out_presets->push_back (p);
+ // p = new Preset ("regout.xpm");
+ p = new Preset ("crossfade_out_constant");
+ p->push_back (PresetPoint (0, 1));
+ p->push_back (PresetPoint (0.228111, 0.988889));
+ p->push_back (PresetPoint (0.347926, 0.972222));
+ p->push_back (PresetPoint (0.529954, 0.886111));
+ p->push_back (PresetPoint (0.753456, 0.658333));
+ p->push_back (PresetPoint (0.9262673, 0.308333));
+ p->push_back (PresetPoint (1, 0));
+ fade_out_presets->push_back (p);
+
// p = new Preset ("regout2.xpm");
p = new Preset ("crossfade_out_slow-fade");
p->push_back (PresetPoint (0, 1));
diff --git a/gtk2_ardour/editing.h b/gtk2_ardour/editing.h
index 2b4519ec9c..64ced895db 100644
--- a/gtk2_ardour/editing.h
+++ b/gtk2_ardour/editing.h
@@ -37,6 +37,8 @@
#define IMPORTPOSITION(a)
#define IMPORTDISPOSITION(a)
#define EDITPOINT(a) /*empty*/
+#define WAVEFORMSCALE(a) /*empty*/
+#define WAVEFORMSHAPE(a) /*empty*/
namespace Editing {
@@ -179,6 +181,27 @@ enum EditPoint {
#undef EDITPOINT
#define EDITPOINT(a) /*empty*/
+// WAVEFORMSCALE
+#undef WAVEFORMSCALE
+#define WAVEFORMSCALE(a) a,
+enum WaveformScale {
+ #include "editing_syms.h"
+};
+
+#undef WAVEFORMSCALE
+#define WAVEFORMSCALE(a) /*empty*/
+
+
+// WAVEFORMSHAPE
+#undef WAVEFORMSHAPE
+#define WAVEFORMSHAPE(a) a,
+enum WaveformShape {
+ #include "editing_syms.h"
+};
+
+#undef WAVEFORMSHAPE
+#define WAVEFORMSHAPE(a) /*empty*/
+
/////////////////////
// These don't need their state saved. yet...
enum CutCopyOp {
diff --git a/gtk2_ardour/editing_syms.h b/gtk2_ardour/editing_syms.h
index 1cbb2decd8..71a7747b47 100644
--- a/gtk2_ardour/editing_syms.h
+++ b/gtk2_ardour/editing_syms.h
@@ -100,3 +100,11 @@ IMPORTDISPOSITION(ImportDistinctChannels=3)
EDITPOINT(EditAtPlayhead)
EDITPOINT(EditAtSelectedMarker)
EDITPOINT(EditAtMouse)
+
+WAVEFORMSCALE(LinearWaveform)
+WAVEFORMSCALE(LogWaveform)
+
+WAVEFORMSHAPE(Traditional)
+WAVEFORMSHAPE(Rectified)
+
+
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index fa44862191..4f36865905 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -247,6 +247,7 @@ Editor::Editor ()
PublicEditor::_instance = this;
session = 0;
+ _have_idled = false;
selection = new Selection (this);
cut_buffer = new Selection (this);
@@ -382,12 +383,12 @@ Editor::Editor ()
horizontal_adjustment.signal_value_changed().connect (mem_fun(*this, &Editor::canvas_horizontally_scrolled), false);
vertical_adjustment.signal_value_changed().connect (mem_fun(*this, &Editor::tie_vertical_scrolling), true);
- track_canvas.set_hadjustment (horizontal_adjustment);
- track_canvas.set_vadjustment (vertical_adjustment);
- time_canvas.set_hadjustment (horizontal_adjustment);
+ track_canvas->set_hadjustment (horizontal_adjustment);
+ track_canvas->set_vadjustment (vertical_adjustment);
+ time_canvas->set_hadjustment (horizontal_adjustment);
- track_canvas.signal_map_event().connect (mem_fun (*this, &Editor::track_canvas_map_handler));
- time_canvas.signal_map_event().connect (mem_fun (*this, &Editor::time_canvas_map_handler));
+ track_canvas->signal_map_event().connect (mem_fun (*this, &Editor::track_canvas_map_handler));
+ time_canvas->signal_map_event().connect (mem_fun (*this, &Editor::time_canvas_map_handler));
controls_layout.add (edit_controls_vbox);
controls_layout.set_name ("EditControlsBase");
@@ -425,7 +426,7 @@ Editor::Editor ()
time_canvas_vbox.pack_start (*smpte_ruler, false, false);
time_canvas_vbox.pack_start (*frames_ruler, false, false);
time_canvas_vbox.pack_start (*bbt_ruler, false, false);
- time_canvas_vbox.pack_start (time_canvas, true, true);
+ time_canvas_vbox.pack_start (*time_canvas, true, true);
time_canvas_vbox.set_size_request (-1, (int)(timebar_height * visible_timebars) + 5);
bbt_label.set_name ("EditorTimeButton");
@@ -492,7 +493,7 @@ Editor::Editor ()
for the canvas areas.
*/
- track_canvas_event_box.add (track_canvas);
+ track_canvas_event_box.add (*track_canvas);
time_canvas_event_box.add (time_canvas_vbox);
time_canvas_event_box.set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
@@ -613,6 +614,10 @@ Editor::Editor ()
region_list_display.set_size_request (100, -1);
region_list_display.set_name ("RegionListDisplay");
+ /* Try to prevent single mouse presses from initiating edits.
+ This relies on a hack in gtktreeview.c:gtk_treeview_button_press()
+ */
+ region_list_display.set_data ("mouse-edits-require-mod1", (gpointer) 0x1);
region_list_model = TreeStore::create (region_list_columns);
region_list_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
@@ -748,8 +753,7 @@ Editor::Editor ()
set_snap_to (snap_type);
snap_mode = SnapOff;
set_snap_mode (snap_mode);
- _edit_point = EditAtMouse;
- set_edit_point_preference (_edit_point);
+ set_edit_point_preference (EditAtMouse, true);
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
set_state (*node);
@@ -833,6 +837,16 @@ Editor::~Editor()
image_socket_listener = 0 ;
}
#endif
+
+ if (track_canvas) {
+ delete track_canvas;
+ track_canvas = 0;
+ }
+
+ if (time_canvas) {
+ delete time_canvas;
+ time_canvas = 0;
+ }
}
void
@@ -1150,6 +1164,10 @@ Editor::connect_to_session (Session *t)
{
session = t;
+ /* there are never any selected regions at startup */
+
+ sensitize_the_right_region_actions (false);
+
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
set_state (*node);
@@ -2229,9 +2247,9 @@ Editor::set_snap_mode (SnapMode mode)
instant_save ();
}
void
-Editor::set_edit_point_preference (EditPoint ep)
+Editor::set_edit_point_preference (EditPoint ep, bool force)
{
- bool changed = _edit_point != ep;
+ bool changed = (_edit_point != ep);
_edit_point = ep;
string str = edit_point_strings[(int)ep];
@@ -2242,7 +2260,7 @@ Editor::set_edit_point_preference (EditPoint ep)
set_canvas_cursor ();
- if (!changed) {
+ if (!force && !changed) {
return;
}
@@ -2266,6 +2284,25 @@ Editor::set_edit_point_preference (EditPoint ep)
break;
}
+ const char* action;
+
+ switch (_edit_point) {
+ case EditAtPlayhead:
+ action = "edit-at-playhead";
+ break;
+ case EditAtSelectedMarker:
+ action = "edit-at-marker";
+ break;
+ case EditAtMouse:
+ action = "edit-at-mouse";
+ break;
+ }
+
+ Glib::RefPtr act = ActionManager::get_action ("Editor", action);
+ if (act) {
+ Glib::RefPtr::cast_dynamic(act)->set_active (true);
+ }
+
instant_save ();
}
@@ -2339,7 +2376,7 @@ Editor::set_state (const XMLNode& node)
}
if ((prop = node.property ("edit-point"))) {
- set_edit_point_preference ((EditPoint) string_2_enum (prop->value(), _edit_point));
+ set_edit_point_preference ((EditPoint) string_2_enum (prop->value(), _edit_point), true);
}
if ((prop = node.property ("mouse-mode"))) {
@@ -2354,7 +2391,7 @@ Editor::set_state (const XMLNode& node)
if ((prop = node.property ("show-waveforms"))) {
bool yn = (prop->value() == "yes");
_show_waveforms = !yn;
- RefPtr act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformVisibility"));
+ RefPtr act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-visible"));
if (act) {
RefPtr tact = RefPtr::cast_dynamic(act);
/* do it twice to force the change */
@@ -4506,8 +4543,7 @@ Editor::set_loop_range (nframes_t start, nframes_t end, string cmd)
session->set_auto_loop_location (loc);
XMLNode &after = session->locations()->get_state();
session->add_command (new MementoCommand(*(session->locations()), &before, &after));
- }
- else {
+ } else {
XMLNode &before = tll->get_state();
tll->set_hidden (false, this);
tll->set (start, end);
@@ -4629,15 +4665,20 @@ Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered)
if (selection->tracks.empty()) {
- /* no regions or tracks selected, but entered regionview is valid
- and we're in object mode - just use entered regionview
+ /* no regions or tracks selected
*/
- if (entered_regionview && (mouse_mode == Editing::MouseObject)) {
+ if (entered_regionview && mouse_mode == Editing::MouseObject) {
+
+ /* entered regionview is valid and we're in object mode -
+ just use entered regionview
+ */
+
rs.add (entered_regionview);
- return;
}
+ return;
+
} else {
/* no regions selected, so get all regions at the edit point across
@@ -4720,3 +4761,29 @@ Editor::show_rhythm_ferret ()
rhythm_ferret->show ();
rhythm_ferret->present ();
}
+
+void
+Editor::first_idle ()
+{
+ MessageDialog* dialog = 0;
+
+ if (track_views.size() > 1) {
+ dialog = new MessageDialog (*this,
+ _("Please wait while Ardour loads visual data"),
+ true,
+ Gtk::MESSAGE_INFO,
+ Gtk::BUTTONS_NONE);
+ dialog->present ();
+ ARDOUR_UI::instance()->flush_pending ();
+ }
+
+ for (TrackViewList::iterator t = track_views.begin(); t != track_views.end(); ++t) {
+ (*t)->first_idle();
+ }
+
+ if (dialog) {
+ delete dialog;
+ }
+
+ _have_idled = true;
+}
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 62d62a330f..6fe6d0207a 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -61,6 +61,7 @@
#include "editor_items.h"
#include "region_selection.h"
#include "canvas.h"
+#include "time_axis_view.h"
#include "draginfo.h"
#include "tempo_lines.h"
@@ -132,6 +133,8 @@ class Editor : public PublicEditor
void connect_to_session (ARDOUR::Session *);
ARDOUR::Session* current_session() const { return session; }
+ void first_idle ();
+ virtual bool have_idled() const { return _have_idled; }
nframes_t leftmost_position() const { return leftmost_frame; }
nframes_t current_page_frames() const {
@@ -163,9 +166,11 @@ class Editor : public PublicEditor
void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
void connect_to_image_compositor() ;
void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
- TimeAxisView* get_named_time_axis(const std::string & name) ;
#endif
+ TimeAxisView* get_named_time_axis(const std::string & name) ;
+ void foreach_time_axis_view (sigc::slot);
+
RouteTimeAxisView* get_route_view_by_id (PBD::ID& id);
void consider_auditioning (boost::shared_ptr);
@@ -181,6 +186,8 @@ class Editor : public PublicEditor
void set_show_waveforms (bool yn);
bool show_waveforms() const { return _show_waveforms; }
+ void set_waveform_scale (Editing::WaveformScale);
+
void set_show_waveforms_recording (bool yn);
bool show_waveforms_recording() const { return _show_waveforms_recording; }
@@ -225,14 +232,14 @@ class Editor : public PublicEditor
*/
if (pixel >= 0) {
- return (nframes_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas.gobj())->pixels_per_unit);
+ return (nframes_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
} else {
return 0;
}
}
gulong frame_to_pixel (nframes64_t frame) const {
- return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas.gobj())->pixels_per_unit)));
+ return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
}
void flush_canvas ();
@@ -561,8 +568,8 @@ class Editor : public PublicEditor
void set_canvas_cursor ();
Gdk::Cursor* which_grabber_cursor ();
- ArdourCanvas::CanvasAA track_canvas;
- ArdourCanvas::CanvasAA time_canvas;
+ ArdourCanvas::Canvas* track_canvas;
+ ArdourCanvas::Canvas* time_canvas;
ArdourCanvas::Text* first_action_message;
ArdourCanvas::Text* verbose_canvas_cursor;
@@ -596,7 +603,7 @@ class Editor : public PublicEditor
ArdourCanvas::Group *transport_marker_group;
ArdourCanvas::Group* cd_marker_group;
- enum {
+ enum RulerType {
ruler_metric_smpte = 0,
ruler_metric_bbt = 1,
ruler_metric_frames = 2,
@@ -611,7 +618,16 @@ class Editor : public PublicEditor
};
static GtkCustomMetric ruler_metrics[4];
- bool ruler_shown[10];
+ Glib::RefPtr ruler_timecode_action;
+ Glib::RefPtr ruler_bbt_action;
+ Glib::RefPtr ruler_samples_action;
+ Glib::RefPtr ruler_minsec_action;
+ Glib::RefPtr ruler_tempo_action;
+ Glib::RefPtr ruler_meter_action;
+ Glib::RefPtr ruler_marker_action;
+ Glib::RefPtr ruler_range_action;
+ Glib::RefPtr ruler_loop_punch_action;
+ Glib::RefPtr ruler_cd_marker_action;
bool no_ruler_shown_update;
gint ruler_button_press (GdkEventButton*);
@@ -629,6 +645,8 @@ class Editor : public PublicEditor
void update_tempo_based_rulers ();
void popup_ruler_menu (nframes_t where = 0, ItemType type = RegionItem);
void update_ruler_visibility ();
+ void set_ruler_visible (RulerType, bool);
+ void toggle_ruler_visibility (RulerType rt);
void ruler_toggled (int);
gint ruler_label_button_release (GdkEventButton*);
void store_ruler_visibility ();
@@ -1018,7 +1036,7 @@ class Editor : public PublicEditor
void cut_copy (Editing::CutCopyOp);
bool can_cut_copy () const;
void cut_copy_points (Editing::CutCopyOp);
- void cut_copy_regions (Editing::CutCopyOp);
+ void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
void cut_copy_ranges (Editing::CutCopyOp);
void mouse_paste ();
@@ -1135,7 +1153,10 @@ class Editor : public PublicEditor
SoundFileOmega* sfbrowser;
void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
+
+ void _do_import (vector paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
void do_import (vector paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
+ bool idle_do_import (vector paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
void _do_embed (vector paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
void do_embed (vector paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
@@ -1641,6 +1662,7 @@ public:
void time_selection_changed ();
void track_selection_changed ();
void region_selection_changed ();
+ void sensitize_the_right_region_actions (bool have_selected_regions);
void point_selection_changed ();
void marker_selection_changed ();
@@ -2172,7 +2194,7 @@ public:
Gtk::ComboBoxText edit_point_selector;
- void set_edit_point_preference (Editing::EditPoint ep);
+ void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
void cycle_edit_point (bool with_marker);
void set_edit_point ();
void edit_point_selection_done ();
@@ -2203,6 +2225,20 @@ public:
void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
RhythmFerret* rhythm_ferret;
+
+ void set_track_height (TimeAxisView::TrackHeight h);
+ void set_track_height_largest ();
+ void set_track_height_large ();
+ void set_track_height_larger ();
+ void set_track_height_normal ();
+ void set_track_height_smaller ();
+ void set_track_height_small ();
+
+ void remove_tracks ();
+ void toggle_tracks_active ();
+ void waveform_scale_chosen (Editing::WaveformScale);
+
+ bool _have_idled;
};
#endif /* __ardour_editor_h__ */
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index d6e4a5a214..f1539757fb 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -18,6 +18,7 @@
*/
#include
+#include
#include "utils.h"
#include "editor.h"
@@ -67,6 +68,7 @@ Editor::register_actions ()
ActionManager::register_action (editor_actions, X_("PlayMenu"), _("Play"));
ActionManager::register_action (editor_actions, X_("PrimaryClockMenu"), _("Primary Clock"));
ActionManager::register_action (editor_actions, X_("Pullup"), _("Pullup / Pulldown"));
+ ActionManager::register_action (editor_actions, X_("RegionMenu"), _("Region"));
ActionManager::register_action (editor_actions, X_("RegionEditOps"), _("Region operations"));
ActionManager::register_action (editor_actions, X_("RegionGainMenu"), _("Gain"));
ActionManager::register_action (editor_actions, X_("RulerMenu"), _("Rulers"));
@@ -79,11 +81,15 @@ Editor::register_actions ()
ActionManager::register_action (editor_actions, X_("SetPunchMenu"), _("Punch"));
ActionManager::register_action (editor_actions, X_("Solo"), _("Solo"));
ActionManager::register_action (editor_actions, X_("Subframes"), _("Subframes"));
+ ActionManager::register_action (editor_actions, X_("SyncMenu"), _("Sync"));
ActionManager::register_action (editor_actions, X_("TempoMenu"), _("Tempo"));
ActionManager::register_action (editor_actions, X_("Timecode"), _("Timecode fps"));
+ ActionManager::register_action (editor_actions, X_("TrackHeightMenu"), _("Height"));
+ ActionManager::register_action (editor_actions, X_("TrackMenu"), _("Track"));
ActionManager::register_action (editor_actions, X_("Tools"), _("Tools"));
ActionManager::register_action (editor_actions, X_("TrimMenu"), _("Trim"));
ActionManager::register_action (editor_actions, X_("View"), _("View"));
+ ActionManager::register_action (editor_actions, X_("WaveformMenu"), _("Waveforms"));
ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("Zoom"));
ActionManager::register_action (editor_actions, X_("ZoomMenu"), _("Zoom"));
ActionManager::register_action (editor_actions, X_("ZoomFocusMenu"), _("Zoom Focus"));
@@ -265,32 +271,32 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "goto", _("goto"), mem_fun(*this, &Editor::goto_frame));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "center-playhead", _("to Center"), mem_fun(*this, &Editor::center_playhead));
+ act = ActionManager::register_action (editor_actions, "center-playhead", _("Center Playhead"), mem_fun(*this, &Editor::center_playhead));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("to Center"), mem_fun(*this, &Editor::center_edit_point));
+ act = ActionManager::register_action (editor_actions, "center-edit-cursor", _("Center Active Marker"), mem_fun(*this, &Editor::center_edit_point));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "scroll-playhead-forward", _("Playhead forward"), bind (mem_fun(*this, &Editor::scroll_playhead), true));;
+ act = ActionManager::register_action (editor_actions, "scroll-playhead-forward", _("Playhead Forward"), bind (mem_fun(*this, &Editor::scroll_playhead), true));;
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "scroll-playhead-backward", _("Playhead Backward"), bind (mem_fun(*this, &Editor::scroll_playhead), false));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("to Edit"), bind (mem_fun(*this, &Editor::cursor_align), true));
+ act = ActionManager::register_action (editor_actions, "playhead-to-edit", _("Playhead To Active Mark"), bind (mem_fun(*this, &Editor::cursor_align), true));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("to Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false));
+ act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("Active Mark To Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "trim-front", _("Trim start at edit point"), mem_fun(*this, &Editor::trim_region_front));
+ act = ActionManager::register_action (editor_actions, "trim-front", _("Trim Start At Edit Point"), mem_fun(*this, &Editor::trim_region_front));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "trim-back", _("Trim end at edit point"), mem_fun(*this, &Editor::trim_region_back));
+ act = ActionManager::register_action (editor_actions, "trim-back", _("Trim End At Edit Point"), mem_fun(*this, &Editor::trim_region_back));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start to edit point"), mem_fun(*this, &Editor::trim_region_from_edit_point));
+ act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start To Edit Point"), mem_fun(*this, &Editor::trim_region_from_edit_point));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "trim-to-end", _("Edit point to end"), mem_fun(*this, &Editor::trim_region_to_edit_point));
+ act = ActionManager::register_action (editor_actions, "trim-to-end", _("Edit Point To End"), mem_fun(*this, &Editor::trim_region_to_edit_point));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::region_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "trim-region-to-loop", _("Trim To Loop"), mem_fun(*this, &Editor::trim_region_to_loop));
@@ -357,9 +363,9 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "brush-at-mouse", _("Brush at Mouse"), mem_fun(*this, &Editor::kbd_brush));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "set-playhead", _("Set Playhead"), mem_fun(*this, &Editor::set_playhead_cursor));
+ act = ActionManager::register_action (editor_actions, "set-playhead", _("Playhead to Mouse"), mem_fun(*this, &Editor::set_playhead_cursor));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (editor_actions, "set-edit-point", _("Set Edit Point"), mem_fun(*this, &Editor::set_edit_point));
+ act = ActionManager::register_action (editor_actions, "set-edit-point", _("Edit Point to Mouse"), mem_fun(*this, &Editor::set_edit_point));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "duplicate-region", _("Duplicate Region"), bind (mem_fun(*this, &Editor::duplicate_dialog), false));
@@ -505,6 +511,33 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, "remove-last-capture", _("Remove Last Capture"), (mem_fun(*this, &Editor::remove_last_capture)));
ActionManager::session_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (editor_actions, "toggle-track-active", _("Toggle Active"), (mem_fun(*this, &Editor::toggle_tracks_active)));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (editor_actions, "remove-track", _("Remove"), (mem_fun(*this, &Editor::remove_tracks)));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+
+ act = ActionManager::register_action (editor_actions, "track-height-largest", _("Largest"), (mem_fun(*this, &Editor::set_track_height_largest)));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (editor_actions, "track-height-larger", _("Larger"), (mem_fun(*this, &Editor::set_track_height_large)));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (editor_actions, "track-height-large", _("Large"), (mem_fun(*this, &Editor::set_track_height_larger)));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (editor_actions, "track-height-normal", _("Normal"), (mem_fun(*this, &Editor::set_track_height_normal)));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (editor_actions, "track-height-small", _("Small"), (mem_fun(*this, &Editor::set_track_height_smaller)));
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (editor_actions, "track-height-smaller", _("Smaller"), (mem_fun(*this, &Editor::set_track_height_small)));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+
Glib::RefPtr zoom_actions = ActionGroup::create (X_("Zoom"));
RadioAction::Group zoom_group;
@@ -536,10 +569,6 @@ Editor::register_actions ()
ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-selected-marker"), _("Marker"), (bind (mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
- ActionManager::register_action (editor_actions, "edit-point-marker", _("Marker"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtSelectedMarker));
- ActionManager::register_action (editor_actions, "edit-point-playhead", _("Playhead"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtPlayhead));
- ActionManager::register_action (editor_actions, "edit-point-mouse", _("Mouse"), bind (mem_fun (*this, &Editor::set_edit_point_preference), EditAtMouse));
-
ActionManager::register_action (editor_actions, "cycle-edit-point", _("Change edit point"), bind (mem_fun (*this, &Editor::cycle_edit_point), false));
ActionManager::register_action (editor_actions, "cycle-edit-point-with-marker", _("Change edit point (w/Marker)"), bind (mem_fun (*this, &Editor::cycle_edit_point), true));
@@ -584,17 +613,36 @@ Editor::register_actions ()
/* RULERS */
Glib::RefPtr ruler_actions = ActionGroup::create (X_("Rulers"));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-tempo-ruler"), _("Tempo"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_tempo));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-meter-ruler"), _("Meter"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_meter));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-range-ruler"), _("Ranges"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_range_marker));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-marker-ruler"), _("Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_marker));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-cd-marker-ruler"), _("CD Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_cd_marker));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-loop-punch-ruler"), _("Loop/Punch"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_transport_marker));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-bbt-ruler"), _("Bars & Beats"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_frames));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-samples-ruler"), _("Samples"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_bbt));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-timecode-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_smpte));
- ActionManager::register_toggle_action (ruler_actions, X_("toggle-minsec-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_metric_minsec));
+ ruler_tempo_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-tempo-ruler"), _("Tempo"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_tempo)));
+ ruler_meter_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-meter-ruler"), _("Meter"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_meter)));
+ ruler_range_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-range-ruler"), _("Ranges"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_range_marker)));
+ ruler_marker_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-marker-ruler"), _("Markers"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_marker)));
+ ruler_cd_marker_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-cd-marker-ruler"), _("CD Markers"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_cd_marker)));
+ ruler_loop_punch_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-loop-punch-ruler"), _("Loop/Punch"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_time_transport_marker)));
+ ruler_bbt_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-bbt-ruler"), _("Bars & Beats"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_frames)));
+ ruler_samples_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-samples-ruler"), _("Samples"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_bbt)));
+ ruler_timecode_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-timecode-ruler"), _("Timecode"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_smpte)));
+ ruler_minsec_action = Glib::RefPtr::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-minsec-ruler"), _("Min:Sec"), bind (mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_minsec)));
+ /* set defaults here */
+
+ no_ruler_shown_update = true;
+ ruler_meter_action->set_active (true);
+ ruler_tempo_action->set_active (true);
+ ruler_marker_action->set_active (true);
+ ruler_range_action->set_active (true);
+ if (Profile->get_sae()) {
+ ruler_cd_marker_action->set_active (false);
+ ruler_timecode_action->set_active (false);
+ ruler_minsec_action->set_active (true);
+ } else {
+ ruler_cd_marker_action->set_active (true);
+ ruler_timecode_action->set_active (true);
+ ruler_minsec_action->set_active (false);
+ }
+ ruler_samples_action->set_active (false);
+ no_ruler_shown_update = false;
+
/* REGION LIST */
Glib::RefPtr rl_actions = ActionGroup::create (X_("RegionList"));
@@ -647,10 +695,18 @@ Editor::register_actions ()
act = ActionManager::register_action (editor_actions, X_("addExternalAudioToRegionList"), _("Add External Media"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
ActionManager::session_sensitive_actions.push_back (act);
- ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformVisibility"), _("Show Waveforms"), mem_fun (*this, &Editor::toggle_waveform_visibility));
+ ActionManager::register_toggle_action (editor_actions, X_("toggle-waveform-visible"), _("Show Waveforms"), mem_fun (*this, &Editor::toggle_waveform_visibility));
+ ActionManager::track_selection_sensitive_actions.push_back (act);
ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformsWhileRecording"), _("Show Waveforms While Recording"), mem_fun (*this, &Editor::toggle_waveforms_while_recording));
act = ActionManager::register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measures"), mem_fun (*this, &Editor::toggle_measure_visibility));
+
+ RadioAction::Group waveform_scale_group;
+ act = ActionManager::register_radio_action (editor_actions, waveform_scale_group, X_("linear-waveforms"), _("Linear"), bind (mem_fun (*this, &Editor::waveform_scale_chosen), Editing::LinearWaveform));
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+ act = ActionManager::register_radio_action (editor_actions, waveform_scale_group, X_("logarithmic-waveforms"), _("Logarithmic"), bind (mem_fun (*this, &Editor::waveform_scale_chosen), Editing::LogWaveform));
+ ActionManager::track_selection_sensitive_actions.push_back (act);
+
/* if there is a logo in the editor canvas, its always visible at startup */
act = ActionManager::register_toggle_action (editor_actions, X_("ToggleLogoVisibility"), _("Show Logo"), mem_fun (*this, &Editor::toggle_logo_visibility));
@@ -703,10 +759,60 @@ Editor::register_actions ()
ActionManager::add_action_group (editor_actions);
}
+void
+Editor::toggle_ruler_visibility (RulerType rt)
+{
+ const char* action = 0;
+
+ if (no_ruler_shown_update) {
+ return;
+ }
+
+ switch (rt) {
+ case ruler_metric_smpte:
+ action = "toggle-timecode-ruler";
+ break;
+ case ruler_metric_bbt:
+ action = "toggle-bbt-ruler";
+ break;
+ case ruler_metric_frames:
+ action = "toggle-samples-ruler";
+ break;
+ case ruler_metric_minsec:
+ action = "toggle-minsec-ruler";
+ break;
+ case ruler_time_tempo:
+ action = "toggle-tempo-ruler";
+ break;
+ case ruler_time_meter:
+ action = "toggle-meter-ruler";
+ break;
+ case ruler_time_marker:
+ action = "toggle-marker-ruler";
+ break;
+ case ruler_time_range_marker:
+ action = "toggle-range-ruler";
+ break;
+ case ruler_time_transport_marker:
+ action = "toggle-loop-punch-ruler";
+ break;
+ case ruler_time_cd_marker:
+ action = "toggle-cd-marker-ruler";
+ break;
+ }
+
+ Glib::RefPtr act = ActionManager::get_action (X_("Rulers"), action);
+ if (act) {
+ Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act);
+ update_ruler_visibility ();
+ store_ruler_visibility ();
+ }
+}
+
void
Editor::toggle_waveform_visibility ()
{
- Glib::RefPtr act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformVisibility"));
+ Glib::RefPtr act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-visible"));
if (act) {
Glib::RefPtr tact = Glib::RefPtr::cast_dynamic(act);
set_show_waveforms (tact->get_active());
@@ -750,6 +856,33 @@ Editor::toggle_logo_visibility ()
}
}
+void
+Editor::waveform_scale_chosen (Editing::WaveformScale ws)
+{
+ RefPtr act;
+
+ /* this is driven by a toggle on a radio group, and so is invoked twice,
+ once for the item that became inactive and once for the one that became
+ active.
+ */
+
+ switch (ws) {
+ case LinearWaveform:
+ act = ActionManager::get_action (X_("Editor"), X_("linear-waveforms"));
+ break;
+ case LogWaveform:
+ act = ActionManager::get_action (X_("Editor"), X_("logarithmic-waveforms"));
+ break;
+ }
+
+ if (act) {
+ RefPtr ract = RefPtr::cast_dynamic(act);
+ if (ract && ract->get_active()) {
+ set_waveform_scale (ws);
+ }
+ }
+}
+
void
Editor::set_crossfade_model (CrossfadeModel model)
{
@@ -1523,7 +1656,6 @@ Editor::parameter_changed (const char* parameter_name)
update_just_smpte ();
} else if (PARAM_IS ("show-track-meters")) {
toggle_meter_updating();
- track_canvas_allocate(track_canvas.get_allocation());
} else if (PARAM_IS ("link-region-and-track-selection")) {
ActionManager::map_some_state ("Editor", "link-region-and-track-selection", &Configuration::get_link_region_and_track_selection);
}
@@ -1534,5 +1666,5 @@ Editor::parameter_changed (const char* parameter_name)
void
Editor::reset_focus ()
{
- track_canvas.grab_focus();
+ track_canvas->grab_focus();
}
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index e13eb81181..fb6e2c8673 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
@@ -312,8 +313,25 @@ Editor::get_nth_selected_midi_track (int nth) const
return mtv->midi_track();
}
+bool
+Editor::idle_do_import (vector paths, ImportDisposition chns, ImportMode mode, SrcQuality quality, nframes64_t& pos)
+{
+ _do_import (paths, chns, mode, quality, pos);
+ return false;
+}
+
void
Editor::do_import (vector paths, ImportDisposition chns, ImportMode mode, SrcQuality quality, nframes64_t& pos)
+{
+#ifdef GTKOSX
+ Glib::signal_idle().connect (bind (mem_fun (*this, &Editor::idle_do_import), paths, chns, mode, quality, pos));
+#else
+ _do_import (paths, chns, mode, quality, pos);
+#endif
+}
+
+void
+Editor::_do_import (vector paths, ImportDisposition chns, ImportMode mode, SrcQuality quality, nframes64_t& pos)
{
boost::shared_ptr