Compare commits

..

No commits in common. "main" and "v1.5.3" have entirely different histories.
main ... v1.5.3

2 changed files with 20 additions and 35 deletions

View file

@ -1,7 +1,7 @@
from collections.abc import Callable, Coroutine from collections.abc import Callable, Coroutine
from typing import Literal from typing import Literal
from AppKit import NSApplication, NSApplicationActivationPolicyAccessory from corefoundationasyncio import CoreFoundationEventLoop
from MediaPlayer import ( from MediaPlayer import (
MPChangePlaybackPositionCommandEvent, MPChangePlaybackPositionCommandEvent,
MPMusicPlaybackStatePlaying, MPMusicPlaybackStatePlaying,
@ -12,8 +12,6 @@ from MediaPlayer import (
MPRemoteCommandHandlerStatusSuccess, MPRemoteCommandHandlerStatusSuccess,
) )
from corefoundationasyncio import CoreFoundationEventLoop
from ...config.model import CocoaReceiverConfig from ...config.model import CocoaReceiverConfig
from ...playback import Playback from ...playback import Playback
from ...playback.state import PlaybackState from ...playback.state import PlaybackState
@ -43,9 +41,6 @@ class CocoaNowPlayingReceiver(Receiver):
pass pass
async def start(self, player: Player) -> None: async def start(self, player: Player) -> None:
NSApplication.sharedApplication().setActivationPolicy_(
NSApplicationActivationPolicyAccessory
)
self.cmd_center = MPRemoteCommandCenter.sharedCommandCenter() self.cmd_center = MPRemoteCommandCenter.sharedCommandCenter()
self.info_center = MPNowPlayingInfoCenter.defaultCenter() self.info_center = MPNowPlayingInfoCenter.defaultCenter()

View file

@ -2,16 +2,6 @@ from typing import Final, Literal
from Foundation import CGSize from Foundation import CGSize
NSApplicationActivationPolicyRegular: Final = 0
NSApplicationActivationPolicyAccessory: Final = 1
NSApplicationActivationPolicyProhibited: Final = 2
NSApplicationActivationPolicy = Literal[0, 1, 2]
class NSApplication:
@staticmethod
def sharedApplication() -> NSApplication: ...
def setActivationPolicy_(self, policy: NSApplicationActivationPolicy) -> bool: ...
# There are many other operations available but we only actually use copy, so we don't need all of them here. # There are many other operations available but we only actually use copy, so we don't need all of them here.
NSCompositingOperationClear: Final = 0 NSCompositingOperationClear: Final = 0
NSCompositingOperationCopy: Final = 1 NSCompositingOperationCopy: Final = 1
@ -25,19 +15,19 @@ def NSMakeRect(x: float, y: float, w: float, h: float) -> NSRect: ...
class NSImage: class NSImage:
@staticmethod @staticmethod
def alloc() -> type[NSImage]: ... def alloc() -> type[NSImage]: ...
@staticmethod @staticmethod
def initByReferencingFile_(file: str) -> NSImage: ... def initByReferencingFile_(file: str) -> NSImage: ...
@staticmethod @staticmethod
def initWithData_(data: bytes) -> NSImage: ... def initWithData_(data: bytes) -> NSImage: ...
@staticmethod @staticmethod
def initWithSize_(size: CGSize) -> NSImage: ... def initWithSize_(size: CGSize) -> NSImage: ...
def size(self) -> CGSize: ... def size(self) -> CGSize: ...
def lockFocus(self) -> None: ... def lockFocus(self) -> None: ...
def unlockFocus(self) -> None: ... def unlockFocus(self) -> None: ...
def drawInRect_fromRect_operation_fraction_(
self, def drawInRect_fromRect_operation_fraction_(self, inRect: NSRect, fromRect: NSRect, operation: NSCompositingOperation, fraction: float) -> None: ...
inRect: NSRect,
fromRect: NSRect,
operation: NSCompositingOperation,
fraction: float,
) -> None: ...