2007-09-02 18:48:22 +02:00
|
|
|
/*
|
2008-01-07 18:16:03 +01:00
|
|
|
PORT.hpp - structural asset corresponding to some port generating media output
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
Copyright (C) CinelerraCV
|
2007-11-27 03:19:35 +01:00
|
|
|
2007, Hermann Vosseler <Ichthyostega@web.de>
|
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
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef ASSET_OUTPORT_H
|
|
|
|
|
#define ASSET_OUTPORT_H
|
|
|
|
|
|
|
|
|
|
#include "proc/asset/struct.hpp"
|
2008-01-07 18:16:03 +01:00
|
|
|
#include "proc/asset/procpatt.hpp"
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace asset
|
|
|
|
|
{
|
2008-01-12 18:19:37 +01:00
|
|
|
|
|
|
|
|
class Port;
|
2008-01-14 01:01:11 +01:00
|
|
|
typedef shared_ptr<Port> PPort;
|
2008-01-12 18:19:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
class ID<Port> : public ID<Struct>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ID (size_t id);
|
|
|
|
|
ID (const Port&);
|
|
|
|
|
};
|
2007-09-02 18:48:22 +02:00
|
|
|
|
2008-01-12 18:19:37 +01:00
|
|
|
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
/**
|
2008-01-07 18:16:03 +01:00
|
|
|
* structural asset corresponding to some port
|
|
|
|
|
* for building a processing chain and
|
|
|
|
|
* generating media output
|
2007-09-02 18:48:22 +02:00
|
|
|
*/
|
2008-01-07 18:16:03 +01:00
|
|
|
class Port : public Struct
|
2007-09-02 18:48:22 +02:00
|
|
|
{
|
2008-01-12 18:19:37 +01:00
|
|
|
string portID_;
|
2008-02-13 04:41:58 +01:00
|
|
|
PProcPatt wiringTemplate;
|
2008-01-14 01:01:11 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
wstring shortDesc;
|
|
|
|
|
wstring longDesc;
|
|
|
|
|
|
|
|
|
|
virtual const ID<Port>& getID() const ///< @return ID typed to asset::Port
|
|
|
|
|
{
|
|
|
|
|
return static_cast<const ID<Port>& > (Asset::getID());
|
|
|
|
|
}
|
|
|
|
|
|
2008-01-12 18:19:37 +01:00
|
|
|
|
2008-01-07 18:16:03 +01:00
|
|
|
protected:
|
2008-01-14 01:01:11 +01:00
|
|
|
Port (PProcPatt& wiring, string portID="", wstring shortDesc =wstring(), wstring longDesc =wstring()) ;
|
2008-01-12 18:19:37 +01:00
|
|
|
friend class StructFactory;
|
2008-02-10 17:23:16 +01:00
|
|
|
friend class StructFactoryImpl;
|
2008-01-07 18:16:03 +01:00
|
|
|
|
2008-01-14 01:01:11 +01:00
|
|
|
public:
|
|
|
|
|
const string& getPortID() const { return portID_; }
|
|
|
|
|
const PProcPatt& getProcPatt() const { return wiringTemplate; }
|
|
|
|
|
|
|
|
|
|
/** use another wiring template. Triggers complete rebuild of the render engine. */
|
|
|
|
|
void switchProcPatt (PProcPatt& another);
|
|
|
|
|
|
|
|
|
|
/** convienience shortcut for retrieving default configured ports */
|
2008-01-27 23:40:45 +01:00
|
|
|
static PPort query (string properties) ;
|
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...
|
|
|
|
|
//
|
|
|
|
|
inline ID<Port>::ID(size_t id) : ID<Struct> (id) {};
|
|
|
|
|
inline ID<Port>::ID(const Port& port) : ID<Struct> (port.getID()) {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
} // namespace asset
|
|
|
|
|
#endif
|