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
f4504578
Commit
f4504578
authored
Jul 21, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: refactor main class object life management and main menu
parent
db62975c
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
2175 additions
and
10206 deletions
+2175
-10206
extras/package/macosx/Resources/English.lproj/MainMenu.xib
extras/package/macosx/Resources/English.lproj/MainMenu.xib
+1114
-8982
extras/package/macosx/vlc.xcodeproj/project.pbxproj
extras/package/macosx/vlc.xcodeproj/project.pbxproj
+0
-8
modules/gui/macosx/ControlsBar.m
modules/gui/macosx/ControlsBar.m
+2
-2
modules/gui/macosx/CoreInteraction.h
modules/gui/macosx/CoreInteraction.h
+2
-0
modules/gui/macosx/CoreInteraction.m
modules/gui/macosx/CoreInteraction.m
+44
-2
modules/gui/macosx/MainMenu.h
modules/gui/macosx/MainMenu.h
+224
-232
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+734
-604
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+3
-3
modules/gui/macosx/Makefile.am
modules/gui/macosx/Makefile.am
+0
-1
modules/gui/macosx/VideoView.m
modules/gui/macosx/VideoView.m
+3
-3
modules/gui/macosx/controls.h
modules/gui/macosx/controls.h
+0
-70
modules/gui/macosx/controls.m
modules/gui/macosx/controls.m
+0
-255
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+0
-4
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+46
-36
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+3
-3
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+0
-1
No files found.
extras/package/macosx/Resources/English.lproj/MainMenu.xib
View file @
f4504578
This diff is collapsed.
Click to expand it.
extras/package/macosx/vlc.xcodeproj/project.pbxproj
View file @
f4504578
...
...
@@ -374,8 +374,6 @@
1CCB5F5B1A62A724004C3E90
/* bookmarks.h in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DCE7BD0708A5724D007B10AE
/* bookmarks.h */
;
};
1CCB5F5C1A62A724004C3E90
/* bookmarks.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DCE7BD0608A5724D007B10AE
/* bookmarks.m */
;
};
1CCB5F5D1A62A724004C3E90
/* CompatibilityFixes.h in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CCB0BB3013FAC9F40095BD0A
/* CompatibilityFixes.h */
;
};
1CCB5F5E1A62A724004C3E90
/* controls.h in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8E6BC6FA041684EC0059A3A7
/* controls.h */
;
};
1CCB5F5F1A62A724004C3E90
/* controls.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8ED6C27B03E2EB1C0059A3A7
/* controls.m */
;
};
1CCB5F601A62A724004C3E90
/* ControlsBar.h in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0382C00160BA09E0031D7FF
/* ControlsBar.h */
;
};
1CCB5F611A62A724004C3E90
/* ControlsBar.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
E0382C01160BA09E0031D7FF
/* ControlsBar.m */
;
};
1CCB5F621A62A724004C3E90
/* ConvertAndSave.h in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
CC0663341566C34C003A411C
/* ConvertAndSave.h */
;
};
...
...
@@ -1272,12 +1270,10 @@
8E55FB800459B0FD00FB3317
/* output.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
output.m
;
path
=
../../../modules/gui/macosx/output.m
;
sourceTree
=
SOURCE_ROOT
;
};
8E6BC6F6041643860059A3A7
/* applescript.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
applescript.h
;
path
=
../../../modules/gui/macosx/applescript.h
;
sourceTree
=
SOURCE_ROOT
;
};
8E6BC6F7041643860059A3A7
/* applescript.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
applescript.m
;
path
=
../../../modules/gui/macosx/applescript.m
;
sourceTree
=
SOURCE_ROOT
;
};
8E6BC6FA041684EC0059A3A7
/* controls.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
controls.h
;
path
=
../../../modules/gui/macosx/controls.h
;
sourceTree
=
SOURCE_ROOT
;
};
8E9CA1A306D7DEE800B7186C
/* prefs_widgets.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
prefs_widgets.h
;
path
=
../../../modules/gui/macosx/prefs_widgets.h
;
sourceTree
=
SOURCE_ROOT
;
};
8E9CA1A406D7DEE800B7186C
/* prefs_widgets.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
prefs_widgets.m
;
path
=
../../../modules/gui/macosx/prefs_widgets.m
;
sourceTree
=
SOURCE_ROOT
;
};
8EBF3FA303F13FFB0059A3A7
/* vlc.scriptSuite */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text
;
name
=
vlc.scriptSuite
;
path
=
Resources/vlc.scriptSuite
;
sourceTree
=
SOURCE_ROOT
;
};
8EBF3FA503F140960059A3A7
/* vlc.scriptTerminology */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.xml
;
name
=
vlc.scriptTerminology
;
path
=
Resources/vlc.scriptTerminology
;
sourceTree
=
SOURCE_ROOT
;
};
8ED6C27B03E2EB1C0059A3A7
/* controls.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
controls.m
;
path
=
../../../modules/gui/macosx/controls.m
;
sourceTree
=
SOURCE_ROOT
;
};
8ED6C27C03E2EB1C0059A3A7
/* intf.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
intf.h
;
path
=
../../../modules/gui/macosx/intf.h
;
sourceTree
=
SOURCE_ROOT
;
};
8ED6C27D03E2EB1C0059A3A7
/* intf.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
intf.m
;
path
=
../../../modules/gui/macosx/intf.m
;
sourceTree
=
SOURCE_ROOT
;
};
8ED6C27E03E2EB1C0059A3A7
/* macosx.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
macosx.m
;
path
=
../../../modules/gui/macosx/macosx.m
;
sourceTree
=
SOURCE_ROOT
;
};
...
...
@@ -1827,8 +1823,6 @@
DCE7BD0708A5724D007B10AE
/* bookmarks.h */
,
DCE7BD0608A5724D007B10AE
/* bookmarks.m */
,
CCB0BB3013FAC9F40095BD0A
/* CompatibilityFixes.h */
,
8E6BC6FA041684EC0059A3A7
/* controls.h */
,
8ED6C27B03E2EB1C0059A3A7
/* controls.m */
,
E0382C00160BA09E0031D7FF
/* ControlsBar.h */
,
E0382C01160BA09E0031D7FF
/* ControlsBar.m */
,
CC0663341566C34C003A411C
/* ConvertAndSave.h */
,
...
...
@@ -3854,8 +3848,6 @@
1CCB5F5B1A62A724004C3E90
/* bookmarks.h in Sources */
,
1CCB5F5C1A62A724004C3E90
/* bookmarks.m in Sources */
,
1CCB5F5D1A62A724004C3E90
/* CompatibilityFixes.h in Sources */
,
1CCB5F5E1A62A724004C3E90
/* controls.h in Sources */
,
1CCB5F5F1A62A724004C3E90
/* controls.m in Sources */
,
1CCB5F601A62A724004C3E90
/* ControlsBar.h in Sources */
,
1CCB5F611A62A724004C3E90
/* ControlsBar.m in Sources */
,
1CCB5F621A62A724004C3E90
/* ConvertAndSave.h in Sources */
,
...
...
modules/gui/macosx/ControlsBar.m
View file @
f4504578
...
...
@@ -1104,7 +1104,7 @@ else \
-
(
IBAction
)
effects
:(
id
)
sender
{
[[
VLCMainMenu
sharedInstance
]
showAudioEffects
:
sender
];
[[
[
VLCMain
sharedInstance
]
mainMenu
]
showAudioEffects
:
sender
];
}
#pragma mark -
...
...
@@ -1161,7 +1161,7 @@ else \
[
o_next_btn
setEnabled
:
(
b_seekable
||
b_plmul
||
b_chapters
)];
}
[[
VLCMainMenu
sharedInstance
]
setRateControlsEnabled
:
b_control
];
[[
[
VLCMain
sharedInstance
]
mainMenu
]
setRateControlsEnabled
:
b_control
];
}
@end
modules/gui/macosx/CoreInteraction.h
View file @
f4504578
...
...
@@ -66,6 +66,7 @@
-
(
void
)
volumeUp
;
-
(
void
)
volumeDown
;
-
(
void
)
toggleMute
;
-
(
void
)
showPosition
;
-
(
void
)
startListeningWithAppleRemote
;
-
(
void
)
stopListeningWithAppleRemote
;
...
...
@@ -82,6 +83,7 @@
-
(
void
)
setVideoFilterProperty
:
(
const
char
*
)
psz_name
forFilter
:
(
const
char
*
)
psz_filter
string
:
(
const
char
*
)
psz_value
;
-
(
void
)
setVideoFilterProperty
:
(
const
char
*
)
psz_name
forFilter
:
(
const
char
*
)
psz_filter
boolean
:
(
BOOL
)
b_value
;
-
(
BOOL
)
keyEvent
:(
NSEvent
*
)
o_event
;
-
(
void
)
updateCurrentlyUsedHotkeys
;
-
(
BOOL
)
hasDefinedShortcutKey
:(
NSEvent
*
)
o_event
force
:(
BOOL
)
b_force
;
...
...
modules/gui/macosx/CoreInteraction.m
View file @
f4504578
...
...
@@ -40,7 +40,6 @@
#import "SPMediaKeyTap.h"
#import "AppleRemote.h"
#import "InputManager.h"
#import "controls.h"
static
int
BossCallback
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
new_val
,
void
*
param
)
...
...
@@ -616,6 +615,19 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
vlc_object_release
(
p_input
);
}
-
(
void
)
showPosition
{
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
if
(
p_input
!=
NULL
)
{
vout_thread_t
*
p_vout
=
input_GetVout
(
p_input
);
if
(
p_vout
!=
NULL
)
{
var_SetInteger
(
VLCIntf
->
p_libvlc
,
"key-action"
,
ACTIONID_POSITION
);
vlc_object_release
(
p_vout
);
}
vlc_object_release
(
p_input
);
}
}
#pragma mark - drag and drop support for VLCVoutView, VLCDragDropView and VLCThreePartDropView
-
(
BOOL
)
performDragOperation
:(
id
<
NSDraggingInfo
>
)
sender
{
...
...
@@ -1152,7 +1164,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
}
break
;
case
kRemoteButtonMenu
:
[
[[
VLCMain
sharedInstance
]
controls
]
showPosition
:
self
];
//FIXME
[
self
showPosition
];
break
;
case
kRemoteButtonPlay_Sleep
:
{
...
...
@@ -1174,6 +1186,36 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
* shortcut key. If it is, pass it off to VLC for handling and return YES,
* otherwise ignore it and return NO (where it will get handled by Cocoa).
*****************************************************************************/
-
(
BOOL
)
keyEvent
:(
NSEvent
*
)
o_event
{
BOOL
eventHandled
=
NO
;
NSString
*
characters
=
[
o_event
charactersIgnoringModifiers
];
if
([
characters
length
]
>
0
)
{
unichar
key
=
[
characters
characterAtIndex
:
0
];
if
(
key
)
{
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
if
(
p_input
!=
NULL
)
{
vout_thread_t
*
p_vout
=
input_GetVout
(
p_input
);
if
(
p_vout
!=
NULL
)
{
/* Escape */
if
(
key
==
(
unichar
)
0x1b
)
{
if
(
var_GetBool
(
p_vout
,
"fullscreen"
))
{
[
self
toggleFullscreen
];
eventHandled
=
YES
;
}
}
vlc_object_release
(
p_vout
);
}
vlc_object_release
(
p_input
);
}
}
}
return
eventHandled
;
}
-
(
BOOL
)
hasDefinedShortcutKey
:(
NSEvent
*
)
o_event
force
:(
BOOL
)
b_force
{
intf_thread_t
*
p_intf
=
VLCIntf
;
...
...
modules/gui/macosx/MainMenu.h
View file @
f4504578
This diff is collapsed.
Click to expand it.
modules/gui/macosx/MainMenu.m
View file @
f4504578
This diff is collapsed.
Click to expand it.
modules/gui/macosx/MainWindow.m
View file @
f4504578
...
...
@@ -32,7 +32,6 @@
#import "AudioEffects.h"
#import "MainMenu.h"
#import "open.h"
#import "controls.h" // TODO: remove me
#import "playlist.h"
#import "SideBarItem.h"
#import <math.h>
...
...
@@ -146,8 +145,9 @@ static VLCMainWindow *sharedInstance = nil;
else
b_force
=
YES
;
return
[[
VLCCoreInteraction
sharedInstance
]
hasDefinedShortcutKey
:
o_event
force
:
b_force
]
||
[(
VLCControls
*
)[[
VLCMain
sharedInstance
]
controls
]
keyEvent
:
o_event
];
VLCCoreInteraction
*
coreInteraction
=
[
VLCCoreInteraction
sharedInstance
];
return
[
coreInteraction
hasDefinedShortcutKey
:
o_event
force
:
b_force
]
||
[
coreInteraction
keyEvent
:
o_event
];
}
-
(
void
)
dealloc
...
...
modules/gui/macosx/Makefile.am
View file @
f4504578
...
...
@@ -29,7 +29,6 @@ libmacosx_plugin_la_SOURCES = \
BWQuincyManager.h BWQuincyManager.m
\
BWQuincyUI.h BWQuincyUI.m
\
CompatibilityFixes.h
\
controls.h controls.m
\
ControlsBar.m ControlsBar.h
\
ConvertAndSave.h ConvertAndSave.m
\
coredialogs.h coredialogs.m
\
...
...
modules/gui/macosx/VideoView.m
View file @
f4504578
...
...
@@ -167,7 +167,7 @@
}
else
if
(([
o_event
type
]
==
NSRightMouseDown
)
||
(([
o_event
type
]
==
NSLeftMouseDown
)
&&
([
o_event
modifierFlags
]
&
NSControlKeyMask
)))
[
NSMenu
popUpContextMenu
:
[[
VLCMainMenu
sharedInstance
]
voutMenu
]
withEvent
:
o_event
forView
:
self
];
[
NSMenu
popUpContextMenu
:
[[
[
VLCMain
sharedInstance
]
mainMenu
]
voutMenu
]
withEvent
:
o_event
forView
:
self
];
[
super
mouseDown
:
o_event
];
}
...
...
@@ -175,7 +175,7 @@
-
(
void
)
rightMouseDown
:(
NSEvent
*
)
o_event
{
if
([
o_event
type
]
==
NSRightMouseDown
)
[
NSMenu
popUpContextMenu
:
[[
VLCMainMenu
sharedInstance
]
voutMenu
]
withEvent
:
o_event
forView
:
self
];
[
NSMenu
popUpContextMenu
:
[[
[
VLCMain
sharedInstance
]
mainMenu
]
voutMenu
]
withEvent
:
o_event
forView
:
self
];
[
super
mouseDown
:
o_event
];
}
...
...
@@ -183,7 +183,7 @@
-
(
void
)
rightMouseUp
:(
NSEvent
*
)
o_event
{
if
([
o_event
type
]
==
NSRightMouseUp
)
[
NSMenu
popUpContextMenu
:
[[
VLCMainMenu
sharedInstance
]
voutMenu
]
withEvent
:
o_event
forView
:
self
];
[
NSMenu
popUpContextMenu
:
[[
[
VLCMain
sharedInstance
]
mainMenu
]
voutMenu
]
withEvent
:
o_event
forView
:
self
];
[
super
mouseUp
:
o_event
];
}
...
...
modules/gui/macosx/controls.h
deleted
100644 → 0
View file @
db62975c
/*****************************************************************************
* controls.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2012 VLC authors and VideoLAN
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net>
* Felix Paul Kühne <fkuehne at videolan 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.
*****************************************************************************/
/*****************************************************************************
* VLCControls interface
*****************************************************************************/
@interface
VLCControls
:
NSObject
{
IBOutlet
id
o_main
;
IBOutlet
id
o_specificTime_cancel_btn
;
IBOutlet
id
o_specificTime_enter_fld
;
IBOutlet
id
o_specificTime_goTo_lbl
;
IBOutlet
id
o_specificTime_ok_btn
;
IBOutlet
id
o_specificTime_win
;
IBOutlet
id
o_specificTime_sec_lbl
;
IBOutlet
id
o_specificTime_stepper
;
IBOutlet
id
o_specificTime_mi
;
}
@property
(
nonatomic
)
int
jumpTimeValue
;
-
(
IBAction
)
play
:(
id
)
sender
;
-
(
IBAction
)
stop
:(
id
)
sender
;
-
(
IBAction
)
prev
:(
id
)
sender
;
-
(
IBAction
)
next
:(
id
)
sender
;
-
(
IBAction
)
random
:(
id
)
sender
;
-
(
IBAction
)
repeat
:(
id
)
sender
;
-
(
IBAction
)
loop
:(
id
)
sender
;
-
(
IBAction
)
forward
:(
id
)
sender
;
-
(
IBAction
)
backward
:(
id
)
sender
;
-
(
IBAction
)
volumeUp
:(
id
)
sender
;
-
(
IBAction
)
volumeDown
:(
id
)
sender
;
-
(
IBAction
)
mute
:(
id
)
sender
;
-
(
IBAction
)
volumeSliderUpdated
:(
id
)
sender
;
-
(
IBAction
)
showPosition
:
(
id
)
sender
;
-
(
IBAction
)
lockVideosAspectRatio
:(
id
)
sender
;
-
(
BOOL
)
keyEvent
:(
NSEvent
*
)
o_event
;
-
(
IBAction
)
goToSpecificTime
:(
id
)
sender
;
@end
modules/gui/macosx/controls.m
deleted
100644 → 0
View file @
db62975c
/*****************************************************************************
* controls.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2013 VLC authors and VideoLAN
* $Id$
*
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
* Benjamin Pracht <bigben at videolan doit 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.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h>
/* malloc(), free() */
#include <sys/param.h>
/* for MAXPATHLEN */
#include <string.h>
#import "intf.h"
#import "VideoView.h"
#import "open.h"
#import "controls.h"
#import "playlist.h"
#import "MainMenu.h"
#import "CoreInteraction.h"
#import "misc.h"
#import <vlc_keys.h>
#pragma mark -
/*****************************************************************************
* VLCControls implementation
*****************************************************************************/
@implementation
VLCControls
-
(
void
)
awakeFromNib
{
[
o_specificTime_mi
setTitle
:
_NS
(
"Jump to Time"
)];
[
o_specificTime_cancel_btn
setTitle
:
_NS
(
"Cancel"
)];
[
o_specificTime_ok_btn
setTitle
:
_NS
(
"OK"
)];
[
o_specificTime_sec_lbl
setStringValue
:
_NS
(
"sec."
)];
[
o_specificTime_goTo_lbl
setStringValue
:
_NS
(
"Jump to Time"
)];
[
o_specificTime_enter_fld
setFormatter
:[[
PositionFormatter
alloc
]
init
]];
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
IBAction
)
play
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
playOrPause
];
}
-
(
IBAction
)
stop
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
stop
];
}
-
(
IBAction
)
prev
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
previous
];
}
-
(
IBAction
)
next
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
next
];
}
-
(
IBAction
)
random
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
shuffle
];
}
-
(
IBAction
)
repeat
:(
id
)
sender
{
vlc_value_t
val
;
intf_thread_t
*
p_intf
=
VLCIntf
;
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
var_Get
(
p_playlist
,
"repeat"
,
&
val
);
if
(
!
val
.
b_bool
)
[[
VLCCoreInteraction
sharedInstance
]
repeatOne
];
else
[[
VLCCoreInteraction
sharedInstance
]
repeatOff
];
}
-
(
IBAction
)
loop
:(
id
)
sender
{
vlc_value_t
val
;
intf_thread_t
*
p_intf
=
VLCIntf
;
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
var_Get
(
p_playlist
,
"loop"
,
&
val
);
if
(
!
val
.
b_bool
)
[[
VLCCoreInteraction
sharedInstance
]
repeatAll
];
else
[[
VLCCoreInteraction
sharedInstance
]
repeatOff
];
}
-
(
IBAction
)
forward
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
forward
];
}
-
(
IBAction
)
backward
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
backward
];
}
-
(
IBAction
)
volumeUp
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
volumeUp
];
}
-
(
IBAction
)
volumeDown
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
volumeDown
];
}
-
(
IBAction
)
mute
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
toggleMute
];
}
-
(
IBAction
)
volumeSliderUpdated
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
setVolume
:
[
sender
intValue
]];
}
-
(
IBAction
)
showPosition
:
(
id
)
sender
{
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
if
(
p_input
!=
NULL
)
{
vout_thread_t
*
p_vout
=
input_GetVout
(
p_input
);
if
(
p_vout
!=
NULL
)
{
var_SetInteger
(
VLCIntf
->
p_libvlc
,
"key-action"
,
ACTIONID_POSITION
);
vlc_object_release
(
p_vout
);
}
vlc_object_release
(
p_input
);
}
}
-
(
IBAction
)
lockVideosAspectRatio
:(
id
)
sender
{
[[
VLCCoreInteraction
sharedInstance
]
setAspectRatioIsLocked
:
!
[
sender
state
]];
[
sender
setState
:
[[
VLCCoreInteraction
sharedInstance
]
aspectRatioIsLocked
]];
}
-
(
BOOL
)
keyEvent
:(
NSEvent
*
)
o_event
{
BOOL
eventHandled
=
NO
;
NSString
*
characters
=
[
o_event
charactersIgnoringModifiers
];
if
([
characters
length
]
>
0
)
{
unichar
key
=
[
characters
characterAtIndex
:
0
];
if
(
key
)
{
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
if
(
p_input
!=
NULL
)
{
vout_thread_t
*
p_vout
=
input_GetVout
(
p_input
);
if
(
p_vout
!=
NULL
)
{
/* Escape */
if
(
key
==
(
unichar
)
0x1b
)
{
if
(
var_GetBool
(
p_vout
,
"fullscreen"
))
{
[[
VLCCoreInteraction
sharedInstance
]
toggleFullscreen
];
eventHandled
=
YES
;
}
}
vlc_object_release
(
p_vout
);
}
vlc_object_release
(
p_input
);
}
}
}
return
eventHandled
;
}
-
(
IBAction
)
goToSpecificTime
:(
id
)
sender
{
if
(
sender
==
o_specificTime_cancel_btn
)
{
[
NSApp
endSheet
:
o_specificTime_win
];
[
o_specificTime_win
close
];
}
else
if
(
sender
==
o_specificTime_ok_btn
)
{
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
if
(
p_input
)
{
int64_t
timeInSec
=
0
;
NSString
*
fieldContent
=
[
o_specificTime_enter_fld
stringValue
];
if
([[
fieldContent
componentsSeparatedByString
:
@":"
]
count
]
>
1
&&
[[
fieldContent
componentsSeparatedByString
:
@":"
]
count
]
<=
3
)
{
NSArray
*
ourTempArray
=
\
[
fieldContent
componentsSeparatedByString
:
@":"
];
if
([[
fieldContent
componentsSeparatedByString
:
@":"
]
count
]
==
3
)
{
timeInSec
+=
([[
ourTempArray
firstObject
]
intValue
]
*
3600
);
//h
timeInSec
+=
([[
ourTempArray
objectAtIndex
:
1
]
intValue
]
*
60
);
//m
timeInSec
+=
[[
ourTempArray
objectAtIndex
:
2
]
intValue
];
//s
}
else
{
timeInSec
+=
([[
ourTempArray
firstObject
]
intValue
]
*
60
);
//m
timeInSec
+=
[[
ourTempArray
objectAtIndex
:
1
]
intValue
];
//s
}
}
else
timeInSec
=
[
fieldContent
intValue
];
input_Control
(
p_input
,
INPUT_SET_TIME
,
(
int64_t
)(
timeInSec
*
1000000
));
vlc_object_release
(
p_input
);
}
[
NSApp
endSheet
:
o_specificTime_win
];
[
o_specificTime_win
close
];
}
else
{
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
if
(
p_input
)
{
/* we can obviously only do that if an input is available */
int64_t
pos
,
length
;
length
=
var_GetInteger
(
p_input
,
"length"
);
[
o_specificTime_stepper
setMaxValue
:
(
length
/
CLOCK_FREQ
)];
pos
=
var_GetInteger
(
p_input
,
"time"
);
[
self
setJumpTimeValue
:
(
pos
/
CLOCK_FREQ
)];
[
NSApp
beginSheet
:
o_specificTime_win
modalForWindow
:
\
[
NSApp
mainWindow
]
modalDelegate
:
self
didEndSelector
:
nil
\
contextInfo
:
nil
];
[
o_specificTime_win
makeKeyWindow
];
vlc_object_release
(
p_input
);
}
}
}
@end
@implementation
VLCControls
(
NSMenuValidation
)
-
(
BOOL
)
validateMenuItem
:(
NSMenuItem
*
)
o_mi
{
return
[[
VLCMainMenu
sharedInstance
]
validateMenuItem
:
o_mi
];
}
@end
modules/gui/macosx/intf.h
View file @
f4504578
...
...
@@ -55,7 +55,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
*****************************************************************************/
@class
AppleRemote
;
@class
VLCInfo
;
@class
VLCControls
;
@class
VLCMainMenu
;
@class
VLCPlaylist
;
@class
VLCInputManager
;
...
...
@@ -70,8 +69,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
@interface
VLCMain
:
NSObject
<
NSWindowDelegate
,
NSApplicationDelegate
>
{
IBOutlet
VLCMainWindow
*
o_mainwindow
;
/* VLCMainWindow */
IBOutlet
VLCControls
*
o_controls
;
/* VLCControls */
IBOutlet
VLCPlaylist
*
o_playlist
;
/* VLCPlaylist */
}
...
...
@@ -85,7 +82,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
-
(
VLCMainMenu
*
)
mainMenu
;
-
(
VLCMainWindow
*
)
mainWindow
;
-
(
VLCControls
*
)
controls
;
-
(
VLCBookmarks
*
)
bookmarks
;
-
(
VLCOpen
*
)
open
;
-
(
VLCSimplePrefs
*
)
simplePreferences
;
...
...
modules/gui/macosx/intf.m
View file @
f4504578
...
...
@@ -49,7 +49,6 @@
#import "prefs.h"
#import "playlist.h"
#import "playlistinfo.h"
#import "controls.h"
#import "open.h"
#import "bookmarks.h"
#import "coredialogs.h"
...
...
@@ -73,6 +72,8 @@
* Local prototypes.
*****************************************************************************/
static
VLCMain
*
sharedInstance
=
nil
;
#pragma mark -
#pragma mark VLC Interface Object Callbacks
...
...
@@ -91,11 +92,6 @@ int OpenIntf (vlc_object_t *p_this)
[
VLCVoutWindowController
sharedInstance
];
[
NSBundle
loadNibNamed
:
@"MainMenu"
owner
:
NSApp
];
[
NSBundle
loadNibNamed
:
@"MainWindow"
owner
:[
VLCMain
sharedInstance
]];
[[[
VLCMain
sharedInstance
]
mainWindow
]
makeKeyAndOrderFront
:
nil
];
return
VLC_SUCCESS
;
}
}
...
...
@@ -105,6 +101,7 @@ void CloseIntf (vlc_object_t *p_this)
@autoreleasepool
{
msg_Dbg
(
p_this
,
"Closing macosx interface"
);
[[
VLCMain
sharedInstance
]
applicationWillTerminate
:
nil
];
sharedInstance
=
nil
;
}
}
...
...
@@ -151,8 +148,8 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
BOOL
nib_main_loaded
;
/* main nibfile */
BOOL
nib_open_loaded
;
/* open nibfile */
BOOL
nib_about_loaded
;
/* about nibfile */
BOOL
nib_prefs_loaded
;
/* preferences
n
ibfile */
BOOL
nib_
info_loaded
;
/* information panel n
ibfile */
BOOL
nib_prefs_loaded
;
/* preferences
x
ibfile */
BOOL
nib_
sprefs_loaded
;
/* simple preferences x
ibfile */
BOOL
nib_coredialogs_loaded
;
/* CoreDialogs nibfile */
BOOL
nib_bookmarks_loaded
;
/* Bookmarks nibfile */
BOOL
b_active_videoplayback
;
...
...
@@ -162,7 +159,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
VLCSimplePrefs
*
_sprefs
;
VLCOpen
*
_open
;
VLCCoreDialogProvider
*
_coredialogs
;
VLCInfo
*
_info
;
VLCEyeTVController
*
_eyetv
;
VLCBookmarks
*
_bookmarks
;
VLCCoreInteraction
*
_coreinteraction
;
...
...
@@ -185,7 +181,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
+
(
VLCMain
*
)
sharedInstance
{
static
dispatch_once_t
pred
;
static
VLCMain
*
sharedInstance
=
nil
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
VLCMain
new
];
...
...
@@ -200,9 +195,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
p_intf
=
NULL
;
_open
=
[[
VLCOpen
alloc
]
init
];
_mainmenu
=
[
VLCMainMenu
sharedInstance
];
_eyetv
=
[[
VLCEyeTVController
alloc
]
init
];
[
VLCApplication
sharedApplication
].
delegate
=
self
;
/* announce our launch to a potential eyetv plugin */
[[
NSDistributedNotificationCenter
defaultCenter
]
postNotificationName
:
@"VLCOSXGUIInit"
...
...
@@ -219,6 +212,20 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
return
self
;
}
-
(
void
)
dealloc
{
_mainmenu
=
nil
;
_prefs
=
nil
;
_sprefs
=
nil
;
_open
=
nil
;
_coredialogs
=
nil
;
_eyetv
=
nil
;
_bookmarks
=
nil
;
_coreinteraction
=
nil
;
_resume_dialog
=
nil
;
_input_manager
=
nil
;
}
-
(
void
)
setIntf
:
(
intf_thread_t
*
)
p_mainintf
{
p_intf
=
p_mainintf
;
...
...
@@ -229,13 +236,35 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
return
p_intf
;
}
-
(
void
)
applicationWillFinishLaunching
:(
NSNotification
*
)
aNotification
{
_open
=
[[
VLCOpen
alloc
]
init
];
_mainmenu
=
[[
VLCMainMenu
alloc
]
init
];
[
NSBundle
loadNibNamed
:
@"MainMenu"
owner
:
_mainmenu
];
[
NSBundle
loadNibNamed
:
@"MainWindow"
owner
:[
VLCMain
sharedInstance
]];
[[[
VLCMain
sharedInstance
]
mainWindow
]
makeKeyAndOrderFront
:
nil
];
_eyetv
=
[[
VLCEyeTVController
alloc
]
init
];
_coreinteraction
=
[
VLCCoreInteraction
sharedInstance
];
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
PL_LOCK
;
items_at_launch
=
p_playlist
->
p_local_category
->
i_children
;
PL_UNLOCK
;
#ifdef HAVE_SPARKLE
[[
SUUpdater
sharedUpdater
]
setDelegate
:
self
];
#endif
}
-
(
void
)
awakeFromNib
{
if
(
!
p_intf
)
return
;
var_Create
(
p_intf
,
"intf-change"
,
VLC_VAR_BOOL
);
/* Check if we already did this once. Opening the other nibs calls it too,
because VLCMain is the owner */
/* Check if we already did this once */
if
(
nib_main_loaded
)
return
;
...
...
@@ -270,20 +299,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
nib_main_loaded
=
TRUE
;
}
-
(
void
)
applicationWillFinishLaunching
:(
NSNotification
*
)
aNotification
{
_coreinteraction
=
[
VLCCoreInteraction
sharedInstance
];
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
PL_LOCK
;
items_at_launch
=
p_playlist
->
p_local_category
->
i_children
;
PL_UNLOCK
;
#ifdef HAVE_SPARKLE
[[
SUUpdater
sharedUpdater
]
setDelegate
:
self
];
#endif
}
-
(
void
)
applicationDidFinishLaunching
:(
NSNotification
*
)
aNotification
{
launched
=
YES
;
...
...
@@ -525,11 +540,6 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
return
o_mainwindow
;
}
-
(
VLCControls
*
)
controls
{
return
o_controls
;
}
-
(
VLCInputManager
*
)
inputManager
{
return
_input_manager
;
...
...
@@ -559,8 +569,8 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
if
(
!
_sprefs
)
_sprefs
=
[[
VLCSimplePrefs
alloc
]
init
];
if
(
!
nib_prefs_loaded
)
nib_prefs_loaded
=
[
NSBundle
loadNibNamed
:
@"SimplePreferences"
owner
:
_sprefs
];
if
(
!
nib_
s
prefs_loaded
)
nib_
s
prefs_loaded
=
[
NSBundle
loadNibNamed
:
@"SimplePreferences"
owner
:
_sprefs
];
return
_sprefs
;
}
...
...
modules/gui/macosx/misc.m
View file @
f4504578
/*****************************************************************************
* misc.m: code not specific to vlc
*****************************************************************************
* Copyright (C) 2003-201
4
VLC authors and VideoLAN
* Copyright (C) 2003-201
5
VLC authors and VideoLAN
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
...
...
@@ -26,8 +26,8 @@
#import "misc.h"
#import "intf.h"
/* VLCApplication */
#import "MainWindow.h"
#import "MainMenu.h"
#import "ControlsBar.h"
#import "controls.h"
#import "CoreInteraction.h"
#import <CoreAudio/CoreAudio.h>
#import <vlc_keys.h>
...
...
@@ -791,7 +791,7 @@ void _drawFrameInRect(NSRect frameRect)
-
(
void
)
mouseDown
:
(
NSEvent
*
)
ourEvent
{
if
(
[
ourEvent
clickCount
]
>
1
)
[[[
VLCMain
sharedInstance
]
controls
]
goToSpecificTime
:
nil
];
[[[
VLCMain
sharedInstance
]
mainMenu
]
goToSpecificTime
:
nil
];
else
{
if
(
o_remaining_identifier
)
{
...
...
modules/gui/macosx/playlist.m
View file @
f4504578
...
...
@@ -45,7 +45,6 @@
#import "bookmarks.h"
#import "playlistinfo.h"
#import "playlist.h"
#import "controls.h"
#import "misc.h"
#import "open.h"
#import "MainMenu.h"
...
...
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