00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __PLENGINE_TOOLS_CAMCORDER_H__
00024 #define __PLENGINE_TOOLS_CAMCORDER_H__
00025 #pragma once
00026
00027
00028
00029
00030
00031 #include "PLCore/Tools/Loadable.h"
00032 #include <PLScene/Scene/SceneNodeHandler.h>
00033 #include "PLEngine/PLEngine.h"
00034
00035
00036
00037
00038
00039 namespace PLEngine {
00040
00041
00042
00043
00044
00045 class EngineApplication;
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 class Camcorder : public PLCore::Object, public PLCore::Loadable {
00059
00060
00061
00062
00063
00064 friend class CamcorderLoaderPL;
00065
00066
00067
00068
00069
00070 pl_class(PL_RTTI_EXPORT, Camcorder, "PLEngine", PLCore::Object, "Camcorder interaction component")
00071
00072 pl_attribute(CamcorderDirectory, PLCore::String, "Data/Camcorder/", ReadWrite, DirectValue, "Default directory for the camcorder files", "")
00073 #ifdef PLENGINE_EXPORTS // The following is only required when compiling PLEngine
00074
00075 pl_constructor_1(ParameterConstructor, EngineApplication&, "Parameter constructor. Owner application as first parameter.", "")
00076
00077 pl_method_1(StartRecord, pl_ret_type(void), const PLCore::String&, "Starts the record, record name as first parameter (if empty string, no recording can be started). The currently used application camera will be recorded. If playback is currently enabled, the playback will be stopped at once.", "")
00078 pl_method_0(IsRecording, pl_ret_type(bool), "Returns whether or not recording is currently active. Returns 'true' if recording is currently active, else 'false'.", "")
00079 pl_method_0(StopRecord, pl_ret_type(void), "Stops the record", "")
00080 pl_method_1(StartPlayback, pl_ret_type(void), const PLCore::String&, "Starts the playback, record name as first parameter (must be valid). The currently used application camera will be feed with the recorded data. If recording is currently enabled, the recording will be stopped at once.", "")
00081 pl_method_0(IsPlaying, pl_ret_type(bool), "Returns whether or not playback is currently active. Returns 'true' if playback is currently active, else 'false'.", "")
00082 pl_method_0(StopPlayback, pl_ret_type(void), "Stops the playback", "")
00083 pl_method_0(Update, pl_ret_type(void), "Updates the camcorder component", "")
00084 #endif
00085
00086 pl_signal_0(SignalPlaybackFinished, "Playback has been finished", "")
00087
00088 pl_slot_0(OnAnimationStop, "Called when one of the keyframe animations has been stopped", "")
00089 pl_class_end
00090
00091
00092
00093
00094
00095 public:
00096
00097
00098
00099
00100
00101
00102
00103 PL_API Camcorder(EngineApplication &cApplication);
00104
00105
00106
00107
00108
00109 PL_API virtual ~Camcorder();
00110
00111
00112
00113
00114
00115
00116
00117
00118 PL_API EngineApplication &GetApplication() const;
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 PL_API void StartRecord(const PLCore::String &sName);
00132
00133
00134
00135
00136
00137
00138
00139
00140 PL_API bool IsRecording() const;
00141
00142
00143
00144
00145
00146 PL_API void StopRecord();
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 PL_API void StartPlayback(const PLCore::String &sName);
00160
00161
00162
00163
00164
00165
00166
00167
00168 PL_API bool IsPlaying() const;
00169
00170
00171
00172
00173
00174 PL_API void StopPlayback();
00175
00176
00177
00178
00179
00180 PL_API void Update();
00181
00182
00183
00184
00185
00186 public:
00187 PL_API virtual bool Unload() override;
00188 PL_API virtual PLCore::String GetLoadableTypeName() const override;
00189
00190
00191
00192
00193
00194 protected:
00195 PL_API virtual bool CallLoadable(PLCore::File &cFile, PLCore::Loader &cLoader, const PLCore::String &sMethod, const PLCore::String &sParams) override;
00196
00197
00198
00199
00200
00201 private:
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211 void SetupSceneNodeModifiers(PLScene::SceneNode &cSceneNode, bool bActive);
00212
00213
00214
00215
00216
00217 void OnAnimationStop();
00218
00219
00220
00221
00222
00223 private:
00224 EngineApplication *m_pApplication;
00225 bool m_bRecording;
00226 bool m_bPlaying;
00227 bool m_bPlaybackFinished;
00228 PLCore::String m_sRecordName;
00229 PLScene::SceneNodeHandler m_cCameraSceneNodeHandler;
00230 PLCore::String m_sCameraStartSceneContainer;
00231 PLCore::String m_sCameraStartName;
00232
00233
00234 };
00235
00236
00237
00238
00239
00240 }
00241
00242
00243 #endif // __PLENGINE_TOOLS_CAMCORDER_H__