macosx: rename to VLCBookmarksWindowController
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Mon, 8 Aug 2016 14:06:32 +0000 (16:06 +0200)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Mon, 8 Aug 2016 16:47:29 +0000 (18:47 +0200)
extras/package/macosx/Resources/English.lproj/Bookmarks.xib
extras/package/macosx/vlc.xcodeproj/project.pbxproj
modules/gui/macosx/MainMenu.m
modules/gui/macosx/Makefile.am
modules/gui/macosx/VLCBookmarksWindowController.h [new file with mode: 0644]
modules/gui/macosx/VLCBookmarksWindowController.m [new file with mode: 0644]
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/bookmarks.h [deleted file]
modules/gui/macosx/bookmarks.m [deleted file]
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m

index 194b9d9..0c2a1de 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
-        <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
     </dependencies>
     <objects>
-        <customObject id="-2" userLabel="File's Owner" customClass="VLCBookmarks">
+        <customObject id="-2" userLabel="File's Owner" customClass="VLCBookmarksWindowController">
             <connections>
                 <outlet property="addButton" destination="88" id="163"/>
                 <outlet property="clearButton" destination="94" id="165"/>
index 3adc407..2dc6981 100644 (file)
                1CCB5F581A62A724004C3E90 /* applescript.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E6BC6F7041643860059A3A7 /* applescript.m */; };
                1CCB5F591A62A724004C3E90 /* AudioEffects.h in Sources */ = {isa = PBXBuildFile; fileRef = CC5560231365CDC700D54038 /* AudioEffects.h */; };
                1CCB5F5A1A62A724004C3E90 /* AudioEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = CC5560241365CDC800D54038 /* AudioEffects.m */; };
-               1CCB5F5B1A62A724004C3E90 /* bookmarks.h in Sources */ = {isa = PBXBuildFile; fileRef = DCE7BD0708A5724D007B10AE /* bookmarks.h */; };
-               1CCB5F5C1A62A724004C3E90 /* bookmarks.m in Sources */ = {isa = PBXBuildFile; fileRef = DCE7BD0608A5724D007B10AE /* bookmarks.m */; };
+               1CCB5F5B1A62A724004C3E90 /* VLCBookmarksWindowController.h in Sources */ = {isa = PBXBuildFile; fileRef = DCE7BD0708A5724D007B10AE /* VLCBookmarksWindowController.h */; };
+               1CCB5F5C1A62A724004C3E90 /* VLCBookmarksWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = DCE7BD0608A5724D007B10AE /* VLCBookmarksWindowController.m */; };
                1CCB5F5D1A62A724004C3E90 /* CompatibilityFixes.h in Sources */ = {isa = PBXBuildFile; fileRef = CCB0BB3013FAC9F40095BD0A /* CompatibilityFixes.h */; };
                1CCB5F601A62A724004C3E90 /* ControlsBar.h in Sources */ = {isa = PBXBuildFile; fileRef = E0382C00160BA09E0031D7FF /* ControlsBar.h */; };
                1CCB5F611A62A724004C3E90 /* ControlsBar.m in Sources */ = {isa = PBXBuildFile; fileRef = E0382C01160BA09E0031D7FF /* ControlsBar.m */; };
                DC1A176914E2778A001477C6 /* qtsound.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = qtsound.m; path = ../../../modules/access/qtsound.m; sourceTree = "<group>"; };
                DCC8017816FCA036007FE736 /* avcapture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = avcapture.m; path = ../../../modules/access/avcapture.m; sourceTree = "<group>"; };
                DCC8017916FCA0DA007FE736 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
-               DCE7BD0608A5724D007B10AE /* bookmarks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = bookmarks.m; path = ../../../modules/gui/macosx/bookmarks.m; sourceTree = SOURCE_ROOT; };
-               DCE7BD0708A5724D007B10AE /* bookmarks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bookmarks.h; path = ../../../modules/gui/macosx/bookmarks.h; sourceTree = SOURCE_ROOT; };
+               DCE7BD0608A5724D007B10AE /* VLCBookmarksWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCBookmarksWindowController.m; path = ../../../modules/gui/macosx/VLCBookmarksWindowController.m; sourceTree = SOURCE_ROOT; };
+               DCE7BD0708A5724D007B10AE /* VLCBookmarksWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCBookmarksWindowController.h; path = ../../../modules/gui/macosx/VLCBookmarksWindowController.h; sourceTree = SOURCE_ROOT; };
                E0382C00160BA09E0031D7FF /* ControlsBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ControlsBar.h; path = ../../../modules/gui/macosx/ControlsBar.h; sourceTree = SOURCE_ROOT; };
                E0382C01160BA09E0031D7FF /* ControlsBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ControlsBar.m; path = ../../../modules/gui/macosx/ControlsBar.m; sourceTree = SOURCE_ROOT; };
                E06CF7F416020F6200C698B7 /* Windows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Windows.h; path = ../../../modules/gui/macosx/Windows.h; sourceTree = SOURCE_ROOT; };
                                8E6BC6F7041643860059A3A7 /* applescript.m */,
                                CC5560231365CDC700D54038 /* AudioEffects.h */,
                                CC5560241365CDC800D54038 /* AudioEffects.m */,
