forked from videolan/vlc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
139 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,9 @@ | |
* Copyright (C) 2002-2015 VLC authors and VideoLAN | ||
* $Id$ | ||
* | ||
* Authors: Jon Lech Johansen <[email protected]> | ||
* 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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,10 @@ | |
* Copyright (C) 2002-2015 VLC authors and VideoLAN | ||
* $Id$ | ||
* | ||
* Authors: Jon Lech Johansen <[email protected]> | ||
* 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 @@ + (NSImage *)_defaultTableHeaderSortImage; | |
+ (NSImage *)_defaultTableHeaderReverseSortImage; | ||
@end | ||
|
||
|
||
/***************************************************************************** | ||
* VLCPlaylist implementation | ||
*****************************************************************************/ | ||
@interface VLCPlaylist () | ||
{ | ||
NSImage *_descendingSortingImage; | ||
|
@@ -732,12 +660,12 @@ - (input_item_t *)createItem:(NSDictionary *)itemToCreateDict | |
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 @@ - (void)outlineView:(NSOutlineView *)outlineView didClickTableColumn:(NSTableCol | |
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]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/***************************************************************************** | ||
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/***************************************************************************** | ||
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters