2007-09-02 18:48:22 +02:00
|
|
|
/*
|
2008-02-14 04:12:30 +01:00
|
|
|
PIPE.hpp - structural asset denoting a processing pipe generating media output
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-03-10 08:38:59 +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
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2008-02-14 04:12:30 +01:00
|
|
|
#ifndef ASSET_PIPE_H
|
|
|
|
|
#define ASSET_PIPE_H
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
#include "proc/asset/struct.hpp"
|
2008-01-07 18:16:03 +01:00
|
|
|
#include "proc/asset/procpatt.hpp"
|
2011-12-02 16:10:03 +01:00
|
|
|
#include "proc/streamtype.hpp"
|
2012-12-01 08:44:07 +01:00
|
|
|
#include "common/query.hpp"
|
2007-09-02 18:48:22 +02:00
|
|
|
|
2010-06-27 03:48:00 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
|
2011-12-02 16:10:03 +01:00
|
|
|
namespace proc {
|
2010-03-01 05:36:18 +01:00
|
|
|
namespace asset {
|
|
|
|
|
|
2012-12-01 08:44:07 +01:00
|
|
|
using lumiera::Query;
|
2010-06-27 03:48:00 +02:00
|
|
|
using std::string;
|
2008-01-12 18:19:37 +01:00
|
|
|
|
2008-02-14 04:12:30 +01:00
|
|
|
class Pipe;
|
2008-05-19 08:46:19 +02:00
|
|
|
typedef P<Pipe> PPipe;
|
2008-01-12 18:19:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
template<>
|
2008-02-14 04:12:30 +01:00
|
|
|
class ID<Pipe> : public ID<Struct>
|
2008-01-12 18:19:37 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2010-11-27 05:11:02 +01:00
|
|
|
ID (HashVal id);
|
2010-12-10 15:29:43 +01:00
|
|
|
ID (Pipe const&);
|
|
|
|
|
ID (PPipe const&);
|
|
|
|
|
|
|
|
|
|
/** allows a Pipe-ID to stand in for a full Pipe Asset
|
2010-12-10 17:39:39 +01:00
|
|
|
* @throw error::Invalid when there is no corresponding Pipe */
|
2010-12-10 15:29:43 +01:00
|
|
|
operator PPipe() const;
|
2010-12-10 17:39:39 +01:00
|
|
|
|
|
|
|
|
/** allows to fetch the StreamType directly just from a Pipe-ID
|
|
|
|
|
* @throw error::Invalid when there is no corresponding Pipe */
|
|
|
|
|
StreamType::ID streamType() const;
|
2008-01-12 18:19:37 +01:00
|
|
|
};
|
2010-03-01 05:36:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
/**
|
2010-06-27 03:48:00 +02:00
|
|
|
* structural asset corresponding to the part
|
|
|
|
|
* of the model forming a processing pipe
|
|
|
|
|
* for generating media output
|
2007-09-02 18:48:22 +02:00
|
|
|
*/
|
2010-10-31 02:02:31 +01:00
|
|
|
class Pipe
|
|
|
|
|
: public Struct
|
2007-09-02 18:48:22 +02:00
|
|
|
{
|
2010-10-31 02:02:31 +01:00
|
|
|
PProcPatt wiringTemplate_;
|
2010-12-10 17:39:39 +01:00
|
|
|
StreamType::ID streamID_; ////////////////////////////////////////TICKET #648
|
2008-01-14 01:01:11 +01:00
|
|
|
|
|
|
|
|
public:
|
2010-06-27 03:48:00 +02:00
|
|
|
string shortDesc;
|
|
|
|
|
string longDesc;
|
2008-01-14 01:01:11 +01:00
|
|
|
|
2010-06-27 03:48:00 +02:00
|
|
|
virtual const ID<Pipe>& getID() const ///< @return ID typed to asset::Pipe
|
2008-01-14 01:01:11 +01:00
|
|
|
{
|
2008-02-14 04:12:30 +01:00
|
|
|
return static_cast<const ID<Pipe>& > (Asset::getID());
|
2008-01-14 01:01:11 +01:00
|
|
|
}
|
2010-03-01 05:36:18 +01:00
|
|
|
|
2008-01-12 18:19:37 +01:00
|
|
|
|
2008-01-07 18:16:03 +01:00
|
|
|
protected:
|
2010-10-31 02:02:31 +01:00
|
|
|
Pipe (Asset::Ident const&, string const& streamID, PProcPatt& wiring, string shortName ="", string longName ="") ;
|
2010-12-30 04:30:33 +01:00
|
|
|
// friend class StructFactory;
|
2008-02-10 17:23:16 +01:00
|
|
|
friend class StructFactoryImpl;
|
2010-03-01 05:36:18 +01:00
|
|
|
|
2008-01-14 01:01:11 +01:00
|
|
|
public:
|
2010-10-31 02:02:31 +01:00
|
|
|
string const& getPipeID() const { return ident.name; }
|
2010-12-10 17:39:39 +01:00
|
|
|
StreamType::ID getStreamID() const { return streamID_; } ////////////////////////////////////////TICKET #648
|
2010-10-31 02:02:31 +01:00
|
|
|
PProcPatt const& getProcPatt() const { return wiringTemplate_; }
|
|
|
|
|
|
2008-01-14 01:01:11 +01:00
|
|
|
|
|
|
|
|
/** use another wiring template. Triggers complete rebuild of the render engine. */
|
|
|
|
|
void switchProcPatt (PProcPatt& another);
|
|
|
|
|
|
2010-01-09 05:10:32 +01:00
|
|
|
/** convenience shortcut for retrieving default configured pipes */
|
2012-12-26 02:20:11 +01:00
|
|
|
static PPipe query (string const& properties);
|
2010-11-24 06:20:53 +01:00
|
|
|
|
|
|
|
|
/** convenience shortcut for lookup by id */
|
|
|
|
|
static PPipe lookup (ID<Pipe> id);
|
2007-09-02 18:48:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2008-01-12 18:19:37 +01:00
|
|
|
// catch up with postponed definition of ID<Struct> ctors...
|
|
|
|
|
//
|
2010-12-10 15:29:43 +01:00
|
|
|
inline ID<Pipe>::ID(HashVal id) : ID<Struct> (id) {};
|
|
|
|
|
inline ID<Pipe>::ID(Pipe const& pipe) : ID<Struct> (pipe.getID()) {};
|
|
|
|
|
inline ID<Pipe>::ID(PPipe const& pipe) : ID<Struct> (pipe->getID()) {};
|
2010-03-01 05:36:18 +01:00
|
|
|
|
2010-12-10 17:39:39 +01:00
|
|
|
inline
|
|
|
|
|
ID<Pipe>::operator PPipe() const
|
|
|
|
|
{
|
|
|
|
|
return Pipe::lookup(*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline StreamType::ID
|
|
|
|
|
ID<Pipe>::streamType() const
|
|
|
|
|
{
|
|
|
|
|
return Pipe::lookup(*this)->getStreamID();
|
|
|
|
|
}
|
2010-03-01 05:36:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-02 16:10:03 +01:00
|
|
|
}} // namespace proc::asset
|
2007-09-02 18:48:22 +02:00
|
|
|
#endif
|