-                               DCE7BD0708A5724D007B10AE /* bookmarks.h */,
-                               DCE7BD0608A5724D007B10AE /* bookmarks.m */,
+                               DCE7BD0708A5724D007B10AE /* VLCBookmarksWindowController.h */,
+                               DCE7BD0608A5724D007B10AE /* VLCBookmarksWindowController.m */,
                                CCB0BB3013FAC9F40095BD0A /* CompatibilityFixes.h */,
                                E0382C00160BA09E0031D7FF /* ControlsBar.h */,
                                E0382C01160BA09E0031D7FF /* ControlsBar.m */,
                                1CCB5F591A62A724004C3E90 /* AudioEffects.h in Sources */,
                                1CCB5F5A1A62A724004C3E90 /* AudioEffects.m in Sources */,
                                7D9516BA1C60B6AB00D14E1A /* VLCStatusBarIcon.m in Sources */,
-                               1CCB5F5B1A62A724004C3E90 /* bookmarks.h in Sources */,
-                               1CCB5F5C1A62A724004C3E90 /* bookmarks.m in Sources */,
+                               1CCB5F5B1A62A724004C3E90 /* VLCBookmarksWindowController.h in Sources */,
+                               1CCB5F5C1A62A724004C3E90 /* VLCBookmarksWindowController.m in Sources */,
                                1CCB5F5D1A62A724004C3E90 /* CompatibilityFixes.h in Sources */,
                                1CCB5F601A62A724004C3E90 /* ControlsBar.h in Sources */,
                                1CCB5F611A62A724004C3E90 /* ControlsBar.m in Sources */,
index e6a98f8..d30ca0a 100644 (file)
@@ -34,7 +34,7 @@
 #import "TrackSynchronization.h"
 #import "HelpWindowController.h"
 #import "VideoEffects.h"
-#import "bookmarks.h"
+#import "VLCBookmarksWindowController.h"
 #import "simple_prefs.h"
 #import "VLCPlaylist.h"
 #import "VLCPlaylistInfo.h"
index eb0a2ad..94b4dbc 100644 (file)
@@ -26,7 +26,6 @@ libmacosx_plugin_la_SOURCES = \
        applescript.h applescript.m \
        AppleRemote.h AppleRemote.m \
        AudioEffects.h AudioEffects.m \
-       bookmarks.h bookmarks.m \
        BWQuincyManager.h BWQuincyManager.m \
        BWQuincyUI.h BWQuincyUI.m \
        CompatibilityFixes.h \
@@ -76,6 +75,7 @@ libmacosx_plugin_la_SOURCES = \
        VLCStatusBarIcon.h VLCStatusBarIcon.m \
        VLCVoutWindowController.h VLCVoutWindowController.m \
        Windows.h Windows.m \
+       VLCBookmarksWindowController.h VLCBookmarksWindowController.m \
        VLCCoreDialogProvider.h VLCCoreDialogProvider.m \
        VLCEyeTvController.h VLCEyeTvController.m \
        VLCHUDSliderCell.h VLCHUDSliderCell.m \
