2008-01-14 01:01:11 +01:00
|
|
|
/*
|
|
|
|
|
DefsManager - access to preconfigured default objects and definitions
|
|
|
|
|
|
|
|
|
|
Copyright (C) CinelerraCV
|
|
|
|
|
2007, Hermann Vosseler <Ichthyostega@web.de>
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "proc/mobject/session/defsmanager.hpp"
|
2008-01-27 23:40:45 +01:00
|
|
|
#include "proc/asset/procpatt.hpp"
|
2008-02-14 04:12:30 +01:00
|
|
|
#include "proc/asset/pipe.hpp"
|
2008-01-28 06:05:46 +01:00
|
|
|
#include "common/configrules.hpp"
|
|
|
|
|
#include "common/error.hpp"
|
|
|
|
|
|
|
|
|
|
#include <boost/format.hpp>
|
|
|
|
|
|
|
|
|
|
using boost::format;
|
2008-01-14 01:01:11 +01:00
|
|
|
|
|
|
|
|
using asset::Query;
|
2008-02-14 04:12:30 +01:00
|
|
|
using asset::Pipe;
|
2008-01-27 23:40:45 +01:00
|
|
|
using asset::ProcPatt;
|
2008-01-28 06:05:46 +01:00
|
|
|
using asset::PProcPatt;
|
|
|
|
|
|
|
|
|
|
using cinelerra::ConfigRules;
|
2008-02-01 15:35:33 +01:00
|
|
|
using cinelerra::query::QueryHandler;
|
2008-01-28 06:05:46 +01:00
|
|
|
using cinelerra::query::CINELERRA_ERROR_CAPABILITY_QUERY;
|
2008-01-14 01:01:11 +01:00
|
|
|
|
|
|
|
|
namespace mobject
|
|
|
|
|
{
|
|
|
|
|
namespace session
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/** initialize the most basic internal defaults. */
|
|
|
|
|
DefsManager::DefsManager () throw()
|
|
|
|
|
{
|
2008-02-10 17:23:16 +01:00
|
|
|
TODO ("setup basic defaults of the session");
|
2008-01-14 01:01:11 +01:00
|
|
|
}
|
|
|
|
|
|
2008-01-28 06:05:46 +01:00
|
|
|
|
|
|
|
|
template<class TAR>
|
|
|
|
|
shared_ptr<TAR>
|
|
|
|
|
DefsManager::operator() (const Query<TAR>& capabilities)
|
2008-01-14 01:01:11 +01:00
|
|
|
{
|
2008-02-01 15:35:33 +01:00
|
|
|
QueryHandler<TAR>& typeHandler = ConfigRules::instance();
|
|
|
|
|
shared_ptr<TAR> res = typeHandler.resolve (capabilities);
|
2008-01-28 06:05:46 +01:00
|
|
|
|
|
|
|
|
if (!res)
|
|
|
|
|
throw cinelerra::error::Config ( str(format("The following Query could not be resolved: %s.")
|
2008-02-13 04:41:58 +01:00
|
|
|
% capabilities.asKey())
|
2008-01-28 06:05:46 +01:00
|
|
|
, CINELERRA_ERROR_CAPABILITY_QUERY );
|
|
|
|
|
else
|
|
|
|
|
return res;
|
2008-01-27 23:40:45 +01:00
|
|
|
}
|
|
|
|
|
|
2008-01-28 06:05:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************/
|
|
|
|
|
/* explicit template instantiations for querying various Types */
|
|
|
|
|
/***************************************************************/
|
2008-01-27 23:40:45 +01:00
|
|
|
|
2008-02-14 04:12:30 +01:00
|
|
|
template shared_ptr<Pipe> DefsManager::operator ()(const Query<Pipe>&);
|
2008-01-28 06:05:46 +01:00
|
|
|
template PProcPatt DefsManager::operator ()(const Query<const ProcPatt>&);
|
2008-01-14 01:01:11 +01:00
|
|
|
|
|
|
|
|
} // namespace mobject::session
|
|
|
|
|
|
|
|
|
|
} // namespace mobject
|
2008-01-28 06:05:46 +01:00
|
|
|
|