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
This commit is contained in:
Paul Davis 2009-10-02 15:38:17 +00:00
parent 03f6001f4a
commit b2d08a44b4
6 changed files with 28 additions and 28 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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;