diff --git a/modules/gui/macosx/VLCBookmarksWindowController.h b/modules/gui/macosx/VLCBookmarksWindowController.h
new file mode 100644 (file)
index 0000000..c0152a9
--- /dev/null
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * VLCBookmarksWindowController.h: MacOS X Bookmarks window
+ *****************************************************************************
+ * Copyright (C) 2005, 2007, 2015 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Felix Kühne <fkuehne at videolan dot org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+#import "intf.h"
+#import <vlc_common.h>
+
+@interface VLCBookmarksWindowController : NSWindowController
+
+/* main window */
+@property (readwrite, weak) IBOutlet NSButton *addButton;
+@property (readwrite, weak) IBOutlet NSButton *clearButton;
+@property (readwrite, weak) IBOutlet NSButton *editButton;
+@property (readwrite, weak) IBOutlet NSButton *extractButton;
+@property (readwrite, weak) IBOutlet NSButton *removeButton;
+@property (readwrite, weak) IBOutlet NSTableView *dataTable;
+
+/* edit window */
+@property (readwrite, weak) IBOutlet NSWindow *editBookmarksWindow;
+@property (readwrite, weak) IBOutlet NSButton *editOKButton;
+@property (readwrite, weak) IBOutlet NSButton *editCancelButton;
+@property (readwrite, weak) IBOutlet NSTextField *editNameLabel;
+@property (readwrite, weak) IBOutlet NSTextField *editTimeLabel;
+@property (readwrite, weak) IBOutlet NSTextField *editNameTextField;
+@property (readwrite, weak) IBOutlet NSTextField *editTimeTextField;
+
+- (void)updateCocoaWindowLevel:(NSInteger)i_level;
+
+- (IBAction)add:(id)sender;
+- (IBAction)clear:(id)sender;
+- (IBAction)edit:(id)sender;
+- (IBAction)extract:(id)sender;
+- (IBAction)remove:(id)sender;
+- (IBAction)goToBookmark:(id)sender;
+
+- (IBAction)edit_cancel:(id)sender;
+- (IBAction)edit_ok:(id)sender;
+
+- (void)showBookmarks;
+
+@end
diff --git a/modules/gui/macosx/VLCBookmarksWindowController.m b/modules/gui/macosx/VLCBookmarksWindowController.m
new file mode 100644 (file)
index 0000000..a5660dc
--- /dev/null
@@ -0,0 +1,426 @@
+/*****************************************************************************
+ * VLCBookmarksWindowController.m: MacOS X Bookmarks window
+ *****************************************************************************
+ * Copyright (C) 2005 - 2015 VLC authors and VideoLAN
+ * $Id$
+ *
+ * Authors: Felix Paul Kühne <fkuehne at videolan dot org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Note:
+ * the code used to bind with VLC's modules is heavily based upon
+ * ../wxwidgets/bookmarks.cpp, written by Gildas Bazin.
+ * (he is a member of the VideoLAN team)
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+
+#import "VLCBookmarksWindowController.h"
+#import "CompatibilityFixes.h"
+
+@interface VLCBookmarksWindowController() <NSTableViewDataSource, NSTableViewDelegate>
+{
+    input_thread_t *p_old_input;
+}
+@end
+
+@implementation VLCBookmarksWindowController
+
+/*****************************************************************************
+ * GUI methods
+ *****************************************************************************/
+
+- (id)init
+{
+    self = [super initWithWindowNibName:@"Bookmarks"];
+
+    return self;
+}
+
+- (void)dealloc
+{
+    if (p_old_input)
+        vlc_object_release(p_old_input);
+
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
+- (void)windowDidLoad
+{
+    [self.window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
+
+    _dataTable.dataSource = self;
+    _dataTable.delegate = self;
+    _dataTable.action = @selector(goToBookmark:);
+    _dataTable.target = self;
+
+    /* main window */
+    [self.window setTitle: _NS("Bookmarks")];
+    [_addButton setTitle: _NS("Add")];
+    [_clearButton setTitle: _NS("Clear")];
+    [_editButton setTitle: _NS("Edit")];
+    [_extractButton setTitle: _NS("Extract")];
+    [_removeButton setTitle: _NS("Remove")];
+    [[[_dataTable tableColumnWithIdentifier:@"description"] headerCell]
+     setStringValue: _NS("Description")];
+    [[[_dataTable tableColumnWithIdentifier:@"time_offset"] headerCell]
+     setStringValue: _NS("Time")];
+
+    /* edit window */
+    [_editOKButton setTitle: _NS("OK")];
+    [_editCancelButton setTitle: _NS("Cancel")];
+    [_editNameLabel setStringValue: _NS("Name")];
+    [_editTimeLabel setStringValue: _NS("Time")];
+
+    [[NSNotificationCenter defaultCenter] addObserver:self
+                                             selector:@selector(inputChangedEvent:)
+                                                 name:VLCInputChangedNotification
+                                               object:nil];
+}
+
+- (void)updateCocoaWindowLevel:(NSInteger)i_level
+{
+    if (self.isWindowLoaded && [self.window isVisible] && [self.window level] != i_level)
+        [self.window setLevel: i_level];
+}
+
+- (void)showBookmarks
+{
+    /* show the window, called from intf.m */
+    [self.window displayIfNeeded];
+    [self.window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
+    [self.window makeKeyAndOrderFront:nil];
+}
+
+-(void)inputChangedEvent:(NSNotification *)o_notification
+{
+    [_dataTable reloadData];
+}
+
+- (IBAction)add:(id)sender
+{
+    /* add item to list */
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (!p_input)
+        return;
+
+    seekpoint_t bookmark;
+
+    if (!input_Control(p_input, INPUT_GET_BOOKMARK, &bookmark)) {
+        bookmark.psz_name = _("Untitled");
+        input_Control(p_input, INPUT_ADD_BOOKMARK, &bookmark);
+    }
+
+    vlc_object_release(p_input);
+
+    [_dataTable reloadData];
+}
+
+- (IBAction)clear:(id)sender
+{
+    /* clear table */
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (!p_input)
+        return;
+
+    input_Control(p_input, INPUT_CLEAR_BOOKMARKS);
+
+    vlc_object_release(p_input);
+
+    [_dataTable reloadData];
+}
+
+- (IBAction)edit:(id)sender
+{
+    /* put values to the sheet's fields and show sheet */
+    /* we take the values from the core and not the table, because we cannot
+     * really trust it */
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+    seekpoint_t **pp_bookmarks;
+    int i_bookmarks;
+    int row;
+    row = [_dataTable selectedRow];
+
+    if (!p_input)
+        return;
+
+    if (row < 0) {
+        vlc_object_release(p_input);
+        return;
+    }
+
+    if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS) {
+        vlc_object_release(p_input);
+        return;
+    }
+
+    [_editNameTextField setStringValue: toNSStr(pp_bookmarks[row]->psz_name)];
+    int total = pp_bookmarks[row]->i_time_offset/ 1000000;
+    int hour = total / (60*60);
+    int min = (total - hour*60*60) / 60;
+    int sec = total - hour*60*60 - min*60;
+    [_editTimeTextField setStringValue: [NSString stringWithFormat:@"%02d:%02d:%02d", hour, min, sec]];
+
+    /* Just keep the pointer value to check if it
+     * changes. Note, we don't need to keep a reference to the object.
+     * so release it now. */
+    p_old_input = p_input;
+    vlc_object_release(p_input);
+
+    [NSApp beginSheet: _editBookmarksWindow modalForWindow: self.window modalDelegate: _editBookmarksWindow didEndSelector: nil contextInfo: nil];
+
+    // Clear the bookmark list
+    for (int i = 0; i < i_bookmarks; i++)
+        vlc_seekpoint_Delete(pp_bookmarks[i]);
+    free(pp_bookmarks);
+}
+
+- (IBAction)edit_cancel:(id)sender
+{
+    /* close sheet */
+    [NSApp endSheet:_editBookmarksWindow];
+    [_editBookmarksWindow close];
+}
+
+- (IBAction)edit_ok:(id)sender
+{
+    /* save field contents and close sheet */
+     seekpoint_t **pp_bookmarks;
+    int i_bookmarks, i;
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (!p_input) {
+        NSBeginCriticalAlertSheet(_NS("No input"), _NS("OK"), @"", @"", self.window, nil, nil, nil, nil, @"%@",_NS("No input found. A stream must be playing or paused for bookmarks to work."));
+        return;
+    }
+    if (p_old_input != p_input) {
+        NSBeginCriticalAlertSheet(_NS("Input has changed"), _NS("OK"), @"", @"", self.window, nil, nil, nil, nil, @"%@",_NS("Input has changed, unable to save bookmark. Suspending playback with \"Pause\" while editing bookmarks to ensure to keep the same input."));
+        vlc_object_release(p_input);
+        return;
+    }
+
+    if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS) {
+        vlc_object_release(p_input);
+        return;
+    }
+
+    i = [_dataTable selectedRow];
+
+    free(pp_bookmarks[i]->psz_name);
+
+    pp_bookmarks[i]->psz_name = strdup([[_editNameTextField stringValue] UTF8String]);
+
+    NSArray * components = [[_editTimeTextField stringValue] componentsSeparatedByString:@":"];
+    NSUInteger componentCount = [components count];
+    if (componentCount == 1)
+        pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components firstObject] longLongValue]);
+    else if (componentCount == 2)
+        pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components firstObject] longLongValue] * 60 + [[components objectAtIndex:1] longLongValue]);
+    else if (componentCount == 3)
+        pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components firstObject] longLongValue] * 3600 + [[components objectAtIndex:1] longLongValue] * 60 + [[components objectAtIndex:2] longLongValue]);
+    else {
+        msg_Err(getIntf(), "Invalid string format for time");
+        goto clear;
+    }
+
+    if (input_Control(p_input, INPUT_CHANGE_BOOKMARK, pp_bookmarks[i], i) != VLC_SUCCESS) {
+        msg_Warn(getIntf(), "Unable to change the bookmark");
+        goto clear;
+    }
+
+    [_dataTable reloadData];
+    vlc_object_release(p_input);
+
+    [NSApp endSheet: _editBookmarksWindow];
+    [_editBookmarksWindow close];
+
+clear:
+    // Clear the bookmark list
+    for (int i = 0; i < i_bookmarks; i++)
+        vlc_seekpoint_Delete(pp_bookmarks[i]);
+    free(pp_bookmarks);
+}
+
+- (IBAction)extract:(id)sender
+{
+#warning this does not work anymore
+#if 0
+    if ([_dataTable numberOfSelectedRows] < 2) {
+        NSBeginAlertSheet(_NS("Invalid selection"), _NS("OK"), @"", @"", self.window, nil, nil, nil, nil, @"%@",_NS("Two bookmarks have to be selected."));
+        return;
+    }
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+    if (!p_input) {
+        NSBeginCriticalAlertSheet(_NS("No input found"), _NS("OK"), @"", @"", self.window, nil, nil, nil, nil, @"%@",_NS("The stream must be playing or paused for bookmarks to work."));
+        return;
+    }
+
+    seekpoint_t **pp_bookmarks;
+    int i_bookmarks ;
+    int i_first = -1;
+    int i_second = -1;
+    int c = 0;
+    for (NSUInteger x = 0; c != 2; x++) {
+        if ([_dataTable isRowSelected:x]) {
+            if (i_first == -1) {
+                i_first = x;
+                c = 1;
+            } else if (i_second == -1) {
+                i_second = x;
+                c = 2;
+            }
+        }
+    }
+
+    if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS) {
+        vlc_object_release(p_input);
+        msg_Err(getIntf(), "already defined bookmarks couldn't be retrieved");
+        return;
+    }
+
+    char *psz_uri = input_item_GetURI(input_GetItem(p_input));
+    [[[VLCMain sharedInstance] wizard] initWithExtractValuesFrom: [NSString stringWithFormat:@"%lli", pp_bookmarks[i_first]->i_time_offset/1000000] to: [NSString stringWithFormat:@"%lli", pp_bookmarks[i_second]->i_time_offset/1000000] ofItem: toNSStr(psz_uri)];
+    free(psz_uri);
+    vlc_object_release(p_input);
+
+    // Clear the bookmark list
+    for (int i = 0; i < i_bookmarks; i++)
+        vlc_seekpoint_Delete(pp_bookmarks[i]);
+    free(pp_bookmarks);
+#endif
+}
+
+- (IBAction)goToBookmark:(id)sender
+{
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (!p_input)
+        return;
+
+    input_Control(p_input, INPUT_SET_BOOKMARK, [_dataTable selectedRow]);
+
+    vlc_object_release(p_input);
+}
+
+- (IBAction)remove:(id)sender
+{
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+
+    if (!p_input)
+        return;
+
+    int i_focused = [_dataTable selectedRow];
+
+    if (i_focused >= 0)
+        input_Control(p_input, INPUT_DEL_BOOKMARK, i_focused);
+
+    vlc_object_release(p_input);
+
+    [_dataTable reloadData];
+}
+
+/*****************************************************************************
+ * data source methods
+ *****************************************************************************/
+
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)theDataTable
+{
+    /* return the number of bookmarks */
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+    seekpoint_t **pp_bookmarks;
+    int i_bookmarks;
+
+    if (!p_input)
+        return 0;
+
+    int returnValue = input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks);
+    vlc_object_release(p_input);
+
+    if (returnValue != VLC_SUCCESS)
+        return 0;
+
+    for (int i = 0; i < i_bookmarks; i++)
+        vlc_seekpoint_Delete(pp_bookmarks[i]);
+    free(pp_bookmarks);
+
+    return i_bookmarks;
+}
+
+- (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn: (NSTableColumn *)theTableColumn row: (NSInteger)row
+{
+    /* return the corresponding data as NSString */
+    input_thread_t * p_input = pl_CurrentInput(getIntf());
+    seekpoint_t **pp_bookmarks;
+    int i_bookmarks;
+    id ret = @"";
+
+    if (!p_input)
+        return @"";
+    else if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS)
+        ret = @"";
+    else if (row >= i_bookmarks)
+        ret = @"";
+    else {
+        NSString * identifier = [theTableColumn identifier];
+        if ([identifier isEqualToString: @"description"])
+            ret = toNSStr(pp_bookmarks[row]->psz_name);
+               else if ([identifier isEqualToString: @"time_offset"]) {
+            int total = pp_bookmarks[row]->i_time_offset/ 1000000;
+            int hour = total / (60*60);
+            int min = (total - hour*60*60) / 60;
+            int sec = total - hour*60*60 - min*60;
+            ret = [NSString stringWithFormat:@"%02d:%02d:%02d", hour, min, sec];
+        }
+
+        // Clear the bookmark list
+        for (int i = 0; i < i_bookmarks; i++)
+            vlc_seekpoint_Delete(pp_bookmarks[i]);
+        free(pp_bookmarks);
+    }
+    vlc_object_release(p_input);
+    return ret;
+}
+
+/*****************************************************************************
+ * delegate methods
+ *****************************************************************************/
+
+- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
+{
+    /* check whether a row is selected and en-/disable the edit/remove buttons */
+    if ([_dataTable selectedRow] == -1) {
+        /* no row is selected */
+        [_editButton setEnabled: NO];
+        [_removeButton setEnabled: NO];
+        [_extractButton setEnabled: NO];
+    } else {
+        /* a row is selected */
+        [_editButton setEnabled: YES];
+        [_removeButton setEnabled: YES];
+        if ([_dataTable numberOfSelectedRows] == 2)
+            [_extractButton setEnabled: YES];
+    }
+}
+
+@end
index 2c6bc9b..f0ba100 100644 (file)
@@ -33,7 +33,7 @@
 #import "VideoEffects.h"
 #import "AudioEffects.h"
 #import "VLCPlaylistInfo.h"
