1 /*****************************************************************************
2 * embeddedwindow.m: MacOS X interface module
3 *****************************************************************************
4 * Copyright (C) 2002-2005 the VideoLAN team
7 * Authors: Benjamin Pracht <bigben at videolan dot org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
31 #include "embeddedwindow.h"
33 /*****************************************************************************
34 * VLCEmbeddedWindow Implementation
35 *****************************************************************************/
37 @implementation VLCEmbeddedWindow
41 [o_window setDelegate: self];
43 [o_btn_backward setToolTip: _NS("Rewind")];
44 [o_btn_forward setToolTip: _NS("Fast Forward")];
45 [o_btn_fullscreen setToolTip: _NS("Fullscreen")];
46 [o_btn_play setToolTip: _NS("Play")];
47 [o_slider setToolTip: _NS("Position")];
49 o_img_play = [NSImage imageNamed: @"play_embedded"];
50 o_img_play_pressed = [NSImage imageNamed: @"play_embedded_blue"];
51 o_img_pause = [NSImage imageNamed: @"pause_embedded"];
52 o_img_pause_pressed = [NSImage imageNamed: @"pause_embedded_blue"];
55 - (void)setTime:(NSString *)o_arg_time position:(float)f_position
57 [o_time setStringValue: o_arg_time];
58 [o_slider setFloatValue: f_position];
61 - (void)playStatusUpdated:(int)i_status
63 if( i_status == PLAYING_S )
65 [o_btn_play setImage: o_img_pause];
66 [o_btn_play setAlternateImage: o_img_pause_pressed];
67 [o_btn_play setToolTip: _NS("Pause")];
71 [o_btn_play setImage: o_img_play];
72 [o_btn_play setAlternateImage: o_img_play_pressed];
73 [o_btn_play setToolTip: _NS("Play")];
77 - (void)setSeekable:(BOOL)b_seekable
79 [o_btn_forward setEnabled: b_seekable];
80 [o_btn_backward setEnabled: b_seekable];
81 [o_slider setEnabled: b_seekable];
84 - (void)setFullscreen:(BOOL)b_fullscreen
86 [o_btn_fullscreen setState: b_fullscreen];
89 - (BOOL)windowShouldClose:(id)sender
91 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
93 if( p_playlist == NULL )
98 playlist_Stop( p_playlist );
99 vlc_object_release( p_playlist );