2009-02-09 01:21:01 +01:00
|
|
|
/*
|
|
|
|
|
DummyPlayer(Proxy) - access point and service implementing a dummy test player
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-02-09 01:21:01 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2009, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-02-09 01:21:01 +01: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.
|
|
|
|
|
|
2009-02-09 01:21:01 +01: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
|
|
|
|
2009-02-09 01:21:01 +01: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
|
|
|
|
2009-02-09 01:21:01 +01:00
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-03 03:14:55 +02:00
|
|
|
/** @file dummy-player-interface-proxy.cpp
|
|
|
|
|
** Interface-Proxy for the lumiera::DummyPlayer facade (experimental/obsolete).
|
2009-02-09 01:21:01 +01:00
|
|
|
** The purpose is to define a proxy implementation of lumiera::DummyPlayer, in order to
|
|
|
|
|
** redirect any calls through the associated C Language Interface "lumieraorg_DummyPlayer"
|
2013-01-04 07:45:18 +01:00
|
|
|
**
|
|
|
|
|
** @remarks the implementation of this interface proxy for the DummyPlayer highlighted
|
|
|
|
|
** some interesting design issues. The way we're defining our interfaces and
|
|
|
|
|
** bindings seems to have some shortcomings when attempting to express an
|
|
|
|
|
** interface (here DummyPlayer) in terms of another abstraction
|
|
|
|
|
** (here the DummyPlayer::Process), since the implementation of this
|
|
|
|
|
** abstraction has to be mapped and indirected via the interface-system
|
|
|
|
|
** as well. This forces us to duplicate all of these secondary interface
|
|
|
|
|
** functions several times, and incurs a further forwarding through the
|
|
|
|
|
** smart-Handle, since our interface system doesn't support suitable
|
|
|
|
|
** lifecycle support out of the box and instead places this burden
|
|
|
|
|
** onto the client code (or, as in this case here, the intermediary
|
|
|
|
|
** proxy used by the client code to access the interface).
|
|
|
|
|
**
|
2009-02-09 01:21:01 +01:00
|
|
|
** @see dummy-player-facade.hpp
|
|
|
|
|
** @see dummy-player-service.hpp actual implementation within the Proc-Layer
|
2018-04-03 03:14:55 +02:00
|
|
|
** @deprecated obsolete early design draft from 2009;
|
|
|
|
|
** as of 2018 only kept in source to compile some likewise obsolete UI widgets.
|
2009-02-09 01:21:01 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ==================== DummyPlayer ======================================= */
|
|
|
|
|
|
2013-01-04 07:45:18 +01:00
|
|
|
#include "include/dummy-player-facade.h"
|
2016-11-04 22:29:24 +01:00
|
|
|
#include "include/interfaceproxy.hpp"
|
2009-02-09 01:21:01 +01:00
|
|
|
|
2009-02-09 01:42:28 +01:00
|
|
|
namespace lumiera {
|
2009-02-09 01:21:01 +01:00
|
|
|
|
2013-01-04 04:34:01 +01:00
|
|
|
// emit the vtable here into this translation unit within liblumieracommon.so ...
|
|
|
|
|
DummyPlayer::~DummyPlayer() { }
|
|
|
|
|
|
2009-02-09 01:42:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 01:21:01 +01:00
|
|
|
namespace facade {
|
|
|
|
|
|
|
|
|
|
typedef lumiera::InstanceHandle< LUMIERA_INTERFACE_INAME(lumieraorg_DummyPlayer, 0)
|
2013-01-04 07:45:18 +01:00
|
|
|
, lumiera::DummyPlayer
|
2011-05-24 03:46:32 +02:00
|
|
|
> IHandle_DummyPlayer;
|
2009-02-09 01:21:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
class Proxy<IHandle_DummyPlayer>
|
2018-04-02 08:20:56 +02:00
|
|
|
: public Binding<IHandle_DummyPlayer>
|
2009-02-09 01:21:01 +01:00
|
|
|
{
|
|
|
|
|
//----Proxy-Implementation-of-DummyPlayer--------
|
2013-01-04 07:45:18 +01:00
|
|
|
typedef lumiera::DummyPlayer::Process Process;
|
2009-02-09 01:21:01 +01:00
|
|
|
typedef proc::play::ProcessImpl ProcessImpl;
|
|
|
|
|
|
|
|
|
|
/** @note as an optimisation we hand out a direct reference
|
|
|
|
|
* to the implementing process object. While this ref could
|
|
|
|
|
* still be passed as handle to the C Language interface, using
|
|
|
|
|
* it directly within the client (=GUI) bypasses the C interface
|
|
|
|
|
* and thus leaves us only with one level of indirection,
|
|
|
|
|
* irrespective if using the C or C++ interface.
|
2013-01-04 07:45:18 +01:00
|
|
|
* @note in hindsight this turned out as a very bad idea,
|
|
|
|
|
* since it complicated the definition of the facade proxy
|
|
|
|
|
* and created quite involved library dependency problems.
|
2009-02-09 01:21:01 +01:00
|
|
|
*/
|
2016-12-12 03:09:08 +01:00
|
|
|
Process start(LumieraDisplaySlot viewerHandle) override
|
2009-02-09 01:21:01 +01:00
|
|
|
{
|
2013-01-04 07:45:18 +01:00
|
|
|
ProcessImplementationLink* pP = static_cast<ProcessImplementationLink*> (_i_.startPlay (viewerHandle));
|
2009-02-09 01:21:01 +01:00
|
|
|
|
|
|
|
|
if (!pP)
|
|
|
|
|
throw lumiera::error::State("failed to start DummyPlayer", lumiera_error());
|
|
|
|
|
|
|
|
|
|
return pP->createHandle();
|
2013-01-04 07:45:18 +01:00
|
|
|
}
|
2009-02-09 01:21:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
2018-04-02 08:20:56 +02:00
|
|
|
using IBinding::IBinding;
|
2009-02-09 01:21:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2018-04-02 08:20:56 +02:00
|
|
|
// template void openProxy<IHandle_DummyPlayer> (IHandle_DummyPlayer const&);
|
|
|
|
|
// template void closeProxy<IHandle_DummyPlayer> (void);
|
2009-02-09 01:21:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace facade
|
|
|
|
|
|
2013-01-04 07:45:18 +01:00
|
|
|
|
|
|
|
|
/* === Forwarding function(s) on the Process handle === */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
DummyPlayer::Process::play (bool yes)
|
|
|
|
|
{
|
|
|
|
|
// access the implementation via smart-Handle
|
|
|
|
|
impl().doPlay(yes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// emit the VTable and typeinfo for this interface here (in liblumieracommon.so)
|
|
|
|
|
DummyPlayer::ProcessImplementationLink::~ProcessImplementationLink() { };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-02-09 01:21:01 +01:00
|
|
|
} // namespace lumiera
|