-#import "bookmarks.h"
+#import "VLCBookmarksWindowController.h"
 #import "TrackSynchronization.h"
 #import "ResumeDialogController.h"
 #import "VLCPlaylist.h"
diff --git a/modules/gui/macosx/bookmarks.h b/modules/gui/macosx/bookmarks.h
deleted file mode 100644 (file)
index 78c24b3..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
- * bookmarks.h: MacOS X Bookmarks window
- *****************************************************************************
- * Copyright (C) 2005, 2007, 2015 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Felix Kühne <fkuehne at videolan dot org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#import <Cocoa/Cocoa.h>
-#import "intf.h"
-#import <vlc_common.h>
-
-@interface VLCBookmarks : NSWindowController
-
-/* main window */
-@property (readwrite, weak) IBOutlet NSButton *addButton;
-@property (readwrite, weak) IBOutlet NSButton *clearButton;
-@property (readwrite, weak) IBOutlet NSButton *editButton;
-@property (readwrite, weak) IBOutlet NSButton *extractButton;
-@property (readwrite, weak) IBOutlet NSButton *removeButton;
-@property (readwrite, weak) IBOutlet NSTableView *dataTable;
-
-/* edit window */
-@property (readwrite, weak) IBOutlet NSWindow *editBookmarksWindow;
-@property (readwrite, weak) IBOutlet NSButton *editOKButton;
-@property (readwrite, weak) IBOutlet NSButton *editCancelButton;
-@property (readwrite, weak) IBOutlet NSTextField *editNameLabel;
-@property (readwrite, weak) IBOutlet NSTextField *editTimeLabel;
-@property (readwrite, weak) IBOutlet NSTextField *editNameTextField;
-@property (readwrite, weak) IBOutlet NSTextField *editTimeTextField;
-
-- (void)updateCocoaWindowLevel:(NSInteger)i_level;
-
-- (IBAction)add:(id)sender;
-- (IBAction)clear:(id)sender;
-- (IBAction)edit:(id)sender;
-- (IBAction)extract:(id)sender;
-- (IBAction)remove:(id)sender;
-- (IBAction)goToBookmark:(id)sender;
-
-- (IBAction)edit_cancel:(id)sender;
-- (IBAction)edit_ok:(id)sender;
-
-- (void)showBookmarks;
-
-@end
diff --git a/modules/gui/macosx/bookmarks.m b/modules/gui/macosx/bookmarks.m
deleted file mode 100644 (file)
index eaeeecd..0000000
+++ /dev/null
@@ -1,426 +0,0 @@
-/*****************************************************************************
- * bookmarks.m: MacOS X Bookmarks window
- *****************************************************************************
- * Copyright (C) 2005 - 2015 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Felix Paul Kühne <fkuehne at videolan dot org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-
-/*****************************************************************************
- * Note:
- * the code used to bind with VLC's modules is heavily based upon
- * ../wxwidgets/bookmarks.cpp, written by Gildas Bazin.
- * (he is a member of the VideoLAN team)
- *****************************************************************************/
-
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-
-#import "bookmarks.h"
-#import "CompatibilityFixes.h"
-
-@interface VLCBookmarks() <NSTableViewDataSource, NSTableViewDelegate>
-{
-    input_thread_t *p_old_input;
-}
-@end
-
-@implementation VLCBookmarks
-
-/*****************************************************************************
- * GUI methods
- *****************************************************************************/
-
-- (id)init
-{
-    self = [super initWithWindowNibName:@"Bookmarks"];
-
-    return self;
-}
-
-- (void)dealloc
-{
-    if (p_old_input)
-        vlc_object_release(p_old_input);
-
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-- (void)windowDidLoad
-{
-    [self.window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
-
-    _dataTable.dataSource = self;
-    _dataTable.delegate = self;
-    _dataTable.action = @selector(goToBookmark:);
-    _dataTable.target = self;
-
-    /* main window */
-    [self.window setTitle: _NS("Bookmarks")];
-    [_addButton setTitle: _NS("Add")];
-    [_clearButton setTitle: _NS("Clear")];
-    [_editButton setTitle: _NS("Edit")];
-    [_extractButton setTitle: _NS("Extract")];
-    [_removeButton setTitle: _NS("Remove")];
-    [[[_dataTable tableColumnWithIdentifier:@"description"] headerCell]
-     setStringValue: _NS("Description")];
-    [[[_dataTable tableColumnWithIdentifier:@"time_offset"] headerCell]
-     setStringValue: _NS("Time")];
-
-    /* edit window */
-    [_editOKButton setTitle: _NS("OK")];
-    [_editCancelButton setTitle: _NS("Cancel")];
-    [_editNameLabel setStringValue: _NS("Name")];
-    [_editTimeLabel setStringValue: _NS("Time")];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(inputChangedEvent:)
-                                                 name:VLCInputChangedNotification
-                                               object:nil];
-}
-
-- (void)updateCocoaWindowLevel:(NSInteger)i_level
-{
-    if (self.isWindowLoaded && [self.window isVisible] && [self.window level] != i_level)
-        [self.window setLevel: i_level];
-}
-
-- (void)showBookmarks
-{
-    /* show the window, called from intf.m */
-    [self.window displayIfNeeded];
-    [self.window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
-    [self.window makeKeyAndOrderFront:nil];
-}
-
--(void)inputChangedEvent:(NSNotification *)o_notification
-{
-    [_dataTable reloadData];
-}
-
-- (IBAction)add:(id)sender
-{
-    /* add item to list */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input)
-        return;
-
-    seekpoint_t bookmark;
-
-    if (!input_Control(p_input, INPUT_GET_BOOKMARK, &bookmark)) {
-        bookmark.psz_name = _("Untitled");
-        input_Control(p_input, INPUT_ADD_BOOKMARK, &bookmark);
-    }
-
-    vlc_object_release(p_input);
-
-    [_dataTable reloadData];
-}
-
-- (IBAction)clear:(id)sender
-{
-    /* clear table */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input)
-        return;
-
-    input_Control(p_input, INPUT_CLEAR_BOOKMARKS);
-
-    vlc_object_release(p_input);
-
-    [_dataTable reloadData];
-}
-
-- (IBAction)edit:(id)sender
-{
-    /* put values to the sheet's fields and show sheet */
-    /* we take the values from the core and not the table, because we cannot
-     * really trust it */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-    seekpoint_t **pp_bookmarks;
-    int i_bookmarks;
-    int row;
-    row = [_dataTable selectedRow];
-
-    if (!p_input)
-        return;
-
-    if (row < 0) {
-        vlc_object_release(p_input);
-        return;
-    }
-
-    if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS) {
-        vlc_object_release(p_input);
-        return;
-    }
-
-    [_editNameTextField setStringValue: toNSStr(pp_bookmarks[row]->psz_name)];
-    int total = pp_bookmarks[row]->i_time_offset/ 1000000;
-    int hour = total / (60*60);
-    int min = (total - hour*60*60) / 60;
-    int sec = total - hour*60*60 - min*60;
-    [_editTimeTextField setStringValue: [NSString stringWithFormat:@"%02d:%02d:%02d", hour, min, sec]];
-
-    /* Just keep the pointer value to check if it
-     * changes. Note, we don't need to keep a reference to the object.
-     * so release it now. */
-    p_old_input = p_input;
-    vlc_object_release(p_input);
-
-    [NSApp beginSheet: _editBookmarksWindow modalForWindow: self.window modalDelegate: _editBookmarksWindow didEndSelector: nil contextInfo: nil];
-
-    // Clear the bookmark list
-    for (int i = 0; i < i_bookmarks; i++)
-        vlc_seekpoint_Delete(pp_bookmarks[i]);
-    free(pp_bookmarks);
-}
-
-- (IBAction)edit_cancel:(id)sender
-{
-    /* close sheet */
-    [NSApp endSheet:_editBookmarksWindow];
-    [_editBookmarksWindow close];
-}
-
-- (IBAction)edit_ok:(id)sender
-{
-    /* save field contents and close sheet */
-     seekpoint_t **pp_bookmarks;
-    int i_bookmarks, i;
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input) {
-        NSBeginCriticalAlertSheet(_NS("No input"), _NS("OK"), @"", @"", self.window, nil, nil, nil, nil, @"%@",_NS("No input found. A stream must be playing or paused for bookmarks to work."));
-        return;
-    }
-    if (p_old_input != p_input) {
-        NSBeginCriticalAlertSheet(_NS("Input has changed"), _NS("OK"), @"", @"", self.window, nil, nil, nil, nil, @"%@",_NS("Input has changed, unable to save bookmark. Suspending playback with \"Pause\" while editing bookmarks to ensure to keep the same input."));
-        vlc_object_release(p_input);
-        return;
-    }
-
-    if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS) {
-        vlc_object_release(p_input);
-        return;
-    }
-
-    i = [_dataTable selectedRow];
-
-    free(pp_bookmarks[i]->psz_name);
-
-    pp_bookmarks[i]->psz_name = strdup([[_editNameTextField stringValue] UTF8String]);
-
-    NSArray * components = [[_editTimeTextField stringValue] componentsSeparatedByString:@":"];
-    NSUInteger componentCount = [components count];
-    if (componentCount == 1)
-        pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components firstObject] longLongValue]);
-    else if (componentCount == 2)
-        pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components firstObject] longLongValue] * 60 + [[components objectAtIndex:1] longLongValue]);
-    else if (componentCount == 3)
-        pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components firstObject] longLongValue] * 3600 + [[components objectAtIndex:1] longLongValue] * 60 + [[components objectAtIndex:2] longLongValue]);
-    else {
-        msg_Err(getIntf(), "Invalid string format for time");
-        goto clear;
-    }
-
-    if (input_Control(p_input, INPUT_CHANGE_BOOKMARK, pp_bookmarks[i], i) != VLC_SUCCESS) {
-        msg_Warn(getIntf(), "Unable to change the bookmark");
-        goto clear;
-    }
-
-    [_dataTable reloadData];
-    vlc_object_release(p_input);
-
-    [NSApp endSheet: _editBookmarksWindow];
-    [_editBookmarksWindow close];
-
-clear:
-    // Clear the bookmark list
-    for (int i = 0; i < i_bookmarks; i++)
-        vlc_seekpoint_Delete(pp_bookmarks[i]);
-    free(pp_bookmarks);
-}
-
-- (IBAction)extract:(id)sender
-{
-#warning this does not work anymore
-#if 0
-    if ([_dataTable numberOfSelectedRows] < 2) {
-        NSBeginAlertSheet(_NS("Invalid selection"), _NS("OK"), @"", @"", self.window, nil, nil, nil, nil, @"%@",_NS("Two bookmarks have to be selected."));
-        return;
-    }
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-    if (!p_input) {
-        NSBeginCriticalAlertSheet(_NS("No input found"), _NS("OK"), @"", @"", self.window, nil, nil, nil, nil, @"%@",_NS("The stream must be playing or paused for bookmarks to work."));
-        return;
-    }
-
-    seekpoint_t **pp_bookmarks;
-    int i_bookmarks ;
-    int i_first = -1;
-    int i_second = -1;
-    int c = 0;
-    for (NSUInteger x = 0; c != 2; x++) {
-        if ([_dataTable isRowSelected:x]) {
-            if (i_first == -1) {
-                i_first = x;
-                c = 1;
-            } else if (i_second == -1) {
-                i_second = x;
-                c = 2;
-            }
-        }
-    }
-
-    if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS) {
-        vlc_object_release(p_input);
-        msg_Err(getIntf(), "already defined bookmarks couldn't be retrieved");
-        return;
-    }
-
-    char *psz_uri = input_item_GetURI(input_GetItem(p_input));
-    [[[VLCMain sharedInstance] wizard] initWithExtractValuesFrom: [NSString stringWithFormat:@"%lli", pp_bookmarks[i_first]->i_time_offset/1000000] to: [NSString stringWithFormat:@"%lli", pp_bookmarks[i_second]->i_time_offset/1000000] ofItem: toNSStr(psz_uri)];
-    free(psz_uri);
-    vlc_object_release(p_input);
-
-    // Clear the bookmark list
-    for (int i = 0; i < i_bookmarks; i++)
-        vlc_seekpoint_Delete(pp_bookmarks[i]);
-    free(pp_bookmarks);
-#endif
-}
-
-- (IBAction)goToBookmark:(id)sender
-{
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input)
-        return;
-
-    input_Control(p_input, INPUT_SET_BOOKMARK, [_dataTable selectedRow]);
-
-    vlc_object_release(p_input);
-}
-
-- (IBAction)remove:(id)sender
-{
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input)
-        return;
-
-    int i_focused = [_dataTable selectedRow];
-
-    if (i_focused >= 0)
-        input_Control(p_input, INPUT_DEL_BOOKMARK, i_focused);
-
-    vlc_object_release(p_input);
-
-    [_dataTable reloadData];
-}
-
-/*****************************************************************************
- * data source methods
- *****************************************************************************/
-
-- (NSInteger)numberOfRowsInTableView:(NSTableView *)theDataTable
-{
-    /* return the number of bookmarks */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-    seekpoint_t **pp_bookmarks;
-    int i_bookmarks;
-
-    if (!p_input)
-        return 0;
-
-    int returnValue = input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks);
-    vlc_object_release(p_input);
-
-    if (returnValue != VLC_SUCCESS)
-        return 0;
-
-    for (int i = 0; i < i_bookmarks; i++)
-        vlc_seekpoint_Delete(pp_bookmarks[i]);
-    free(pp_bookmarks);
-
-    return i_bookmarks;
-}
-
-- (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn: (NSTableColumn *)theTableColumn row: (NSInteger)row
-{
-    /* return the corresponding data as NSString */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-    seekpoint_t **pp_bookmarks;
-    int i_bookmarks;
-    id ret = @"";
-
-    if (!p_input)
-        return @"";
-    else if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS)
-        ret = @"";
-    else if (row >= i_bookmarks)
-        ret = @"";
-    else {
-        NSString * identifier = [theTableColumn identifier];
-        if ([identifier isEqualToString: @"description"])
-            ret = toNSStr(pp_bookmarks[row]->psz_name);
-               else if ([identifier isEqualToString: @"time_offset"]) {
-            int total = pp_bookmarks[row]->i_time_offset/ 1000000;
-            int hour = total / (60*60);
-            int min = (total - hour*60*60) / 60;
-            int sec = total - hour*60*60 - min*60;
-            ret = [NSString stringWithFormat:@"%02d:%02d:%02d", hour, min, sec];
-        }
-
-        // Clear the bookmark list
-        for (int i = 0; i < i_bookmarks; i++)
-            vlc_seekpoint_Delete(pp_bookmarks[i]);
-        free(pp_bookmarks);
-    }
-    vlc_object_release(p_input);
-    return ret;
-}
-
-/*****************************************************************************
- * delegate methods
- *****************************************************************************/
-
-- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
-{
-    /* check whether a row is selected and en-/disable the edit/remove buttons */
-    if ([_dataTable selectedRow] == -1) {
-        /* no row is selected */
-        [_editButton setEnabled: NO];
-        [_removeButton setEnabled: NO];
-        [_extractButton setEnabled: NO];
-    } else {
-        /* a row is selected */
-        [_editButton setEnabled: YES];
-        [_removeButton setEnabled: YES];
-        if ([_dataTable numberOfSelectedRows] == 2)
-            [_extractButton setEnabled: YES];
-    }
-}
-
-@end
index 6a35290..6ea11e7 100644 (file)
@@ -64,7 +64,7 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
 @class VLCSimplePrefs;
 @class VLCPrefs;
 @class VLCCoreDialogProvider;
