diff options
Diffstat (limited to 'libs/ardour/region_factory.cc')
-rw-r--r-- | libs/ardour/region_factory.cc | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc index 44615e2182..6f49d8c5b3 100644 --- a/libs/ardour/region_factory.cc +++ b/libs/ardour/region_factory.cc @@ -327,13 +327,34 @@ RegionFactory::region_by_id (const PBD::ID& id) RegionMap::iterator i = region_map.find (id); if (i == region_map.end()) { - cerr << "ID " << id << " not found in region map\n"; return boost::shared_ptr<Region>(); } return i->second; } - + +boost::shared_ptr<Region> +RegionFactory::wholefile_region_by_name (const std::string& name) +{ + for (RegionMap::iterator i = region_map.begin(); i != region_map.end(); ++i) { + if (i->second->whole_file() && i->second->name() == name) { + return i->second; + } + } + return boost::shared_ptr<Region>(); +} + +boost::shared_ptr<Region> +RegionFactory::region_by_name (const std::string& name) +{ + for (RegionMap::iterator i = region_map.begin(); i != region_map.end(); ++i) { + if (i->second->name() == name) { + return i->second; + } + } + return boost::shared_ptr<Region>(); +} + void RegionFactory::clear_map () { |