Lumiera  0.pre.03
»edit your freedom«
unknown.cpp
Go to the documentation of this file.
1 /*
2  Unknown - placeholder for unknown or unavailable media source
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
29 #include "steam/asset/unknown.hpp"
30 #include "lib/format-string.hpp"
31 
32 using util::_Fmt;
33 
34 namespace steam {
35 namespace asset {
36 
37  LUMIERA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media referred by placeholder not found");
38 
39 
40 
46  Unknown::Unknown (const Asset::Ident& idi, string name, Duration length)
47  : Media (idi, name, length)
48  {
49  TODO ("implement some sensible behaviour for the »unknown media« placeholder...");
50  }
51 
52 
58  {
59  UNIMPLEMENTED ("how to get at the original media from a »Unknown« placeholder");
60  if (1==0)
61  throw lumiera::error::Invalid (_Fmt("Unable to locate original media "
62  "for ID=%s, filename=\"%s\".")
63  % this->ident
64  % this->getFilename()
65  ,LUMIERA_ERROR_ORIG_NOT_FOUND);
66  }
67 
68 
69 
70 }} // namespace asset
Unknown(const Asset::Ident &idi, string name="", Duration length=DUMMY_TIME)
create a placeholder for a media with the given identity.
Definition: unknown.cpp:46
key abstraction: media-like assets
Definition: media.hpp:72
Front-end for printf-style string template interpolation.
const Ident ident
Asset identification tuple.
Definition: asset.hpp:208
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
Derived specific exceptions within Lumiera&#39;s exception hierarchy.
Definition: error.hpp:199
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:158
virtual Media::PMedia getOrg()
using the information stored in this placeholder asset, try to access the "real" media it stands for...
Definition: unknown.cpp:57
Marker Asset to indicate an unknown media source.
Duration is the internal Lumiera time metric.
Definition: timevalue.hpp:477
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:80
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
ElementBoxWidget::Config::Qualifier name(string id)
define the name-ID displayed in the caption
#define LUMIERA_ERROR_DEFINE(err, msg)
Definition and initialisation of an error constant.
Definition: error.h:80