Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
20b891eb
Commit
20b891eb
authored
Feb 12, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: save playback modes on quit and recover more gracefully
parent
22f92c93
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
20 deletions
+22
-20
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+1
-0
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+21
-20
No files found.
modules/gui/macosx/MainWindow.m
View file @
20b891eb
...
@@ -456,6 +456,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -456,6 +456,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
someWindowWillClose
:
)
name
:
NSWindowWillCloseNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
someWindowWillClose
:
)
name
:
NSWindowWillCloseNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
someWindowWillMiniaturize
:
)
name
:
NSWindowWillMiniaturizeNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
someWindowWillMiniaturize
:
)
name
:
NSWindowWillMiniaturizeNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
applicationWillTerminate
:
)
name
:
NSApplicationWillTerminateNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
applicationWillTerminate
:
)
name
:
NSApplicationWillTerminateNotification
object
:
nil
];
[[
VLCMain
sharedInstance
]
playbackModeUpdated
];
}
}
#pragma mark -
#pragma mark -
...
...
modules/gui/macosx/intf.m
View file @
20b891eb
...
@@ -614,8 +614,6 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -614,8 +614,6 @@ static VLCMain *_o_sharedMainInstance = nil;
var_AddCallback
(
p_intf
,
"dialog-progress-bar"
,
DialogCallback
,
self
);
var_AddCallback
(
p_intf
,
"dialog-progress-bar"
,
DialogCallback
,
self
);
dialog_Register
(
p_intf
);
dialog_Register
(
p_intf
);
[
self
playbackModeUpdated
];
/* init Apple Remote support */
/* init Apple Remote support */
o_remote
=
[[
AppleRemote
alloc
]
init
];
o_remote
=
[[
AppleRemote
alloc
]
init
];
[
o_remote
setClickCountEnabledButtons
:
kRemoteButtonPlay
];
[
o_remote
setClickCountEnabledButtons
:
kRemoteButtonPlay
];
...
@@ -636,6 +634,11 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -636,6 +634,11 @@ static VLCMain *_o_sharedMainInstance = nil;
{
{
if
(
!
p_intf
)
return
;
if
(
!
p_intf
)
return
;
[
o_mainwindow
updateWindow
];
[
o_mainwindow
updateTimeSlider
];
[
o_mainwindow
updateVolumeSlider
];
[
o_mainwindow
makeKeyAndOrderFront
:
self
];
/* init media key support */
/* init media key support */
b_mediaKeySupport
=
config_GetInt
(
VLCIntf
,
"macosx-mediakeys"
);
b_mediaKeySupport
=
config_GetInt
(
VLCIntf
,
"macosx-mediakeys"
);
if
(
b_mediaKeySupport
)
if
(
b_mediaKeySupport
)
...
@@ -650,11 +653,6 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -650,11 +653,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[
self
_removeOldPreferences
];
[
self
_removeOldPreferences
];
[
o_mainwindow
updateWindow
];
[
o_mainwindow
updateTimeSlider
];
[
o_mainwindow
updateVolumeSlider
];
[
o_mainwindow
makeKeyAndOrderFront
:
self
];
/* Handle sleep notification */
/* Handle sleep notification */
[[[
NSWorkspace
sharedWorkspace
]
notificationCenter
]
addObserver
:
self
selector
:
@selector
(
computerWillSleep
:
)
[[[
NSWorkspace
sharedWorkspace
]
notificationCenter
]
addObserver
:
self
selector
:
@selector
(
computerWillSleep
:
)
name:
NSWorkspaceWillSleepNotification
object
:
nil
];
name:
NSWorkspaceWillSleepNotification
object
:
nil
];
...
@@ -690,20 +688,11 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -690,20 +688,11 @@ static VLCMain *_o_sharedMainInstance = nil;
-
(
void
)
applicationWillTerminate
:(
NSNotification
*
)
notification
-
(
void
)
applicationWillTerminate
:(
NSNotification
*
)
notification
{
{
if
(
notification
==
nil
)
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
NSApplicationWillTerminateNotification
object
:
nil
];
playlist_t
*
p_playlist
;
int
returnedValue
=
0
;
if
(
!
p_intf
)
if
(
!
p_intf
)
return
;
return
;
// save stuff
/* don't allow a double termination call. If the user has
config_SaveConfigFile
(
p_intf
);
* already invoked the quit then simply return this time. */
// don't allow a double termination call. If the user has
// already invoked the quit then simply return this time.
int
isTerminating
=
false
;
int
isTerminating
=
false
;
[
o_appLock
lock
];
[
o_appLock
lock
];
...
@@ -713,9 +702,21 @@ static VLCMain *_o_sharedMainInstance = nil;
...
@@ -713,9 +702,21 @@ static VLCMain *_o_sharedMainInstance = nil;
if
(
isTerminating
)
if
(
isTerminating
)
return
;
return
;
msg_Dbg
(
p_intf
,
"Terminating"
);
if
(
notification
==
nil
)
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
NSApplicationWillTerminateNotification
object
:
nil
];
p_playlist
=
pl_Get
(
p_intf
);
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);;
int
returnedValue
=
0
;
/* Save some interface state in configuration, at module quit */
config_PutInt
(
p_intf
,
"random"
,
var_GetBool
(
p_playlist
,
"random"
)
);
config_PutInt
(
p_intf
,
"loop"
,
var_GetBool
(
p_playlist
,
"loop"
)
);
config_PutInt
(
p_intf
,
"repeat"
,
var_GetBool
(
p_playlist
,
"repeat"
)
);
// save stuff
config_SaveConfigFile
(
p_intf
);
msg_Dbg
(
p_intf
,
"Terminating"
);
/* unsubscribe from the interactive dialogues */
/* unsubscribe from the interactive dialogues */
dialog_Unregister
(
p_intf
);
dialog_Unregister
(
p_intf
);
...
...
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