Lumiverse  2.5
A framework for creating lighting control applications
Snapshot.h
1 #pragma once
2 #ifndef _SNAPSHOT_H_
3 #define _SNAPSHOT_H_
4 
5 #define pragma once
6 
7 #include "LumiverseCore.h"
8 #include "Playback.h"
9 
10 namespace Lumiverse {
11 namespace ShowControl {
21  class Snapshot
22  {
23  public:
24  Snapshot();
25  Snapshot(Rig* rig);
26  Snapshot(Snapshot& other);
27  ~Snapshot();
28 
34  void saveSnapshot(Rig* rig);
35 
45  void loadSnapshot(Rig* targetRig);
46 
52  void loadRig(Rig* targetRig);
53 
57  map<string, Device*>& getRigData() { return m_rigData; }
58 
62  set<Device*> getDevices();
63 
67  map<string, string> _metadata;
68 
69  protected:
73  map<string, Device*> m_rigData;
74  };
75 
76  class PlaybackSnapshot : public Snapshot
77  {
78  public:
79  PlaybackSnapshot(Rig* rig, Playback* pb);
82 
83  void saveSnapshot(Rig* rig, Playback* pb);
84 
85  void loadSnapshot(Rig* targetRig, Playback* targetPb);
86 
87  void loadPlayback(Playback* targetPb);
88 
89  private:
95  JSONNode m_playbackData;
96  };
97 }
98 }
99 #endif
Include file for all of LumiverseCore in one conveninent location.
set< Device * > getDevices()
Returns an unindexed set of the devices from the snapshot.
Definition: Snapshot.cpp:53
map< string, Device * > & getRigData()
Retrieves device data from the snapshot.
Definition: Snapshot.h:57
A Snapshot stores the state of the Rig at a particular time.
Definition: Snapshot.h:21
A playback object manages layers, timelines, and coordinates their actions and updates.
Definition: Playback.h:32
void saveSnapshot(Rig *rig)
Saves a snapshot of the given Rig and Playback objects.
Definition: Snapshot.cpp:31
void loadSnapshot(Rig *targetRig)
Loads the stored snapshot values into the given Rig and Playback objects.
Definition: Snapshot.cpp:45
map< string, Device * > m_rigData
Stores the device data from the rig.
Definition: Snapshot.h:73
map< string, string > _metadata
Arbitrary use metadata map for a snapshot object.
Definition: Snapshot.h:67
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
void loadRig(Rig *targetRig)
Loads the stored rig state into the given Rig.
Definition: Snapshot.cpp:49
JSONNode m_playbackData
The entire playback object. We're getting a little lazy here (or efficient depending on your point of...
Definition: Snapshot.h:95
The Rig contains information about the state of the lighting system.
Definition: Rig.h:58