mirror of
https://github.com/zakk4223/CocoaSplit.git
synced 2026-05-21 06:46:14 -06:00
Add recording option to menubar menu
This commit is contained in:
parent
6567ea8a65
commit
e5fe2dbd20
1 changed files with 21 additions and 0 deletions
|
|
@ -2605,6 +2605,13 @@ NSString *const CSAppearanceSystem = @"CSAppearanceSystem";
|
||||||
{
|
{
|
||||||
[menu removeAllItems];
|
[menu removeAllItems];
|
||||||
NSString *streamTitle = nil;
|
NSString *streamTitle = nil;
|
||||||
|
NSString *recordingTitle = nil;
|
||||||
|
if (self.mainRecordingActive)
|
||||||
|
{
|
||||||
|
recordingTitle = @"Stop Recording";
|
||||||
|
} else {
|
||||||
|
recordingTitle = @"Start Recording";
|
||||||
|
}
|
||||||
if (self.captureRunning)
|
if (self.captureRunning)
|
||||||
{
|
{
|
||||||
streamTitle = @"Stop Stream";
|
streamTitle = @"Stop Stream";
|
||||||
|
|
@ -2614,6 +2621,9 @@ NSString *const CSAppearanceSystem = @"CSAppearanceSystem";
|
||||||
NSMenuItem *streamItem = [[NSMenuItem alloc] initWithTitle:streamTitle action:@selector(statusMenuStreamAction:) keyEquivalent:@""];
|
NSMenuItem *streamItem = [[NSMenuItem alloc] initWithTitle:streamTitle action:@selector(statusMenuStreamAction:) keyEquivalent:@""];
|
||||||
streamItem.target = self;
|
streamItem.target = self;
|
||||||
[menu addItem:streamItem];
|
[menu addItem:streamItem];
|
||||||
|
NSMenuItem *recItem = [[NSMenuItem alloc] initWithTitle:recordingTitle action:@selector(statusMenuRecordAction:) keyEquivalent:@""];
|
||||||
|
recItem.target = self;
|
||||||
|
[menu addItem:recItem];
|
||||||
} else if (menu == self.stagingFullScreenMenu || menu == self.liveFullScreenMenu) {
|
} else if (menu == self.stagingFullScreenMenu || menu == self.liveFullScreenMenu) {
|
||||||
[menu removeAllItems];
|
[menu removeAllItems];
|
||||||
for (NSDictionary *sInfo in _screensCache)
|
for (NSDictionary *sInfo in _screensCache)
|
||||||
|
|
@ -3384,6 +3394,17 @@ NSString *const CSAppearanceSystem = @"CSAppearanceSystem";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(void)statusMenuRecordAction:(NSMenuItem *)sender
|
||||||
|
{
|
||||||
|
if (self.mainRecordingActive)
|
||||||
|
{
|
||||||
|
[self stopRecording];
|
||||||
|
} else {
|
||||||
|
[self startRecording];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
-(void)statusMenuStreamAction:(NSMenuItem *)sender
|
-(void)statusMenuStreamAction:(NSMenuItem *)sender
|
||||||
{
|
{
|
||||||
if (self.captureRunning)
|
if (self.captureRunning)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue