You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configuration.cpp-skeleton 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include "ovasCConfiguration@@ClassName@@.h"
  2. using namespace OpenViBE;
  3. using namespace /*OpenViBE::*/Kernel;
  4. using namespace /*OpenViBE::*/AcquisitionServer;
  5. /*_________________________________________________
  6. Insert callback to specific widget here
  7. Example with a button that launch a calibration of the device:
  8. //Callback connected to a dedicated gtk button:
  9. static void button_calibrate_pressed_cb(GtkButton* button, void* data)
  10. {
  11. CConfiguration@@ClassName@@* config = static_cast<CConfiguration@@ClassName@@*>(data);
  12. config->buttonCalibratePressedCB();
  13. }
  14. //Callback actually called:
  15. void CConfigurationGTecGUSBamp::buttonCalibratePressedCB()
  16. {
  17. // Connect to the hardware, ask for calibration, verify the return code, etc.
  18. }
  19. _________________________________________________*/
  20. // If you added more reference attribute, initialize them here
  21. CConfiguration@@ClassName@@::CConfiguration@@ClassName@@(IDriverContext& ctx, const char* gtkBuilderFilename)
  22. : CConfigurationBuilder(gtkBuilderFilename), m_driverCtx(ctx) { }
  23. bool CConfiguration@@ClassName@@::preConfigure()
  24. {
  25. if(! CConfigurationBuilder::preConfigure()) { return false; }
  26. // Connect here all callbacks
  27. // Example:
  28. // g_signal_connect(gtk_builder_get_object(m_builder, "button_calibrate"), "pressed", G_CALLBACK(button_calibrate_pressed_cb), this);
  29. // Insert here the pre-configure code.
  30. // For example, you may want to check if a device is currently connected
  31. // and if more than one are connected. Then you can list in a dedicated combo-box
  32. // the device currently connected so the user can choose which one he wants to acquire from.
  33. return true;
  34. }
  35. bool CConfiguration@@ClassName@@::postConfigure()
  36. {
  37. if(m_applyConfig)
  38. {
  39. // If the user pressed the "apply" button, you need to save the changes made in the configuration.
  40. // For example, you can save the connection ID of the selected device:
  41. // m_connectionID = <value-from-gtk-widget>
  42. }
  43. if(!CConfigurationBuilder::postConfigure()) { return false; } // normal header is filled (Subject ID, Age, Gender, channels, sampling frequency), ressources are realesed
  44. return true;
  45. }