+ /* Look through the regions that we are handling and make notes about what we have got */
+
+ bool have_audio = false;
+ bool have_midi = false;
+ bool have_locked = false;
+ bool have_unlocked = false;
+ bool have_position_lock_style_audio = false;
+ bool have_position_lock_style_music = false;
+ bool have_muted = false;
+ bool have_unmuted = false;
+ bool have_opaque = false;
+ bool have_non_opaque = false;
+ bool have_not_at_natural_position = false;
+ bool have_envelope_visible = false;
+ bool have_envelope_invisible = false;
+ bool have_envelope_active = false;
+ bool have_envelope_inactive = false;
+ bool have_non_unity_scale_amplitude = false;
+
+ for (list<boost::shared_ptr<Region> >::const_iterator i = regions.begin(); i != regions.end(); ++i) {
+ boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (*i);
+ if (ar) {
+ have_audio = true;
+ }
+ if (boost::dynamic_pointer_cast<MidiRegion> (*i)) {
+ have_midi = true;
+ }
+
+ if ((*i)->locked()) {
+ have_locked = true;
+ } else {
+ have_unlocked = true;
+ }
+
+ if ((*i)->position_lock_style() == MusicTime) {
+ have_position_lock_style_music = true;
+ } else {
+ have_position_lock_style_audio = true;
+ }
+
+ if ((*i)->muted()) {
+ have_muted = true;
+ } else {
+ have_unmuted = true;
+ }
+
+ if ((*i)->opaque()) {
+ have_opaque = true;
+ } else {
+ have_non_opaque = true;
+ }
+
+ if (!(*i)->at_natural_position()) {
+ have_not_at_natural_position = true;
+ }
+
+ if (ar) {
+ /* its a bit unfortunate that "envelope visible" is a view-only
+ property. we have to find the regionview to able to check
+ its current setting.
+ */
+
+ RegionView* rv = sv->find_view (ar);
+ have_envelope_invisible = true;
+
+ if (rv) {
+ AudioRegionView* arv = dynamic_cast<AudioRegionView*> (rv);
+ if (arv && arv->envelope_visible()) {
+ have_envelope_visible = true;
+ }
+ }
+
+ if (ar->envelope_active()) {
+ have_envelope_active = true;
+ } else {
+ have_envelope_inactive = true;
+ }
+
+ if (ar->scale_amplitude() != 1) {
+ have_non_unity_scale_amplitude = true;
+ }
+ }
+ }