Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
2570019d
Commit
2570019d
authored
Jun 22, 2011
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: basic UI to have something as a start
minor functional changes only
parent
dfa953d4
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14571 additions
and
13022 deletions
+14571
-13022
extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
...acosx/Resources/English.lproj/MainMenu.nib/designable.nib
+14492
-12586
extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
...osx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
+0
-0
modules/gui/macosx/controls.m
modules/gui/macosx/controls.m
+16
-10
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+0
-9
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+11
-220
modules/gui/macosx/misc.h
modules/gui/macosx/misc.h
+2
-12
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+33
-92
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.h
+0
-8
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+17
-85
No files found.
extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
View file @
2570019d
This diff is collapsed.
Click to expand it.
extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
View file @
2570019d
No preview for this file type
modules/gui/macosx/controls.m
View file @
2570019d
...
@@ -182,18 +182,18 @@
...
@@ -182,18 +182,18 @@
/* three little ugly helpers */
/* three little ugly helpers */
-
(
void
)
repeatOne
-
(
void
)
repeatOne
{
{
[
o_btn_repeat
setImage
:
[
NSImage
imageNamed
:
@"repeat
_single_embedded_graphit
e"
]];
[
o_btn_repeat
setImage
:
[
NSImage
imageNamed
:
@"repeat
-on
e"
]];
[
o_btn_repeat
setAlternateImage
:
[
NSImage
imageNamed
:
@"repeat
_embedded_graphite
"
]];
[
o_btn_repeat
setAlternateImage
:
[
NSImage
imageNamed
:
@"repeat
-one-pressed
"
]];
}
}
-
(
void
)
repeatAll
-
(
void
)
repeatAll
{
{
[
o_btn_repeat
setImage
:
[
NSImage
imageNamed
:
@"repeat
_embedded_graphite
"
]];
[
o_btn_repeat
setImage
:
[
NSImage
imageNamed
:
@"repeat
-all
"
]];
[
o_btn_repeat
setAlternateImage
:
[
NSImage
imageNamed
:
@"repeat
_embedd
ed"
]];
[
o_btn_repeat
setAlternateImage
:
[
NSImage
imageNamed
:
@"repeat
-all-press
ed"
]];
}
}
-
(
void
)
repeatOff
-
(
void
)
repeatOff
{
{
[
o_btn_repeat
setImage
:
[
NSImage
imageNamed
:
@"repeat
_embedded
"
]];
[
o_btn_repeat
setImage
:
[
NSImage
imageNamed
:
@"repeat"
]];
[
o_btn_repeat
setAlternateImage
:
[
NSImage
imageNamed
:
@"repeat
_embedded_graphite
"
]];
[
o_btn_repeat
setAlternateImage
:
[
NSImage
imageNamed
:
@"repeat
-pressed
"
]];
}
}
-
(
void
)
shuffle
-
(
void
)
shuffle
{
{
...
@@ -201,10 +201,16 @@
...
@@ -201,10 +201,16 @@
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
var_Get
(
p_playlist
,
"random"
,
&
val
);
var_Get
(
p_playlist
,
"random"
,
&
val
);
[
o_btn_shuffle
setState
:
val
.
b_bool
];
[
o_btn_shuffle
setState
:
val
.
b_bool
];
if
(
val
.
b_bool
)
if
(
val
.
b_bool
)
{
[
o_btn_shuffle_embed
setImage
:
[
NSImage
imageNamed
:
@"shuffle_embedded_graphite"
]];
[
o_btn_shuffle_embed
setImage
:
[
NSImage
imageNamed
:
@"shuffle-on"
]];
[
o_btn_shuffle_embed
setAlternativeImage
:
[
NSImage
imageNamed
:
@"shuffle-blue-pressed"
]];
}
else
else
[
o_btn_shuffle_embed
setImage
:
[
NSImage
imageNamed
:
@"shuffle_embedded"
]];
{
[
o_btn_shuffle_embed
setImage
:
[
NSImage
imageNamed
:
@"shuffle"
]];
[
o_btn_shuffle_embed
setImage
:
[
NSImage
imageNamed
:
@"shuffle-pressed"
]];
}
}
}
-
(
IBAction
)
repeatButtonAction
:(
id
)
sender
-
(
IBAction
)
repeatButtonAction
:(
id
)
sender
...
...
modules/gui/macosx/intf.h
View file @
2570019d
...
@@ -136,8 +136,6 @@ struct intf_sys_t
...
@@ -136,8 +136,6 @@ struct intf_sys_t
float
f_slider_old
;
/* old slider val */
float
f_slider_old
;
/* old slider val */
IBOutlet
NSSlider
*
o_volumeslider
;
/* volume slider */
IBOutlet
NSSlider
*
o_volumeslider
;
/* volume slider */
IBOutlet
NSView
*
toolbarMediaControl
;
/* view with the controls */
IBOutlet
NSProgressIndicator
*
o_main_pgbar
;
/* playlist window progress bar */
IBOutlet
NSProgressIndicator
*
o_main_pgbar
;
/* playlist window progress bar */
IBOutlet
NSButton
*
o_btn_prev
;
/* btn previous */
IBOutlet
NSButton
*
o_btn_prev
;
/* btn previous */
IBOutlet
NSButton
*
o_btn_rewind
;
/* btn rewind */
IBOutlet
NSButton
*
o_btn_rewind
;
/* btn rewind */
...
@@ -320,15 +318,8 @@ struct intf_sys_t
...
@@ -320,15 +318,8 @@ struct intf_sys_t
IBOutlet
NSMenuItem
*
o_vmi_fullscreen
;
IBOutlet
NSMenuItem
*
o_vmi_fullscreen
;
IBOutlet
NSMenuItem
*
o_vmi_snapshot
;
IBOutlet
NSMenuItem
*
o_vmi_snapshot
;
bool
b_small_window
;
bool
b_restore_size
;
NSRect
o_restore_rect
;
mtime_t
i_end_scroll
;
mtime_t
i_end_scroll
;
NSSize
o_size_with_playlist
;
int
i_lastShownVolume
;
int
i_lastShownVolume
;
input_state_e
cachedInputState
;
input_state_e
cachedInputState
;
...
...
modules/gui/macosx/intf.m
View file @
2570019d
...
@@ -388,15 +388,6 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -388,15 +388,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[
o_msgs_panel
setExcludedFromWindowsMenu
:
YES
];
[
o_msgs_panel
setExcludedFromWindowsMenu
:
YES
];
[
o_msgs_panel
setDelegate
:
self
];
[
o_msgs_panel
setDelegate
:
self
];
/* In code and not in Nib for 10.4 compat */
NSToolbar
*
toolbar
=
[[[
NSToolbar
alloc
]
initWithIdentifier
:
@"mainControllerToolbar"
]
autorelease
];
[
toolbar
setDelegate
:
self
];
[
toolbar
setShowsBaselineSeparator
:
NO
];
[
toolbar
setAllowsUserCustomization
:
NO
];
[
toolbar
setDisplayMode
:
NSToolbarDisplayModeIconOnly
];
[
toolbar
setAutosavesConfiguration
:
YES
];
[
o_window
setToolbar
:
toolbar
];
o_key
=
[
NSString
stringWithFormat
:
@"%s"
,
config_GetPsz
(
p_intf
,
"key-quit"
)];
o_key
=
[
NSString
stringWithFormat
:
@"%s"
,
config_GetPsz
(
p_intf
,
"key-quit"
)];
[
o_mi_quit
setKeyEquivalent
:
[
self
VLCKeyToString
:
o_key
]];
[
o_mi_quit
setKeyEquivalent
:
[
self
VLCKeyToString
:
o_key
]];
[
o_mi_quit
setKeyEquivalentModifierMask
:
[
self
VLCModifiersToCocoa
:
o_key
]];
[
o_mi_quit
setKeyEquivalentModifierMask
:
[
self
VLCModifiersToCocoa
:
o_key
]];
...
@@ -474,32 +465,8 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -474,32 +465,8 @@ static VLCMain *_o_sharedMainInstance = nil;
[
self
manageVolumeSlider
];
[
self
manageVolumeSlider
];
[
o_window
setDelegate
:
self
];
[
o_window
setDelegate
:
self
];
b_restore_size
=
false
;
// Set that here as IB seems to be buggy
// Set that here as IB seems to be buggy
[
o_window
setContentMinSize
:
NSMakeSize
(
338
.,
30
.)];
[
o_window
setContentMinSize
:
NSMakeSize
(
500
.,
200
.)];
if
(
[
o_window
contentRectForFrameRect
:[
o_window
frame
]].
size
.
height
<=
169
.
)
{
b_small_window
=
YES
;
[
o_window
setFrame
:
NSMakeRect
(
[
o_window
frame
].
origin
.
x
,
[
o_window
frame
].
origin
.
y
,
[
o_window
frame
].
size
.
width
,
[
o_window
minSize
].
height
)
display
:
YES
animate
:
YES
];
[
o_playlist_view
setAutoresizesSubviews
:
NO
];
}
else
{
b_small_window
=
NO
;
NSRect
contentRect
=
[
o_window
contentRectForFrameRect
:[
o_window
frame
]];
[
o_playlist_view
setFrame
:
NSMakeRect
(
0
,
0
,
contentRect
.
size
.
width
,
contentRect
.
size
.
height
-
[
o_window
contentMinSize
].
height
)];
[
o_playlist_view
setNeedsDisplay
:
YES
];
[
o_playlist_view
setAutoresizesSubviews
:
YES
];
[[
o_window
contentView
]
addSubview
:
o_playlist_view
];
}
[
self
updateTogglePlaylistState
];
o_size_with_playlist
=
[
o_window
contentRectForFrameRect
:[
o_window
frame
]].
size
;
p_playlist
=
pl_Get
(
p_intf
);
p_playlist
=
pl_Get
(
p_intf
);
...
@@ -906,66 +873,6 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -906,66 +873,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[[[
o_controls
voutView
]
window
]
orderOut
:
self
];
[[[
o_controls
voutView
]
window
]
orderOut
:
self
];
}
}
#pragma mark -
#pragma mark Toolbar delegate
/* Our item identifiers */
static
NSString
*
VLCToolbarMediaControl
=
@"VLCToolbarMediaControl"
;
-
(
NSArray
*
)
toolbarAllowedItemIdentifiers
:(
NSToolbar
*
)
toolbar
{
return
[
NSArray
arrayWithObjects
:
// NSToolbarCustomizeToolbarItemIdentifier,
// NSToolbarFlexibleSpaceItemIdentifier,
// NSToolbarSpaceItemIdentifier,
// NSToolbarSeparatorItemIdentifier,
VLCToolbarMediaControl
,
nil
];
}
-
(
NSArray
*
)
toolbarDefaultItemIdentifiers
:
(
NSToolbar
*
)
toolbar
{
return
[
NSArray
arrayWithObjects
:
VLCToolbarMediaControl
,
nil
];
}
-
(
NSToolbarItem
*
)
toolbar
:(
NSToolbar
*
)
toolbar
itemForItemIdentifier
:(
NSString
*
)
itemIdentifier
willBeInsertedIntoToolbar
:(
BOOL
)
flag
{
NSToolbarItem
*
toolbarItem
=
[[[
NSToolbarItem
alloc
]
initWithItemIdentifier
:
itemIdentifier
]
autorelease
];
if
(
[
itemIdentifier
isEqual
:
VLCToolbarMediaControl
]
)
{
[
toolbarItem
setLabel
:
@"Media Controls"
];
[
toolbarItem
setPaletteLabel
:
@"Media Controls"
];
NSSize
size
=
toolbarMediaControl
.
frame
.
size
;
[
toolbarItem
setView
:
toolbarMediaControl
];
[
toolbarItem
setMinSize
:
size
];
size
.
width
+=
1000
.;
[
toolbarItem
setMaxSize
:
size
];
// Hack: For some reason we need to make sure
// that the those element are on top
// Add them again will put them frontmost
[
toolbarMediaControl
addSubview
:
o_scrollfield
];
[
toolbarMediaControl
addSubview
:
o_timeslider
];
[
toolbarMediaControl
addSubview
:
o_timefield
];
[
toolbarMediaControl
addSubview
:
o_main_pgbar
];
/* TODO: setup a menu */
}
else
{
/* itemIdentifier referred to a toolbar item that is not
* provided or supported by us or Cocoa
* Returning nil will inform the toolbar
* that this kind of item is not supported */
toolbarItem
=
nil
;
}
return
toolbarItem
;
}
#pragma mark -
#pragma mark -
#pragma mark Media Key support
#pragma mark Media Key support
...
@@ -2676,130 +2583,14 @@ end:
...
@@ -2676,130 +2583,14 @@ end:
-
(
IBAction
)
togglePlaylist
:(
id
)
sender
-
(
IBAction
)
togglePlaylist
:(
id
)
sender
{
{
NSRect
contentRect
=
[
o_window
contentRectForFrameRect
:[
o_window
frame
]];
NSLog
(
@"needs to be re-implemented"
);
NSRect
o_rect
=
[
o_window
contentRectForFrameRect
:[
o_window
frame
]];
/*First, check if the playlist is visible*/
if
(
contentRect
.
size
.
height
<=
169
.
)
{
o_restore_rect
=
contentRect
;
b_restore_size
=
true
;
b_small_window
=
YES
;
/* we know we are small, make sure this is actually set (see case below) */
/* make large */
if
(
o_size_with_playlist
.
height
>
169
.
)
o_rect
.
size
.
height
=
o_size_with_playlist
.
height
;
else
o_rect
.
size
.
height
=
500
.;
if
(
o_size_with_playlist
.
width
>=
[
o_window
contentMinSize
].
width
)
o_rect
.
size
.
width
=
o_size_with_playlist
.
width
;
else
o_rect
.
size
.
width
=
[
o_window
contentMinSize
].
width
;
o_rect
.
origin
.
x
=
contentRect
.
origin
.
x
;
o_rect
.
origin
.
y
=
contentRect
.
origin
.
y
-
o_rect
.
size
.
height
+
[
o_window
contentMinSize
].
height
;
o_rect
=
[
o_window
frameRectForContentRect
:
o_rect
];
NSRect
screenRect
=
[[
o_window
screen
]
visibleFrame
];
if
(
!
NSContainsRect
(
screenRect
,
o_rect
)
)
{
if
(
NSMaxX
(
o_rect
)
>
NSMaxX
(
screenRect
)
)
o_rect
.
origin
.
x
=
(
NSMaxX
(
screenRect
)
-
o_rect
.
size
.
width
);
if
(
NSMinY
(
o_rect
)
<
NSMinY
(
screenRect
)
)
o_rect
.
origin
.
y
=
(
NSMinY
(
screenRect
)
);
}
[
o_btn_playlist
setState
:
YES
];
}
else
{
NSSize
curSize
=
o_rect
.
size
;
if
(
b_restore_size
)
{
o_rect
=
o_restore_rect
;
if
(
o_rect
.
size
.
height
<
[
o_window
contentMinSize
].
height
)
o_rect
.
size
.
height
=
[
o_window
contentMinSize
].
height
;
if
(
o_rect
.
size
.
width
<
[
o_window
contentMinSize
].
width
)
o_rect
.
size
.
width
=
[
o_window
contentMinSize
].
width
;
}
else
{
NSRect
contentRect
=
[
o_window
contentRectForFrameRect
:[
o_window
frame
]];
/* make small */
o_rect
.
size
.
height
=
[
o_window
contentMinSize
].
height
;
o_rect
.
size
.
width
=
[
o_window
contentMinSize
].
width
;
o_rect
.
origin
.
x
=
contentRect
.
origin
.
x
;
/* Calculate the position of the lower right corner after resize */
o_rect
.
origin
.
y
=
contentRect
.
origin
.
y
+
contentRect
.
size
.
height
-
[
o_window
contentMinSize
].
height
;
}
[
o_playlist_view
setAutoresizesSubviews
:
NO
];
[
o_playlist_view
removeFromSuperview
];
[
o_btn_playlist
setState
:
NO
];
b_small_window
=
NO
;
/* we aren't small here just yet. we are doing an animated resize after this */
o_rect
=
[
o_window
frameRectForContentRect
:
o_rect
];
}
[
o_window
setFrame
:
o_rect
display
:
YES
animate
:
YES
];
}
}
-
(
void
)
updateTogglePlaylistState
-
(
void
)
updateTogglePlaylistState
{
{
if
(
[
o_window
contentRectForFrameRect
:[
o_window
frame
]].
size
.
height
<=
169
.
)
[
o_btn_playlist
setState
:
NO
];
else
[
o_btn_playlist
setState
:
YES
];
[[
self
playlist
]
outlineViewSelectionDidChange
:
NULL
];
[[
self
playlist
]
outlineViewSelectionDidChange
:
NULL
];
}
}
-
(
NSSize
)
windowWillResize
:(
NSWindow
*
)
sender
toSize
:(
NSSize
)
proposedFrameSize
{
/* Not triggered on a window resize or maxification of the window. only by window mouse dragging resize */
/*Stores the size the controller one resize, to be able to restore it when
toggling the playlist*/
o_size_with_playlist
=
proposedFrameSize
;
NSRect
rect
;
rect
.
size
=
proposedFrameSize
;
if
(
[
o_window
contentRectForFrameRect
:
rect
].
size
.
height
<=
169
.
)
{
if
(
b_small_window
==
NO
)
{
/* if large and going to small then hide */
b_small_window
=
YES
;
[
o_playlist_view
setAutoresizesSubviews
:
NO
];
[
o_playlist_view
removeFromSuperview
];
}
return
NSMakeSize
(
proposedFrameSize
.
width
,
[
o_window
minSize
].
height
);
}
return
proposedFrameSize
;
}
-
(
void
)
windowDidMove
:(
NSNotification
*
)
notif
{
b_restore_size
=
false
;
}
-
(
void
)
windowDidResize
:(
NSNotification
*
)
notif
{
if
(
[
o_window
contentRectForFrameRect
:[
o_window
frame
]].
size
.
height
>
169
.
&&
b_small_window
)
{
/* If large and coming from small then show */
[
o_playlist_view
setAutoresizesSubviews
:
YES
];
NSRect
contentRect
=
[
o_window
contentRectForFrameRect
:[
o_window
frame
]];
[
o_playlist_view
setFrame
:
NSMakeRect
(
0
,
0
,
contentRect
.
size
.
width
,
contentRect
.
size
.
height
-
[
o_window
contentMinSize
].
height
)];
[
o_playlist_view
setNeedsDisplay
:
YES
];
[[
o_window
contentView
]
addSubview
:
o_playlist_view
];
b_small_window
=
NO
;
}
[
self
updateTogglePlaylistState
];
}
#pragma mark -
#pragma mark -
@end
@end
...
...
modules/gui/macosx/misc.h
View file @
2570019d
...
@@ -138,17 +138,7 @@
...
@@ -138,17 +138,7 @@
{
{
}
}
@end
-
(
void
)
drawRect
:(
NSRect
)
rect
;
-
(
void
)
drawKnobInRect
:(
NSRect
)
knobRect
;
/*****************************************************************************
* ITSliderCell
*****************************************************************************/
@interface
ITSliderCell
:
NSSliderCell
{
NSImage
*
_knobOff
;
NSImage
*
_knobOn
;
BOOL
b_mouse_down
;
}
@end
@end
modules/gui/macosx/misc.m
View file @
2570019d
...
@@ -695,90 +695,31 @@ void _drawFrameInRect(NSRect frameRect)
...
@@ -695,90 +695,31 @@ void _drawFrameInRect(NSRect frameRect)
@implementation
ITSlider
@implementation
ITSlider
-
(
void
)
awakeFromNib
-
(
void
)
drawKnobInRect
:(
NSRect
)
knobRect
{
if
([[
self
cell
]
class
]
!=
[
ITSliderCell
class
])
{
// replace cell
NSSliderCell
*
oldCell
=
[
self
cell
];
NSSliderCell
*
newCell
=
[[[
ITSliderCell
alloc
]
init
]
autorelease
];
[
newCell
setTag
:[
oldCell
tag
]];
[
newCell
setTarget
:[
oldCell
target
]];
[
newCell
setAction
:[
oldCell
action
]];
[
newCell
setControlSize
:[
oldCell
controlSize
]];
[
newCell
setType
:[
oldCell
type
]];
[
newCell
setState
:[
oldCell
state
]];
[
newCell
setAllowsTickMarkValuesOnly
:[
oldCell
allowsTickMarkValuesOnly
]];
[
newCell
setAltIncrementValue
:[
oldCell
altIncrementValue
]];
[
newCell
setControlTint
:[
oldCell
controlTint
]];
[
newCell
setKnobThickness
:[
oldCell
knobThickness
]];
[
newCell
setMaxValue
:[
oldCell
maxValue
]];
[
newCell
setMinValue
:[
oldCell
minValue
]];
[
newCell
setDoubleValue
:[
oldCell
doubleValue
]];
[
newCell
setNumberOfTickMarks
:[
oldCell
numberOfTickMarks
]];
[
newCell
setEditable
:[
oldCell
isEditable
]];
[
newCell
setEnabled
:[
oldCell
isEnabled
]];
[
newCell
setFormatter
:[
oldCell
formatter
]];
[
newCell
setHighlighted
:[
oldCell
isHighlighted
]];
[
newCell
setTickMarkPosition
:[
oldCell
tickMarkPosition
]];
[
self
setCell
:
newCell
];
}
}
@end
/*************************************************************************** **
* ITSliderCell
*****************************************************************************/
@implementation
ITSliderCell
-
(
id
)
init
{
{
self
=
[
super
init
];
NSRect
image_rect
;
_knobOff
=
[
NSImage
imageNamed
:
@"volumeslider_normal"
];
NSImage
*
img
=
[
NSImage
imageNamed
:
@"volume-slider-knob"
];
_knobOn
=
[
NSImage
imageNamed
:
@"volumeslider_graphite"
];
image_rect
.
size
=
[
img
size
];
b_mouse_down
=
FALSE
;
image_rect
.
origin
.
x
=
0
;
return
self
;
image_rect
.
origin
.
y
=
0
;
knobRect
.
origin
.
x
+=
(
knobRect
.
size
.
width
-
image_rect
.
size
.
width
)
/
2
;
knobRect
.
size
.
width
=
image_rect
.
size
.
width
;
knobRect
.
size
.
height
=
image_rect
.
size
.
height
;
[
img
drawInRect
:
knobRect
fromRect
:
image_rect
operation
:
NSCompositeSourceOver
fraction
:
1
];
}
}
-
(
void
)
drawRect
:(
NSRect
)
rect
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
[
_knobOff
release
];
[
_knobOn
release
];
[
super
dealloc
];
}
-
(
void
)
drawKnob
:(
NSRect
)
knob_rect
{
NSImage
*
knob
;
if
(
b_mouse_down
)
knob
=
_knobOn
;
else
knob
=
_knobOff
;
[[
self
controlView
]
lockFocus
];
[
knob
compositeToPoint
:
NSMakePoint
(
knob_rect
.
origin
.
x
+
1
,
knob_rect
.
origin
.
y
+
knob_rect
.
size
.
height
-
2
)
operation:
NSCompositeSourceOver
];
[[
self
controlView
]
unlockFocus
];
}
-
(
void
)
stopTracking
:(
NSPoint
)
lastPoint
at
:(
NSPoint
)
stopPoint
inView
:
(
NSView
*
)
controlView
mouseIsUp
:(
BOOL
)
flag
{
{
b_mouse_down
=
NO
;
/* Draw default to make sure the slider behaves correctly */
[
self
drawKnob
];
[[
NSGraphicsContext
currentContext
]
saveGraphicsState
];
[
super
stopTracking
:
lastPoint
at
:
stopPoint
inView
:
controlView
mouseIsUp
:
flag
];
NSRectClip
(
NSZeroRect
);
}
[
super
drawRect
:
rect
];
[[
NSGraphicsContext
currentContext
]
restoreGraphicsState
];
-
(
BOOL
)
startTrackingAt
:(
NSPoint
)
startPoint
inView
:(
NSView
*
)
controlView
NSRect
knobRect
=
[[
self
cell
]
knobRectFlipped
:
NO
];
{
knobRect
.
origin
.
y
+=
2
;
b_mouse_down
=
YES
;
// [[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
[
self
drawKnob
];
[
self
drawKnobInRect
:
knobRect
];
return
[
super
startTrackingAt
:
startPoint
inView
:
controlView
];
}
}
@end
@end
...
...
modules/gui/macosx/playlist.h
View file @
2570019d
...
@@ -77,8 +77,6 @@
...
@@ -77,8 +77,6 @@
IBOutlet
id
o_btn_playlist
;
IBOutlet
id
o_btn_playlist
;
IBOutlet
id
o_playlist_view
;
IBOutlet
id
o_playlist_view
;
IBOutlet
id
o_sidebar
;
IBOutlet
id
o_sidebar
;
IBOutlet
id
o_status_field
;
IBOutlet
id
o_status_field_embed
;
IBOutlet
id
o_search_field
;
IBOutlet
id
o_search_field
;
IBOutlet
id
o_search_field_other
;
IBOutlet
id
o_search_field_other
;
IBOutlet
id
o_mi_save_playlist
;
IBOutlet
id
o_mi_save_playlist
;
...
@@ -118,10 +116,6 @@
...
@@ -118,10 +116,6 @@
BOOL
b_selected_item_met
;
BOOL
b_selected_item_met
;
BOOL
b_isSortDescending
;
BOOL
b_isSortDescending
;
id
o_tc_sortColumn
;
id
o_tc_sortColumn
;
/* "add node" button and menu entry */
IBOutlet
id
o_mi_addNode
;
IBOutlet
id
o_btn_addNode
;
}
}
-
(
void
)
searchfieldChanged
:(
NSNotification
*
)
o_notification
;
-
(
void
)
searchfieldChanged
:(
NSNotification
*
)
o_notification
;
...
@@ -148,8 +142,6 @@
...
@@ -148,8 +142,6 @@
-
(
IBAction
)
sortNodeByAuthor
:(
id
)
sender
;
-
(
IBAction
)
sortNodeByAuthor
:(
id
)
sender
;
-
(
IBAction
)
recursiveExpandNode
:(
id
)
sender
;
-
(
IBAction
)
recursiveExpandNode
:(
id
)
sender
;
-
(
IBAction
)
addNode
:(
id
)
sender
;
-
(
void
)
playSidebarItem
:(
id
)
item
;
-
(
void
)
playSidebarItem
:(
id
)
item
;
-
(
id
)
playingItem
;
-
(
id
)
playingItem
;
...
...
modules/gui/macosx/playlist.m
View file @
2570019d
...
@@ -477,12 +477,9 @@
...
@@ -477,12 +477,9 @@
[
o_mi_sort_author
setTitle
:
_NS
(
"Sort Node by Author"
)];
[
o_mi_sort_author
setTitle
:
_NS
(
"Sort Node by Author"
)];
[
o_mi_services
setTitle
:
_NS
(
"Services discovery"
)];
[
o_mi_services
setTitle
:
_NS
(
"Services discovery"
)];
[
o_mm_mi_services
setTitle
:
_NS
(
"Services discovery"
)];
[
o_mm_mi_services
setTitle
:
_NS
(
"Services discovery"
)];
[
o_status_field
setStringValue
:
_NS
(
"No items in the playlist"
)];
[
o_status_field_embed
setStringValue
:
_NS
(
"No items in the playlist"
)];
[
o_search_field
setToolTip
:
_NS
(
"Search in Playlist"
)];
[
o_search_field
setToolTip
:
_NS
(
"Search in Playlist"
)];
[
o_search_field_other
setToolTip
:
_NS
(
"Search in Playlist"
)];
[
o_search_field_other
setToolTip
:
_NS
(
"Search in Playlist"
)];
[
o_mi_addNode
setTitle
:
_NS
(
"Add Folder to Playlist"
)];
[
o_save_accessory_text
setStringValue
:
_NS
(
"File Format:"
)];
[
o_save_accessory_text
setStringValue
:
_NS
(
"File Format:"
)];
[[
o_save_accessory_popup
itemAtIndex
:
0
]
setTitle
:
_NS
(
"Extended M3U"
)];
[[
o_save_accessory_popup
itemAtIndex
:
0
]
setTitle
:
_NS
(
"Extended M3U"
)];
...
@@ -520,33 +517,6 @@
...
@@ -520,33 +517,6 @@
[[[[
VLCMain
sharedInstance
]
wizard
]
playlistWizard
]
reloadOutlineView
];
[[[[
VLCMain
sharedInstance
]
wizard
]
playlistWizard
]
reloadOutlineView
];
[[[[
VLCMain
sharedInstance
]
bookmarks
]
dataTable
]
reloadData
];
[[[[
VLCMain
sharedInstance
]
bookmarks
]
dataTable
]
reloadData
];
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
PL_LOCK
;
if
(
playlist_CurrentSize
(
p_playlist
)
>=
2
)
{
[
o_status_field
setStringValue
:
[
NSString
stringWithFormat
:
_NS
(
"%i items"
),
playlist_CurrentSize
(
p_playlist
)]];
[
o_status_field_embed
setStringValue
:
[
NSString
stringWithFormat
:
_NS
(
"%i items"
),
playlist_CurrentSize
(
p_playlist
)]];
}
else
{
if
(
playlist_IsEmpty
(
p_playlist
)
)
{
[
o_status_field
setStringValue
:
_NS
(
"No items in the playlist"
)];
[
o_status_field_embed
setStringValue
:
_NS
(
"No items in the playlist"
)];
}
else
{
[
o_status_field
setStringValue
:
_NS
(
"1 item"
)];
[
o_status_field_embed
setStringValue
:
_NS
(
"1 item"
)];
}
}
PL_UNLOCK
;
[
self
outlineViewSelectionDidChange
:
nil
];
[
self
outlineViewSelectionDidChange
:
nil
];
}
}
...
@@ -1516,18 +1486,6 @@
...
@@ -1516,18 +1486,6 @@
return
o_playing_item
;
return
o_playing_item
;
}
}
-
(
IBAction
)
addNode
:(
id
)
sender
{
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
PL_LOCK
;
playlist_NodeCreate
(
p_playlist
,
_
(
"Empty Folder"
),
p_playlist
->
p_local_category
,
PLAYLIST_END
,
0
,
NULL
);
PL_UNLOCK
;
[
self
playlistUpdated
];
}
@end
@end
@implementation
VLCPlaylist
(
NSOutlineViewDataSource
)
@implementation
VLCPlaylist
(
NSOutlineViewDataSource
)
...
@@ -1535,32 +1493,6 @@
...
@@ -1535,32 +1493,6 @@
-
(
id
)
outlineView
:(
NSOutlineView
*
)
outlineView
child
:(
NSInteger
)
index
ofItem
:(
id
)
item
-
(
id
)
outlineView
:(
NSOutlineView
*
)
outlineView
child
:(
NSInteger
)
index
ofItem
:(
id
)
item
{
{
id
o_value
=
[
super
outlineView
:
outlineView
child
:
index
ofItem
:
item
];
id
o_value
=
[
super
outlineView
:
outlineView
child
:
index
ofItem
:
item
];
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
PL_LOCK
;
if
(
playlist_CurrentSize
(
p_playlist
)
>=
2
)
{
[
o_status_field
setStringValue
:
[
NSString
stringWithFormat
:
_NS
(
"%i items"
),
playlist_CurrentSize
(
p_playlist
)]];
[
o_status_field_embed
setStringValue
:
[
NSString
stringWithFormat
:
_NS
(
"%i items"
),
playlist_CurrentSize
(
p_playlist
)]];
}
else
{
if
(
playlist_IsEmpty
(
p_playlist
)
)
{
[
o_status_field
setStringValue
:
_NS
(
"No items in the playlist"
)];
[
o_status_field_embed
setStringValue
:
_NS
(
"No items in the playlist"
)];
}
else
{
[
o_status_field
setStringValue
:
_NS
(
"1 item"
)];
[
o_status_field_embed
setStringValue
:
_NS
(
"1 item"
)];
}
}
PL_UNLOCK
;
[
o_outline_dict
setObject
:
o_value
forKey
:[
NSString
stringWithFormat
:
@"%p"
,
[
o_outline_dict
setObject
:
o_value
forKey
:[
NSString
stringWithFormat
:
@"%p"
,
[
o_value
pointerValue
]]];
[
o_value
pointerValue
]]];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment