Skip to content

Commit 500e1cb

Browse files
Feature/windowed projector (#66)
* Working windowed projector. * Update version to 0.0.2
1 parent 7f956f5 commit 500e1cb

File tree

7 files changed

+26
-4
lines changed

7 files changed

+26
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ endfunction()
3636

3737
#
3838

39-
project(obs-quick-access-utility VERSION 0.0.1)
39+
project(obs-quick-access-utility VERSION 0.0.2)
4040

4141
message(STATUS "CMAKE_PROJECT_NAME is ${CMAKE_PROJECT_NAME}")
4242
if(${CMAKE_PROJECT_NAME} STREQUAL "obs-studio")

buildspec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"name": "obs-quick-access-utility",
4242
"displayName": "Quick Access Utility",
43-
"version": "0.0.1",
43+
"version": "0.0.2",
4444
"author": "FiniteSingularity",
4545
"website": "https://github.com/finitesingularity",
4646
"email": "[email protected]",

src/quick-access-source.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,17 @@ void QuickAccessSource::openInteract() const
639639
obs_source_release(source);
640640
}
641641

642+
void QuickAccessSource::openWindowedProjector() const
643+
{
644+
obs_source_t *source = obs_weak_source_get_source(_source);
645+
std::string projectorType =
646+
_sourceClass == SourceClass::Source ? "Source" : "Scene";
647+
std::string name = obs_source_get_name(source);
648+
obs_frontend_open_projector(projectorType.c_str(), -1, "",
649+
name.c_str());
650+
obs_source_release(source);
651+
}
652+
642653
void QuickAccessSource::activateScene() const
643654
{
644655
obs_source_t *source = obs_weak_source_get_source(_source);

src/quick-access-source.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class QuickAccessSource {
124124
void openProperties() const;
125125
void openFilters() const;
126126
void openInteract() const;
127+
void openWindowedProjector() const;
127128
void refreshBrowser() const;
128129
void toggleActivation() const;
129130
void activateScene() const;

src/quick-access.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,15 @@ void QuickAccessSourceList::_setupContextMenu()
184184
source->toggleActivation();
185185
});
186186
addAction(_actionCtxtToggleActivation);
187+
188+
_actionCtxtOpenWindowedProjector = new QAction(this);
189+
_actionCtxtOpenWindowedProjector->setText("Open Windowed Projector");
190+
connect(_actionCtxtOpenWindowedProjector, &QAction::triggered, this,
191+
[this]() {
192+
auto source = currentSource();
193+
source->openWindowedProjector();
194+
});
195+
addAction(_actionCtxtOpenWindowedProjector);
187196
}
188197

189198
QuickAccessSource *QuickAccessSourceList::currentSource()

src/quick-access.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class QuickAccessSourceList : public QListView {
5656
QAction *_actionCtxtInteract;
5757
QAction *_actionCtxtRefresh;
5858
QAction *_actionCtxtToggleActivation;
59+
QAction *_actionCtxtOpenWindowedProjector;
5960

6061
QItemSelection _selected, _prior;
6162

src/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#pragma once
22

33
#define PROJECT_NAME "Quick Access Utility"
4-
#define PROJECT_VERSION "0.0.1"
4+
#define PROJECT_VERSION "0.0.2"
55
#define PROJECT_VERSION_MAJOR 0
66
#define PROJECT_VERSION_MINOR 0
7-
#define PROJECT_VERSION_PATCH 1
7+
#define PROJECT_VERSION_PATCH 2
88

99
#define blog(level, msg, ...) \
1010
blog(level, "[" PROJECT_NAME "] " msg, ##__VA_ARGS__)

0 commit comments

Comments
 (0)