lumiera_documentation/src/proc/mobject/session/session-impl.cpp
Ichthyostega 7da8844581 first steps towards using the new SessionServices access mechanism
add the necessary hooks and change the SessionImpl accordingly.
Still using the old access method for any real code
2009-11-09 07:35:08 +01:00

126 lines
3 KiB
C++

/*
SessionImpl - holds the complete session data to be edited by the user
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
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.
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.
* *****************************************************/
#include "proc/mobject/session/session-impl.hpp"
#include "proc/mobject/placement.hpp"
#include "lib/error.hpp"
namespace mobject {
namespace session {
/////////////////////////////////////////TODO temporary hack
namespace {
DefsManager&
getDummyDefaultsManager()
{
static scoped_ptr<DefsManager> dummyDefaultsManagerInstance(new DefsManager);
return *dummyDefaultsManagerInstance;
}
}
/////////////////////////////////////////TODO temporary hack
/** create a new empty session with default values.
* @note any exception arising while creating this
* default session will inevitably halt the
* system (and this is desirable)
*/
SessionImpl::SessionImpl ()
: Session( getDummyDefaultsManager() ), ///////TODO temporary hack
focusEDL_(0),
edls(1),
fixture(new Fixture),
pIdx_(PlacementIndex::create())
{
}
/** @internal used by SessionManager#clear
* discard all EDL content, without
* touching global configuration.
*/
void
SessionImpl::clear ()
{
try
{
edls.clear();
edls.resize(1);
focusEDL_ = 0;
}
catch (...)
{
focusEDL_ = 0;
throw lumiera::error::Fatal ("unexpected exception while clearing EDLs");
}
}
bool
SessionImpl::isValid ()
{
UNIMPLEMENTED ("session self test");
return false; // TODO
}
void
SessionImpl::add (PMO& placement)
{
UNIMPLEMENTED ("add Placement to the current EDL");
}
bool
SessionImpl::remove (PMO& placement)
{
UNIMPLEMENTED ("search and remove a given Placement from current EDL");
return false; // TODO
}
/// @deprecated should not grant direct access to EDL objects
EDL&
SessionImpl::currEDL ()
{
ASSERT (focusEDL_ < edls.size());
return edls[focusEDL_];
}
PFix&
SessionImpl::getFixture ()
{
return fixture;
}
void
SessionImpl::rebuildFixture ()
{
UNIMPLEMENTED ("rebuild Fixture");
}
}} // namespace mobject::session