Tuning List contains a list of tunings Tuning List is serializable via QDataStream.
More...
#include <TuningList.h>
Tuning List contains a list of tunings Tuning List is serializable via QDataStream.
omni::proj::TuningList::TuningList |
( |
Session const & |
_session | ) |
|
Session const & session_
Definition: TuningList.h:100
Tuning * omni::proj::TuningList::add |
( |
bool |
_makeCurrent = true | ) |
|
Add tuning to list Returns pointer new tuning.
- Parameters
-
_makeCurrent | Flag whether to set current index when added successfully |
40 container_type::emplace_back(
new Tuning(
session_));
41 auto* _tuning = container_type::back().get();
46 _tuning->assignVirtualScreen();
47 _tuning->projector().setup(
"PeripheralSetup",
session_.
scene().size());
void setCurrentIndex(int)
Set new current index, must be between 0 and size()-1.
Definition: TuningList.cpp:66
Session const & session_
Definition: TuningList.h:100
Scene & scene()
Return reference to export settings.
Definition: Session.cpp:144
void omni::proj::TuningList::clear |
( |
| ) |
|
Deletes all tunings.
94 container_type::clear();
int currentIdx_
Definition: TuningList.h:98
Tuning * omni::proj::TuningList::current |
( |
| ) |
|
Returns pointer to current tuning Returns nullptr if currentIdx_ == -1 or tuning list is empty.
bool validIndex(int) const
Test of index is between 0 and size()-1.
Definition: TuningList.cpp:158
int currentIdx_
Definition: TuningList.h:98
Tuning const * omni::proj::TuningList::current |
( |
| ) |
const |
Returns pointer to current tuning (const version) Returns nullptr if currentIdx_ == -1 or tuning list is empty.
bool validIndex(int) const
Test of index is between 0 and size()-1.
Definition: TuningList.cpp:158
int currentIdx_
Definition: TuningList.h:98
int omni::proj::TuningList::currentIndex |
( |
| ) |
const |
Return current index.
int currentIdx_
Definition: TuningList.h:98
void omni::proj::TuningList::fromStream |
( |
QDataStream & |
_stream | ) |
|
Deserialize list from stream.
116 uint32_t _size = _map.getValue<uint32_t>(
"size",0);
117 int _currentIdx = _map.getValue<
int>(
"currentIndex",-1);
119 for (
int i = 0; i < _size; ++i)
121 auto* _tuning =
add(
false );
122 if (!_tuning)
continue;
void setCurrentIndex(int)
Set new current index, must be between 0 and size()-1.
Definition: TuningList.cpp:66
void clear()
Deletes all tunings.
Definition: TuningList.cpp:92
Tuning * add(bool _makeCurrent=true)
Add tuning to list Returns pointer new tuning.
Definition: TuningList.cpp:38
Tuning * omni::proj::TuningList::operator[] |
( |
int |
_index | ) |
|
Returns tuning at a specific index.
101 container_type::at(_index).get() :
nullptr;
bool validIndex(int) const
Test of index is between 0 and size()-1.
Definition: TuningList.cpp:158
Tuning const * omni::proj::TuningList::operator[] |
( |
int |
_index | ) |
const |
Returns tuning at a specific index (const version)
107 container_type::at(_index).get() :
nullptr;
bool validIndex(int) const
Test of index is between 0 and size()-1.
Definition: TuningList.cpp:158
void omni::proj::TuningList::remove |
( |
| ) |
|
Remove tuning with current index.
int currentIdx_
Definition: TuningList.h:98
void omni::proj::TuningList::remove |
( |
int |
_idx | ) |
|
Remove tuning with custom index.
89 container_type::erase(container_type::begin() + _idx);
bool validIndex(int) const
Test of index is between 0 and size()-1.
Definition: TuningList.cpp:158
void omni::proj::TuningList::setCurrentIndex |
( |
int |
_currentIdx | ) |
|
Set new current index, must be between 0 and size()-1.
73 if (_currentIdx >= size())
int currentIdx_
Definition: TuningList.h:98
void omni::proj::TuningList::toStream |
( |
QDataStream & |
_stream | ) |
const |
Serialize list to stream.
131 _map(
"size",uint32_t(container_type::size()));
135 for (
auto& _tuning : *
this)
int currentIdx_
Definition: TuningList.h:98
bool omni::proj::TuningList::validIndex |
( |
int |
_idx | ) |
const |
|
private |
Test of index is between 0 and size()-1.
160 return (_idx >= 0) && (_idx < container_type::size());
Test both lists for equality.
142 auto _tuningsEqual = [](Tuning
const* _a, Tuning
const* _b) ->
bool
int currentIdx_
Definition: TuningList.h:98
#define OMNI_TEST_MEMBER_EQUAL(member)
Definition: util.h:125
bool testPtrVectorEqual(T const &_a, T const &_b, F f)
Test if two vectors which hold unique_ptr's of SerializationInterfaces.
Definition: util.h:78
int omni::proj::TuningList::currentIdx_ = -1 |
|
private |
Session const& omni::proj::TuningList::session_ |
|
private |
The documentation for this class was generated from the following files: