mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
cleanup: osx_common: remove unused functions
Remove functions that aren't called anymore: * `osx_foreground_hack` was replaced by the NSApplication's activateIgnoringOtherApps: in cocoa_common. * Aspect ratio functions were not called by the "new" cocoa backend, since the corresponding menu item was deleted.
This commit is contained in:
parent
dcb90fde25
commit
13675fc7dc
@ -113,53 +113,3 @@ int convert_key(unsigned key, unsigned charcode)
|
||||
return mpkey;
|
||||
return charcode;
|
||||
}
|
||||
|
||||
static int our_aspect_change;
|
||||
static float old_movie_aspect;
|
||||
|
||||
/**
|
||||
* Sends MPlayer a command to change aspect to the requested value.
|
||||
* @param new_aspect desired new aspect, < 0 means restore original.
|
||||
*/
|
||||
void change_movie_aspect(struct vo *vo, float new_aspect)
|
||||
{
|
||||
char cmd_str[64];
|
||||
if (new_aspect < 0)
|
||||
new_aspect = old_movie_aspect;
|
||||
our_aspect_change = 1;
|
||||
snprintf(cmd_str, sizeof(cmd_str), "switch_ratio %f", new_aspect);
|
||||
mp_input_queue_cmd(vo->input_ctx, mp_input_parse_cmd(cmd_str));
|
||||
}
|
||||
|
||||
/**
|
||||
* Call in config to save the original movie aspect.
|
||||
* This will ignore config calls caused by change_movie_aspect.
|
||||
*/
|
||||
void config_movie_aspect(float config_aspect)
|
||||
{
|
||||
if (!our_aspect_change)
|
||||
old_movie_aspect = config_aspect;
|
||||
our_aspect_change = 0;
|
||||
}
|
||||
|
||||
/** This chunk of code is heavily based off SDL_macosx.m from SDL.
|
||||
* The CPSEnableForegroundOperation that was here before is private
|
||||
* and should not be used.
|
||||
* Replaced by a call to the 10.3+ TransformProcessType.
|
||||
*/
|
||||
void osx_foreground_hack(void)
|
||||
{
|
||||
#if !defined (CONFIG_MACOSX_FINDER) || !defined (CONFIG_SDL)
|
||||
ProcessSerialNumber myProc, frProc;
|
||||
Boolean sameProc;
|
||||
|
||||
if (GetFrontProcess(&frProc) == noErr &&
|
||||
GetCurrentProcess(&myProc) == noErr) {
|
||||
if (SameProcess(&frProc, &myProc, &sameProc) == noErr && !sameProc) {
|
||||
TransformProcessType(&myProc,
|
||||
kProcessTransformToForegroundApplication);
|
||||
}
|
||||
SetFrontProcess(&myProc);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -22,8 +22,5 @@
|
||||
struct vo;
|
||||
|
||||
int convert_key(unsigned key, unsigned charcode);
|
||||
void change_movie_aspect(struct vo *vo, float new_aspect);
|
||||
void config_movie_aspect(float config_aspect);
|
||||
void osx_foreground_hack(void);
|
||||
|
||||
#endif /* MPLAYER_OSX_COMMON_H */
|
||||
|
Loading…
Reference in New Issue
Block a user