reference-frontend-api.rst 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  1. OBS Studio Frontend API
  2. =======================
  3. The OBS Studio frontend API is the API specific to OBS Studio itself.
  4. .. code:: cpp
  5. #include <obs-frontend-api.h>
  6. Structures/Enumerations
  7. -----------------------
  8. .. enum:: obs_frontend_event
  9. Specifies a front-end event. Can be one of the following values:
  10. - **OBS_FRONTEND_EVENT_STREAMING_STARTING**
  11. Triggered when streaming is starting.
  12. - **OBS_FRONTEND_EVENT_STREAMING_STARTED**
  13. Triggered when streaming has successfully started.
  14. - **OBS_FRONTEND_EVENT_STREAMING_STOPPING**
  15. Triggered when streaming is stopping.
  16. - **OBS_FRONTEND_EVENT_STREAMING_STOPPED**
  17. Triggered when streaming has fully stopped.
  18. - **OBS_FRONTEND_EVENT_RECORDING_STARTING**
  19. Triggered when recording is starting.
  20. - **OBS_FRONTEND_EVENT_RECORDING_STARTED**
  21. Triggered when recording has successfully started.
  22. - **OBS_FRONTEND_EVENT_RECORDING_STOPPING**
  23. Triggered when recording is stopping.
  24. - **OBS_FRONTEND_EVENT_RECORDING_STOPPED**
  25. Triggered when recording has fully stopped.
  26. - **OBS_FRONTEND_EVENT_RECORDING_PAUSED**
  27. Triggered when the recording has been paused.
  28. - **OBS_FRONTEND_EVENT_RECORDING_UNPAUSED**
  29. Triggered when the recording has been unpaused.
  30. - **OBS_FRONTEND_EVENT_SCENE_CHANGED**
  31. Triggered when the current scene has changed.
  32. - **OBS_FRONTEND_EVENT_SCENE_LIST_CHANGED**
  33. Triggered when a scenes has been added/removed/reordered by the
  34. user.
  35. - **OBS_FRONTEND_EVENT_TRANSITION_CHANGED**
  36. Triggered when the current transition has changed by the user.
  37. - **OBS_FRONTEND_EVENT_TRANSITION_STOPPED**
  38. Triggered when a transition has completed.
  39. - **OBS_FRONTEND_EVENT_TRANSITION_LIST_CHANGED**
  40. Triggered when the user adds/removes transitions.
  41. - **OBS_FRONTEND_EVENT_TRANSITION_DURATION_CHANGED**
  42. Triggered when the transition duration has been changed by the
  43. user.
  44. - **OBS_FRONTEND_EVENT_TBAR_VALUE_CHANGED**
  45. Triggered when the transition bar is moved.
  46. - **OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING**
  47. Triggered when the current scene collection is about to change.
  48. - **OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGED**
  49. Triggered when the current scene collection has changed.
  50. - **OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED**
  51. Triggered when a scene collection has been added or removed.
  52. - **OBS_FRONTEND_EVENT_SCENE_COLLECTION_RENAMED**
  53. Triggered when a scene collection has been renamed.
  54. - **OBS_FRONTEND_EVENT_PROFILE_CHANGING**
  55. Triggered when the current profile is about to change.
  56. - **OBS_FRONTEND_EVENT_PROFILE_CHANGED**
  57. Triggered when the current profile has changed.
  58. - **OBS_FRONTEND_EVENT_PROFILE_LIST_CHANGED**
  59. Triggered when a profile has been added or removed.
  60. - **OBS_FRONTEND_EVENT_PROFILE_RENAMED**
  61. Triggered when a profile has been renamed.
  62. - **OBS_FRONTEND_EVENT_FINISHED_LOADING**
  63. Triggered when the program has finished loading.
  64. - **OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN**
  65. Triggered when scripts need to know that OBS is exiting. The
  66. **OBS_FRONTEND_EVENT_EXIT** event is normally called after scripts
  67. have been destroyed.
  68. - **OBS_FRONTEND_EVENT_EXIT**
  69. Triggered when the program is about to exit.
  70. - **OBS_FRONTEND_EVENT_REPLAY_BUFFER_STARTING**
  71. Triggered when the replay buffer is starting.
  72. - **OBS_FRONTEND_EVENT_REPLAY_BUFFER_STARTED**
  73. Triggered when the replay buffer has successfully started.
  74. - **OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPING**
  75. Triggered when the replay buffer is stopping.
  76. - **OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPED**
  77. Triggered when the replay buffer has fully stopped.
  78. - **OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED**
  79. Triggered when the replay buffer has been saved.
  80. - **OBS_FRONTEND_EVENT_STUDIO_MODE_ENABLED**
  81. Triggered when the user has turned on studio mode.
  82. - **OBS_FRONTEND_EVENT_STUDIO_MODE_DISABLED**
  83. Triggered when the user has turned off studio mode.
  84. - **OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED**
  85. Triggered when the current preview scene has changed in studio
  86. mode.
  87. - **OBS_FRONTEND_EVENT_SCENE_COLLECTION_CLEANUP**
  88. Triggered when a scene collection has been completely unloaded, and
  89. the program is either about to load a new scene collection, or the
  90. program is about to exit.
  91. - **OBS_FRONTEND_EVENT_VIRTUALCAM_STARTED**
  92. Triggered when the virtual camera is started.
  93. - **OBS_FRONTEND_EVENT_VIRTUALCAM_STOPPED**
  94. Triggered when the virtual camera is stopped.
  95. - **OBS_FRONTEND_EVENT_THEME_CHANGED**
  96. Triggered when the theme is changed.
  97. .. versionadded:: 29.0.0
  98. - **OBS_FRONTEND_EVENT_SCREENSHOT_TAKEN**
  99. Triggered when a screenshot is taken.
  100. .. versionadded:: 29.0.0
  101. .. struct:: obs_frontend_source_list
  102. - DARRAY(obs_source_t*) **sources**
  103. Example usage:
  104. .. code:: cpp
  105. struct obs_frontend_source_list scenes = {0};
  106. obs_frontend_get_scenes(&scenes);
  107. for (size_t i = 0; i < scenes.num; i++) {
  108. obs_source_t *source = scenes.sources.array[i];
  109. [...]
  110. }
  111. obs_frontend_source_list_free(&scenes);
  112. .. type:: void (*obs_frontend_cb)(void *private_data)
  113. Frontend tool menu callback
  114. .. type:: void (*obs_frontend_event_cb)(enum obs_frontend_event event, void *private_data)
  115. Frontend event callback
  116. .. type:: void (*obs_frontend_save_cb)(obs_data_t *save_data, bool saving, void *private_data)
  117. Frontend save/load callback
  118. .. type:: bool (*obs_frontend_translate_ui_cb)(const char *text, const char **out)
  119. Translation callback
  120. .. type:: void (*undo_redo_cb)(const char *data)
  121. Undo redo callback
  122. Functions
  123. ---------
  124. .. function:: void obs_frontend_source_list_free(struct obs_frontend_source_list *source_list)
  125. Releases sources within a source list and frees the list.
  126. :param source_list: Source list to free
  127. ---------------------------------------
  128. .. function:: void *obs_frontend_get_main_window(void)
  129. :return: The QMainWindow pointer to the OBS Studio window
  130. ---------------------------------------
  131. .. function:: void *obs_frontend_get_main_window_handle(void)
  132. :return: The native window handle of the OBS Studio window
  133. ---------------------------------------
  134. .. function:: char **obs_frontend_get_scene_names(void)
  135. :return: The scene name list, ending with NULL. The list is stored
  136. within one contiguous segment of memory, so freeing the
  137. returned pointer with :c:func:`bfree()` will free the entire
  138. list.
  139. ---------------------------------------
  140. .. function:: void obs_frontend_get_scenes(struct obs_frontend_source_list *sources)
  141. :param sources: Pointer to a :c:type:`obs_frontend_source_list`
  142. structure to receive the list of
  143. reference-incremented scenes. Release with
  144. :c:func:`obs_frontend_source_list_free`
  145. ---------------------------------------
  146. .. function:: obs_source_t *obs_frontend_get_current_scene(void)
  147. :return: A new reference to the currently active scene. Release with
  148. :c:func:`obs_source_release()`.
  149. ---------------------------------------
  150. .. function:: void obs_frontend_set_current_scene(obs_source_t *scene)
  151. :param scene: The scene to set as the current scene
  152. ---------------------------------------
  153. .. function:: void obs_frontend_get_transitions(struct obs_frontend_source_list *sources)
  154. :param sources: Pointer to a :c:type:`obs_frontend_source_list`
  155. structure to receive the list of
  156. reference-incremented transitions. Release with
  157. :c:func:`obs_frontend_source_list_free`
  158. ---------------------------------------
  159. .. function:: obs_source_t *obs_frontend_get_current_transition(void)
  160. :return: A new reference to the currently active transition.
  161. Release with :c:func:`obs_source_release()`.
  162. ---------------------------------------
  163. .. function:: void obs_frontend_set_current_transition(obs_source_t *transition)
  164. :param transition: The transition to set as the current transition
  165. ---------------------------------------
  166. .. function:: int obs_frontend_get_transition_duration(void)
  167. :return: The transition duration (in milliseconds) currently set in the UI
  168. ---------------------------------------
  169. .. function:: void obs_frontend_set_transition_duration(int duration)
  170. :param duration: Desired transition duration, in milliseconds
  171. ---------------------------------------
  172. .. function:: void obs_frontend_release_tbar(void)
  173. Emulate a mouse button release on the transition bar and determine transition status.
  174. ---------------------------------------
  175. .. function:: void obs_frontend_set_tbar_position(int position)
  176. Set the value of the transition bar.
  177. :param position: The position to set the T-bar to, with a range of 0-1023
  178. ---------------------------------------
  179. .. function:: int obs_frontend_get_tbar_position(void)
  180. Get the value of the transition bar.
  181. :return: The value of the position of the T-bar to, with a range of 0-1023
  182. ---------------------------------------
  183. .. function:: char **obs_frontend_get_scene_collections(void)
  184. :return: The list of profile names, ending with NULL. The list is
  185. stored within one contiguous segment of memory, so freeing
  186. the returned pointer with :c:func:`bfree()` will free the
  187. entire list.
  188. ---------------------------------------
  189. .. function:: char *obs_frontend_get_current_scene_collection(void)
  190. :return: A new pointer to the current scene collection name. Free
  191. with :c:func:`bfree()`
  192. ---------------------------------------
  193. .. function:: void obs_frontend_set_current_scene_collection(const char *collection)
  194. :param profile: Name of the scene collection to activate
  195. ---------------------------------------
  196. .. function:: bool obs_frontend_add_scene_collection(const char *name)
  197. Add a new scene collection, then switch to it.
  198. :param name: Name of the scene collection to add/create
  199. ---------------------------------------
  200. .. function:: char **obs_frontend_get_profiles(void)
  201. :return: The list of profile names, ending with NULL. The list is
  202. stored within one contiguous segment of memory, so freeing
  203. the returned pointer with :c:func:`bfree()` will free the
  204. entire list.
  205. ---------------------------------------
  206. .. function:: char *obs_frontend_get_current_profile(void)
  207. :return: A new pointer to the current profile name. Free with
  208. :c:func:`bfree()`
  209. ---------------------------------------
  210. .. function:: char *obs_frontend_get_current_profile_path(void)
  211. :return: A new pointer to the current profile's path on the
  212. filesystem. Free with :c:func:`bfree()`
  213. ---------------------------------------
  214. .. function:: void obs_frontend_set_current_profile(const char *profile)
  215. :param profile: Name of the profile to activate
  216. ---------------------------------------
  217. .. function:: bool obs_frontend_create_profile(const char *name)
  218. :param name: Name of the new profile to create (must be unique)
  219. ---------------------------------------
  220. .. function:: bool obs_frontend_duplicate_profile(const char *name)
  221. :param name: Name of the duplicate profile to create (must be unique)
  222. ---------------------------------------
  223. .. function:: void obs_frontend_delete_profile(const char *profile)
  224. :param profile: Name of the profile to delete
  225. ---------------------------------------
  226. .. function:: void *obs_frontend_add_tools_menu_qaction(const char *name)
  227. Adds a QAction to the tools menu then returns it.
  228. :param name: Name for the new menu item
  229. :return: A pointer to the added QAction
  230. ---------------------------------------
  231. .. function:: void obs_frontend_add_tools_menu_item(const char *name, obs_frontend_cb callback, void *private_data)
  232. Adds a tools menu item and links the ::clicked signal to the
  233. callback.
  234. :param name: The name for the new menu item
  235. :param callback: Callback to use when the menu item is clicked
  236. :param private_data: Private data associated with the callback
  237. ---------------------------------------
  238. .. function:: void* obs_frontend_add_dock(void *dock)
  239. Adds a QDockWidget to the UI's Docks menu.
  240. :param dock: QDockWidget to add/create
  241. :return: A pointer to the added QAction
  242. ---------------------------------------
  243. .. function:: void obs_frontend_add_event_callback(obs_frontend_event_cb callback, void *private_data)
  244. Adds a callback that will be called when a frontend event occurs.
  245. See :c:type:`obs_frontend_event` on what sort of events can be
  246. triggered.
  247. :param callback: Callback to use when a frontend event occurs
  248. :param private_data: Private data associated with the callback
  249. ---------------------------------------
  250. .. function:: void obs_frontend_remove_event_callback(obs_frontend_event_cb callback, void *private_data)
  251. Removes an event callback.
  252. :param callback: Callback to remove
  253. :param private_data: Private data associated with the callback
  254. ---------------------------------------
  255. .. function:: void obs_frontend_add_save_callback(obs_frontend_save_cb callback, void *private_data)
  256. Adds a callback that will be called when the current scene collection
  257. is being saved/loaded.
  258. :param callback: Callback to use when saving/loading a scene
  259. collection
  260. :param private_data: Private data associated with the callback
  261. ---------------------------------------
  262. .. function:: void obs_frontend_remove_save_callback(obs_frontend_save_cb callback, void *private_data)
  263. Removes a save/load callback.
  264. :param callback: Callback to remove
  265. :param private_data: Private data associated with the callback
  266. ---------------------------------------
  267. .. function:: void obs_frontend_add_preload_callback(obs_frontend_save_cb callback, void *private_data)
  268. Adds a callback that will be called right before a scene collection
  269. is loaded.
  270. :param callback: Callback to use when pre-loading
  271. :param private_data: Private data associated with the callback
  272. ---------------------------------------
  273. .. function:: void obs_frontend_remove_preload_callback(obs_frontend_save_cb callback, void *private_data)
  274. Removes a pre-load callback.
  275. :param callback: Callback to remove
  276. :param private_data: Private data associated with the callback
  277. ---------------------------------------
  278. .. function:: void obs_frontend_push_ui_translation(obs_frontend_translate_ui_cb translate)
  279. Pushes a UI translation callback. This allows a front-end plugin to
  280. intercept when Qt is automatically generating translating data.
  281. Typically this is just called with obs_module_get_string.
  282. :param translate: The translation callback to use
  283. ---------------------------------------
  284. .. function:: void obs_frontend_pop_ui_translation(void)
  285. Pops the current UI translation callback.
  286. ---------------------------------------
  287. .. function:: void obs_frontend_streaming_start(void)
  288. Starts streaming.
  289. ---------------------------------------
  290. .. function:: void obs_frontend_streaming_stop(void)
  291. Stops streaming.
  292. ---------------------------------------
  293. .. function:: bool obs_frontend_streaming_active(void)
  294. :return: *true* if streaming active, *false* otherwise
  295. ---------------------------------------
  296. .. function:: void obs_frontend_recording_start(void)
  297. Starts recording.
  298. ---------------------------------------
  299. .. function:: void obs_frontend_recording_stop(void)
  300. Stops recording.
  301. ---------------------------------------
  302. .. function:: bool obs_frontend_recording_active(void)
  303. :return: *true* if recording active, *false* otherwise
  304. ---------------------------------------
  305. .. function:: void obs_frontend_recording_pause(bool pause)
  306. :pause: *true* to pause recording, *false* to unpause
  307. ---------------------------------------
  308. .. function:: bool obs_frontend_recording_paused(void)
  309. :return: *true* if recording paused, *false* otherwise
  310. ---------------------------------------
  311. .. function:: bool obs_frontend_recording_split_file(void)
  312. Asks OBS to split the current recording file.
  313. :return: *true* if splitting was successfully requested (this
  314. does not mean that splitting has finished or guarantee that it
  315. split successfully), *false* if recording is inactive or paused
  316. or if file splitting is disabled.
  317. ---------------------------------------
  318. .. function:: void obs_frontend_replay_buffer_start(void)
  319. Starts the replay buffer.
  320. ---------------------------------------
  321. .. function:: void obs_frontend_replay_buffer_stop(void)
  322. Stops the replay buffer.
  323. ---------------------------------------
  324. .. function:: void obs_frontend_replay_buffer_save(void)
  325. Saves a replay if the replay buffer is active.
  326. ---------------------------------------
  327. .. function:: bool obs_frontend_replay_buffer_active(void)
  328. :return: *true* if replay buffer active, *false* otherwise
  329. ---------------------------------------
  330. .. function:: void obs_frontend_open_projector(const char *type, int monitor, const char *geometry, const char *name)
  331. :param type: "Preview", "Source", "Scene", "StudioProgram", or "Multiview" (case insensitive)
  332. :param monitor: Monitor to open the projector on. If -1, this opens a window.
  333. :param geometry: If *monitor* is -1, size and position of the projector window. Encoded in Base64 using Qt's geometry encoding.
  334. :param name: If *type* is "Source" or "Scene", name of the source or scene to be displayed
  335. ---------------------------------------
  336. .. function:: void obs_frontend_save(void)
  337. Saves the current scene collection.
  338. ---------------------------------------
  339. .. function:: obs_output_t *obs_frontend_get_streaming_output(void)
  340. :return: A new reference to the current streaming output.
  341. Release with :c:func:`obs_output_release()`.
  342. ---------------------------------------
  343. .. function:: obs_output_t *obs_frontend_get_recording_output(void)
  344. :return: A new reference to the current recording output.
  345. Release with :c:func:`obs_output_release()`.
  346. ---------------------------------------
  347. .. function:: obs_output_t *obs_frontend_get_replay_buffer_output(void)
  348. :return: A new reference to the current replay buffer output.
  349. Release with :c:func:`obs_output_release()`.
  350. ---------------------------------------
  351. .. function:: config_t *obs_frontend_get_profile_config(void)
  352. :return: The config_t* associated with the current profile
  353. ---------------------------------------
  354. .. function:: config_t *obs_frontend_get_global_config(void)
  355. :return: The config_t* associated with the global config (global.ini)
  356. ---------------------------------------
  357. .. function:: void obs_frontend_set_streaming_service(obs_service_t *service)
  358. Sets the current streaming service to stream with.
  359. :param service: The streaming service to set
  360. ---------------------------------------
  361. .. function:: obs_service_t *obs_frontend_get_streaming_service(void)
  362. :return: The current streaming service object. Does not increment the
  363. reference.
  364. ---------------------------------------
  365. .. function:: void obs_frontend_save_streaming_service(void)
  366. Saves the current streaming service data.
  367. ---------------------------------------
  368. .. function:: bool obs_frontend_preview_program_mode_active(void)
  369. :return: *true* if studio mode is active, *false* otherwise
  370. ---------------------------------------
  371. .. function:: void obs_frontend_set_preview_program_mode(bool enable)
  372. Activates/deactivates studio mode.
  373. :param enable: *true* to activate studio mode, *false* to deactivate
  374. studio mode
  375. ---------------------------------------
  376. .. function:: void obs_frontend_preview_program_trigger_transition(void)
  377. Triggers a preview-to-program transition if studio mode is active.
  378. ---------------------------------------
  379. .. function:: obs_source_t *obs_frontend_get_current_preview_scene(void)
  380. :return: A new reference to the current preview scene if studio mode
  381. is active, or *NULL* if studio mode is not active. Release
  382. with :c:func:`obs_source_release()`.
  383. ---------------------------------------
  384. .. function:: void obs_frontend_set_current_preview_scene(obs_source_t *scene)
  385. Sets the current preview scene in studio mode. Does nothing if studio
  386. mode is disabled.
  387. :param scene: The scene to set as the current preview
  388. ---------------------------------------
  389. .. function:: void obs_frontend_set_preview_enabled(bool enable)
  390. Sets the enable state of the preview display. Only relevant with
  391. studio mode disabled.
  392. :param enable: *true* to enable preview, *false* to disable preview
  393. ---------------------------------------
  394. .. function:: bool obs_frontend_preview_enabled(void)
  395. :return: *true* if the preview display is enabled, *false* otherwise
  396. ---------------------------------------
  397. .. function:: void *obs_frontend_take_screenshot(void)
  398. Takes a screenshot of the main OBS output.
  399. ---------------------------------------
  400. .. function:: void *obs_frontend_take_source_screenshot(obs_source_t *source)
  401. Takes a screenshot of the specified source.
  402. :param source: The source to take screenshot of
  403. ---------------------------------------
  404. .. function:: obs_output_t *obs_frontend_get_virtualcam_output(void)
  405. :return: A new reference to the current virtual camera output.
  406. Release with :c:func:`obs_output_release()`.
  407. ---------------------------------------
  408. .. function:: void obs_frontend_start_virtualcam(void)
  409. Starts the virtual camera.
  410. ---------------------------------------
  411. .. function:: void obs_frontend_stop_virtualcam(void)
  412. Stops the virtual camera.
  413. ---------------------------------------
  414. .. function:: bool obs_frontend_virtualcam_active(void)
  415. :return: *true* if virtual camera is active, *false* otherwise
  416. ---------------------------------------
  417. .. function:: void obs_frontend_reset_video(void)
  418. Reloads the UI canvas and resets libobs video with latest data from
  419. the current profile.
  420. ---------------------------------------
  421. .. function:: void *obs_frontend_open_source_properties(obs_source_t *source)
  422. Opens the properties window of the specified source.
  423. :param source: The source to open the properties window of
  424. ---------------------------------------
  425. .. function:: void *obs_frontend_open_source_filters(obs_source_t *source)
  426. Opens the filters window of the specified source.
  427. :param source: The source to open the filters window of
  428. ---------------------------------------
  429. .. function:: void *obs_frontend_open_source_interaction(obs_source_t *source)
  430. Opens the interact window of the specified source. Only call if
  431. source has the *OBS_SOURCE_INTERACTION* output flag.
  432. :param source: The source to open the interact window of
  433. ---------------------------------------
  434. .. function:: void *obs_frontend_open_sceneitem_edit_transform(obs_sceneitem_t *item)
  435. Opens the edit transform window of the specified sceneitem.
  436. :param item: The sceneitem to open the edit transform window of
  437. ---------------------------------------
  438. .. function:: char *obs_frontend_get_current_record_output_path(void)
  439. :return: A new pointer to the current record output path. Free
  440. with :c:func:`bfree()`
  441. ---------------------------------------
  442. .. function:: const char *obs_frontend_get_locale_string(const char *string)
  443. :return: Gets the frontend translation of a given string.
  444. ---------------------------------------
  445. .. function:: bool obs_frontend_is_theme_dark(void)
  446. :return: Checks if the current theme is dark or light.
  447. .. versionadded:: 29.0.0
  448. ---------------------------------------
  449. .. function:: char *obs_frontend_get_last_recording(void)
  450. :return: The file path of the last recording. Free with :c:func:`bfree()`
  451. .. versionadded:: 29.0.0
  452. ---------------------------------------
  453. .. function:: char *obs_frontend_get_last_screenshot(void)
  454. :return: The file path of the last screenshot taken. Free with
  455. :c:func:`bfree()`
  456. .. versionadded:: 29.0.0
  457. ---------------------------------------
  458. .. function:: char *obs_frontend_get_last_replay(void)
  459. :return: The file path of the last replay buffer saved. Free with
  460. :c:func:`bfree()`
  461. .. versionadded:: 29.0.0
  462. ---------------------------------------
  463. .. function:: void obs_frontend_add_undo_redo_action(const char *name, const undo_redo_cb undo, const undo_redo_cb redo, const char *undo_data, const char *redo_data, bool repeatable)
  464. :param name: The name of the undo redo action
  465. :param undo: Callback to use for undo
  466. :param redo: Callback to use for redo
  467. :param undo_data: String with data for the undo callback
  468. :param redo_data: String with data for the redo callback
  469. :param repeatable: Allow multiple actions with the same name to be merged to 1 undo redo action.
  470. This uses the undo action from the first and the redo action from the last action.