simplify waveform menu items
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5555 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
eecc8d4c20
commit
02b4b169f8
|
@ -297,7 +297,6 @@
|
|||
<menuitem action='track-height-small'/>
|
||||
</menu>
|
||||
<menu action='WaveformMenu'>
|
||||
<menuitem action='toggle-waveform-visible'/>
|
||||
<menuitem action='linear-waveforms'/>
|
||||
<menuitem action='logarithmic-waveforms'/>
|
||||
</menu>
|
||||
|
@ -381,9 +380,12 @@
|
|||
|
||||
<menuitem action='ToggleMaximalEditor'/>
|
||||
<menuitem action='show-editor-mixer'/>
|
||||
<menuitem action='ToggleMeasureVisibility'/>
|
||||
<menuitem action='ToggleMeasureVisibility'/>
|
||||
<menu action="Waveforms">
|
||||
<menuitem action='toggle-waveform-visible'/>
|
||||
<menuitem action='toggle-waveform-rectified'/>
|
||||
<menuitem action='ToggleWaveformsWhileRecording'/>
|
||||
</menu>
|
||||
<menuitem action='SyncEditorAndMixerTrackOrder'/>
|
||||
<menuitem action='toggle-region-fades-visible'/>
|
||||
</menu>
|
||||
|
|
|
@ -264,28 +264,6 @@ AudioTimeAxisView::append_extra_display_menu_items ()
|
|||
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)));
|
||||
|
@ -298,12 +276,6 @@ AudioTimeAxisView::append_extra_display_menu_items ()
|
|||
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);
|
||||
|
@ -347,6 +319,16 @@ AudioTimeAxisView::set_show_waveforms_recording (bool yn)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioTimeAxisView::set_show_waveforms_rectified (bool yn)
|
||||
{
|
||||
AudioStreamView* asv = audio_view();
|
||||
|
||||
if (asv) {
|
||||
asv->set_waveform_shape ( yn ? Rectified : Traditional );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
|
||||
{
|
||||
|
|
|
@ -72,6 +72,7 @@ class AudioTimeAxisView : public RouteTimeAxisView
|
|||
AudioStreamView* audio_view();
|
||||
|
||||
void set_show_waveforms (bool yn);
|
||||
void set_show_waveforms_rectified (bool yn);
|
||||
void set_show_waveforms_recording (bool yn);
|
||||
void show_all_xfades ();
|
||||
void hide_all_xfades ();
|
||||
|
|
|
@ -171,16 +171,21 @@ class Editor : public PublicEditor
|
|||
std::vector<std::string> rb_opt_strings;
|
||||
#endif
|
||||
|
||||
/* option editor-access */
|
||||
//global waveform options
|
||||
|
||||
void set_show_waveforms (bool yn);
|
||||
bool show_waveforms() const { return _show_waveforms; }
|
||||
|
||||
void set_waveform_scale (Editing::WaveformScale);
|
||||
void set_show_waveforms_rectified (bool yn);
|
||||
bool show_waveforms_rectified() const { return _show_waveforms_rectified; }
|
||||
|
||||
void set_show_waveforms_recording (bool yn);
|
||||
bool show_waveforms_recording() const { return _show_waveforms_recording; }
|
||||
|
||||
//per-track waveform options
|
||||
|
||||
void set_waveform_scale (Editing::WaveformScale);
|
||||
|
||||
/* things that need to be public to be used in the main menubar */
|
||||
|
||||
void new_region_from_selection ();
|
||||
|
@ -318,7 +323,9 @@ class Editor : public PublicEditor
|
|||
bool dragging_playhead () const { return _dragging_playhead; }
|
||||
|
||||
void toggle_waveform_visibility ();
|
||||
void toggle_waveform_rectified ();
|
||||
void toggle_waveforms_while_recording ();
|
||||
|
||||
void toggle_measure_visibility ();
|
||||
void toggle_logo_visibility ();
|
||||
|
||||
|
@ -1473,10 +1480,13 @@ public:
|
|||
/* display control */
|
||||
|
||||
bool _show_measures;
|
||||
|
||||
bool _show_waveforms;
|
||||
bool _show_waveforms_rectified;
|
||||
bool _show_waveforms_recording;
|
||||
|
||||
bool _stationary_playhead;
|
||||
bool _follow_playhead;
|
||||
bool _show_waveforms_recording;
|
||||
|
||||
ARDOUR::TempoMap::BBTPointList *current_bbt_points;
|
||||
|
||||
|
@ -2222,7 +2232,6 @@ public:
|
|||
|
||||
void remove_tracks ();
|
||||
void toggle_tracks_active ();
|
||||
void waveform_scale_chosen (Editing::WaveformScale);
|
||||
|
||||
bool _have_idled;
|
||||
int resize_idle_id;
|
||||
|
|
|
@ -801,17 +801,16 @@ Editor::register_actions ()
|
|||
act = ActionManager::register_action (editor_actions, X_("addExternalAudioToRegionList"), _("Import to Region List"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsRegion));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
ActionManager::register_action (editor_actions, X_("Waveforms"), _("Waveforms"));
|
||||
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);
|
||||
|
||||
act = ActionManager::register_toggle_action (editor_actions, X_("toggle-waveform-rectified"), _("Show Waveforms Rectified"), mem_fun (*this, &Editor::toggle_waveform_rectified));
|
||||
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));
|
||||
act = ActionManager::register_action (editor_actions, X_("linear-waveforms"), _("Set Selected Tracks to Linear Waveforms"), bind (mem_fun (*this, &Editor::set_waveform_scale), 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));
|
||||
act = ActionManager::register_action (editor_actions, X_("logarithmic-waveforms"), _("Set Selected Tracks to Logarithmic Waveforms"), bind (mem_fun (*this, &Editor::set_waveform_scale), Editing::LogWaveform));
|
||||
ActionManager::track_selection_sensitive_actions.push_back (act);
|
||||
|
||||
/* if there is a logo in the editor canvas, its always visible at startup */
|
||||
|
@ -926,6 +925,16 @@ Editor::toggle_waveform_visibility ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_waveform_rectified ()
|
||||
{
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-rectified"));
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
set_show_waveforms_rectified (tact->get_active());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_waveforms_while_recording ()
|
||||
{
|
||||
|
@ -963,33 +972,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_crossfade_model (CrossfadeModel model)
|
||||
{
|
||||
|
|
|
@ -62,6 +62,21 @@ Editor::set_show_waveforms_recording (bool yn)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_show_waveforms_rectified (bool yn)
|
||||
{
|
||||
AudioTimeAxisView* atv;
|
||||
|
||||
if (_show_waveforms_rectified != yn) {
|
||||
_show_waveforms_rectified = yn;
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
|
||||
atv->set_show_waveforms_rectified (yn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
Editor::start_updating ()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue