Cog/Application/ScriptAdditions.m
Christopher Snowhill b63a076e21 Add more automation commands and properties
Added commands to control playback: play, pause, stop, previous, next.
Also added a spam property to PlaylistEntry, to return the formatted
spam string for the playlist entry, which is currently limited to the
playing item.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-21 21:52:09 -08:00

33 lines
894 B
Objective-C

//
// ScriptAdditions.m
// Cog
//
// Created by Christopher Snowhill on 2/21/22.
//
#import <Cocoa/Cocoa.h>
#import "AppController.h"
@implementation NSApplication (APLApplicationExtensions)
- (id)playbackStart:(NSScriptCommand *)command {
[(AppController *)[NSApp delegate] clickPlay];
return [NSNumber numberWithBool:YES];
}
- (id)playbackPause:(NSScriptCommand *)command {
[(AppController *)[NSApp delegate] clickPause];
return [NSNumber numberWithBool:YES];
}
- (id)playbackStop:(NSScriptCommand *)command {
[(AppController *)[NSApp delegate] clickStop];
return [NSNumber numberWithBool:YES];
}
- (id)playbackPrevious:(NSScriptCommand *)command {
[(AppController *)[NSApp delegate] clickPrev];
return [NSNumber numberWithBool:YES];
}
- (id)playbackNext:(NSScriptCommand *)command {
[(AppController *)[NSApp delegate] clickNext];
return [NSNumber numberWithBool:YES];
}
@end