2007-09-02 18:48:22 +02:00
|
|
|
/*
|
|
|
|
|
Unknown - placeholder for unknown or unavailable media source
|
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:22:31 +01:00
|
|
|
/** @file unknown.cpp
|
2016-11-08 14:18:28 +01:00
|
|
|
** Implementation functions regarding a marker asset for unknown media.
|
2016-11-03 18:20:10 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
#include "proc/asset/unknown.hpp"
|
2016-01-04 01:38:04 +01:00
|
|
|
#include "lib/format-string.hpp"
|
2007-11-20 05:20:01 +01:00
|
|
|
|
2016-01-04 01:38:04 +01:00
|
|
|
using util::_Fmt;
|
2007-09-02 18:48:22 +02:00
|
|
|
|
2011-12-02 16:10:03 +01:00
|
|
|
namespace proc {
|
2010-11-27 05:11:02 +01:00
|
|
|
namespace asset {
|
|
|
|
|
|
|
|
|
|
LUMIERA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media referred by placeholder not found");
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
|
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...
|
|
|
|
|
*/
|
2011-05-16 08:37:36 +02:00
|
|
|
Unknown::Unknown (const Asset::Ident& idi, string name, Duration length)
|
2007-11-20 05:20:01 +01:00
|
|
|
: 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
|
2011-12-02 16:10:03 +01:00
|
|
|
Unknown::getOrg()
|
2007-11-20 05:20:01 +01:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("how to get at the original media from a »Unknown« placeholder");
|
|
|
|
|
if (1==0)
|
2016-01-04 01:38:04 +01:00
|
|
|
throw lumiera::error::Invalid (_Fmt("Unable to locate original media "
|
|
|
|
|
"for ID=%s, filename=\"%s\".")
|
|
|
|
|
% this->ident
|
|
|
|
|
% this->getFilename()
|
|
|
|
|
,LUMIERA_ERROR_ORIG_NOT_FOUND);
|
2007-11-20 05:20:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-02 16:10:03 +01:00
|
|
|
}} // namespace asset
|