Commit 896af425 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: split playlist source file

parent c169acfa
......@@ -1246,6 +1246,8 @@
7D8BB0B61830311300FAE9B7 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/DebugMessageVisualizer.xib; sourceTree = "<group>"; };
7D8BB0B91830367200FAE9B7 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/PlaylistMenu.xib; sourceTree = "<group>"; };
7D8BB0BF1830393300FAE9B7 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/MainWindow.xib; sourceTree = "<group>"; };
7DA481221B5FC13700917FD7 /* playlistview.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = playlistview.h; path = ../../../modules/gui/macosx/playlistview.h; sourceTree = "<group>"; };
7DA481231B5FC13700917FD7 /* playlistview.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = playlistview.m; path = ../../../modules/gui/macosx/playlistview.m; sourceTree = "<group>"; };
7DB65D5218ABD6380053B874 /* AddonsWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AddonsWindowController.h; path = ../../../modules/gui/macosx/AddonsWindowController.h; sourceTree = SOURCE_ROOT; };
7DB65D5318ABD6380053B874 /* AddonsWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AddonsWindowController.m; path = ../../../modules/gui/macosx/AddonsWindowController.m; sourceTree = SOURCE_ROOT; };
7DB65D5518ABD6490053B874 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/AddonManager.xib; sourceTree = "<group>"; };
......@@ -1860,6 +1862,8 @@
8E55FB800459B0FD00FB3317 /* output.m */,
8ED6C28303E2EB1C0059A3A7 /* playlist.h */,
8ED6C28403E2EB1C0059A3A7 /* playlist.m */,
7DA481221B5FC13700917FD7 /* playlistview.h */,
7DA481231B5FC13700917FD7 /* playlistview.m */,
8E49720006417F6800370C9F /* playlistinfo.h */,
8E49720106417F6800370C9F /* playlistinfo.m */,
7DF812F11B5599E40052293C /* PLItem.h */,
......
......@@ -50,6 +50,7 @@ libmacosx_plugin_la_SOURCES = \
misc.h misc.m \
open.h open.m \
output.h output.m \
playlistview.h playlistview.m \
playlist.h playlist.m \
playlistinfo.h playlistinfo.m \
PLItem.h PLItem.m \
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2002-2015 VLC authors and VideoLAN
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <hartman at videolan dot org>
* Authors: Benjamin Pracht <bigben at videolab dot org>
* Felix Paul Kühne <fkuehne at videolan dot org>
* David Fuhrmann <david dot fuhrmann at googlemail dot com>
*
* 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
......@@ -25,17 +25,8 @@
#import "PXSourceList.h"
#import "PLModel.h"
#import "playlistview.h"
/*****************************************************************************
* VLCPlaylistView interface
*****************************************************************************/
@interface VLCPlaylistView : NSOutlineView
@end
/*****************************************************************************
* VLCPlaylist interface
*****************************************************************************/
@interface VLCPlaylist : NSObject<NSOutlineViewDelegate>
@property (readwrite, weak) IBOutlet NSMenu *playlistMenu;
......@@ -71,7 +62,6 @@
- (void)deletionCompleted;
- (IBAction)playItem:(id)sender;
- (IBAction)revealItemInFinder:(id)sender;
- (IBAction)preparseItem:(id)sender;
......
......@@ -4,10 +4,10 @@
* Copyright (C) 2002-2015 VLC authors and VideoLAN
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <hartman at videola/n dot org>
* Benjamin Pracht <bigben at videolab dot org>
* Authors: Derk-Jan Hartman <hartman at videola/n dot org>
* Benjamin Pracht <bigben at videolan dot org>
* Felix Paul Kühne <fkuehne at videolan dot org>
* David Fuhrmann <david dot fuhrmann at googlemail dot com>
*
* 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
......@@ -112,74 +112,6 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
}
}
/*****************************************************************************
* VLCPlaylistView implementation
*****************************************************************************/
@implementation VLCPlaylistView
- (NSMenu *)menuForEvent:(NSEvent *)o_event
{
return([(VLCPlaylist *)[self delegate] menuForEvent: o_event]);
}
- (void)keyDown:(NSEvent *)o_event
{
unichar key = 0;
if ([[o_event characters] length])
key = [[o_event characters] characterAtIndex: 0];
switch(key) {
case NSDeleteCharacter:
case NSDeleteFunctionKey:
case NSDeleteCharFunctionKey:
case NSBackspaceCharacter:
[(VLCPlaylist *)[self delegate] deleteItem:self];
break;
case NSEnterCharacter:
case NSCarriageReturnCharacter:
[(VLCPlaylist *)[[VLCMain sharedInstance] playlist] playItem:nil];
break;
default:
[super keyDown: o_event];
break;
}
}
- (BOOL)validateMenuItem:(NSMenuItem *)item
{
if (([self numberOfSelectedRows] >= 1 && [item action] == @selector(delete:)) || [item action] == @selector(selectAll:))
return YES;
return NO;
}
- (BOOL)acceptsFirstResponder
{
return YES;
}
- (BOOL)becomeFirstResponder
{
[self setNeedsDisplay:YES];
return YES;
}
- (BOOL)resignFirstResponder
{
[self setNeedsDisplay:YES];
return YES;
}
- (IBAction)delete:(id)sender
{
[[[VLCMain sharedInstance] playlist] deleteItem: sender];
}
@end
/*****************************************************************************
* An extension to NSOutlineView's interface to fix compilation warnings
* and let us access these 2 functions properly.
......@@ -193,10 +125,6 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
+ (NSImage *)_defaultTableHeaderReverseSortImage;
@end
/*****************************************************************************
* VLCPlaylist implementation
*****************************************************************************/
@interface VLCPlaylist ()
{
NSImage *_descendingSortingImage;
......@@ -732,12 +660,12 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
if (optionsArray) {
NSUInteger count = [optionsArray count];
for (NSUInteger i = 0; i < count; i++)
input_item_AddOption(p_input, [o_options[i] UTF8String], VLC_INPUT_OPTION_TRUSTED);
input_item_AddOption(p_input, [optionsArray[i] UTF8String], VLC_INPUT_OPTION_TRUSTED);
}
/* Recent documents menu */
if (url != nil && (BOOL)config_GetInt(p_playlist, "macosx-recentitems") == YES)
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: o_nsurl];
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:url];
return p_input;
}
......@@ -866,9 +794,9 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
b_isSortDescending = false;
if (b_isSortDescending)
i_type = ORDER_REVERSE;
type = ORDER_REVERSE;
else
i_type = ORDER_NORMAL;
type = ORDER_NORMAL;
[[self model] sortForColumn:identifier withMode:type];
......
/*****************************************************************************
* playlist.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2015 VLC authors and VideoLAN
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
* 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.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
@interface VLCPlaylistView : NSOutlineView
@end
/*****************************************************************************
* playlistview.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2003-2015 VLC authors and VideoLAN
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videola/n dot org>
* Benjamin Pracht <bigben at videolab dot org>
* 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.
*****************************************************************************/
#import "intf.h"
#import "playlistview.h"
#import "playlist.h"
@implementation VLCPlaylistView
- (NSMenu *)menuForEvent:(NSEvent *)event
{
return([(VLCPlaylist *)[self delegate] menuForEvent: event]);
}
- (void)keyDown:(NSEvent *)event
{
unichar key = 0;
if ([[event characters] length])
key = [[event characters] characterAtIndex: 0];
switch(key) {
case NSDeleteCharacter:
case NSDeleteFunctionKey:
case NSDeleteCharFunctionKey:
case NSBackspaceCharacter:
[(VLCPlaylist *)[self delegate] deleteItem:self];
break;
case NSEnterCharacter:
case NSCarriageReturnCharacter:
[(VLCPlaylist *)[[VLCMain sharedInstance] playlist] playItem:nil];
break;
default:
[super keyDown: event];
break;
}
}
- (BOOL)validateMenuItem:(NSMenuItem *)item
{
if (([self numberOfSelectedRows] >= 1 && [item action] == @selector(delete:)) || [item action] == @selector(selectAll:))
return YES;
return NO;
}
- (BOOL)acceptsFirstResponder
{
return YES;
}
- (BOOL)becomeFirstResponder
{
[self setNeedsDisplay:YES];
return YES;
}
- (BOOL)resignFirstResponder
{
[self setNeedsDisplay:YES];
return YES;
}
- (IBAction)delete:(id)sender
{
[[[VLCMain sharedInstance] playlist] deleteItem: sender];
}
@end
......@@ -596,6 +596,8 @@ modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.m
modules/gui/macosx/playlistinfo.h
modules/gui/macosx/playlistinfo.m
modules/gui/macosx/playlistview.h
modules/gui/macosx/playlistview.m
modules/gui/macosx/prefs.h
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs_widgets.h
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment