Lumiera
0.pre.03
»edit your freedom«
session-cmd.cpp
Go to the documentation of this file.
1
/*
2
SessionCmd - actual steam command scripts for session-global actions
3
4
Copyright (C)
5
2017, 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
28
#include "
steam/cmd.hpp
"
29
#include "
steam/control/command-def.hpp
"
30
#include "
steam/mobject/session.hpp
"
31
//#include "lib/symbol.hpp"
32
#include "
lib/idi/entry-id.hpp
"
33
//#include "lib/format-string.hpp"
34
35
//#include <string>
36
37
using
lib::hash::LuidH
;
38
//using std::string;
39
//using util::cStr;
40
//using util::_Fmt;
41
42
43
namespace
steam
{
44
namespace
cmd
{
45
namespace
error
=
lumiera::error
;
46
47
using
mobject::Session;
48
49
namespace
{
// implementation helper...
50
}
//(End) implementation helper
51
52
53
54
58
COMMAND_DEFINITION
(session_saveSnapshot)
59
{
60
def.operation ([](
string
snapshotID)
61
{
62
Session::current
.
save
(snapshotID);
63
})
64
.captureUndo ([](
string
snapshotID) ->
string
65
{
66
return
snapshotID;
67
})
68
.undoOperation ([](
string
,
string
oldSnapshot)
69
{
70
UNIMPLEMENTED (
"how to remove a snapshot from session history"
);
71
});
72
};
73
74
79
COMMAND_DEFINITION
(session_newSequence)
80
{
81
def.operation ([](
LuidH
context,
LuidH
newID
)
82
{
83
UNIMPLEMENTED (
"add a new Sequence into the given context scope within the Session"
);
84
})
85
.captureUndo ([](
LuidH
,
LuidH
addedSeq) ->
LuidH
86
{
87
return
addedSeq;
88
})
89
.undoOperation ([](
LuidH
context,
LuidH
addedSeq,
LuidH
newID)
90
{
91
REQUIRE (addedSeq == newID);
92
UNIMPLEMENTED (
"how to remove a sub-sequence from the given context"
);
93
});
94
};
95
96
97
98
103
}}
// namespace steam::cmd
COMMAND_DEFINITION
#define COMMAND_DEFINITION(_NAME_)
Macro to write command definitions in a compact form.
Definition:
command-setup.hpp:135
cmd.hpp
Common ID definitions for Steam-Layer commands.
steam::mobject::Session::current
static session::SessManager & current
access point to the current Session
Definition:
session.hpp:120
steam
Steam-Layer implementation namespace root.
Definition:
dummy-player-facade.h:37
steam::cmd
Definition:
meta-cmd.cpp:59
steam::mobject::session::SessManager::save
virtual void save(string snapshotID)=0
create a complete, serialised representation of the current session config and contents.
lib::hash::LuidH
Hash implementation based on a lumiera unique object id (LUID) When invoking the default ctor...
Definition:
hash-indexed.hpp:91
entry-id.hpp
Bare symbolic and hash ID used for accounting of asset like entries.
lumiera::error
Definition:
config-rules.hpp:66
session.hpp
Primary Interface to the current Session.
command-def.hpp
Actually defining a command and binding it to execution parameters.
steam::mobject::session::test::anonymous_namespace{defs-manager-impl-test.cpp}::newID
string newID(Symbol prefix)
create a random new ID
Definition:
defs-manager-impl-test.cpp:71
steam
cmd
session-cmd.cpp
Generated on Fri Dec 13 2024 05:05:35 for Lumiera by
1.8.13