summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-10-02 15:38:17 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-10-02 15:38:17 +0000
commitb2d08a44b423ce9349b482e4c55ab613729c5d7d (patch)
tree1260a18e0687d76f749c61fc3a6a8fe82aa73842
parent03f6001f4a47d7095f148aa193042c9d0656bc56 (diff)
now in gtk2_ardour: replace all instances of prop->value() == "yes" with string_is_affirmative (prop->value()) to avoid XML property SNAFUs
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5721 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/audio_region_view.cc8
-rw-r--r--gtk2_ardour/audio_time_axis.cc8
-rw-r--r--gtk2_ardour/editor.cc14
-rw-r--r--gtk2_ardour/editor_rulers.cc20
-rw-r--r--gtk2_ardour/mixer_ui.cc4
-rw-r--r--gtk2_ardour/redirect_automation_time_axis.cc2
6 files changed, 28 insertions, 28 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index 705a870da0..f231bfb91f 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -1009,25 +1009,25 @@ AudioRegionView::set_flags (XMLNode* node)
XMLProperty *prop;
if ((prop = node->property ("waveform-visible")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
_flags |= WaveformVisible;
}
}
if ((prop = node->property ("envelope-visible")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
_flags |= EnvelopeVisible;
}
}
if ((prop = node->property ("waveform-rectified")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
_flags |= WaveformRectified;
}
}
if ((prop = node->property ("waveform-logscaled")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
_flags |= WaveformLogScaled;
}
}
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 0266ff7a0b..9f4f709cfc 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -201,7 +201,7 @@ AudioTimeAxisView::set_state (const XMLNode& node)
XMLProperty *prop=child_node->property ("shown");
if (prop != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
show_gain_automation = true;
}
}
@@ -212,7 +212,7 @@ AudioTimeAxisView::set_state (const XMLNode& node)
XMLProperty *prop=child_node->property ("shown");
if (prop != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
show_pan_automation = true;
}
}
@@ -388,7 +388,7 @@ AudioTimeAxisView::add_gain_automation_child ()
if ((node = gain_track->get_state_node()) != 0) {
if ((prop = node->property ("shown")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
hideit = false;
}
}
@@ -419,7 +419,7 @@ AudioTimeAxisView::add_pan_automation_child ()
if ((node = pan_track->get_state_node()) != 0) {
if ((prop = node->property ("shown")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
hideit = false;
}
}
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index f5aa512eab..15b6519810 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -2469,7 +2469,7 @@ Editor::set_state (const XMLNode& node)
}
if ((prop = node.property ("show-waveforms"))) {
- bool yn = (prop->value() == "yes");
+ bool yn = (string_is_affirmative (prop->value()));
_show_waveforms = !yn;
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-visible"));
if (act) {
@@ -2481,7 +2481,7 @@ Editor::set_state (const XMLNode& node)
}
if ((prop = node.property ("show-waveforms-rectified"))) {
- bool yn = (prop->value() == "yes");
+ bool yn = (string_is_affirmative (prop->value()));
_show_waveforms_rectified = !yn;
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-rectified"));
if (act) {
@@ -2493,7 +2493,7 @@ Editor::set_state (const XMLNode& node)
}
if ((prop = node.property ("show-waveforms-recording"))) {
- bool yn = (prop->value() == "yes");
+ bool yn = (string_is_affirmative (prop->value()));
_show_waveforms_recording = !yn;
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleWaveformsWhileRecording"));
if (act) {
@@ -2505,7 +2505,7 @@ Editor::set_state (const XMLNode& node)
}
if ((prop = node.property ("show-measures"))) {
- bool yn = (prop->value() == "yes");
+ bool yn = (string_is_affirmative (prop->value()));
_show_measures = !yn;
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleMeasureVisibility"));
if (act) {
@@ -2517,7 +2517,7 @@ Editor::set_state (const XMLNode& node)
}
if ((prop = node.property ("follow-playhead"))) {
- bool yn = (prop->value() == "yes");
+ bool yn = (string_is_affirmative (prop->value()));
set_follow_playhead (yn);
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-follow-playhead"));
if (act) {
@@ -2529,7 +2529,7 @@ Editor::set_state (const XMLNode& node)
}
if ((prop = node.property ("stationary-playhead"))) {
- bool yn = (prop->value() == "yes");
+ bool yn = (string_is_affirmative (prop->value()));
set_stationary_playhead (yn);
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-stationary-playhead"));
if (act) {
@@ -2546,7 +2546,7 @@ Editor::set_state (const XMLNode& node)
}
if ((prop = node.property ("xfades-visible"))) {
- bool yn = (prop->value() == "yes");
+ bool yn = (string_is_affirmative (prop->value()));
_xfade_visibility = !yn;
// set_xfade_visibility (yn);
}
diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc
index dd33f48a7e..b96e3b912e 100644
--- a/gtk2_ardour/editor_rulers.cc
+++ b/gtk2_ardour/editor_rulers.cc
@@ -528,56 +528,56 @@ Editor::restore_ruler_visibility ()
if (node) {
if ((prop = node->property ("smpte")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_timecode_action->set_active (true);
} else {
ruler_timecode_action->set_active (false);
}
}
if ((prop = node->property ("bbt")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_bbt_action->set_active (true);
} else {
ruler_bbt_action->set_active (false);
}
}
if ((prop = node->property ("frames")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_samples_action->set_active (true);
} else {
ruler_samples_action->set_active (false);
}
}
if ((prop = node->property ("minsec")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_minsec_action->set_active (true);
} else {
ruler_minsec_action->set_active (false);
}
}
if ((prop = node->property ("tempo")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_tempo_action->set_active (true);
} else {
ruler_tempo_action->set_active (false);
}
}
if ((prop = node->property ("meter")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_meter_action->set_active (true);
} else {
ruler_meter_action->set_active (false);
}
}
if ((prop = node->property ("marker")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_marker_action->set_active (true);
} else {
ruler_marker_action->set_active (false);
}
}
if ((prop = node->property ("rangemarker")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_range_action->set_active (true);
} else {
ruler_range_action->set_active (false);
@@ -585,7 +585,7 @@ Editor::restore_ruler_visibility ()
}
if ((prop = node->property ("transportmarker")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_loop_punch_action->set_active (true);
} else {
ruler_loop_punch_action->set_active (false);
@@ -593,7 +593,7 @@ Editor::restore_ruler_visibility ()
}
if ((prop = node->property ("cdmarker")) != 0) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
ruler_cd_marker_action->set_active (true);
} else {
ruler_cd_marker_action->set_active (false);
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc
index b135764131..6f4fa592b5 100644
--- a/gtk2_ardour/mixer_ui.cc
+++ b/gtk2_ardour/mixer_ui.cc
@@ -1361,7 +1361,7 @@ Mixer_UI::set_state (const XMLNode& node)
set_window_pos_and_size ();
if ((prop = node.property ("narrow-strips"))) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
set_strip_width (Narrow);
} else {
set_strip_width (Wide);
@@ -1369,7 +1369,7 @@ Mixer_UI::set_state (const XMLNode& node)
}
if ((prop = node.property ("show-mixer"))) {
- if (prop->value() == "yes") {
+ if (string_is_affirmative (prop->value())) {
_visible = true;
}
}
diff --git a/gtk2_ardour/redirect_automation_time_axis.cc b/gtk2_ardour/redirect_automation_time_axis.cc
index acffda4ff1..65ef2b6fe3 100644
--- a/gtk2_ardour/redirect_automation_time_axis.cc
+++ b/gtk2_ardour/redirect_automation_time_axis.cc
@@ -60,7 +60,7 @@ RedirectAutomationTimeAxisView::RedirectAutomationTimeAxisView (Session& s, boos
XMLProperty *shown = (*iter)->property("shown_editor");
- if (shown && shown->value() == "yes") {
+ if (shown && string_is_affirmative (shown->value())) {
_marked_for_display = true;
}
break;