Commit 2f78783f authored by bigben's avatar bigben
Browse files

* Add an controls to the vout (using the embedded vout framework)

  - There is some redundancy in the controls now...
  - This is just a proposal. If you don't like it, say so...
  - Hope I didn't forget any file (yell if you habe troubles)
* Add an option to disable the embedded window
parent 8b953e6d
......@@ -31,10 +31,29 @@
};
CLASS = VLCControls;
LANGUAGE = ObjC;
OUTLETS = {"o_btn_fullscreen" = id; "o_main" = id; "o_volumeslider" = id; };
OUTLETS = {"o_main" = id; "o_volumeslider" = id; };
SUPERCLASS = NSObject;
},
{
CLASS = VLCDetachedEmbeddedVoutView;
LANGUAGE = ObjC;
SUPERCLASS = VLCEmbeddedVoutView;
},
{CLASS = VLCEmbeddedVoutView; LANGUAGE = ObjC; SUPERCLASS = VLCVoutView; },
{
CLASS = VLCEmbeddedWindow;
LANGUAGE = ObjC;
OUTLETS = {
"o_btn_backward" = id;
"o_btn_forward" = id;
"o_btn_fullscreen" = id;
"o_btn_play" = id;
"o_slider" = id;
"o_time" = id;
"o_window" = id;
};
SUPERCLASS = NSObject;
},
{
ACTIONS = {
bandSliderUpdated = id;
......@@ -122,7 +141,6 @@
LANGUAGE = ObjC;
OUTLETS = {
"o_btn_ff" = id;
"o_btn_fullscreen" = id;
"o_btn_next" = id;
"o_btn_play" = id;
"o_btn_playlist" = id;
......@@ -135,6 +153,7 @@
"o_dmi_play" = id;
"o_dmi_previous" = id;
"o_dmi_stop" = id;
"o_embedded_window" = id;
"o_err_btn_dismiss" = id;
"o_err_btn_msgs" = id;
"o_err_bug_lbl" = id;
......@@ -292,4 +311,4 @@
{CLASS = VLCVoutView; LANGUAGE = ObjC; SUPERCLASS = NSView; }
);
IBVersion = 1;
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>394 559 496 270 0 0 1280 1002 </string>
<string>134 289 496 270 0 0 1024 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>1617</key>
......@@ -11,18 +11,17 @@
<key>2197</key>
<string>422 532 596 143 0 0 1440 878 </string>
<key>29</key>
<string>503 790 438 44 0 0 1440 878 </string>
<string>294 89 438 44 0 0 1024 746 </string>
<key>915</key>
<string>678 573 187 249 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>437.0</string>
<string>439.0</string>
<key>IBLockedObjects</key>
<array/>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>2029</integer>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
......
This diff is collapsed.
......@@ -38,5 +38,7 @@ SOURCES_macosx = \
bookmarks.m \
sfilters.h \
sfilters.m \
embeddedwindow.h \
embeddedwindow.m \
$(NULL)
/*****************************************************************************
* embeddedwindow.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2004 the VideoLAN team
* $Id: playlistinfo.h 11664 2005-07-09 06:17:09Z courmisch $
*
* Authors: Benjamin Pracht <bigben at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* VLCEmbeddedWindow interface
*****************************************************************************/
@interface VLCEmbeddedWindow : NSObject
{
IBOutlet id o_btn_backward;
IBOutlet id o_btn_forward;
IBOutlet id o_btn_fullscreen;
IBOutlet id o_btn_play;
IBOutlet id o_slider;
IBOutlet id o_time;
IBOutlet id o_window;
NSImage * o_img_play;
NSImage * o_img_play_pressed;
NSImage * o_img_pause;
NSImage * o_img_pause_pressed;
}
- (void)setTime:(NSString *)o_arg_ime position:(float)f_position;
- (void)playStatusUpdated:(int)i_status;
- (void)setSeekable:(BOOL)b_seekable;
- (void)setFullscreen:(BOOL)b_fullscreen;
@end
/*****************************************************************************
* embeddedwindow.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2005 the VideoLAN team
* $Id: playlistinfo.m 12560 2005-09-15 14:21:38Z hartman $
*
* Authors: Benjamin Pracht <bigben at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "intf.h"
#include "vout.h"
#include "embeddedwindow.h"
/*****************************************************************************
* VLCEmbeddedWindow Implementation
*****************************************************************************/
@implementation VLCEmbeddedWindow
- (void)awakeFromNib
{
[o_window setDelegate: self];
[o_btn_backward setToolTip: _NS("Rewind")];
[o_btn_forward setToolTip: _NS("Fast Forward")];
[o_btn_fullscreen setToolTip: _NS("Fullscreen")];
[o_btn_play setToolTip: _NS("Play")];
[o_slider setToolTip: _NS("Position")];
o_img_play = [NSImage imageNamed: @"play_embedded"];
o_img_play_pressed = [NSImage imageNamed: @"play_embedded_blue"];
o_img_pause = [NSImage imageNamed: @"pause_embedded"];
o_img_pause_pressed = [NSImage imageNamed: @"pause_embedded_blue"];
}
- (void)setTime:(NSString *)o_arg_time position:(float)f_position
{
[o_time setStringValue: o_arg_time];
[o_slider setFloatValue: f_position];
}
- (void)playStatusUpdated:(int)i_status
{
if( i_status == PLAYING_S )
{
[o_btn_play setImage: o_img_pause];
[o_btn_play setAlternateImage: o_img_pause_pressed];
[o_btn_play setToolTip: _NS("Pause")];
}
else
{
[o_btn_play setImage: o_img_play];
[o_btn_play setAlternateImage: o_img_play_pressed];
[o_btn_play setToolTip: _NS("Play")];
}
}
- (void)setSeekable:(BOOL)b_seekable
{
[o_btn_forward setEnabled: b_seekable];
[o_btn_backward setEnabled: b_seekable];
[o_slider setEnabled: b_seekable];
}
- (void)setFullscreen:(BOOL)b_fullscreen
{
[o_btn_fullscreen setState: b_fullscreen];
}
- (BOOL)windowShouldClose:(id)sender
{
playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return NO;
}
playlist_Stop( p_playlist );
vlc_object_release( p_playlist );
return YES;
}
@end
......@@ -356,24 +356,20 @@ static VLCExtended *_o_sharedInstance = nil;
FIND_ANYWHERE );
vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
vout_thread_t *p_real_vout;
val.f_float = [o_sld_opaque floatValue] / 100;
if( p_vout != NULL )
{
if( p_vout->i_object_type == VLC_OBJECT_OPENGL )
{
p_real_vout = (vout_thread_t *) p_vout->p_parent;
}
else
{
p_real_vout = p_vout;
}
p_real_vout = [VLCVoutView getRealVout: p_vout];
var_Set( p_real_vout, "macosx-opaqueness", val );
while ((o_window = [o_enumerator nextObject]))
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
if( [[o_window className] isEqualToString: @"VLCWindow"] ||
[[[VLCMain sharedInstance] getEmbeddedList]
windowContainsEmbedded: o_window])
{
[o_window setAlphaValue: val.f_float];
}
......
......@@ -112,6 +112,7 @@ struct intf_sys_t
IBOutlet id o_scrollfield; /* info field */
IBOutlet id o_timefield; /* time field */
IBOutlet id o_timeslider; /* time slider */
IBOutlet id o_embedded_window; /* Embedded Vout Window */
float f_slider; /* slider value */
float f_slider_old; /* old slider val */
IBOutlet id o_volumeslider; /* volume slider */
......
......@@ -43,6 +43,7 @@
#include "bookmarks.h"
#include "sfilters.h"
#include "interaction.h"
#include "embeddedwindow.h"
/*#include "update.h"*/
/*****************************************************************************
......@@ -449,7 +450,8 @@ static VLCMain *_o_sharedMainInstance = nil;
var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self);
[o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool )];
[o_embedded_window setFullscreen: var_GetBool( p_playlist,
"fullscreen" )];
vlc_object_release( p_playlist );
}
......@@ -964,6 +966,8 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_timeslider setEnabled: b_seekable];
[o_timefield setStringValue: @"0:00:00"];
[o_embedded_window setSeekable: b_seekable];
p_intf->p_sys->b_intf_update = VLC_FALSE;
}
......@@ -983,7 +987,7 @@ static VLCMain *_o_sharedMainInstance = nil;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
var_Get( p_playlist, "fullscreen", &val );
[o_btn_fullscreen setState: val.b_bool];
[o_embedded_window setFullscreen: val.b_bool];
vlc_object_release( p_playlist );
p_intf->p_sys->b_fullscreen_update = VLC_FALSE;
......@@ -1020,9 +1024,11 @@ static VLCMain *_o_sharedMainInstance = nil;
while( ( o_vout_wnd = [o_enum nextObject] ) )
{
if( [[o_vout_wnd className] isEqualToString: @"VLCWindow"] )
if( [[o_vout_wnd className] isEqualToString: @"VLCWindow"]
|| [[[VLCMain sharedInstance] getEmbeddedList]
windowContainsEmbedded: o_vout_wnd])
{
[o_vout_wnd updateTitle];
[[o_vout_wnd getVoutView] updateTitle];
}
}
vlc_object_release( (vlc_object_t *)p_vout );
......@@ -1053,8 +1059,9 @@ static VLCMain *_o_sharedMainInstance = nil;
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time];
[o_embedded_window setTime: o_time position: f_updated];
}
if( p_intf->p_sys->b_volume_update )
{
NSString *o_text;
......@@ -1075,6 +1082,7 @@ static VLCMain *_o_sharedMainInstance = nil;
{
p_intf->p_sys->i_play_status = val.i_int;
[self playStatusUpdated: p_intf->p_sys->i_play_status];
[o_embedded_window playStatusUpdated: p_intf->p_sys->i_play_status];
}
}
else
......@@ -1082,6 +1090,7 @@ static VLCMain *_o_sharedMainInstance = nil;
p_intf->p_sys->i_play_status = END_S;
p_intf->p_sys->b_intf_update = VLC_TRUE;
[self playStatusUpdated: p_intf->p_sys->i_play_status];
[o_embedded_window playStatusUpdated: p_intf->p_sys->i_play_status];
[self setSubmenusEnabled: FALSE];
}
......@@ -1368,6 +1377,7 @@ static VLCMain *_o_sharedMainInstance = nil;
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time];
[o_embedded_window setTime: o_time position: f_updated];
}
#undef p_input
}
......
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