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
91751dbd
Commit
91751dbd
authored
Jun 27, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: Move input-related handlers to InputManager, simplify
parent
0eaddd99
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
57 deletions
+46
-57
modules/gui/macosx/InputManager.m
modules/gui/macosx/InputManager.m
+41
-15
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+2
-0
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/VLCVoutWindowController.m
+2
-2
modules/gui/macosx/fspanel.m
modules/gui/macosx/fspanel.m
+1
-1
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+0
-6
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+0
-33
No files found.
modules/gui/macosx/InputManager.m
View file @
91751dbd
...
...
@@ -21,6 +21,7 @@
#import "InputManager.h"
#import "CoreInteraction.h"
#import "CompatibilityFixes.h"
#import "ExtensionsManager.h"
#import "intf.h"
...
...
@@ -28,6 +29,7 @@
#import "MainWindow.h"
#import "playlist.h"
#import "playlistinfo.h"
#import "TrackSynchronization.h"
#import "iTunes.h"
#import "Spotify.h"
...
...
@@ -60,14 +62,14 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
[[[
VLCMain
sharedInstance
]
mainMenu
]
performSelectorOnMainThread
:
@selector
(
updatePlaybackRate
)
withObject
:
nil
waitUntilDone
:
NO
];
break
;
case
INPUT_EVENT_POSITION
:
[[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updatePlaybackPosition
)
withObject
:
nil
waitUntilDone
:
NO
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
performSelectorOnMainThread
:
@selector
(
updateTimeSlider
)
withObject
:
nil
waitUntilDone
:
NO
];
break
;
case
INPUT_EVENT_TITLE
:
case
INPUT_EVENT_CHAPTER
:
[
[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateMainMenu
)
withObject
:
nil
waitUntilDone
:
NO
];
[
inputManager
performSelectorOnMainThread
:
@selector
(
updateMainMenu
)
withObject
:
nil
waitUntilDone
:
NO
];
break
;
case
INPUT_EVENT_CACHE
:
[
[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateMainWindow
)
withObject
:
nil
waitUntilDone
:
NO
];
[
inputManager
performSelectorOnMainThread
:
@selector
(
updateMainWindow
)
withObject
:
nil
waitUntilDone
:
NO
];
break
;
case
INPUT_EVENT_STATISTICS
:
dispatch_async
(
dispatch_get_main_queue
(),
^
{
...
...
@@ -84,17 +86,19 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
break
;
case
INPUT_EVENT_ITEM_META
:
case
INPUT_EVENT_ITEM_INFO
:
[
[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateMainMenu
)
withObject
:
nil
waitUntilDone
:
NO
];
[
[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateName
)
withObject
:
nil
waitUntilDone
:
NO
];
[
inputManager
performSelectorOnMainThread
:
@selector
(
updateMainMenu
)
withObject
:
nil
waitUntilDone
:
NO
];
[
inputManager
performSelectorOnMainThread
:
@selector
(
updateName
)
withObject
:
nil
waitUntilDone
:
NO
];
[
inputManager
performSelectorOnMainThread
:
@selector
(
updateMetaAndInfo
)
withObject
:
nil
waitUntilDone
:
NO
];
break
;
case
INPUT_EVENT_BOOKMARK
:
break
;
case
INPUT_EVENT_RECORD
:
[[
VLCMain
sharedInstance
]
updateRecordState
:
var_GetBool
(
p_this
,
"record"
)];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[[[
VLCMain
sharedInstance
]
mainMenu
]
updateRecordState
:
var_InheritBool
(
p_this
,
"record"
)];
});
break
;
case
INPUT_EVENT_PROGRAM
:
[
[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateMainMenu
)
withObject
:
nil
waitUntilDone
:
NO
];
[
inputManager
performSelectorOnMainThread
:
@selector
(
updateMainMenu
)
withObject
:
nil
waitUntilDone
:
NO
];
break
;
case
INPUT_EVENT_ITEM_EPG
:
break
;
...
...
@@ -102,17 +106,17 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
break
;
case
INPUT_EVENT_ITEM_NAME
:
[
[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateName
)
withObject
:
nil
waitUntilDone
:
NO
];
[
inputManager
performSelectorOnMainThread
:
@selector
(
updateName
)
withObject
:
nil
waitUntilDone
:
NO
];
break
;
case
INPUT_EVENT_AUDIO_DELAY
:
case
INPUT_EVENT_SUBTITLE_DELAY
:
[
[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateDelays
)
withObject
:
nil
waitUntilDone
:
NO
];
[
inputManager
performSelectorOnMainThread
:
@selector
(
updateDelays
)
withObject
:
nil
waitUntilDone
:
NO
];
break
;
case
INPUT_EVENT_DEAD
:
[
[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateName
)
withObject
:
nil
waitUntilDone
:
NO
];
[[
VLCMain
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updatePlaybackPosition
)
withObject
:
nil
waitUntilDone
:
NO
];
[
inputManager
performSelectorOnMainThread
:
@selector
(
updateName
)
withObject
:
nil
waitUntilDone
:
NO
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
performSelectorOnMainThread
:
@selector
(
updateTimeSlider
)
withObject
:
nil
waitUntilDone
:
NO
];
break
;
default:
...
...
@@ -198,9 +202,9 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
[
self
updateMetaAndInfo
];
[
[
o_main
mainWindow
]
update
Window
];
[
o_main
updateDelays
];
[
o_main
updateMainMenu
];
[
self
updateMain
Window
];
[
self
updateDelays
];
[
self
updateMainMenu
];
/*
* Due to constraints within NSAttributedString's main loop runtime handling
...
...
@@ -334,7 +338,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
}
}
[
[
VLCMain
sharedInstance
]
updateMainWindow
];
[
self
updateMainWindow
];
[
self
sendDistributedNotificationWithUpdatedPlaybackStatus
];
}
...
...
@@ -383,6 +387,28 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
[[
o_main
info
]
updatePanelWithItem
:
p_input_item
];
}
-
(
void
)
updateMainWindow
{
[[
o_main
mainWindow
]
updateWindow
];
}
-
(
void
)
updateName
{
[[
o_main
mainWindow
]
updateName
];
}
-
(
void
)
updateDelays
{
[[
VLCTrackSynchronization
sharedInstance
]
updateValues
];
}
-
(
void
)
updateMainMenu
{
[[
o_main
mainMenu
]
setupMenus
];
[[
o_main
mainMenu
]
updatePlaybackRate
];
[[
VLCCoreInteraction
sharedInstance
]
resetAtoB
];
}
-
(
void
)
sendDistributedNotificationWithUpdatedPlaybackStatus
{
[[
NSDistributedNotificationCenter
defaultCenter
]
postNotificationName
:
@"VLCPlayerStateDidChange"
...
...
modules/gui/macosx/MainWindow.m
View file @
91751dbd
...
...
@@ -688,6 +688,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
o_fspanel
updatePositionAndTime
];
[[[
VLCMain
sharedInstance
]
voutController
]
updateWindowsControlsBarWithSelector
:
@selector
(
updateTimeSlider
)];
[[
VLCCoreInteraction
sharedInstance
]
updateAtoB
];
}
-
(
void
)
updateName
...
...
modules/gui/macosx/VLCVoutWindowController.m
View file @
91751dbd
...
...
@@ -212,8 +212,8 @@
if
(
b_nonembedded
)
{
// events might be posted before window is created, so call them again
[[
VLCMain
sharedInstance
]
updateName
];
[[
VLCMain
sharedInstance
]
updateMain
Window
];
// update controls bar
[[
[
VLCMain
sharedInstance
]
mainWindow
]
updateName
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
update
Window
];
// update controls bar
}
// TODO: find a cleaner way for "start in fullscreen"
...
...
modules/gui/macosx/fspanel.m
View file @
91751dbd
...
...
@@ -642,7 +642,7 @@
var_Set
(
p_input
,
"position"
,
pos
);
vlc_object_release
(
p_input
);
}
[[
VLCMain
sharedInstance
]
updatePlaybackPosition
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
updateTimeSlider
];
}
-
(
IBAction
)
fsVolumeSliderUpdate
:(
id
)
sender
...
...
modules/gui/macosx/intf.h
View file @
91751dbd
...
...
@@ -146,14 +146,8 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
-
(
void
)
plItemUpdated
;
-
(
void
)
playbackModeUpdated
;
-
(
void
)
updateVolume
;
-
(
void
)
updatePlaybackPosition
;
-
(
void
)
updateName
;
-
(
void
)
updateRecordState
:
(
BOOL
)
b_value
;
-
(
void
)
updateMainMenu
;
-
(
void
)
updateMainWindow
;
-
(
void
)
showMainWindow
;
-
(
void
)
showFullscreenController
;
-
(
void
)
updateDelays
;
-
(
void
)
updateTogglePlaylistState
;
...
...
modules/gui/macosx/intf.m
View file @
91751dbd
...
...
@@ -1225,18 +1225,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[
o_info
updateMetadata
];
}
-
(
void
)
updateMainMenu
{
[
o_mainmenu
setupMenus
];
[
o_mainmenu
updatePlaybackRate
];
[[
VLCCoreInteraction
sharedInstance
]
resetAtoB
];
}
-
(
void
)
updateMainWindow
{
[
o_mainwindow
updateWindow
];
}
-
(
void
)
showMainWindow
{
[
o_mainwindow
performSelectorOnMainThread
:
@selector
(
makeKeyAndOrderFront
:)
withObject
:
nil
waitUntilDone
:
NO
];
...
...
@@ -1249,32 +1237,11 @@ static VLCMain *_o_sharedMainInstance = nil;
[
o_mainwindow
performSelectorOnMainThread
:
@selector
(
showFullscreenController
)
withObject
:
nil
waitUntilDone
:
NO
];
}
-
(
void
)
updateDelays
{
[[
VLCTrackSynchronization
sharedInstance
]
performSelectorOnMainThread
:
@selector
(
updateValues
)
withObject
:
nil
waitUntilDone
:
NO
];
}
-
(
void
)
updateName
{
[
o_mainwindow
updateName
];
}
-
(
void
)
updatePlaybackPosition
{
[
o_mainwindow
updateTimeSlider
];
[[
VLCCoreInteraction
sharedInstance
]
updateAtoB
];
}
-
(
void
)
updateVolume
{
[
o_mainwindow
updateVolumeSlider
];
}
-
(
void
)
updateRecordState
:
(
BOOL
)
b_value
{
[
o_mainmenu
updateRecordState
:
b_value
];
}
-
(
void
)
playbackModeUpdated
{
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
...
...
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