summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/ardour.menus.in6
-rw-r--r--gtk2_ardour/audio_region_view.cc2
-rw-r--r--gtk2_ardour/audio_region_view.h4
-rw-r--r--gtk2_ardour/audio_streamview.cc48
-rw-r--r--gtk2_ardour/audio_streamview.h13
-rw-r--r--gtk2_ardour/audio_time_axis.cc106
-rw-r--r--gtk2_ardour/audio_time_axis.h13
-rw-r--r--gtk2_ardour/editing.h22
-rw-r--r--gtk2_ardour/editing_syms.h8
-rw-r--r--gtk2_ardour/editor.cc14
-rw-r--r--gtk2_ardour/editor.h9
-rw-r--r--gtk2_ardour/editor_actions.cc49
-rw-r--r--gtk2_ardour/editor_audiotrack.cc15
-rw-r--r--gtk2_ardour/editor_ops.cc17
-rw-r--r--gtk2_ardour/enums.cc10
-rw-r--r--gtk2_ardour/public_editor.h8
-rw-r--r--gtk2_ardour/rc_option_editor.cc32
-rw-r--r--libs/ardour/ardour/rc_configuration_vars.h3
-rw-r--r--libs/ardour/ardour/types.h12
-rw-r--r--libs/ardour/globals.cc2
20 files changed, 77 insertions, 316 deletions
diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in
index 117cb8004b..b3dcd86780 100644
--- a/gtk2_ardour/ardour.menus.in
+++ b/gtk2_ardour/ardour.menus.in
@@ -282,11 +282,6 @@
<menuitem action='track-height-smaller'/>
<menuitem action='track-height-small'/>
</menu>
- <menu action='WaveformMenu'>
- <menuitem action='toggle-waveform-visible'/>
- <menuitem action='linear-waveforms'/>
- <menuitem action='logarithmic-waveforms'/>
- </menu>
<menuitem action='toggle-track-active'/>
<menuitem action='remove-track'/>
</menu>
@@ -396,7 +391,6 @@
<menuitem action='show-editor-mixer'/>
<menuitem action='show-editor-list'/>
<menuitem action='ToggleMeasureVisibility'/>
- <menuitem action='toggle-waveform-visible'/>
<menuitem action='ToggleWaveformsWhileRecording'/>
</menu>
<menu name='JACK' action='JACK'>
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index 30f97ba523..b36a237da5 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -1125,7 +1125,7 @@ AudioRegionView::set_waveform_shape (WaveformShape shape)
void
AudioRegionView::set_waveform_scale (WaveformScale scale)
{
- bool yn = (scale == LogWaveform);
+ bool yn = (scale == Logarithmic);
if (yn != (bool) (_flags & WaveformLogScaled)) {
for (vector<WaveView *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h
index 6d74b7a1ed..cae83ac370 100644
--- a/gtk2_ardour/audio_region_view.h
+++ b/gtk2_ardour/audio_region_view.h
@@ -84,8 +84,8 @@ class AudioRegionView : public RegionView
void set_envelope_visible (bool);
void set_waveform_visible (bool yn);
- void set_waveform_shape (Editing::WaveformShape);
- void set_waveform_scale (Editing::WaveformScale);
+ void set_waveform_shape (ARDOUR::WaveformShape);
+ void set_waveform_scale (ARDOUR::WaveformScale);
bool waveform_rectified() const { return _flags & WaveformRectified; }
bool waveform_logscaled() const { return _flags & WaveformLogScaled; }
diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc
index e2aa080b64..7dbae624e1 100644
--- a/gtk2_ardour/audio_streamview.cc
+++ b/gtk2_ardour/audio_streamview.cc
@@ -59,12 +59,12 @@ AudioStreamView::AudioStreamView (AudioTimeAxisView& tv)
: StreamView (tv)
{
crossfades_visible = true;
- _waveform_scale = LinearWaveform;
- _waveform_shape = Traditional;
color_handler ();
_amplitude_above_axis = 1.0;
use_rec_regions = tv.editor().show_waveforms_recording ();
+
+ Config->ParameterChanged.connect (sigc::mem_fun (*this, &AudioStreamView::parameter_changed));
}
AudioStreamView::~AudioStreamView ()
@@ -148,30 +148,9 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
region_view->set_sensitive (false);
}
- /* if this was the first one, then lets query the waveform scale and shape.
- otherwise, we set it to the current value */
-
- if (region_views.size() == 1) {
-
- if (region_view->waveform_logscaled()) {
- _waveform_scale = LogWaveform;
- } else {
- _waveform_scale = LinearWaveform;
- }
-
- if (region_view->waveform_rectified()) {
- _waveform_shape = Rectified;
- } else {
- _waveform_shape = Traditional;
- }
- }
- else {
- region_view->set_waveform_scale(_waveform_scale);
- region_view->set_waveform_shape(_waveform_shape);
- }
-
- /* follow global waveform setting */
- region_view->set_waveform_visible(_trackview.editor().show_waveforms());
+ region_view->set_waveform_scale (Config->get_waveform_scale ());
+ region_view->set_waveform_shape (Config->get_waveform_shape ());
+ region_view->set_waveform_visible (Config->get_show_waveforms ());
return region_view;
}
@@ -460,7 +439,6 @@ AudioStreamView::set_waveform_shape (WaveformShape shape)
if (arv)
arv->set_waveform_shape (shape);
}
- _waveform_shape = shape;
}
void
@@ -468,10 +446,10 @@ AudioStreamView::set_waveform_scale (WaveformScale scale)
{
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
- if (arv)
+ if (arv) {
arv->set_waveform_scale (scale);
+ }
}
- _waveform_scale = scale;
}
void
@@ -832,3 +810,15 @@ AudioStreamView::update_contents_height ()
}
}
}
+
+void
+AudioStreamView::parameter_changed (string const & p)
+{
+ if (p == "show-waveforms") {
+ set_show_waveforms (Config->get_show_waveforms ());
+ } else if (p == "waveform-scale") {
+ set_waveform_scale (Config->get_waveform_scale ());
+ } else if (p == "waveform-shape") {
+ set_waveform_shape (Config->get_waveform_shape ());
+ }
+}
diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h
index 728e9b39f2..1c5265f193 100644
--- a/gtk2_ardour/audio_streamview.h
+++ b/gtk2_ardour/audio_streamview.h
@@ -57,11 +57,6 @@ class AudioStreamView : public StreamView
AudioStreamView (AudioTimeAxisView&);
~AudioStreamView ();
- 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);
int set_amplitude_above_axis (gdouble app);
@@ -105,6 +100,10 @@ class AudioStreamView : public StreamView
void color_handler ();
void update_contents_height ();
+
+ void parameter_changed (std::string const &);
+ void set_waveform_shape (ARDOUR::WaveformShape);
+ void set_waveform_scale (ARDOUR::WaveformScale);
double _amplitude_above_axis;
@@ -112,15 +111,11 @@ class AudioStreamView : public StreamView
CrossfadeViewList crossfade_views;
bool crossfades_visible;
-
std::list<sigc::connection> rec_data_ready_connections;
nframes_t last_rec_data_frame;
std::map<boost::shared_ptr<ARDOUR::Source>, bool> rec_data_ready_map;
bool outline_region;
-
- Editing::WaveformShape _waveform_shape;
- Editing::WaveformScale _waveform_scale;
};
#endif /* __ardour_audio_streamview_h__ */
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 8f0c25bdb0..50f0df74cc 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -84,7 +84,6 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
assert(!is_track() || is_audio_track());
subplugin_menu.set_name ("ArdourContextMenu");
- waveform_item = 0;
_view = new AudioStreamView (*this);
@@ -130,7 +129,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::sh
/* first idle will do what we need */
} else {
first_idle ();
- }
+ }
} else {
post_construct ();
@@ -185,60 +184,6 @@ AudioTimeAxisView::append_extra_display_menu_items ()
items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
}
-
- // waveform menu
- Menu *waveform_menu = manage(new Menu);
- MenuList& waveform_items = waveform_menu->items();
- waveform_menu->set_name ("ArdourContextMenu");
-
- waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
- waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
- ignore_toggle = true;
- waveform_item->set_active (_editor.show_waveforms());
- ignore_toggle = false;
-
- waveform_items.push_back (SeparatorElem());
-
- RadioMenuItem::Group group;
-
- waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
- traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
-
- if (!Profile->get_sae()) {
- waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
- rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
- } else {
- rectified_item = 0;
- }
-
- waveform_items.push_back (SeparatorElem());
-
- RadioMenuItem::Group group2;
-
- waveform_items.push_back (RadioMenuElem (group2, _("Linear"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LinearWaveform)));
- linearscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
-
- waveform_items.push_back (RadioMenuElem (group2, _("Logarithmic"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LogWaveform)));
- logscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
-
- // setting initial item state
- AudioStreamView* asv = audio_view();
- if (asv) {
- ignore_toggle = true;
- if (asv->get_waveform_shape() == Rectified && rectified_item) {
- rectified_item->set_active(true);
- } else {
- traditional_item->set_active(true);
- }
-
- if (asv->get_waveform_scale() == LogWaveform)
- logscale_item->set_active(true);
- else linearscale_item->set_active(true);
- ignore_toggle = false;
- }
-
- items.push_back (MenuElem (_("Waveform"), *waveform_menu));
-
}
Gtk::Menu*
@@ -280,30 +225,6 @@ AudioTimeAxisView::build_mode_menu()
}
void
-AudioTimeAxisView::toggle_waveforms ()
-{
- AudioStreamView* asv = audio_view();
- assert(asv);
-
- if (asv && waveform_item && !ignore_toggle) {
- asv->set_show_waveforms (waveform_item->get_active());
- }
-}
-
-void
-AudioTimeAxisView::set_show_waveforms (bool yn)
-{
- AudioStreamView* asv = audio_view();
- assert(asv);
-
- if (waveform_item) {
- waveform_item->set_active (yn);
- } else {
- asv->set_show_waveforms (yn);
- }
-}
-
-void
AudioTimeAxisView::set_show_waveforms_recording (bool yn)
{
AudioStreamView* asv = audio_view();
@@ -314,30 +235,6 @@ AudioTimeAxisView::set_show_waveforms_recording (bool yn)
}
void
-AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
-{
- AudioStreamView* asv = audio_view();
-
- if (asv && !ignore_toggle) {
- asv->set_waveform_shape (shape);
- }
-
- map_frozen ();
-}
-
-void
-AudioTimeAxisView::set_waveform_scale (WaveformScale scale)
-{
- AudioStreamView* asv = audio_view();
-
- if (asv && !ignore_toggle) {
- asv->set_waveform_scale (scale);
- }
-
- map_frozen ();
-}
-
-void
AudioTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool show)
{
if (param.type() == GainAutomation) {
@@ -591,4 +488,3 @@ AudioTimeAxisView::update_control_names ()
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 d3fe93fdc6..48ea7cc816 100644
--- a/gtk2_ardour/audio_time_axis.h
+++ b/gtk2_ardour/audio_time_axis.h
@@ -71,7 +71,6 @@ class AudioTimeAxisView : public RouteTimeAxisView
AudioStreamView* audio_view();
- void set_show_waveforms (bool yn);
void set_show_waveforms_recording (bool yn);
void show_all_xfades ();
void hide_all_xfades ();
@@ -88,9 +87,6 @@ class AudioTimeAxisView : public RouteTimeAxisView
XMLNode* get_child_xml_node (const std::string & childname);
- void set_waveform_shape (Editing::WaveformShape);
- void set_waveform_scale (Editing::WaveformScale);
-
private:
friend class AudioStreamView;
friend class AudioRegionView;
@@ -100,9 +96,6 @@ class AudioTimeAxisView : public RouteTimeAxisView
void append_extra_display_menu_items ();
Gtk::Menu* build_mode_menu();
- void toggle_show_waveforms ();
- void toggle_waveforms ();
-
void show_all_automation ();
void show_existing_automation ();
void hide_all_automation ();
@@ -112,12 +105,6 @@ class AudioTimeAxisView : public RouteTimeAxisView
void ensure_pan_views (bool show = true);
void update_control_names ();
-
- Gtk::CheckMenuItem* waveform_item;
- Gtk::RadioMenuItem* traditional_item;
- Gtk::RadioMenuItem* rectified_item;
- Gtk::RadioMenuItem* linearscale_item;
- Gtk::RadioMenuItem* logscale_item;
};
#endif /* __ardour_audio_time_axis_h__ */
diff --git a/gtk2_ardour/editing.h b/gtk2_ardour/editing.h
index d2c9ba97b7..19a3d13370 100644
--- a/gtk2_ardour/editing.h
+++ b/gtk2_ardour/editing.h
@@ -182,28 +182,6 @@ 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*/
-
-
// INSERTTIMEOPT
#undef INSERTTIMEOPT
#define INSERTTIMEOPT(a) a,
diff --git a/gtk2_ardour/editing_syms.h b/gtk2_ardour/editing_syms.h
index ed6cf8aed8..1717a3228c 100644
--- a/gtk2_ardour/editing_syms.h
+++ b/gtk2_ardour/editing_syms.h
@@ -97,18 +97,10 @@ IMPORTDISPOSITION(ImportMergeFiles=1)
IMPORTDISPOSITION(ImportSerializeFiles=2)
IMPORTDISPOSITION(ImportDistinctChannels=3)
-
EDITPOINT(EditAtPlayhead)
EDITPOINT(EditAtSelectedMarker)
EDITPOINT(EditAtMouse)
-WAVEFORMSCALE(LinearWaveform)
-WAVEFORMSCALE(LogWaveform)
-
-WAVEFORMSHAPE(Traditional)
-WAVEFORMSHAPE(Rectified)
-
-
INSERTTIMEOPT(LeaveIntersected)
INSERTTIMEOPT(MoveIntersected)
INSERTTIMEOPT(SplitIntersected)
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index a984f6129e..e96b7838a6 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -290,7 +290,6 @@ Editor::Editor ()
current_interthread_info = 0;
_show_measures = true;
- _show_waveforms = true;
_show_waveforms_recording = true;
show_gain_after_trim = false;
route_redisplay_does_not_sync_order_keys = false;
@@ -2554,18 +2553,6 @@ Editor::set_state (const XMLNode& node)
set_mouse_mode (MouseObject, true);
}
- if ((prop = node.property ("show-waveforms"))) {
- bool yn = (prop->value() == "yes");
- _show_waveforms = !yn;
- RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-visible"));
- if (act) {
- RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
- /* do it twice to force the change */
- tact->set_active (!yn);
- tact->set_active (yn);
- }
- }
-
if ((prop = node.property ("show-waveforms-recording"))) {
bool yn = (prop->value() == "yes");
_show_waveforms_recording = !yn;
@@ -2701,7 +2688,6 @@ Editor::get_state ()
snprintf (buf, sizeof (buf), "%" PRIi64, playhead_cursor->current_frame);
node->add_property ("playhead", buf);
- node->add_property ("show-waveforms", _show_waveforms ? "yes" : "no");
node->add_property ("show-waveforms-recording", _show_waveforms_recording ? "yes" : "no");
node->add_property ("show-measures", _show_measures ? "yes" : "no");
node->add_property ("follow-playhead", _follow_playhead ? "yes" : "no");
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index c96e3768d7..5a45e398d0 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -198,11 +198,6 @@ class Editor : public PublicEditor
/* option editor-access */
- 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; }
@@ -338,7 +333,6 @@ class Editor : public PublicEditor
bool follow_playhead() const { return _follow_playhead; }
bool dragging_playhead () const { return _dragging_playhead; }
- void toggle_waveform_visibility ();
void toggle_zero_line_visibility ();
void toggle_waveforms_while_recording ();
void toggle_measure_visibility ();
@@ -1511,8 +1505,6 @@ public:
/* display control */
bool _show_measures;
- /// true to show waveforms, otherwise false
- bool _show_waveforms;
/// true if the editor should follow the playhead, otherwise false
bool _follow_playhead;
/// true if waveforms should be shown while recording audio tracks, otherwise false
@@ -2210,7 +2202,6 @@ public:
void remove_tracks ();
void toggle_tracks_active ();
- void waveform_scale_chosen (Editing::WaveformScale);
bool _have_idled;
int resize_idle_id;
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index 87b354eb28..585eff23e7 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -28,6 +28,7 @@
#include "time_axis_view.h"
#include "utils.h"
#include "i18n.h"
+#include "audio_time_axis.h"
using namespace Gtk;
using namespace Glib;
@@ -94,7 +95,6 @@ Editor::register_actions ()
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 Focus"));
ActionManager::register_action (editor_actions, X_("ZoomMenu"), _("Zoom"));
@@ -805,19 +805,9 @@ Editor::register_actions ()
ActionManager::register_action (editor_actions, X_("importFromSession"), _("Import From Session"), mem_fun(*this, &Editor::session_import_dialog));
- act = 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));
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));
@@ -883,16 +873,6 @@ Editor::toggle_ruler_visibility (RulerType rt)
}
void
-Editor::toggle_waveform_visibility ()
-{
- Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-visible"));
- if (act) {
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- set_show_waveforms (tact->get_active());
- }
-}
-
-void
Editor::toggle_waveforms_while_recording ()
{
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformsWhileRecording"));
@@ -929,33 +909,6 @@ Editor::toggle_logo_visibility ()
}
}
-void
-Editor::waveform_scale_chosen (Editing::WaveformScale ws)
-{
- RefPtr<Action> 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<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
- if (ract && ract->get_active()) {
- set_waveform_scale (ws);
- }
- }
-}
-
RefPtr<RadioAction>
Editor::snap_type_action (SnapType type)
{
diff --git a/gtk2_ardour/editor_audiotrack.cc b/gtk2_ardour/editor_audiotrack.cc
index 693a7a6af9..997bf41a3f 100644
--- a/gtk2_ardour/editor_audiotrack.cc
+++ b/gtk2_ardour/editor_audiotrack.cc
@@ -34,21 +34,6 @@ using namespace ARDOUR;
using namespace PBD;
void
-Editor::set_show_waveforms (bool yn)
-{
- AudioTimeAxisView* atv;
-
- if (_show_waveforms != yn) {
- _show_waveforms = yn;
- for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
- if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
- atv->set_show_waveforms (yn);
- }
- }
- }
-}
-
-void
Editor::set_show_waveforms_recording (bool yn)
{
AudioTimeAxisView* atv;
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 5dac7820fb..e61c8d6abe 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -6160,23 +6160,6 @@ Editor::remove_tracks ()
}
void
-Editor::set_waveform_scale (WaveformScale ws)
-{
- TrackSelection& ts (selection->tracks);
-
- if (ts.empty()) {
- return;
- }
-
- for (TrackSelection::iterator x = ts.begin(); x != ts.end(); ++x) {
- AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (*x);
- if (atv) {
- atv->set_waveform_scale (ws);
- }
- }
-}
-
-void
Editor::do_insert_time ()
{
if (selection->tracks.empty()) {
diff --git a/gtk2_ardour/enums.cc b/gtk2_ardour/enums.cc
index 513be94aef..73675dc84c 100644
--- a/gtk2_ardour/enums.cc
+++ b/gtk2_ardour/enums.cc
@@ -39,8 +39,6 @@ setup_gtk_ardour_enums ()
Width width;
ImportMode import_mode;
EditPoint edit_point;
- WaveformScale waveform_scale;
- WaveformShape waveform_shape;
#define REGISTER(e) enum_writer.register_distinct (typeid(e).name(), i, s); i.clear(); s.clear()
#define REGISTER_BITS(e) enum_writer.register_bits (typeid(e).name(), i, s); i.clear(); s.clear()
@@ -68,12 +66,4 @@ setup_gtk_ardour_enums ()
REGISTER_ENUM (EditAtMouse);
REGISTER_ENUM (EditAtSelectedMarker);
REGISTER (edit_point);
-
- REGISTER_ENUM (LinearWaveform);
- REGISTER_ENUM (LogWaveform);
- REGISTER (waveform_scale);
-
- REGISTER_ENUM (Traditional);
- REGISTER_ENUM (Rectified);
- REGISTER (waveform_shape);
}
diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h
index ef087fa2cc..8e366a3dd7 100644
--- a/gtk2_ardour/public_editor.h
+++ b/gtk2_ardour/public_editor.h
@@ -172,14 +172,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
*/
virtual void consider_auditioning (boost::shared_ptr<ARDOUR::Region> r) = 0;
- /** Set whether waveforms should be shown for audio tracks.
- * @param yn true to show waveforms, otherwise false.
- */
- virtual void set_show_waveforms (bool yn) = 0;
-
- /** @return true if waveforms are being shown, otherwise false */
- virtual bool show_waveforms () const = 0;
-
/** Set whether waveforms should be shown while recording audio tracks.
* @param yn true to show waveforms, otherwise false.
*/
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 5d1aaa596c..8639b92f7c 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -1038,6 +1038,38 @@ RCOptionEditor::RCOptionEditor ()
mem_fun (*_rc_config, &RCConfiguration::set_rubberbanding_snaps_to_grid)
));
+ add_option (_("Editor"),
+ new BoolOption (
+ "show-waveforms",
+ _("Show waveforms in regions"),
+ mem_fun (*_rc_config, &RCConfiguration::get_show_waveforms),
+ mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms)
+ ));
+
+ ComboOption<WaveformScale>* wfs = new ComboOption<WaveformScale> (
+ "waveform-scale",
+ _("Waveform scale"),
+ mem_fun (*_rc_config, &RCConfiguration::get_waveform_scale),
+ mem_fun (*_rc_config, &RCConfiguration::set_waveform_scale)
+ );
+
+ wfs->add (Linear, _("linear"));
+ wfs->add (Logarithmic, _("logarithmic"));
+
+ add_option (_("Editor"), wfs);
+
+ ComboOption<WaveformShape>* wfsh = new ComboOption<WaveformShape> (
+ "waveform-shape",
+ _("Waveform shape"),
+ mem_fun (*_rc_config, &RCConfiguration::get_waveform_shape),
+ mem_fun (*_rc_config, &RCConfiguration::set_waveform_shape)
+ );
+
+ wfsh->add (Traditional, _("traditional"));
+ wfsh->add (Rectified, _("rectified"));
+
+ add_option (_("Editor"), wfsh);
+
/* AUDIO */
add_option (_("Audio"), new OptionEditorHeading (_("Solo")));
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h
index 1a4c49fe64..d74778b67f 100644
--- a/libs/ardour/ardour/rc_configuration_vars.h
+++ b/libs/ardour/ardour/rc_configuration_vars.h
@@ -141,6 +141,9 @@ CONFIG_VARIABLE (bool, name_new_markers, "name-new-markers", false)
CONFIG_VARIABLE (bool, rubberbanding_snaps_to_grid, "rubberbanding-snaps-to-grid", false)
CONFIG_VARIABLE (long, font_scale, "font-scale", 102400)
CONFIG_VARIABLE (std::string, default_session_parent_dir, "default-session-parent-dir", "~")
+CONFIG_VARIABLE (bool, show_waveforms, "show-waveforms", true)
+CONFIG_VARIABLE (WaveformScale, waveform_scale, "waveform-scale", Linear)
+CONFIG_VARIABLE (WaveformShape, waveform_shape, "waveform-shape", Traditional)
/* denormal management */
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index cdec0c5fab..b5e53d494e 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -436,6 +436,16 @@ namespace ARDOUR {
class Bundle;
typedef std::vector<boost::shared_ptr<Bundle> > BundleList;
+ enum WaveformScale {
+ Linear,
+ Logarithmic
+ };
+
+ enum WaveformShape {
+ Traditional,
+ Rectified
+ };
+
} // namespace ARDOUR
std::istream& operator>>(std::istream& o, ARDOUR::SampleFormat& sf);
@@ -452,6 +462,8 @@ std::istream& operator>>(std::istream& o, ARDOUR::ShuttleBehaviour& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleUnits& sf);
std::istream& operator>>(std::istream& o, ARDOUR::SmpteFormat& sf);
std::istream& operator>>(std::istream& o, ARDOUR::DenormalModel& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::WaveformScale& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::WaveformShape& sf);
using ARDOUR::nframes_t;
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 1e17b3aeb9..a501e65931 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -606,4 +606,6 @@ std::istream& operator>>(std::istream& o, ShuttleBehaviour& var) { return int_to
std::istream& operator>>(std::istream& o, ShuttleUnits& var) { return int_to_type<ShuttleUnits> (o, var); }
std::istream& operator>>(std::istream& o, SmpteFormat& var) { return int_to_type<SmpteFormat> (o, var); }
std::istream& operator>>(std::istream& o, DenormalModel& var) { return int_to_type<DenormalModel> (o, var); }
+std::istream& operator>>(std::istream& o, WaveformScale& var) { return int_to_type<WaveformScale> (o, var); }
+std::istream& operator>>(std::istream& o, WaveformShape& var) { return int_to_type<WaveformShape> (o, var); }