Commit 9b21679c authored by Christophe Massiot's avatar Christophe Massiot

* New Loop menu item in OS X interface.

parent b73f6722
......@@ -6,6 +6,7 @@
eject = id;
faster = id;
fullscreen = id;
loop = id;
maxvolume = id;
mute = id;
next = id;
......
......@@ -19,9 +19,8 @@
<string>248.0</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>528</integer>
<integer>21</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
......
......@@ -2,7 +2,7 @@
* intf_controller.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_controller.h,v 1.9 2002/06/02 01:20:52 massiot Exp $
* $Id: intf_controller.h,v 1.10 2002/06/02 12:16:31 massiot Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
*
......@@ -68,7 +68,7 @@
- (void)applicationWillFinishLaunching:(NSNotification *)o_notification;
- (BOOL)application:(NSApplication *)o_app openFile:(NSString *)o_filename;
/* Functions atteched to user interface */
/* Functions attached to user interface */
- (IBAction)pause:(id)sender;
- (IBAction)play:(id)sender;
- (IBAction)stop:(id)sender;
......@@ -78,6 +78,7 @@
- (IBAction)next:(id)sender;
- (IBAction)prevChannel:(id)sender;
- (IBAction)nextChannel:(id)sender;
- (IBAction)loop:(id)sender;
- (IBAction)mute:(id)sender;
- (IBAction)fullscreen:(id)fullscreen;
- (IBAction)eject:(id)sender;
......@@ -85,4 +86,6 @@
- (IBAction)timesliderUpdate:(id)slider;
- (IBAction)quit:(id)sender;
- (BOOL)validateMenuItem:(id)sender;
@end
......@@ -2,7 +2,7 @@
* intf_controller.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_controller.m,v 1.6 2002/06/02 01:20:52 massiot Exp $
* $Id: intf_controller.m,v 1.7 2002/06/02 12:16:31 massiot Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -175,6 +175,22 @@
[o_intf channelNext];
}
- (IBAction)loop:(id)sender
{
NSMenuItem * item = (NSMenuItem *)sender;
[o_intf loop];
if( p_main->p_intf->p_sys->b_loop )
{
[item setState:NSOnState];
}
else
{
[item setState:NSOffState];
}
}
- (IBAction)mute:(id)sender
{
NSMenuItem * item = (NSMenuItem *)sender;
......@@ -229,6 +245,21 @@
[o_intf quit];
}
- (BOOL)validateMenuItem:(id)sender
{
NSMenuItem * o_item = (NSMenuItem *)sender;
if ( [o_item tag] == 12 || [o_item tag] == 13 )
{
if( !config_GetIntVariable( "network-channel" ) )
{
return NO;
}
}
return YES;
}
@end
@implementation Intf_PlaylistDS
......
......@@ -2,7 +2,7 @@
* intf_macosx.c: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_macosx.m,v 1.3 2002/06/02 01:20:52 massiot Exp $
* $Id: intf_macosx.m,v 1.4 2002/06/02 12:16:31 massiot Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -69,6 +69,7 @@ static int intf_Open( intf_thread_t *p_intf )
p_intf->p_sys->b_mute = 0;
p_intf->p_sys->i_part = 0;
p_intf->p_sys->b_disabled_menus = 0;
p_intf->p_sys->b_loop = 0;
p_intf->p_sys->>i_channel = 0;
[[NSApplication sharedApplication] autorelease];
......
......@@ -2,7 +2,7 @@
* intf_vlc_wrapper.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.h,v 1.9 2002/06/02 01:20:52 massiot Exp $
* $Id: intf_vlc_wrapper.h,v 1.10 2002/06/02 12:16:31 massiot Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -44,6 +44,7 @@
- (void)playlistPrev;
- (void)channelNext;
- (void)channelPrev;
- (void)loop;
- (void)playSlower;
- (void)playFaster;
......
......@@ -2,7 +2,7 @@
* intf_vlc_wrapper.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.m,v 1.10 2002/06/02 01:20:52 massiot Exp $
* $Id: intf_vlc_wrapper.m,v 1.11 2002/06/02 12:16:31 massiot Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -275,6 +275,23 @@ static Intf_VLCWrapper *o_intf = nil;
vlc_mutex_unlock( &p_intf->change_lock );
}
- (void)loop
{
intf_thread_t * p_intf = p_main->p_intf;
if ( p_intf->p_sys->b_loop )
{
intf_PlaylistDelete( p_main->p_playlist,
p_main->p_playlist->i_size - 1 );
}
else
{
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,
"vlc:loop" );
}
p_intf->p_sys->b_loop = !p_intf->p_sys->b_loop;
}
- (void)playSlower
{
if( p_input_bank->pp_input[0] != NULL )
......@@ -499,6 +516,13 @@ static Intf_VLCWrapper *o_intf = nil;
NSString *o_file;
int i_end = p_main->p_playlist->i_size;
NSEnumerator *o_enum = [o_files objectEnumerator];
intf_thread_t * p_intf = p_main->p_intf;
if ( p_intf->p_sys->b_loop )
{
intf_PlaylistDelete( p_main->p_playlist,
p_main->p_playlist->i_size - 1 );
}
while( ( o_file = (NSString *)[o_enum nextObject] ) )
{
......@@ -513,16 +537,29 @@ static Intf_VLCWrapper *o_intf = nil;
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
if ( p_intf->p_sys->b_loop )
{
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,
"vlc:loop" );
}
}
- (void)openDisc:(NSString*)o_type device:(NSString*)o_device title:(int)i_title chapter:(int)i_chapter
{
NSString *o_source;
int i_end = p_main->p_playlist->i_size;
intf_thread_t * p_intf = p_main->p_intf;
o_source = [NSString stringWithFormat: @"%@:%@@%d,%d",
o_type, o_device, i_title, i_chapter];
if ( p_intf->p_sys->b_loop )
{
intf_PlaylistDelete( p_main->p_playlist,
p_main->p_playlist->i_size - 1 );
}
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,
[o_source fileSystemRepresentation] );
......@@ -533,12 +570,19 @@ static Intf_VLCWrapper *o_intf = nil;
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
if ( p_intf->p_sys->b_loop )
{
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,
"vlc:loop" );
}
}
- (void)openNet:(NSString*)o_protocol addr:(NSString*)o_addr port:(int)i_port baddr:(NSString*)o_baddr
{
NSString *o_source;
int i_end = p_main->p_playlist->i_size;
intf_thread_t * p_intf = p_main->p_intf;
if( p_input_bank->pp_input[0] != NULL )
{
......@@ -558,10 +602,22 @@ static Intf_VLCWrapper *o_intf = nil;
o_protocol, o_addr, i_port];
}
if ( p_intf->p_sys->b_loop )
{
intf_PlaylistDelete( p_main->p_playlist,
p_main->p_playlist->i_size - 1 );
}
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,
[o_source fileSystemRepresentation] );
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
if ( p_intf->p_sys->b_loop )
{
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,
"vlc:loop" );
}
}
- (void)openNetChannel:(NSString*)o_addr port:(int)i_port
......@@ -737,8 +793,8 @@ static Intf_VLCWrapper *o_intf = nil;
o_chapter_item = [[o_controls_item submenu] itemWithTitle: @"Chapter"];
o_language_item = [[o_controls_item submenu] itemWithTitle: @"Language"];
o_subtitle_item = [[o_controls_item submenu] itemWithTitle: @"Subtitles"];
o_next_channel_item = [[o_controls_item submenu] itemWithTag: 2];
o_prev_channel_item = [[o_controls_item submenu] itemWithTag: 1];
o_next_channel_item = [[o_controls_item submenu] itemWithTag: 13];
o_prev_channel_item = [[o_controls_item submenu] itemWithTag: 12];
if( p_input == NULL )
{
......@@ -1007,17 +1063,6 @@ static Intf_VLCWrapper *o_intf = nil;
}
p_input->stream.b_changed = 0;
}
if( config_GetIntVariable( "network-channel" ) )
{
[o_next_channel_item setEnabled: 1];
[o_prev_channel_item setEnabled: 1];
}
else
{
[o_next_channel_item setEnabled: 0];
[o_prev_channel_item setEnabled: 0];
}
}
@end
......@@ -2,7 +2,7 @@
* macosx.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: macosx.h,v 1.11 2002/06/02 01:20:52 massiot Exp $
* $Id: macosx.h,v 1.12 2002/06/02 12:16:31 massiot Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
......@@ -43,6 +43,7 @@ struct intf_sys_s
int i_part;
vlc_bool_t b_disabled_menus;
vlc_bool_t b_loop;
int i_channel;
};
......
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