0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02: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:
Stefano Pigozzi 2012-04-25 15:36:06 +02:00
parent dcb90fde25
commit 13675fc7dc
2 changed files with 0 additions and 53 deletions

View File

@ -113,53 +113,3 @@ int convert_key(unsigned key, unsigned charcode)
return mpkey; return mpkey;
return charcode; 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
}

View File

@ -22,8 +22,5 @@
struct vo; struct vo;
int convert_key(unsigned key, unsigned charcode); 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 */ #endif /* MPLAYER_OSX_COMMON_H */