41 namespace ArgusSamples
48 const float seconds = atof(optArg);
50 ORIGINATE_ERROR(
"'SECONDS' is invalid, must not be less than or equal to zero");
53 PROPAGATE_ERROR(module->
start());
68 PROPAGATE_ERROR(Window::getInstance().pollEvents());
73 recordingGuard.cancel();
77 runningGuard.cancel();
78 PROPAGATE_ERROR(module->
stop());
112 : m_initialized(false)
114 , m_guiContainerConfig(NULL)
134 "record video for DURATION seconds and save to a file.",
video,
this)));
138 "set the video bit rate mode to RATE. If RATE is zero a reasonable default "
145 "set the video file type. For 'h265' set the file type as 'mkv' since 'h265' is only "
158 PROPAGATE_ERROR_CONTINUE(
stop());
173 Window::IGuiContainer *iGuiContainerConfig)
179 PROPAGATE_ERROR(Window::getInstance().registerObserver(
this));
187 PROPAGATE_ERROR(Window::IGuiContainerGrid::create(&
m_guiConfig));
190 UniquePointer<Window::IGuiElement> element;
193 Window::IGuiContainerGrid::BuildHelper buildHelper(
m_guiConfig);
195 #define CREATE_GUI_ELEMENT(_NAME, _VALUE) \
196 PROPAGATE_ERROR(Window::IGuiElement::createValue(&dispatcher._VALUE, &element));\
197 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
200 #define CREATE_GUI_ELEMENT_COMBO_BOX(_NAME, _VALUE, _FROMTYPE, _TOTYPE) \
201 assert(sizeof(_FROMTYPE) == sizeof(_TOTYPE)); \
202 PROPAGATE_ERROR(Window::IGuiElement::createValue(reinterpret_cast< \
203 Value<_TOTYPE>*>(&dispatcher._VALUE), &element)); \
204 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
214 #undef CREATE_GUI_ELEMENT
215 #undef CREATE_GUI_ELEMENT_COMBO_BOX
217 PROPAGATE_ERROR(Window::IGuiElement::createAction(
"Toggle Recording",
219 Window::IGuiElement::ICON_MEDIA_RECORD, &element));
220 PROPAGATE_ERROR(buildHelper.append(element.get(), 2));
247 PROPAGATE_ERROR(Window::getInstance().unregisterObserver(
this));
256 if (key == Key(
"space"))