Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
454
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
53fe0768
Commit
53fe0768
authored
5 years ago
by
Felix Paul Kühne
Browse files
Options
Downloads
Patches
Plain Diff
macosx/apple script: remove dependency on core interaction singleton
parent
c632dbaf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/gui/macosx/os-integration/applescript.h
+2
-2
2 additions, 2 deletions
modules/gui/macosx/os-integration/applescript.h
modules/gui/macosx/os-integration/applescript.m
+52
-56
52 additions, 56 deletions
modules/gui/macosx/os-integration/applescript.m
with
54 additions
and
58 deletions
modules/gui/macosx/os-integration/applescript.h
+
2
−
2
View file @
53fe0768
/*****************************************************************************
* applescript.h: MacOS X AppleScript support
*****************************************************************************
* Copyright (C) 2002-201
2
VLC authors and VideoLAN
* Copyright (C) 2002-201
9
VLC authors and VideoLAN
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
...
...
@@ -40,7 +40,7 @@
@interface
NSApplication
(
ScriptSupport
)
@property
(
readwrite
)
BOOL
scriptFullscreenMode
;
@property
(
readwrite
)
in
t
audioVolume
;
@property
(
readwrite
)
floa
t
audioVolume
;
@property
(
readwrite
)
long
long
audioDesync
;
@property
(
readwrite
)
int
currentTime
;
@property
(
readonly
)
NSInteger
durationOfCurrentItem
;
...
...
This diff is collapsed.
Click to expand it.
modules/gui/macosx/os-integration/applescript.m
+
52
−
56
View file @
53fe0768
...
...
@@ -31,7 +31,6 @@
#import <vlc_url.h>
#import "main/VLCMain.h"
#import "coreinteraction/VLCCoreInteraction.h"
#import "playlist/VLCPlaylistController.h"
#import "playlist/VLCPlayerController.h"
#import "windows/VLCOpenInputMetadata.h"
...
...
@@ -59,7 +58,6 @@
@end
/*****************************************************************************
* VLControlScriptCommand implementation
*****************************************************************************/
...
...
@@ -67,86 +65,84 @@
* This entire control command needs a better design. more object oriented.
* Applescript developers would be very welcome (hartman)
*/
@implementation
VLControlScriptCommand
-
(
id
)
performDefaultImplementation
{
VLCPlaylistController
*
playlistController
;
VLCPlayerController
*
playerController
;
NSString
*
commandString
=
[[
self
commandDescription
]
commandName
];
NSString
*
parameterString
=
[
self
directParameter
];
VLCCoreInteraction
*
coreInteractionInstance
=
[
VLCCoreInteraction
sharedInstance
];
if
([
commandString
isEqualToString
:
@"play"
])
[
coreInteractionInstance
playOrPause
];
else
if
([
commandString
isEqualToString
:
@"stop"
])
[
coreInteractionInstance
stop
];
else
if
([
commandString
isEqualToString
:
@"previous"
])
[
coreInteractionInstance
previous
];
else
if
([
commandString
isEqualToString
:
@"next"
])
[
coreInteractionInstance
next
];
else
if
([
commandString
isEqualToString
:
@"fullscreen"
])
[
coreInteractionInstance
toggleFullscreen
];
else
if
([
commandString
isEqualToString
:
@"mute"
])
[
coreInteractionInstance
toggleMute
];
else
if
([
commandString
isEqualToString
:
@"volumeUp"
])
[
coreInteractionInstance
volumeUp
];
else
if
([
commandString
isEqualToString
:
@"volumeDown"
])
[
coreInteractionInstance
volumeDown
];
else
if
([
commandString
isEqualToString
:
@"moveMenuFocusUp"
])
[
coreInteractionInstance
moveMenuFocusUp
];
else
if
([
commandString
isEqualToString
:
@"moveMenuFocusDown"
])
[
coreInteractionInstance
moveMenuFocusDown
];
else
if
([
commandString
isEqualToString
:
@"moveMenuFocusLeft"
])
[
coreInteractionInstance
moveMenuFocusLeft
];
else
if
([
commandString
isEqualToString
:
@"moveMenuFocusRight"
])
[
coreInteractionInstance
moveMenuFocusRight
];
else
if
([
commandString
isEqualToString
:
@"menuFocusActivate"
])
[
coreInteractionInstance
menuFocusActivate
];
else
if
([
commandString
isEqualToString
:
@"stepForward"
])
{
//default: forwardShort
if
([
commandString
isEqualToString
:
@"play"
])
{
[
playerController
togglePlayPause
];
}
else
if
([
commandString
isEqualToString
:
@"stop"
])
{
[
playerController
stop
];
}
else
if
([
commandString
isEqualToString
:
@"previous"
])
{
[
playlistController
playPreviousItem
];
}
else
if
([
commandString
isEqualToString
:
@"next"
])
{
[
playlistController
playNextItem
];
}
else
if
([
commandString
isEqualToString
:
@"fullscreen"
])
{
[
playerController
toggleFullscreen
];
}
else
if
([
commandString
isEqualToString
:
@"mute"
])
{
[
playerController
toggleMute
];
}
else
if
([
commandString
isEqualToString
:
@"volumeUp"
])
{
[
playerController
incrementVolume
];
}
else
if
([
commandString
isEqualToString
:
@"volumeDown"
])
{
[
playerController
decrementVolume
];
}
else
if
([
commandString
isEqualToString
:
@"moveMenuFocusUp"
])
{
[
playerController
navigateInInteractiveContent
:
VLC_PLAYER_NAV_UP
];
}
else
if
([
commandString
isEqualToString
:
@"moveMenuFocusDown"
])
{
[
playerController
navigateInInteractiveContent
:
VLC_PLAYER_NAV_DOWN
];
}
else
if
([
commandString
isEqualToString
:
@"moveMenuFocusLeft"
])
{
[
playerController
navigateInInteractiveContent
:
VLC_PLAYER_NAV_LEFT
];
}
else
if
([
commandString
isEqualToString
:
@"moveMenuFocusRight"
])
{
[
playerController
navigateInInteractiveContent
:
VLC_PLAYER_NAV_RIGHT
];
}
else
if
([
commandString
isEqualToString
:
@"menuFocusActivate"
])
{
[
playerController
navigateInInteractiveContent
:
VLC_PLAYER_NAV_ACTIVATE
];
}
else
if
([
commandString
isEqualToString
:
@"stepForward"
])
{
if
(
parameterString
)
{
int
parameterInt
=
[
parameterString
intValue
];
switch
(
parameterInt
)
{
case
1
:
[
coreInteractionInstance
forwardExtraShort
];
break
;
case
2
:
[
coreInteractionInstance
forwardShort
];
[
playerController
jumpForwardExtraShort
];
break
;
case
3
:
[
coreInteractionInstance
f
orwardMedium
];
[
playerController
jumpF
orwardMedium
];
break
;
case
4
:
[
coreInteractionInstance
f
orwardLong
];
[
playerController
jumpF
orwardLong
];
break
;
case
2
:
default:
[
coreInteractionInstance
f
orwardShort
];
[
playerController
jumpF
orwardShort
];
break
;
}
}
else
[
coreInteractionInstance
f
orwardShort
];
[
playerController
jumpF
orwardShort
];
}
else
if
([
commandString
isEqualToString
:
@"stepBackward"
])
{
//default: backwardShort
if
(
parameterString
)
{
int
parameterInt
=
[
parameterString
intValue
];
switch
(
parameterInt
)
{
case
1
:
[
coreInteractionInstance
backwardExtraShort
];
break
;
case
2
:
[
coreInteractionInstance
backwardShort
];
[
playerController
jumpBackwardExtraShort
];
break
;
case
3
:
[
coreInteractionInstance
b
ackwardMedium
];
[
playerController
jumpB
ackwardMedium
];
break
;
case
4
:
[
coreInteractionInstance
b
ackwardLong
];
[
playerController
jumpB
ackwardLong
];
break
;
case
2
:
default:
[
coreInteractionInstance
b
ackwardShort
];
[
playerController
jumpB
ackwardShort
];
break
;
}
}
else
[
coreInteractionInstance
b
ackwardShort
];
[
playerController
jumpB
ackwardShort
];
}
return
nil
;
}
...
...
@@ -170,7 +166,7 @@
-
(
BOOL
)
muted
{
return
[[
VLC
CoreInteractio
n
sharedInstance
]
mute
];
return
[[
[[
VLC
Mai
n
sharedInstance
]
playlistController
]
playerController
]
mute
];
}
-
(
BOOL
)
playing
...
...
@@ -184,14 +180,14 @@
return
NO
;
}
-
(
in
t
)
audioVolume
-
(
floa
t
)
audioVolume
{
return
[[
VLC
CoreInteractio
n
sharedInstance
]
volume
];
return
[[
[[
VLC
Mai
n
sharedInstance
]
playlistController
]
playerController
]
volume
];
}
-
(
void
)
setAudioVolume
:(
in
t
)
volume
-
(
void
)
setAudioVolume
:(
floa
t
)
volume
{
[[
VLC
CoreInteractio
n
sharedInstance
]
setVolume
:
volume
];
[[
[[
VLC
Mai
n
sharedInstance
]
playlistController
]
playerController
]
setVolume
:
volume
];
}
-
(
long
long
)
audioDesync
...
...
@@ -216,17 +212,17 @@
-
(
NSInteger
)
durationOfCurrentItem
{
return
[[
VLCCoreInteraction
sharedInstance
]
durationOfCurrent
Playlist
Item
]
;
return
SEC_FROM_VLC_TICK
([[[
VLCMain
sharedInstance
]
playlistController
]
playerController
].
durationOfCurrent
Media
Item
)
;
}
-
(
NSString
*
)
pathOfCurrentItem
{
return
[[[
VLC
CoreInteractio
n
sharedInstance
]
URLOfCurrent
Playlist
Item
]
path
];
return
[[[
[
VLC
Mai
n
sharedInstance
]
playlistController
]
playerController
].
URLOfCurrent
Media
Item
path
];
}
-
(
NSString
*
)
nameOfCurrentItem
{
return
[[
VLC
CoreInteractio
n
sharedInstance
]
nameOfCurrent
Playlist
Item
];
return
[[
[[
VLC
Mai
n
sharedInstance
]
playlistController
]
playerController
]
nameOfCurrent
Media
Item
];
}
-
(
BOOL
)
playbackShowsMenu
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment