2007-09-02 18:48:22 +02:00
|
|
|
/*
|
|
|
|
|
Preview(Asset) - alternative version of the media data, probably with lower resolution
|
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 preview.cpp
|
2016-11-08 14:18:28 +01:00
|
|
|
** Implementation details regarding a placeholder / "Proxy" / preview media asset
|
2016-11-03 18:20:10 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2018-11-15 23:42:43 +01:00
|
|
|
#include "steam/asset/preview.hpp"
|
2007-09-02 18:48:22 +02:00
|
|
|
|
2018-11-15 23:55:13 +01:00
|
|
|
namespace steam {
|
2010-11-27 05:11:02 +01:00
|
|
|
namespace asset {
|
2007-11-19 04:58:18 +01:00
|
|
|
|
|
|
|
|
|
2010-11-27 05:11:02 +01:00
|
|
|
namespace {
|
|
|
|
|
/** @internal derive a sensible asset ident tuple when creating
|
|
|
|
|
* a proxy placeholder media based on some existing asset::Media
|
|
|
|
|
* @todo getting this one right is important for the handling
|
|
|
|
|
* of "proxy editing"....
|
|
|
|
|
*/
|
|
|
|
|
const Asset::Ident
|
|
|
|
|
createProxyIdent (const Asset::Ident& mediaref)
|
2007-11-19 04:58:18 +01:00
|
|
|
{
|
2010-11-27 05:11:02 +01:00
|
|
|
string name (mediaref.name + "-proxy"); // TODO something sensible here; append number, sanitise etc.
|
|
|
|
|
Category category (mediaref.category);
|
|
|
|
|
TODO ("put it in another subfolder within the same category??");
|
|
|
|
|
return Asset::Ident (name, category,
|
|
|
|
|
mediaref.org,
|
|
|
|
|
mediaref.version );
|
|
|
|
|
|
2007-11-19 04:58:18 +01:00
|
|
|
}
|
2010-11-27 05:11:02 +01:00
|
|
|
}//(End)implementation helper
|
2007-11-19 04:58:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** create a preview placeholder ("proxy media") for the given
|
2007-11-20 05:20:01 +01:00
|
|
|
* media asset. The name of the created media asset is derived
|
|
|
|
|
* by decorating the original media's name.
|
2007-11-26 04:27:27 +01:00
|
|
|
* @note creates a dependency between the media and this proxy
|
2007-11-19 04:58:18 +01:00
|
|
|
*/
|
2007-11-26 04:27:27 +01:00
|
|
|
Preview::Preview (Media& mediaref)
|
2007-11-20 05:20:01 +01:00
|
|
|
: Unknown (createProxyIdent (mediaref.ident),
|
|
|
|
|
mediaref.getFilename(),
|
|
|
|
|
mediaref.getLength())
|
2007-11-19 04:58:18 +01:00
|
|
|
{
|
2007-11-26 04:27:27 +01:00
|
|
|
this->defineDependency (mediaref);
|
2007-11-19 04:58:18 +01:00
|
|
|
UNIMPLEMENTED ("do something to setup proxy media");
|
|
|
|
|
}
|
2010-11-27 05:11:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-02 16:10:03 +01:00
|
|
|
}} // namespace asset
|