-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved the ScreenSaverDefeater class out of the transport control and …
…into utilities
- Loading branch information
1 parent
f2ae3c8
commit 58d1202
Showing
6 changed files
with
61 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
modules/tracktion_engine/utilities/tracktion_ScreenSaverDefeater.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
,--. ,--. ,--. ,--. | ||
,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2018 | ||
'-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software | ||
| | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation | ||
`---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com | ||
*/ | ||
|
||
|
||
namespace tracktion { inline namespace engine | ||
{ | ||
|
||
static int numScreenSaverDefeaters = 0; | ||
|
||
ScreenSaverDefeater::ScreenSaverDefeater() | ||
{ | ||
if (juce::Desktop::getInstance().isHeadless()) | ||
return; | ||
|
||
TRACKTION_ASSERT_MESSAGE_THREAD | ||
++numScreenSaverDefeaters; | ||
juce::Desktop::setScreenSaverEnabled (numScreenSaverDefeaters == 0); | ||
} | ||
|
||
ScreenSaverDefeater::~ScreenSaverDefeater() | ||
{ | ||
if (juce::Desktop::getInstance().isHeadless()) | ||
return; | ||
|
||
TRACKTION_ASSERT_MESSAGE_THREAD | ||
--numScreenSaverDefeaters; | ||
jassert (numScreenSaverDefeaters >= 0); | ||
juce::Desktop::setScreenSaverEnabled (numScreenSaverDefeaters == 0); | ||
} | ||
|
||
|
||
}} // namespace tracktion { inline namespace engine |
22 changes: 22 additions & 0 deletions
22
modules/tracktion_engine/utilities/tracktion_ScreenSaverDefeater.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
,--. ,--. ,--. ,--. | ||
,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2018 | ||
'-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software | ||
| | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation | ||
`---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com | ||
*/ | ||
|
||
|
||
namespace tracktion { inline namespace engine | ||
{ | ||
|
||
//============================================================================== | ||
/// As long as at least one of these objects exists, the screensaver will be disabled | ||
struct ScreenSaverDefeater | ||
{ | ||
ScreenSaverDefeater(); | ||
~ScreenSaverDefeater(); | ||
}; | ||
|
||
|
||
}} // namespace tracktion { inline namespace engine |