-@class VLCBookmarks;
+@class VLCBookmarksWindowController;
 @class VLCOpen;
 @class VLCDebugMessageVisualizer;
 @class VLCTrackSynchronization;
@@ -86,7 +86,7 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
 
 - (VLCMainMenu *)mainMenu;
 - (VLCMainWindow *)mainWindow;
-- (VLCBookmarks *)bookmarks;
+- (VLCBookmarksWindowController *)bookmarks;
 - (VLCOpen *)open;
 - (VLCSimplePrefs *)simplePreferences;
 - (VLCPrefs *)preferences;
index 79b22b7..69216c1 100644 (file)
@@ -51,7 +51,7 @@
 #import "VLCPlaylistInfo.h"
 #import "VLCPlaylistInfo.h"
 #import "open.h"
-#import "bookmarks.h"
+#import "VLCBookmarksWindowController.h"
 #import "VLCCoreDialogProvider.h"
 #import "simple_prefs.h"
 #import "CoreInteraction.h"
@@ -169,7 +169,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
     VLCSimplePrefs *_sprefs;
     VLCOpen *_open;
     VLCCoreDialogProvider *_coredialogs;
-    VLCBookmarks *_bookmarks;
+    VLCBookmarksWindowController *_bookmarks;
     VLCCoreInteraction *_coreinteraction;
     ResumeDialogController *_resume_dialog;
     VLCInputManager *_input_manager;
@@ -576,10 +576,10 @@ static VLCMain *sharedInstance = nil;
     return _currentMediaInfoPanel;
 }
 
-- (VLCBookmarks *)bookmarks
+- (VLCBookmarksWindowController *)bookmarks
 {
     if (!_bookmarks)
-        _bookmarks = [[VLCBookmarks alloc] init];
+        _bookmarks = [[VLCBookmarksWindowController alloc] init];
 
     return _bookmarks;
 }