Return silence from read_from_sources() if we try to read a channel that our source...
[ardour.git] / libs / ardour / region_factory.cc
index 6af256f169ec356399893ed6694dc235cc5b4ed7..fa948844abcf2adc224127a03b1115fc5f8eb555 100644 (file)
 #include <inttypes.h>
 
 #include "pbd/error.h"
-#include "pbd/boost_debug.h"
 
-#include "ardour/session.h"
-
-#include "ardour/region_factory.h"
-#include "ardour/region.h"
 #include "ardour/audioregion.h"
 #include "ardour/audiosource.h"
-#include "ardour/midi_source.h"
 #include "ardour/midi_region.h"
-#include "ardour/utils.h"
+#include "ardour/midi_source.h"
+#include "ardour/region.h"
+#include "ardour/region_factory.h"
+#include "ardour/session.h"
 
 #include "i18n.h"
 
@@ -78,11 +75,10 @@ RegionFactory::create (boost::shared_ptr<const Region> region, bool announce)
                if (ret->session().config.get_glue_new_regions_to_bars_and_beats ()) {
                        ret->set_position_lock_style (MusicTime);
                }
-               
-               map_add (ret);
 
                /* pure copy constructor - no property list */
                if (announce) {
+                       map_add (ret);
                        CheckNewRegion (ret);
                }
        }
@@ -122,9 +118,8 @@ RegionFactory::create (boost::shared_ptr<Region> region, const PropertyList& pli
                        ret->set_position_lock_style (MusicTime);
                }
                
-               map_add (ret);
-
                if (announce) {
+                       map_add (ret);
                        CheckNewRegion (ret);
                }
        }
@@ -164,9 +159,8 @@ RegionFactory::create (boost::shared_ptr<Region> region, frameoffset_t offset, c
                        ret->set_position_lock_style (MusicTime);
                }
 
-               map_add (ret);
-
                if (announce) {
+                       map_add (ret);
                        CheckNewRegion (ret);
                }
        }
@@ -206,9 +200,8 @@ RegionFactory::create (boost::shared_ptr<Region> region, const SourceList& srcs,
                        ret->set_position_lock_style (MusicTime);
                }
 
-               map_add (ret);
-
                if (announce) {
+                       map_add (ret);
                        CheckNewRegion (ret);
                }
        }
@@ -251,9 +244,8 @@ RegionFactory::create (const SourceList& srcs, const PropertyList& plist, bool a
                        ret->set_position_lock_style (MusicTime);
                }
                
-               map_add (ret);
-
                if (announce) {
+                       map_add (ret);
                        CheckNewRegion (ret);
                }
        }