Commit 36dea1a8 authored by Christophe Massiot's avatar Christophe Massiot

* Channel change support on Mac OS X ;

* New OS X icon, courtesy of Benjamin Mironer <bmironer@noos.fr>
parent 014315c3
...@@ -9,9 +9,11 @@ ...@@ -9,9 +9,11 @@
maxvolume = id; maxvolume = id;
mute = id; mute = id;
next = id; next = id;
nextChannel = id;
pause = id; pause = id;
play = id; play = id;
prev = id; prev = id;
prevChannel = id;
quit = id; quit = id;
slower = id; slower = id;
stop = id; stop = id;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<key>235</key> <key>235</key>
<string>401 417 350 182 0 0 1152 746 </string> <string>401 417 350 182 0 0 1152 746 </string>
<key>29</key> <key>29</key>
<string>804 409 262 44 0 0 1152 746 </string> <string>797 461 262 44 0 0 1152 746 </string>
<key>445</key> <key>445</key>
<string>347 561 370 117 0 0 1152 746 </string> <string>347 561 370 117 0 0 1152 746 </string>
<key>460</key> <key>460</key>
...@@ -19,8 +19,9 @@ ...@@ -19,8 +19,9 @@
<string>248.0</string> <string>248.0</string>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>21</integer>
<integer>29</integer> <integer>29</integer>
<integer>528</integer>
<integer>21</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>5Q125</string> <string>5Q125</string>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_controller.h: MacOS X plugin for vlc * intf_controller.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: intf_controller.h,v 1.8 2002/05/20 05:20:12 jlj Exp $ * $Id: intf_controller.h,v 1.8.2.1 2002/06/02 01:22:04 massiot Exp $
* *
* Authors: Florian G. Pflug <fgp@phlo.org> * Authors: Florian G. Pflug <fgp@phlo.org>
* *
...@@ -76,6 +76,8 @@ ...@@ -76,6 +76,8 @@
- (IBAction)slower:(id)sender; - (IBAction)slower:(id)sender;
- (IBAction)prev:(id)sender; - (IBAction)prev:(id)sender;
- (IBAction)next:(id)sender; - (IBAction)next:(id)sender;
- (IBAction)prevChannel:(id)sender;
- (IBAction)nextChannel:(id)sender;
- (IBAction)mute:(id)sender; - (IBAction)mute:(id)sender;
- (IBAction)fullscreen:(id)fullscreen; - (IBAction)fullscreen:(id)fullscreen;
- (IBAction)eject:(id)sender; - (IBAction)eject:(id)sender;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_controller.c: MacOS X plugin for vlc * intf_controller.c: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: intf_controller.m,v 1.4 2002/05/20 05:20:12 jlj Exp $ * $Id: intf_controller.m,v 1.4.2.1 2002/06/02 01:22:04 massiot Exp $
* *
* Authors: Florian G. Pflug <fgp@phlo.org> * Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -167,6 +167,16 @@ ...@@ -167,6 +167,16 @@
[o_intf playlistNext]; [o_intf playlistNext];
} }
- (IBAction)prevChannel:(id)sender
{
[o_intf channelPrev];
}
- (IBAction)nextChannel:(id)sender
{
[o_intf channelNext];
}
- (IBAction)mute:(id)sender - (IBAction)mute:(id)sender
{ {
NSMenuItem * item = (NSMenuItem *)sender; NSMenuItem * item = (NSMenuItem *)sender;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_macosx.c: MacOS X interface plugin * intf_macosx.c: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: intf_macosx.m,v 1.1 2002/05/12 20:56:33 massiot Exp $ * $Id: intf_macosx.m,v 1.1.2.1 2002/06/02 01:22:04 massiot Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
...@@ -70,6 +70,7 @@ static int intf_Open( intf_thread_t *p_intf ) ...@@ -70,6 +70,7 @@ static int intf_Open( intf_thread_t *p_intf )
p_intf->p_sys->b_mute = 0; p_intf->p_sys->b_mute = 0;
p_intf->p_sys->i_part = 0; p_intf->p_sys->i_part = 0;
p_intf->p_sys->b_disabled_menus = 0; p_intf->p_sys->b_disabled_menus = 0;
p_intf->p_sys->i_channel = 0;
[[NSApplication sharedApplication] autorelease]; [[NSApplication sharedApplication] autorelease];
[NSBundle loadNibNamed: @"MainMenu" owner: NSApp]; [NSBundle loadNibNamed: @"MainMenu" owner: NSApp];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_vlc_wrapper.h: MacOS X plugin for vlc * intf_vlc_wrapper.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.h,v 1.8 2002/05/18 13:33:44 massiot Exp $ * $Id: intf_vlc_wrapper.h,v 1.8.2.1 2002/06/02 01:22:04 massiot Exp $
* *
* Authors: Florian G. Pflug <fgp@phlo.org> * Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
- (void)playlistStop; - (void)playlistStop;
- (void)playlistNext; - (void)playlistNext;
- (void)playlistPrev; - (void)playlistPrev;
- (void)channelNext;
- (void)channelPrev;
- (void)playSlower; - (void)playSlower;
- (void)playFaster; - (void)playFaster;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_vlc_wrapper.c: MacOS X plugin for vlc * intf_vlc_wrapper.c: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.m,v 1.6.2.2 2002/06/01 23:41:41 massiot Exp $ * $Id: intf_vlc_wrapper.m,v 1.6.2.3 2002/06/02 01:22:04 massiot Exp $
* *
* Authors: Florian G. Pflug <fgp@phlo.org> * Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -202,6 +202,79 @@ static Intf_VLCWrapper *o_intf = nil; ...@@ -202,6 +202,79 @@ static Intf_VLCWrapper *o_intf = nil;
} }
} }
- (void)channelNext
{
intf_thread_t * p_intf = p_main->p_intf;
p_intf->p_sys->i_channel++;
intf_WarnMsg( 3, "intf info: joining channel %d", p_intf->p_sys->i_channel );
vlc_mutex_lock( &p_intf->change_lock );
if( p_input_bank->pp_input[0] != NULL )
{
/* end playing item */
p_input_bank->pp_input[0]->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
/* FIXME: ugly hack to close input and outputs */
p_intf->pf_manage( p_intf );
}
network_ChannelJoin( p_intf->p_sys->i_channel );
/* FIXME 2 */
p_main->p_playlist->b_stopped = 0;
p_intf->pf_manage( p_intf );
vlc_mutex_unlock( &p_intf->change_lock );
}
- (void)channelPrev
{
intf_thread_t * p_intf = p_main->p_intf;
if ( p_intf->p_sys->i_channel )
{
p_intf->p_sys->i_channel--;
}
intf_WarnMsg( 3, "intf info: joining channel %d", p_intf->p_sys->i_channel );
vlc_mutex_lock( &p_intf->change_lock );
if( p_input_bank->pp_input[0] != NULL )
{
/* end playing item */
p_input_bank->pp_input[0]->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
/* FIXME: ugly hack to close input and outputs */
p_intf->pf_manage( p_intf );
}
network_ChannelJoin( p_intf->p_sys->i_channel );
/* FIXME 2 */
p_main->p_playlist->b_stopped = 0;
p_intf->pf_manage( p_intf );
vlc_mutex_unlock( &p_intf->change_lock );
}
- (void)playSlower - (void)playSlower
{ {
if( p_input_bank->pp_input[0] != NULL ) if( p_input_bank->pp_input[0] != NULL )
...@@ -653,7 +726,7 @@ static Intf_VLCWrapper *o_intf = nil; ...@@ -653,7 +726,7 @@ static Intf_VLCWrapper *o_intf = nil;
NSMenu *o_main_menu; NSMenu *o_main_menu;
NSMenuItem *o_controls_item; NSMenuItem *o_controls_item;
NSMenuItem *o_program_item, *o_title_item, *o_chapter_item, *o_language_item, NSMenuItem *o_program_item, *o_title_item, *o_chapter_item, *o_language_item,
*o_subtitle_item; *o_subtitle_item, *o_next_channel_item, *o_prev_channel_item;
input_thread_t * p_input = p_input_bank->pp_input[0]; input_thread_t * p_input = p_input_bank->pp_input[0];
o_main_menu = [NSApp mainMenu]; o_main_menu = [NSApp mainMenu];
...@@ -663,6 +736,8 @@ static Intf_VLCWrapper *o_intf = nil; ...@@ -663,6 +736,8 @@ static Intf_VLCWrapper *o_intf = nil;
o_chapter_item = [[o_controls_item submenu] itemWithTitle: @"Chapter"]; o_chapter_item = [[o_controls_item submenu] itemWithTitle: @"Chapter"];
o_language_item = [[o_controls_item submenu] itemWithTitle: @"Language"]; o_language_item = [[o_controls_item submenu] itemWithTitle: @"Language"];
o_subtitle_item = [[o_controls_item submenu] itemWithTitle: @"Subtitles"]; 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];
if( p_input == NULL ) if( p_input == NULL )
{ {
...@@ -931,6 +1006,17 @@ static Intf_VLCWrapper *o_intf = nil; ...@@ -931,6 +1006,17 @@ static Intf_VLCWrapper *o_intf = nil;
} }
p_input->stream.b_changed = 0; 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 @end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* macosx.h: MacOS X plugin for vlc * macosx.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: macosx.h,v 1.9 2002/05/12 01:39:36 massiot Exp $ * $Id: macosx.h,v 1.9.2.1 2002/06/02 01:22:04 massiot Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu> * Eugenio Jarosiewicz <ej0@cise.ufl.edu>
...@@ -43,6 +43,7 @@ typedef struct intf_sys_s ...@@ -43,6 +43,7 @@ typedef struct intf_sys_s
int i_part; int i_part;
boolean_t b_disabled_menus; boolean_t b_disabled_menus;
int i_channel;
} intf_sys_t; } intf_sys_t;
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* netutils.c: various network functions * netutils.c: various network functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: netutils.c,v 1.66 2002/05/30 13:22:43 asmax Exp $ * $Id: netutils.c,v 1.66.2.1 2002/06/02 01:22:04 massiot Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr> * Benoit Steiner <benny@via.ecp.fr>
...@@ -159,21 +159,11 @@ int network_ChannelJoin( int i_channel ) ...@@ -159,21 +159,11 @@ int network_ChannelJoin( int i_channel )
if( !config_GetIntVariable( "network-channel" ) ) if( !config_GetIntVariable( "network-channel" ) )
{ {
intf_ErrMsg( "network: channels disabled, to enable them, use the" intf_ErrMsg( "network: channels disabled, to enable them, use the "
"--channels option" ); "--channels option" );
return -1; return -1;
} }
/* If last change is too recent, wait a while */
// if( mdate() - p_main->p_channel->last_change < INPUT_CHANNEL_CHANGE_DELAY )
// {
// intf_WarnMsg( 2, "network: waiting before changing channel" );
/* XXX Isn't this completely brain-damaged ??? -- Sam */
/* Yes it is. I don't think this is still justified with the new
* vlanserver --Meuuh */
// mwait( p_main->p_channel->last_change + INPUT_CHANNEL_CHANGE_DELAY );
// }
if( config_GetIntVariable( "ipv4" ) ) if( config_GetIntVariable( "ipv4" ) )
{ {
psz_network = "ipv4"; psz_network = "ipv4";
......
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