void Source_Ref::redirect(unsigned media_nr, const Url & new_url)
{ _pimpl->redirect(media_nr, new_url); }
+
+ void Source_Ref::release()
+ { _pimpl->release(); }
media::MediaVerifierRef Source_Ref::verifier(unsigned media_nr)
{ return _pimpl->verifier(media_nr); }
*/
void redirect(unsigned media_nr, const Url & new_url);
+ /**
+ * Release all medias attached by the source
+ */
+ void release();
+
/**
* Provide a media verifier suitable for the given media number
*/
}
}
+ void SourceManager::releaseAllSources()
+ {
+ for (SourceMap::iterator it = _sources.begin();
+ it != _sources.end(); it++)
+ {
+ it->second->release();
+ }
+ }
+
void SourceManager::removeSource(const std::string & alias_r)
{
for (SourceMap::iterator it = _sources.begin(); it != _sources.end(); ++it)
*/
void removeSource(const std::string & alias_r);
+ /**
+ * Release all medias held by all sources
+ *
+ * \throws Exception
+ */
+ void releaseAllSources();
+
/**
* Disable all registered sources
*/
medias = MediaMap();
}
+ void MediaSet::release()
+ {
+ media::MediaManager media_mgr;
+ for (MediaMap::iterator it = medias.begin(); it != medias.end(); it++)
+ {
+ if (media_mgr.isAttached(it->second))
+ {
+ media_mgr.release(it->second, false);
+ }
+ }
+ }
+
media::MediaAccessId MediaSet::getMediaAccessId (media::MediaNr medianr)
{
media::MediaManager media_mgr;
void redirect (media::MediaNr medianr, media::MediaAccessId media_id);
/** Reset the handles to the medias */
void reset();
+ /**
+ * Release all medias in the set
+ */
+ void release();
protected:
_media_set->redirect(media_nr, id);
}
+ void SourceImpl::release()
+ {
+ _media_set->release();
+ }
+
media::MediaVerifierRef SourceImpl::verifier(unsigned media_nr)
{ return media::MediaVerifierRef(new media::NoVerifier()); }
virtual void setZmdDescription (const std::string desc_r);
virtual void redirect(unsigned media_nr, const Url & new_url);
+ /**
+ * Release all medias attached by the source
+ */
+ void release();
/**
* Get media verifier for the specified media
*/