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)
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
20 #include "steam/asset/unknown.hpp"
21 #include "lib/format-string.hpp"
22 
23 using util::_Fmt;
24 
25 namespace steam {
26 namespace asset {
27 
28  LUMIERA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media referred by placeholder not found");
29 
30 
31 
37  Unknown::Unknown (const Asset::Ident& idi, string name, Duration length)
38  : Media (idi, name, length)
39  {
40  TODO ("implement some sensible behaviour for the »unknown media« placeholder...");
41  }
42 
43 
49  {
50  UNIMPLEMENTED ("how to get at the original media from a »Unknown« placeholder");
51  if (1==0)
52  throw lumiera::error::Invalid (_Fmt("Unable to locate original media "
53  "for ID=%s, filename=\"%s\".")
54  % this->ident
55  % this->getFilename()
56  ,LUMIERA_ERROR_ORIG_NOT_FOUND);
57  }
58 
59 
60 
61 }} // 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:37
key abstraction: media-like assets
Definition: media.hpp:63
Front-end for printf-style string template interpolation.
const Ident ident
Asset identification tuple.
Definition: asset.hpp:199
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:190
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:149
virtual Media::PMedia getOrg()
using the information stored in this placeholder asset, try to access the "real" media it stands for...
Definition: unknown.cpp:48
Marker Asset to indicate an unknown media source.
Duration is the internal Lumiera time metric.
Definition: timevalue.hpp:468
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:71
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
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:71