lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
JournallingObject.h
Go to the documentation of this file.
1
/*
2
* JournallingObject.h - declaration of class JournallingObject
3
*
4
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5
*
6
* This file is part of LMMS - https://lmms.io
7
*
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public
19
* License along with this program (see COPYING); if not, write to the
20
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301 USA.
22
*
23
*/
24
25
#ifndef LMMS_JOURNALLING_OBJECT_H
26
#define LMMS_JOURNALLING_OBJECT_H
27
28
#include <QStack>
29
30
#include "
LmmsTypes.h
"
31
#include "
SerializingObject.h
"
32
33
namespace
lmms
34
{
35
36
class
LMMS_EXPORT
JournallingObject
:
public
SerializingObject
37
{
38
public
:
39
JournallingObject
();
40
~JournallingObject
()
override
;
41
42
inline
jo_id_t
id
()
const
43
{
44
return
m_id
;
45
}
46
47
void
saveJournallingState
(
const
bool
newState )
48
{
49
m_journallingStateStack
.push(
m_journalling
);
50
m_journalling
= newState;
51
}
52
53
void
restoreJournallingState
()
54
{
55
if
( !
isJournallingStateStackEmpty
())
56
{
57
m_journalling
=
m_journallingStateStack
.pop();
58
}
59
}
60
61
void
addJournalCheckPoint();
62
63
QDomElement saveState( QDomDocument & _doc,
64
QDomElement & _parent )
override
;
65
66
void
restoreState(
const
QDomElement & _this )
override
;
67
68
inline
bool
isJournalling
()
const
69
{
70
return
m_journalling
;
71
}
72
73
inline
void
setJournalling
(
const
bool
_sr )
74
{
75
m_journalling
= _sr;
76
}
77
78
inline
bool
testAndSetJournalling
(
const
bool
newState )
79
{
80
const
bool
oldJournalling =
m_journalling
;
81
m_journalling
= newState;
82
return
oldJournalling;
83
}
84
85
bool
isJournallingStateStackEmpty
()
const
86
{
87
return
m_journallingStateStack
.isEmpty();
88
}
89
90
protected
:
91
void
changeID(
jo_id_t
_id );
92
93
94
private
:
95
jo_id_t
m_id
;
96
97
bool
m_journalling
;
98
99
QStack<bool>
m_journallingStateStack
;
100
101
} ;
102
103
104
}
// namespace lmms
105
106
#endif
// LMMS_JOURNALLING_OBJECT_H
LmmsTypes.h
SerializingObject.h
lmms::JournallingObject::m_id
jo_id_t m_id
Definition
JournallingObject.h:95
lmms::JournallingObject::restoreJournallingState
void restoreJournallingState()
Definition
JournallingObject.h:53
lmms::JournallingObject::setJournalling
void setJournalling(const bool _sr)
Definition
JournallingObject.h:73
lmms::JournallingObject::m_journallingStateStack
QStack< bool > m_journallingStateStack
Definition
JournallingObject.h:99
lmms::JournallingObject::isJournalling
bool isJournalling() const
Definition
JournallingObject.h:68
lmms::JournallingObject::JournallingObject
JournallingObject()
Definition
JournallingObject.cpp:36
lmms::JournallingObject::id
jo_id_t id() const
Definition
JournallingObject.h:42
lmms::JournallingObject::isJournallingStateStackEmpty
bool isJournallingStateStackEmpty() const
Definition
JournallingObject.h:85
lmms::JournallingObject::saveJournallingState
void saveJournallingState(const bool newState)
Definition
JournallingObject.h:47
lmms::JournallingObject::m_journalling
bool m_journalling
Definition
JournallingObject.h:97
lmms::JournallingObject::testAndSetJournalling
bool testAndSetJournalling(const bool newState)
Definition
JournallingObject.h:78
lmms::SerializingObject::SerializingObject
SerializingObject()
Definition
SerializingObject.cpp:32
lmms
Definition
RemotePluginBase.cpp:34
lmms::jo_id_t
std::uint32_t jo_id_t
Definition
LmmsTypes.h:50
Generated on
for lmms by
1.18.0