2013-11-07 15:45:03 -08:00
|
|
|
/******************************************************************************
|
|
|
|
Copyright (C) 2013 by Hugh Bailey <obs.jim@gmail.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2013-12-02 21:24:38 -08:00
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
2013-11-07 15:45:03 -08:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2013-12-06 05:48:21 -08:00
|
|
|
#include "forms/OBSWindows.h"
|
2013-11-07 15:45:03 -08:00
|
|
|
|
2013-12-22 22:40:07 -08:00
|
|
|
#include <obs.hpp>
|
|
|
|
|
2014-01-06 19:20:18 -08:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2013-11-07 15:45:03 -08:00
|
|
|
class OBSBasic : public OBSBasicBase {
|
2014-01-06 19:20:18 -08:00
|
|
|
std::unordered_map<obs_source_t, int> sourceSceneRefs;
|
|
|
|
|
2014-01-04 12:53:36 -08:00
|
|
|
obs_scene_t GetCurrentScene();
|
|
|
|
void AddSceneItem(obs_sceneitem_t item);
|
|
|
|
void RemoveSceneItem(obs_sceneitem_t item);
|
|
|
|
void AddScene(obs_source_t scene);
|
|
|
|
void RemoveScene(obs_source_t scene);
|
|
|
|
void UpdateSources(obs_scene_t scene);
|
|
|
|
void UpdateSceneSelection(obs_source_t source);
|
|
|
|
|
|
|
|
/* OBS Callbacks */
|
|
|
|
static void SceneItemAdded(void *data, calldata_t params);
|
|
|
|
static void SceneItemRemoved(void *data, calldata_t params);
|
2013-12-28 04:33:16 -08:00
|
|
|
static void SourceAdded(void *data, calldata_t params);
|
|
|
|
static void SourceDestroyed(void *data, calldata_t params);
|
2014-01-04 12:53:36 -08:00
|
|
|
static void ChannelChanged(void *data, calldata_t params);
|
2013-12-28 04:33:16 -08:00
|
|
|
|
2013-12-31 03:02:07 -08:00
|
|
|
void ResizePreview(uint32_t cx, uint32_t cy);
|
|
|
|
|
2013-12-30 05:56:39 -08:00
|
|
|
void AddSource(obs_scene_t scene, const char *id);
|
2014-01-04 17:53:02 -08:00
|
|
|
void AddSourcePopupMenu();
|
2013-12-30 05:56:39 -08:00
|
|
|
|
2013-12-22 22:40:07 -08:00
|
|
|
bool InitGraphics();
|
|
|
|
|
2013-12-20 10:56:01 -08:00
|
|
|
void NewProject();
|
|
|
|
void SaveProject();
|
|
|
|
void LoadProject();
|
|
|
|
|
2013-11-07 15:45:03 -08:00
|
|
|
protected:
|
2014-01-04 12:53:36 -08:00
|
|
|
/* wxWidgets callbacks */
|
2013-12-10 20:14:45 -08:00
|
|
|
virtual void OnClose(wxCloseEvent &event);
|
|
|
|
virtual void OnMinimize(wxIconizeEvent &event);
|
|
|
|
virtual void OnSize(wxSizeEvent &event);
|
2013-12-31 06:10:47 -08:00
|
|
|
virtual void OnResizePreview(wxSizeEvent &event);
|
2013-12-10 20:14:45 -08:00
|
|
|
virtual void fileNewClicked(wxCommandEvent &event);
|
|
|
|
virtual void fileOpenClicked(wxCommandEvent &event);
|
|
|
|
virtual void fileSaveClicked(wxCommandEvent &event);
|
|
|
|
virtual void fileExitClicked(wxCommandEvent &event);
|
2013-12-30 00:17:57 -08:00
|
|
|
virtual void scenesClicked(wxCommandEvent &event);
|
2013-12-10 20:14:45 -08:00
|
|
|
virtual void scenesRDown(wxMouseEvent &event);
|
|
|
|
virtual void sceneAddClicked(wxCommandEvent &event);
|
|
|
|
virtual void sceneRemoveClicked(wxCommandEvent &event);
|
|
|
|
virtual void scenePropertiesClicked(wxCommandEvent &event);
|
|
|
|
virtual void sceneUpClicked(wxCommandEvent &event);
|
|
|
|
virtual void sceneDownClicked(wxCommandEvent &event);
|
2013-12-30 00:17:57 -08:00
|
|
|
virtual void sourcesClicked(wxCommandEvent &event);
|
|
|
|
virtual void sourcesToggled(wxCommandEvent &event);
|
2013-12-10 20:14:45 -08:00
|
|
|
virtual void sourcesRDown(wxMouseEvent &event);
|
|
|
|
virtual void sourceAddClicked(wxCommandEvent &event);
|
|
|
|
virtual void sourceRemoveClicked(wxCommandEvent &event);
|
|
|
|
virtual void sourcePropertiesClicked(wxCommandEvent &event);
|
|
|
|
virtual void sourceUpClicked(wxCommandEvent &event);
|
|
|
|
virtual void sourceDownClicked(wxCommandEvent &event);
|
|
|
|
virtual void settingsClicked(wxCommandEvent &event);
|
|
|
|
virtual void exitClicked(wxCommandEvent &event);
|
2013-11-07 15:45:03 -08:00
|
|
|
|
|
|
|
public:
|
|
|
|
inline OBSBasic() : OBSBasicBase(NULL) {}
|
2013-12-22 22:40:07 -08:00
|
|
|
virtual ~OBSBasic();
|
|
|
|
|
|
|
|
bool Init();
|
2013-11-22 19:43:48 -08:00
|
|
|
|
2013-12-06 05:39:19 -08:00
|
|
|
inline wxPanel *GetPreviewPanel() {return previewPanel;}
|
|
|
|
inline wxSizer *GetPreviewContainer() {return previewContainer;}
|
2013-11-07 15:45:03 -08:00
|
|
|
};
|