2007-09-02 18:48:22 +02:00
|
|
|
/*
|
2010-06-27 03:48:00 +02:00
|
|
|
Pipe - structural asset denoting a processing pipe to generate media output
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
2016-11-03 18:20:10 +01:00
|
|
|
/** @file §§§
|
|
|
|
|
** TODO §§§
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2008-02-14 04:12:30 +01:00
|
|
|
#include "proc/asset/pipe.hpp"
|
2010-11-24 06:20:53 +01:00
|
|
|
#include "proc/assetmanager.hpp"
|
2008-12-17 17:53:32 +01:00
|
|
|
#include "lib/util.hpp"
|
2008-02-18 04:16:53 +01:00
|
|
|
|
|
|
|
|
using util::isnil;
|
2007-09-02 18:48:22 +02:00
|
|
|
|
2011-12-02 16:10:03 +01:00
|
|
|
namespace proc {
|
2010-06-27 03:48:00 +02:00
|
|
|
namespace asset {
|
2008-01-12 18:19:37 +01:00
|
|
|
|
|
|
|
|
|
2010-06-27 03:48:00 +02:00
|
|
|
/** Create and register a new Pipe asset.
|
|
|
|
|
* Usually, this is triggered automatically
|
|
|
|
|
* by referring to the pipeID. When building
|
|
|
|
|
* the render network, the given processing pattern
|
|
|
|
|
* will be executed, allowing for all sorts of
|
|
|
|
|
* default wiring.
|
|
|
|
|
*/
|
2008-02-18 04:16:53 +01:00
|
|
|
Pipe::Pipe ( const Asset::Ident& idi
|
2010-12-10 17:39:39 +01:00
|
|
|
, string const& streamID ////////////////////////////////////////TICKET #648
|
2008-02-18 04:16:53 +01:00
|
|
|
, PProcPatt& wiring
|
2010-06-27 03:48:00 +02:00
|
|
|
, string shortName
|
|
|
|
|
, string longName
|
2010-10-31 02:02:31 +01:00
|
|
|
)
|
2010-10-29 06:09:06 +02:00
|
|
|
: Struct (idi)
|
2010-10-31 02:02:31 +01:00
|
|
|
, wiringTemplate_(wiring)
|
|
|
|
|
, streamID_(streamID)
|
2010-10-29 06:09:06 +02:00
|
|
|
, shortDesc (shortName)
|
|
|
|
|
, longDesc (longName)
|
2008-01-12 18:19:37 +01:00
|
|
|
{
|
2010-10-29 06:09:06 +02:00
|
|
|
REQUIRE (idi.isValid());
|
2008-02-18 04:16:53 +01:00
|
|
|
if (isnil (shortDesc))
|
2010-10-29 06:09:06 +02:00
|
|
|
shortDesc = string(idi);
|
2008-01-12 18:19:37 +01:00
|
|
|
}
|
2010-10-31 02:02:31 +01:00
|
|
|
|
2008-01-14 01:01:11 +01:00
|
|
|
|
|
|
|
|
|
2008-02-14 04:12:30 +01:00
|
|
|
PPipe
|
2012-12-26 02:20:11 +01:00
|
|
|
Pipe::query (string const& properties)
|
2010-11-24 06:20:53 +01:00
|
|
|
{
|
2012-12-26 02:20:11 +01:00
|
|
|
return Struct::retrieve (Query<Pipe> (properties));
|
2010-11-24 06:20:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @param id asset-ID of the pipe to retrieve
|
|
|
|
|
* @throw error::Invalid when not found
|
|
|
|
|
*/
|
|
|
|
|
PPipe
|
|
|
|
|
Pipe::lookup (ID<Pipe> id)
|
|
|
|
|
{
|
|
|
|
|
return AssetManager::instance().getAsset(id);
|
|
|
|
|
}
|
|
|
|
|
|
2008-01-27 23:40:45 +01:00
|
|
|
|
2008-01-14 01:01:11 +01:00
|
|
|
void
|
2008-02-14 04:12:30 +01:00
|
|
|
Pipe::switchProcPatt (PProcPatt& another)
|
2008-01-14 01:01:11 +01:00
|
|
|
{
|
2010-10-31 02:02:31 +01:00
|
|
|
wiringTemplate_ = another;
|
2008-01-14 01:01:11 +01:00
|
|
|
TODO ("trigger rebuild fixture");
|
|
|
|
|
}
|
2010-10-31 02:02:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-02 16:10:03 +01:00
|
|
|
}} // namespace asset
|