[vlc-commits] macosx/playlist: add notifications when items are added or removed
Felix Paul Kühne
git at videolan.org
Wed Apr 17 00:18:12 CEST 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Tue Apr 16 23:46:42 2019 +0200| [d6f65fd06ec6c6af95624991daa720e2dc1abd07] | committer: Felix Paul Kühne
macosx/playlist: add notifications when items are added or removed
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d6f65fd06ec6c6af95624991daa720e2dc1abd07
---
modules/gui/macosx/playlist/VLCPlaylistController.h | 2 ++
modules/gui/macosx/playlist/VLCPlaylistController.m | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.h b/modules/gui/macosx/playlist/VLCPlaylistController.h
index 79b8b9e391..cc5b4abf31 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.h
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.h
@@ -35,6 +35,8 @@ extern NSString *VLCPlaybackRepeatChanged;
extern NSString *VLCPlaybackHasPreviousChanged;
extern NSString *VLCPlaybackHasNextChanged;
extern NSString *VLCPlaylistCurrentItemChanged;
+extern NSString *VLCPlaylistItemsAdded;
+extern NSString *VLCPlaylistItemsRemoved;
@interface VLCPlaylistController : NSObject
diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.m b/modules/gui/macosx/playlist/VLCPlaylistController.m
index 076bb6d39a..aea9cfeecb 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.m
@@ -37,6 +37,8 @@ NSString *VLCPlaybackRepeatChanged = @"VLCPlaybackRepeatChanged";
NSString *VLCPlaybackHasPreviousChanged = @"VLCPlaybackHasPreviousChanged";
NSString *VLCPlaybackHasNextChanged = @"VLCPlaybackHasNextChanged";
NSString *VLCPlaylistCurrentItemChanged = @"VLCPlaylistCurrentItemChanged";
+NSString *VLCPlaylistItemsAdded = @"VLCPlaylistItemsAdded";
+NSString *VLCPlaylistItemsRemoved = @"VLCPlaylistItemsRemoved";
@interface VLCPlaylistController ()
{
@@ -246,6 +248,7 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
[_playlistModel addItems:items atIndex:insertionIndex count:numberOfItems];
[_playlistDataSource playlistUpdated];
+ [_defaultNotificationCenter postNotificationName:VLCPlaylistItemsAdded object:self];
}
- (void)playlistRemovedItemsAtIndex:(size_t)index count:(size_t)numberOfItems
@@ -254,6 +257,7 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
[_playlistModel removeItemsInRange:range];
[_playlistDataSource playlistUpdated];
+ [_defaultNotificationCenter postNotificationName:VLCPlaylistItemsRemoved object:self];
}
- (void)playlistUpdatedForIndex:(size_t)firstUpdatedIndex items:(vlc_playlist_item_t *const *)items count:(size_t)numberOfItems
More information about the vlc-commits
mailing list