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.

68 lines
1.6 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #ifndef SCREEN_RECORDER_OBS_MANAGER_HPP
  2. #define SCREEN_RECORDER_OBS_MANAGER_HPP
  3. #include "settings-manager.hpp"
  4. #include <list>
  5. #include <gdkmm/display.h>
  6. #include <gdk/gdkx.h>
  7. #include <X11/X.h>
  8. #include <obs/obs.hpp>
  9. using namespace std;
  10. class OBSManager
  11. {
  12. public:
  13. OBSManager();
  14. virtual ~OBSManager();
  15. string GetVersion();
  16. void LoadSettings(SettingsManager *settings);
  17. void Initialize(Gdk::Rectangle rect);
  18. void StartPreview(XID wid, Display *wdisplay);
  19. void StopPreview();
  20. void StartRecording();
  21. void StopRecording();
  22. bool IsRecording();
  23. void Cleanup();
  24. OBSSource CreateScreenSource();
  25. OBSSource CreateWebcamSource();
  26. OBSSource CreateAudioSource();
  27. const int PreviewWidth = 1280;
  28. const int PreviewHeight = 720;
  29. // Signals
  30. sigc::signal<void()> sigStartPreview;
  31. sigc::signal<void()> sigStopPreview;
  32. sigc::signal<void()> sigStartRecording;
  33. sigc::signal<void()> sigStopRecording;
  34. sigc::signal<void()> sigCleanup;
  35. private:
  36. void printTypes();
  37. bool isInitialized = false;
  38. bool isRecording = false;
  39. int mScreenWidth = 0;
  40. int mScreenHeight = 0;
  41. bool mScreenEnabled = false;
  42. bool mWebcamEnabled = false;
  43. bool mAudioEnabled = false;
  44. string mPluginDir;
  45. string mOutputDir;
  46. string mWebcamDeviceID;
  47. string mAudioDeviceID;
  48. OBSDisplay mDisplay;
  49. OBSOutput mOutput;
  50. OBSSignal obsStartRecording;
  51. OBSSignal obsStopRecording;
  52. // Plugins
  53. void loadPlugin(string name);
  54. void loadPlugins();
  55. list<string> mPlugins;
  56. };
  57. #endif