Commit 69487bf4 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

macosx: Add a teletext menu

* Also reorders the Video menu a bit.
* teletext-es remains a dirty hack
* MenuValidation for Submenu's remains annoying in OSX :D
parent 8c31d06a
...@@ -2,19 +2,8 @@ ...@@ -2,19 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key>
<string>69 71 356 240 0 0 1280 778 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>69 316 438 44 0 0 1280 778 </string>
<key>3568</key>
<string>476 535 328 85 0 0 1280 778 </string>
<key>915</key>
<string>69 316 187 285 0 0 1280 778 </string>
</dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>489.0</string> <string>649</string>
<key>IBLastKnownRelativeProjectPath</key> <key>IBLastKnownRelativeProjectPath</key>
<string>../../vlc.xcodeproj</string> <string>../../vlc.xcodeproj</string>
<key>IBOldestOS</key> <key>IBOldestOS</key>
...@@ -22,10 +11,9 @@ ...@@ -22,10 +11,9 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>915</integer> <integer>915</integer>
<integer>334</integer>
<integer>3568</integer> <integer>3568</integer>
<integer>282</integer>
<integer>21</integer> <integer>21</integer>
<integer>29</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>9E17</string> <string>9E17</string>
......
...@@ -88,6 +88,10 @@ ...@@ -88,6 +88,10 @@
- (IBAction)toogleFullscreen:(id)sender; - (IBAction)toogleFullscreen:(id)sender;
- (BOOL) isFullscreen; - (BOOL) isFullscreen;
- (IBAction)windowAction:(id)sender; - (IBAction)windowAction:(id)sender;
- (IBAction)telxTransparent:(id)sender;
- (IBAction)telxNavLink:(id)sender;
- (BOOL)keyEvent:(NSEvent *)o_event; - (BOOL)keyEvent:(NSEvent *)o_event;
- (void)scrollWheel: (NSEvent *)theEvent; - (void)scrollWheel: (NSEvent *)theEvent;
......
...@@ -499,6 +499,47 @@ ...@@ -499,6 +499,47 @@
} }
- (IBAction)telxTransparent:(id)sender
{
intf_thread_t * p_intf = VLCIntf;
vlc_object_t *p_vbi;
p_vbi = (vlc_object_t *) vlc_object_find_name( p_intf,
"zvbi", FIND_ANYWHERE );
if( p_vbi )
{
var_SetBool( p_vbi, "vbi-opaque", [sender state] );
[sender setState: ![sender state]];
vlc_object_release( p_vbi );
}
}
- (IBAction)telxNavLink:(id)sender;
{
intf_thread_t * p_intf = VLCIntf;
vlc_object_t *p_vbi;
int i_page = 0;
if( [[sender title] isEqualToString: _NS("Index")] )
i_page = 'i' << 16;
else if( [[sender title] isEqualToString: _NS("Red")] )
i_page = 'r' << 16;
else if( [[sender title] isEqualToString: _NS("Green")] )
i_page = 'g' << 16;
else if( [[sender title] isEqualToString: _NS("Yellow")] )
i_page = 'y' << 16;
else if( [[sender title] isEqualToString: _NS("Blue")] )
i_page = 'b' << 16;
if( i_page == 0 ) return;
p_vbi = (vlc_object_t *) vlc_object_find_name( p_intf,
"zvbi", FIND_ANYWHERE );
if( p_vbi )
{
var_SetInteger( p_vbi, "vbi-page", i_page );
vlc_object_release( p_vbi );
}
}
- (void)scrollWheel:(NSEvent *)theEvent - (void)scrollWheel:(NSEvent *)theEvent
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
...@@ -975,6 +1016,26 @@ ...@@ -975,6 +1016,26 @@
[o_main setupMenus]; /* Make sure video menu is up to date */ [o_main setupMenus]; /* Make sure video menu is up to date */
} }
/* Special case for telx menu */
if( [[o_mi title] isEqualToString: _NS("Normal Size")] );
{
NSMenuItem *item = [[o_mi menu] itemWithTitle:_NS("Teletext")];
bool b_telx = false;
if( p_input )
{
const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
const int i_spu_es = var_GetInteger( p_input, "spu-es" );
if( i_teletext_es >= 0 && i_teletext_es == i_spu_es )
b_telx = true;
}
[[item submenu] setAutoenablesItems:NO];
for( int k=0; k < [[item submenu] numberOfItems]; k++ )
{
[[[item submenu] itemAtIndex:k] setEnabled: b_telx];
}
}
if( p_input ) vlc_object_release( p_input ); if( p_input ) vlc_object_release( p_input );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
......
...@@ -253,6 +253,13 @@ struct intf_sys_t ...@@ -253,6 +253,13 @@ struct intf_sys_t
IBOutlet NSMenu * o_mu_deinterlace; IBOutlet NSMenu * o_mu_deinterlace;
IBOutlet NSMenuItem * o_mi_ffmpeg_pp; IBOutlet NSMenuItem * o_mi_ffmpeg_pp;
IBOutlet NSMenuItem * o_mu_ffmpeg_pp; IBOutlet NSMenuItem * o_mu_ffmpeg_pp;
IBOutlet NSMenuItem * o_mi_teletext;
IBOutlet NSMenuItem * o_mi_teletext_transparent;
IBOutlet NSMenuItem * o_mi_teletext_index;
IBOutlet NSMenuItem * o_mi_teletext_red;
IBOutlet NSMenuItem * o_mi_teletext_green;
IBOutlet NSMenuItem * o_mi_teletext_yellow;
IBOutlet NSMenuItem * o_mi_teletext_blue;
IBOutlet NSMenu * o_mu_window; IBOutlet NSMenu * o_mu_window;
IBOutlet NSMenuItem * o_mi_minimize; IBOutlet NSMenuItem * o_mi_minimize;
......
...@@ -582,6 +582,13 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -582,6 +582,13 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_mu_deinterlace setTitle: _NS("Deinterlace")]; [o_mu_deinterlace setTitle: _NS("Deinterlace")];
[o_mi_ffmpeg_pp setTitle: _NS("Post processing")]; [o_mi_ffmpeg_pp setTitle: _NS("Post processing")];
[o_mu_ffmpeg_pp setTitle: _NS("Post processing")]; [o_mu_ffmpeg_pp setTitle: _NS("Post processing")];
[o_mi_teletext setTitle: _NS("Teletext")];
[o_mi_teletext_transparent setTitle: _NS("Transparent")];
[o_mi_teletext_index setTitle: _NS("Index")];
[o_mi_teletext_red setTitle: _NS("Red")];
[o_mi_teletext_green setTitle: _NS("Green")];
[o_mi_teletext_yellow setTitle: _NS("Yellow")];
[o_mi_teletext_blue setTitle: _NS("Blue")];
[o_mu_window setTitle: _NS("Window")]; [o_mu_window setTitle: _NS("Window")];
[o_mi_minimize setTitle: _NS("Minimize Window")]; [o_mi_minimize setTitle: _NS("Minimize Window")];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment