2007-09-02 18:48:22 +02:00
|
|
|
/*
|
|
|
|
|
Unknown - placeholder for unknown or unavailable media source
|
|
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, 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.
|
|
|
|
|
|
|
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "proc/asset/unknown.hpp"
|
2007-11-20 05:20:01 +01:00
|
|
|
#include <boost/format.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using boost::format;
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
namespace asset
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
2007-11-19 04:58:18 +01:00
|
|
|
|
2007-11-20 05:20:01 +01:00
|
|
|
/** create a placeholder for a media with the given identity.
|
|
|
|
|
* the denoted original media (identity) can be accessed later
|
2007-11-26 04:27:27 +01:00
|
|
|
* on using the Unknown::getOrg() function.
|
|
|
|
|
* @note we don't depend on the refered media...
|
|
|
|
|
*/
|
2007-11-20 05:20:01 +01:00
|
|
|
Unknown::Unknown (const Asset::Ident& idi, string name, Time length)
|
|
|
|
|
: Media (idi, name, length)
|
2007-11-19 04:58:18 +01:00
|
|
|
{
|
2007-11-20 05:20:01 +01:00
|
|
|
TODO ("implement some sensible behaviour for the »unknown media« placeholder...");
|
2007-11-19 04:58:18 +01:00
|
|
|
}
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
|
2007-11-20 05:20:01 +01:00
|
|
|
/** using the information stored in this placeholder asset,
|
|
|
|
|
* try to access the "real" media it stands for.
|
|
|
|
|
*/
|
|
|
|
|
Media::PMedia
|
2008-04-09 00:27:21 +02:00
|
|
|
Unknown::getOrg() throw(lumiera::error::Invalid)
|
2007-11-20 05:20:01 +01:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("how to get at the original media from a »Unknown« placeholder");
|
|
|
|
|
if (1==0)
|
2008-04-09 00:27:21 +02:00
|
|
|
throw lumiera::error::Invalid (str(format("Unable to locate original media "
|
|
|
|
|
"for ID=%s, filename=\"%s\".")
|
|
|
|
|
% string(this->ident)
|
|
|
|
|
% string(this->getFilename()))
|
|
|
|
|
,LUMIERA_ERROR_ORIG_NOT_FOUND
|
|
|
|
|
);
|
2007-11-20 05:20:01 +01:00
|
|
|
}
|
|
|
|
|
|
2008-04-09 00:27:21 +02:00
|
|
|
LUMIERA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media refered by placeholder not found");
|
2007-11-20 05:20:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
} // namespace asset
|