diff --git a/CHANGELOG.md b/CHANGELOG.md index 33da6d2..910ea9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ To note a change, add a line under Unreleased, in a group such as Added, Changed ### Added -- Documentation for the persistence API, built with DocC: doc comments in its headers, which Xcode shows in Quick Help, and a Persistence article with an example. +- Documentation for the persistence and media APIs, built with DocC: doc comments in their headers, which Xcode shows in Quick Help, and an article with examples for each. ## 0.1.0 - 2026-11-19 diff --git a/CoreZen/CoreZen.docc/CoreZen.md b/CoreZen/CoreZen.docc/CoreZen.md index b8c29ce..c9a3a37 100755 --- a/CoreZen/CoreZen.docc/CoreZen.md +++ b/CoreZen/CoreZen.docc/CoreZen.md @@ -17,3 +17,4 @@ CoreZen's [README](https://github.com/znelson/CoreZen#readme) says how to get it ### Essentials - +- diff --git a/CoreZen/CoreZen.docc/Media.md b/CoreZen/CoreZen.docc/Media.md new file mode 100644 index 0000000..e1a06f7 --- /dev/null +++ b/CoreZen/CoreZen.docc/Media.md @@ -0,0 +1,58 @@ +# Media + +Play media files with mpv, and read their details and render their frames with FFmpeg. + +## Overview + +A ``ZENMediaPlayer`` plays a file with [mpv](https://mpv.io), and shows its video in a ``ZENMediaPlayerView``. A ``ZENMediaPlayerControlsView`` adds buttons to play, pause, step and skip, and a ``ZENMediaPlayerCTIView`` adds a timeline. + +A ``ZENMediaFile`` reads a file's duration, frame size and codecs with [FFmpeg](https://ffmpeg.org), and a ``ZENFrameRenderer`` renders its frames as images, for thumbnails. + +### Play a File + +```objc +ZENMediaPlayer *player = [ZENMediaPlayer new]; +[playerView attachPlayer:player]; +[player loadFileURL:fileURL]; +[player startPlayback]; +``` + +The file loads paused, and `startPlayback` lets it play once it has loaded. To learn when the file is ready, or why it couldn't play, observe the player's ``ZENMediaPlayer/status`` with key-value observing. Its properties change only on the main thread. + +### Render Thumbnails + +```objc +ZENMediaFile *file = [ZENMediaFile mediaFileWithURL:fileURL]; +ZENFrameRenderer *renderer = [ZENFrameRenderer frameRendererWithMediaFile:file]; +[renderer renderFrames:10 width:320 height:180 completion:^(NSArray *frames) { + dispatch_async(dispatch_get_main_queue(), ^{ + // Show each frame's image, from the start of the file to its end + }); +}]; +``` + +Making a media file reads from disk, so for a file that may be slow to reach, make it on a background queue. Terminate the media file once you're done with it, which also stops any renders still waiting. + +### Quit Cleanly + +Before the app quits, call ``ZENMediaPlayer/terminateAllPlayers`` and ``ZENMediaFile/terminateAllMediaFiles``, so that every player shuts its mpv instance down, and every media file closes its file. + +## Topics + +### Playback + +- ``ZENMediaPlayer`` + +### Player Views + +- ``ZENMediaPlayerView`` +- ``ZENMediaPlayerControlsView`` +- ``ZENMediaPlayerCTIView`` + +### Files and Frames + +- ``ZENMediaFile`` +- ``ZENFrameRenderer`` +- ``ZENRenderedFrame`` +- ``ZENRenderFrameResultsBlock`` +- ``ZENRenderFramesResultsBlock`` diff --git a/CoreZen/CoreZen.docc/ZENMediaFile.md b/CoreZen/CoreZen.docc/ZENMediaFile.md new file mode 100644 index 0000000..8bbd727 --- /dev/null +++ b/CoreZen/CoreZen.docc/ZENMediaFile.md @@ -0,0 +1,28 @@ +# ``ZENMediaFile`` + +## Topics + +### Opening a File + +- ``mediaFileWithURL:`` +- ``fileURL`` + +### Duration and Frame Size + +- ``durationMicroseconds`` +- ``frameWidth`` +- ``frameHeight`` +- ``rotationDegrees`` +- ``pixelAspectRatio`` + +### Codecs + +- ``videoCodecName`` +- ``videoCodecLongName`` +- ``audioCodecName`` +- ``audioCodecLongName`` + +### Closing a File + +- ``terminateMediaFile`` +- ``terminateAllMediaFiles`` diff --git a/CoreZen/CoreZen.docc/ZENMediaPlayer.md b/CoreZen/CoreZen.docc/ZENMediaPlayer.md new file mode 100644 index 0000000..4b0fef6 --- /dev/null +++ b/CoreZen/CoreZen.docc/ZENMediaPlayer.md @@ -0,0 +1,39 @@ +# ``ZENMediaPlayer`` + +## Topics + +### Loading and Playing + +- ``loadFileURL:`` +- ``startPlayback`` +- ``pausePlayback`` +- ``stepOneFrame:`` + +### Seeking + +- ``seekRelativeSeconds:`` +- ``seekAbsoluteSeconds:`` +- ``seekAbsolutePercentage:`` +- ``seeking`` + +### Observing the Player + +- ``status`` +- ``error`` +- ``fileURL`` +- ``paused`` +- ``positionSeconds`` +- ``durationSeconds`` +- ``positionPercent`` +- ``ZENMediaPlayerStatus`` +- ``ZENMediaPlayerErrorDomain`` +- ``ZENMediaPlayerErrorCode`` + +### Showing Video + +- ``playerView`` + +### Shutting Down + +- ``terminatePlayer`` +- ``terminateAllPlayers`` diff --git a/CoreZen/CoreZen.docc/ZENRenderedFrame.md b/CoreZen/CoreZen.docc/ZENRenderedFrame.md new file mode 100644 index 0000000..46f2782 --- /dev/null +++ b/CoreZen/CoreZen.docc/ZENRenderedFrame.md @@ -0,0 +1,21 @@ +# ``ZENRenderedFrame`` + +## Topics + +### The Image + +- ``image`` + +### The Position Asked For + +- ``requestType`` +- ``requestedSeconds`` +- ``requestedPercentage`` +- ``requestedTimestamp`` +- ``ZENFrameRequestType`` + +### The Position Rendered + +- ``actualSeconds`` +- ``actualPercentage`` +- ``actualTimestamp`` diff --git a/CoreZen/Media/FrameRenderer.h b/CoreZen/Media/FrameRenderer.h index aef9791..ea78265 100644 --- a/CoreZen/Media/FrameRenderer.h +++ b/CoreZen/Media/FrameRenderer.h @@ -12,30 +12,58 @@ NS_ASSUME_NONNULL_BEGIN -// Completion block types +/// A block called with one rendered frame. typedef void (^ZENRenderFrameResultsBlock)(ZENRenderedFrame *frame); + +/// A block called with several rendered frames. typedef void (^ZENRenderFramesResultsBlock)(NSArray *frames); +/// How a frame's position was asked for. typedef NS_ENUM(NSInteger, ZENFrameRequestType) { + /// As a time in seconds from the start of the file. ZENFrameRequestTypeSeconds, + /// As a fraction of the file's duration, from 0 to 1. ZENFrameRequestTypePercentage }; -// Rendered frame result +/// A frame rendered from a media file, with the position it was asked for and +/// the position it came from. +/// +/// The renderer shows the keyframe at or before the position asked for, which +/// is fast, so the frame can come from earlier. Each position is given three +/// ways: in seconds; as a fraction of the duration, from 0 to 1, despite the +/// name "percentage"; and as a timestamp, in the units of the video stream's +/// time base. A position the renderer couldn't work out, such as for a file it +/// couldn't open, is 0. @interface ZENRenderedFrame : NSObject -// The rendered video frame image +/// The frame's image, or nil if it couldn't be rendered. +/// +/// It fits within the width and height asked for, in the shape the video is +/// shown in: stretched to its pixel aspect ratio and turned upright. @property (nonatomic, strong, nullable) NSImage *image; -// The requested position of the frame +/// Whether the frame was asked for by time or by fraction of the duration. @property (nonatomic) ZENFrameRequestType requestType; + +/// The position asked for, as a timestamp in the video stream's time base. @property (nonatomic) int64_t requestedTimestamp; + +/// The position asked for, in seconds. @property (nonatomic) double requestedSeconds; + +/// The position asked for, as a fraction of the duration from 0 to 1. @property (nonatomic) double requestedPercentage; -// The actual rendered position of the frame +/// The position of the frame rendered, as a timestamp in the video stream's +/// time base. @property (nonatomic) int64_t actualTimestamp; + +/// The position of the frame rendered, in seconds. @property (nonatomic) double actualSeconds; + +/// The position of the frame rendered, as a fraction of the duration from 0 +/// to 1. @property (nonatomic) double actualPercentage; @end @@ -43,31 +71,50 @@ typedef NS_ENUM(NSInteger, ZENFrameRequestType) { @class ZENMediaFile; @protocol ZENFrameRenderController; -// Interface for requesting rendered frames -// -// Every render method calls its completion exactly once, on a background queue. -// A frame's image is nil when it couldn't be rendered: the file has no video -// stream or couldn't be opened, the request was canceled, or the media file was -// terminated. renderFrames: only returns frames that have an image. +/// Renders a media file's frames as images, for thumbnails. +/// +/// Renders run one at a time, in the order they're asked for. Every render +/// method calls its completion exactly once, on a background queue. A frame's +/// image is nil when it couldn't be rendered: the file has no video stream or +/// couldn't be opened, the render was canceled, or the media file was +/// terminated. @interface ZENFrameRenderer : NSObject +/// The media file the renderer renders frames from. @property (nonatomic, strong, readonly) ZENMediaFile *mediaFile; +/// Makes a renderer for a media file's frames. + (instancetype)frameRendererWithMediaFile:(ZENMediaFile *)mediaFile; -// Each returns a token to cancel the render with, or nil if there's nothing to -// cancel: the media file was already terminated, or renderFrames: was asked for -// no frames. The completion is called either way. +/// Renders the frame at a time in seconds, at most a width and height in pixels. +/// +/// It returns a token to cancel the render with, or nil if there's nothing to +/// cancel because the media file was terminated already. The completion is +/// called either way. - (nullable ZENWorkQueueToken *)renderFrameAtSeconds:(double)seconds width:(NSUInteger)width height:(NSUInteger)height completion:(ZENRenderFrameResultsBlock)completion; +/// Renders the frame at a fraction of the duration, from 0 to 1, at most a +/// width and height in pixels. +/// +/// It returns a token to cancel the render with, or nil if there's nothing to +/// cancel because the media file was terminated already. The completion is +/// called either way. - (nullable ZENWorkQueueToken *)renderFrameAtPercentage:(double)percentage width:(NSUInteger)width height:(NSUInteger)height completion:(ZENRenderFrameResultsBlock)completion; +/// Renders frames spread evenly across the file, each at most a width and +/// height in pixels. +/// +/// The frames go from the start of the file, at 0, to its end, at 1, and a +/// single frame comes from the middle. The completion gets the frames that +/// have an image, in order. It returns a token that cancels the renders not +/// yet run. It's nil when the count is 0, and can be nil when the media file +/// was terminated already. The completion is called either way. - (nullable ZENWorkQueueToken *)renderFrames:(NSUInteger)count width:(NSUInteger)width height:(NSUInteger)height diff --git a/CoreZen/Media/MediaFile.h b/CoreZen/Media/MediaFile.h index 3e10513..0a441fd 100644 --- a/CoreZen/Media/MediaFile.h +++ b/CoreZen/Media/MediaFile.h @@ -10,47 +10,89 @@ NS_ASSUME_NONNULL_BEGIN +/// A media file's details, read with FFmpeg: its duration, frame size, +/// rotation and codecs. +/// +/// Making one opens the file and reads its details, which reads from disk, so a +/// file on a slow volume can keep the calling thread waiting. Call +/// ``terminateMediaFile`` once you're done with it, or +/// ``terminateAllMediaFiles`` before the app quits. @interface ZENMediaFile : NSObject +/// The file's URL. @property (nonatomic, strong, readonly) NSURL *fileURL; +/// Opens a media file and reads its details. +/// +/// A file that can't be opened still makes a media file, whose details are 0 +/// or nil. + (instancetype)mediaFileWithURL:(NSURL *)url; -// Terminate frame renderer (and frame render controller) if one was created, -// then terminate media file format context +/// Closes the file, and stops its frame renderer's work, if it has one. +/// +/// Renders still waiting complete with no image. A media file released without +/// this terminates itself, and logs that it wasn't terminated first. - (void)terminateMediaFile; -// Call before application terminates to terminate all ZENMediaFile instances +/// Terminates every media file that hasn't been terminated. +/// +/// Call it before the app quits. + (void)terminateAllMediaFiles; +/// The file's duration in microseconds, or 0 if it's unknown or the file +/// couldn't be read. - (NSUInteger)durationMicroseconds; -// The video's size as it's shown: the stored frame stretched to its pixel aspect -// ratio, then turned by its rotation. So a phone's portrait video is taller than -// it is wide, and a DVD's anamorphic 720x480 widescreen frames are 853x480. 0 if -// there's no video. +/// The video's width as it's shown, or 0 if there's no video. +/// +/// The size as it's shown is the stored frame stretched to its pixel aspect +/// ratio, then turned by its rotation. So a phone's portrait video is taller +/// than it is wide, and a DVD's anamorphic 720x480 widescreen frames are +/// 853x480. - (NSUInteger)frameWidth; + +/// The video's height as it's shown, or 0 if there's no video. +/// +/// Like ``frameWidth``, it's the size after the pixel aspect ratio and the +/// rotation. - (NSUInteger)frameHeight; -// How far the video's frames are turned clockwise to show them upright: 0, 90, 180 -// or 270 degrees. Phones store portrait video as landscape frames tagged with 90. -// ZENFrameRenderer's images are already turned. +/// How far the video's frames are turned clockwise to show them upright: 0, +/// 90, 180 or 270 degrees. +/// +/// Phones store portrait video as landscape frames tagged with 90. +/// ``ZENFrameRenderer``'s images are already turned. - (NSUInteger)rotationDegrees; -// How wide each stored pixel is shown, relative to its height: 1 for square -// pixels, as most video has, and more than 1 for frames stored narrower than -// they're shown, like a DVD's anamorphic widescreen (32:27, about 1.185). +/// How wide each stored pixel is shown, relative to its height. +/// +/// It's 1 for square pixels, as most video has, and more than 1 for frames +/// stored narrower than they're shown, like a DVD's anamorphic widescreen +/// (32:27, about 1.185). - (double)pixelAspectRatio; -// Short names of the codecs of the file's video and audio, like "h264" and "aac". nil if -// the file has no stream of that kind that can be decoded, like the audio of a video with -// no sound, or if the file couldn't be read. +/// The short name of the video's codec, like "h264". +/// +/// It's nil if the file has no video stream that can be decoded, or if the file +/// couldn't be read. - (nullable NSString *)videoCodecName; + +/// The short name of the audio's codec, like "aac". +/// +/// It's nil if the file has no audio stream that can be decoded, like a video +/// with no sound, or if the file couldn't be read. - (nullable NSString *)audioCodecName; -// Descriptive names of the same codecs, like "AAC (Advanced Audio Coding)". nil in the -// same cases. +/// The descriptive name of the video's codec, like "H.264 / AVC / MPEG-4 AVC / +/// MPEG-4 part 10". +/// +/// It's nil in the same cases as ``videoCodecName``. - (nullable NSString *)videoCodecLongName; + +/// The descriptive name of the audio's codec, like "AAC (Advanced Audio +/// Coding)". +/// +/// It's nil in the same cases as ``audioCodecName``. - (nullable NSString *)audioCodecLongName; @end diff --git a/CoreZen/Media/MediaPlayer.h b/CoreZen/Media/MediaPlayer.h index 3814fe6..6894d38 100644 --- a/CoreZen/Media/MediaPlayer.h +++ b/CoreZen/Media/MediaPlayer.h @@ -12,67 +12,115 @@ NS_ASSUME_NONNULL_BEGIN -// What the player is doing with the file it was last asked to load +/// What a media player is doing with the file it was last asked to load. typedef NS_ENUM(NSInteger, ZENMediaPlayerStatus) { - // No file: none has been loaded yet, or playback was stopped + /// No file: none has been loaded yet, or playback was stopped. ZENMediaPlayerStatusIdle, - // loadFileURL: was called, and the file hasn't loaded yet + /// The player was asked to load a file, which hasn't loaded yet. ZENMediaPlayerStatusLoading, - // The file has loaded, and can play and seek + /// The file has loaded, and can play and seek. ZENMediaPlayerStatusReady, - // Playback reached the end of the file, which mpv then closes + /// Playback reached the end of the file, which mpv then closes. ZENMediaPlayerStatusEnded, - // The file couldn't be loaded or played. error says why. + /// The file couldn't be loaded or played. The player's error says why. ZENMediaPlayerStatusFailed, }; +/// The domain of the errors that say why a media player couldn't play a file. extern NSErrorDomain const ZENMediaPlayerErrorDomain; +/// Why a media player couldn't play a file. typedef NS_ERROR_ENUM(ZENMediaPlayerErrorDomain, ZENMediaPlayerErrorCode){ - // mpv couldn't load or play the file. The description gives its reason, like - // "loading failed" for a missing file, and NSURLErrorKey the file's URL. + /// mpv couldn't load or play the file. + /// + /// The description gives mpv's reason, like "loading failed" for a missing + /// file, and `NSURLErrorKey` gives the file's URL. ZENMediaPlayerErrorPlaybackFailed = 1, }; +/// Plays a media file with mpv. +/// +/// A player shows its video in the ``ZENMediaPlayerView`` attached to it. Use a +/// player on the main thread: its properties change only there, so a UI can +/// observe them with key-value observing. Call ``terminatePlayer`` once you're +/// done with a player, or ``terminateAllPlayers`` before the app quits. +/// +/// ### Seeking +/// +/// Seeks run one at a time. A seek asked for before the loaded file is ready, or +/// while another seek is running, waits and then runs. Only the latest waiting +/// seek is kept, except that relative seeks add up. Loading a new file drops a +/// waiting seek. @interface ZENMediaPlayer : NSObject -// nil while no view is attached +/// The view showing the player's video, or nil while none is attached. @property (nonatomic, strong, readonly, nullable) ZENMediaPlayerView *playerView; -// Observe these properties for updates to the UI. They will only change on the main thread. +/// The file mpv has open, or nil while there's none. @property (nonatomic, strong, readonly, nullable) NSURL *fileURL; + +/// Whether playback is paused. @property (nonatomic, readonly) BOOL paused; + +/// The position in the file, from 0 to 100. @property (nonatomic, readonly) double positionPercent; + +/// Whether a seek is running. @property (nonatomic, readonly) BOOL seeking; + +/// What the player is doing with the file it was last asked to load. @property (nonatomic, readonly) ZENMediaPlayerStatus status; -// Why the last file failed, while status is ZENMediaPlayerStatusFailed + +/// Why the last file failed, while the status is +/// ``ZENMediaPlayerStatus/ZENMediaPlayerStatusFailed``. @property (nonatomic, strong, readonly, nullable) NSError *error; -// The position and length of the file in seconds, or 0 until mpv knows them + +/// The position in the file in seconds, or 0 until mpv knows it. @property (nonatomic, readonly) double positionSeconds; + +/// The length of the file in seconds, or 0 until mpv knows it. @property (nonatomic, readonly) double durationSeconds; -// Terminate and detach the player view, terminate player controller +/// Detaches the player's view, and shuts its mpv instance down. +/// +/// A player released without this terminates itself, and logs that it wasn't +/// terminated first. - (void)terminatePlayer; -// Call before application terminates to terminate all ZENMediaPlayer instances +/// Terminates every player that hasn't been terminated. +/// +/// Call it before the app quits. + (void)terminateAllPlayers; -// Starts loading url in place of the current file, paused. status becomes -// ZENMediaPlayerStatusLoading, then Ready or Failed. +/// Starts loading a file in place of the current one, paused. +/// +/// The status becomes ``ZENMediaPlayerStatus/ZENMediaPlayerStatusLoading``, +/// then ``ZENMediaPlayerStatus/ZENMediaPlayerStatusReady`` or +/// ``ZENMediaPlayerStatus/ZENMediaPlayerStatusFailed``. - (void)loadFileURL:(NSURL *)url; +/// Starts or resumes playback. - (void)startPlayback; + +/// Pauses playback. - (void)pausePlayback; +/// Pauses, then shows the next frame, or the previous one if `forward` is NO. - (void)stepOneFrame:(BOOL)forward; -// Seeks run one at a time. A seek requested before the loaded file is ready, or -// while another seek is running, waits and then runs. Only the latest waiting -// seek is kept, except that relative seeks add up. Loading a new file drops a -// waiting seek. Call these on the main thread. +/// Seeks forward by a number of seconds, or back if it's negative. +/// +/// Call it on the main thread. The class overview says how seeks wait for each other. - (void)seekRelativeSeconds:(double)seconds; +/// Seeks to a time in seconds from the start of the file. +/// +/// Call it on the main thread. The class overview says how seeks wait for each other. - (void)seekAbsoluteSeconds:(double)seconds; + +/// Seeks to a position in the file, from 0 to 100. +/// +/// Call it on the main thread. The class overview says how seeks wait for each other. - (void)seekAbsolutePercentage:(double)percentage; @end diff --git a/CoreZen/Media/Views/MediaPlayerCTIView.h b/CoreZen/Media/Views/MediaPlayerCTIView.h index 9357c79..9c9ea84 100644 --- a/CoreZen/Media/Views/MediaPlayerCTIView.h +++ b/CoreZen/Media/Views/MediaPlayerCTIView.h @@ -12,11 +12,18 @@ NS_ASSUME_NONNULL_BEGIN +/// A timeline for a media player, which shows and sets its position, and +/// previews the frame under the pointer. +/// +/// Dragging along it seeks the player. While the pointer is over it, it shows a +/// frame from that point in the file, from frames it renders across each file +/// the player loads. @interface ZENMediaPlayerCTIView : ZENArchivedView +/// The player the view works with, or nil while none is attached. @property (nonatomic, weak, readonly, nullable) ZENMediaPlayer *player; -// nil detaches the current player +/// Makes the view work with a player, or with none if it's nil. - (void)attachPlayer:(nullable ZENMediaPlayer *)player; @end diff --git a/CoreZen/Media/Views/MediaPlayerControlsView.h b/CoreZen/Media/Views/MediaPlayerControlsView.h index 46caf23..f8b990f 100644 --- a/CoreZen/Media/Views/MediaPlayerControlsView.h +++ b/CoreZen/Media/Views/MediaPlayerControlsView.h @@ -12,11 +12,16 @@ NS_ASSUME_NONNULL_BEGIN +/// Buttons that control a media player. +/// +/// They play and pause, step one frame back or forward, and skip back 3 or 10 +/// seconds, or forward 6 or 15. @interface ZENMediaPlayerControlsView : ZENArchivedView +/// The player the view works with, or nil while none is attached. @property (nonatomic, weak, readonly, nullable) ZENMediaPlayer *player; -// nil detaches the current player +/// Makes the view work with a player, or with none if it's nil. - (void)attachPlayer:(nullable ZENMediaPlayer *)player; @end diff --git a/CoreZen/Media/Views/MediaPlayerView.h b/CoreZen/Media/Views/MediaPlayerView.h index bc69c33..b124ae1 100644 --- a/CoreZen/Media/Views/MediaPlayerView.h +++ b/CoreZen/Media/Views/MediaPlayerView.h @@ -17,18 +17,24 @@ NS_ASSUME_NONNULL_BEGIN // that import this header without it. #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" +/// Shows a media player's video. +/// +/// It's an `NSOpenGLView`, because OpenGL is the only GPU rendering that mpv's +/// render API offers on macOS. A view shows one player, and a player renders +/// into one view. @interface ZENMediaPlayerView : NSOpenGLView #pragma clang diagnostic pop +/// The player whose video the view shows, or nil while none is attached. @property (nonatomic, weak, readonly, nullable) ZENMediaPlayer *player; -// Attach a player to this player view, create view render context. A view shows -// one player and a player renders into one view, so this first detaches the -// view's current player, and detaches the new player from any other view (both -// are left paused). +/// Shows a player's video in this view. +/// +/// It first detaches the view's current player, and detaches the new player +/// from any other view. Both are left paused. - (void)attachPlayer:(ZENMediaPlayer *)player; -// Detach the player from this player view, destroy view render context, but leave player paused +/// Stops showing the player's video, and leaves the player paused. - (void)detachPlayer; @end diff --git a/README.md b/README.md index 6e28d34..81a937a 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The framework bundles both in its `Resources` folder, as `FMDB-LICENSE.txt` and ### Logging -CoreZen logs to the unified log, under the subsystem `com.zdnelson.CoreZen`, in the categories Database, Domain, Media, Player and General. Failures are errors, harmless surprises like a method called twice are default messages, and routine events like a database opening are info. Paths, URLs and mpv's messages are private, since they can name the user's files. To watch them: +CoreZen logs to the unified log, under the subsystem `com.zdnelson.CoreZen`, in the categories Database, Domain, Media, Player and General. Failures are errors, harmless surprises like a method called twice are default messages, and routine events like a database opening are info. Paths, URLs and mpv's messages are private, since they can name the user's files. mpv's own macOS code also writes a few debug messages, such as "AppHub initialised", under its own subsystem, `io.mpv`. To watch CoreZen's: ``` log stream --level info --predicate 'subsystem == "com.zdnelson.CoreZen"'