Changeset 3a361d2f7684140a9adfc005185840bafb192f7c
- Timestamp:
- 07/05/02 00:59:46
(7 years ago)
- Author:
- Christophe Massiot <massiot@videolan.org>
- git-committer:
- Christophe Massiot <massiot@videolan.org> 1020725986 +0000
- git-parent:
[a4fcb5e2e8d543bdb6b50bc339d00324ae99b2f6]
- git-author:
- Christophe Massiot <massiot@videolan.org> 1020725986 +0000
- Message:
Improvements of the OS X GUI.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r30a5f36 |
r3a361d2 |
|
| 4 | 4 | { |
|---|
| 5 | 5 | ACTIONS = { |
|---|
| | 6 | eject = id; |
|---|
| 6 | 7 | faster = id; |
|---|
| | 8 | fullscreen = id; |
|---|
| | 9 | mute = id; |
|---|
| 7 | 10 | next = id; |
|---|
| 8 | 11 | pause = id; |
|---|
| r30a5f36 |
r3a361d2 |
|
| 4 | 4 | <dict> |
|---|
| 5 | 5 | <key>IBDocumentLocation</key> |
|---|
| 6 | | <string>729 10 500 426 0 0 1600 1178 </string> |
|---|
| | 6 | <string>13 255 500 426 0 0 1152 746 </string> |
|---|
| 7 | 7 | <key>IBEditorPositions</key> |
|---|
| 8 | 8 | <dict> |
|---|
| | 9 | <key>235</key> |
|---|
| | 10 | <string>401 417 350 182 0 0 1152 746 </string> |
|---|
| 9 | 11 | <key>29</key> |
|---|
| 10 | | <string>108 456 205 44 0 0 1600 1178 </string> |
|---|
| | 12 | <string>804 409 205 44 0 0 1152 746 </string> |
|---|
| | 13 | <key>445</key> |
|---|
| | 14 | <string>347 561 370 117 0 0 1152 746 </string> |
|---|
| 11 | 15 | <key>460</key> |
|---|
| 12 | | <string>120 456 104 66 0 0 1600 1178 </string> |
|---|
| | 16 | <string>84 279 104 66 0 0 1152 746 </string> |
|---|
| 13 | 17 | </dict> |
|---|
| 14 | 18 | <key>IBFramework Version</key> |
|---|
| 15 | 19 | <string>248.0</string> |
|---|
| | 20 | <key>IBOpenObjects</key> |
|---|
| | 21 | <array> |
|---|
| | 22 | <integer>29</integer> |
|---|
| | 23 | <integer>21</integer> |
|---|
| | 24 | </array> |
|---|
| 16 | 25 | <key>IBSystem Version</key> |
|---|
| 17 | 26 | <string>5Q125</string> |
|---|
| r1538dd9 |
r3a361d2 |
|
| 106 | 106 | /* Duration between the time we receive the data packet, and the time we will |
|---|
| 107 | 107 | * mark it to be presented */ |
|---|
| 108 | | #define DEFAULT_PTS_DELAY (mtime_t)(.2*CLOCK_FREQ) |
|---|
| | 108 | #define DEFAULT_PTS_DELAY (mtime_t)(.35*CLOCK_FREQ) |
|---|
| 109 | 109 | |
|---|
| 110 | 110 | /***************************************************************************** |
|---|
| … | … | |
| 135 | 135 | * song from the interface) |
|---|
| 136 | 136 | * - long, in order to perform the buffer calculations as few as possible */ |
|---|
| 137 | | #define AOUT_BUFFER_DURATION 100000 |
|---|
| | 137 | #define AOUT_BUFFER_DURATION 90000 |
|---|
| 138 | 138 | |
|---|
| 139 | 139 | /***************************************************************************** |
|---|
| r30a5f36 |
r3a361d2 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: intf_controller.c,v 1.6 2002/04/23 03:21:21 jlj Exp $ |
|---|
| | 5 | * $Id: intf_controller.c,v 1.7 2002/05/06 22:59:46 massiot Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Florian G. Pflug <fgp@phlo.org> |
|---|
| … | … | |
| 156 | 156 | } |
|---|
| 157 | 157 | |
|---|
| | 158 | - (IBAction)mute:(id)sender |
|---|
| | 159 | { |
|---|
| | 160 | NSMenuItem * item = (NSMenuItem *)sender; |
|---|
| | 161 | |
|---|
| | 162 | [o_intf mute]; |
|---|
| | 163 | |
|---|
| | 164 | if( p_main->p_intf->p_sys->b_mute ) |
|---|
| | 165 | { |
|---|
| | 166 | [item setState:NSOnState]; |
|---|
| | 167 | } |
|---|
| | 168 | else |
|---|
| | 169 | { |
|---|
| | 170 | [item setState:NSOffState]; |
|---|
| | 171 | } |
|---|
| | 172 | } |
|---|
| | 173 | |
|---|
| | 174 | - (IBAction)fullscreen:(id)sender |
|---|
| | 175 | { |
|---|
| | 176 | [o_intf fullscreen]; |
|---|
| | 177 | } |
|---|
| | 178 | |
|---|
| | 179 | - (IBAction)eject:(id)sender |
|---|
| | 180 | { |
|---|
| | 181 | [o_intf eject]; |
|---|
| | 182 | } |
|---|
| | 183 | |
|---|
| 158 | 184 | - (IBAction)timesliderUpdate:(id)slider |
|---|
| 159 | 185 | { |
|---|
| r30a5f36 |
r3a361d2 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: intf_controller.h,v 1.5 2002/04/23 03:21:21 jlj Exp $ |
|---|
| | 5 | * $Id: intf_controller.h,v 1.6 2002/05/06 22:59:46 massiot Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Florian G. Pflug <fgp@phlo.org> |
|---|
| … | … | |
| 74 | 74 | - (IBAction)prev:(id)sender; |
|---|
| 75 | 75 | - (IBAction)next:(id)sender; |
|---|
| | 76 | - (IBAction)mute:(id)sender; |
|---|
| | 77 | - (IBAction)fullscreen:(id)fullscreen; |
|---|
| | 78 | - (IBAction)eject:(id)sender; |
|---|
| 76 | 79 | - (IBAction)timesliderUpdate:(id)slider; |
|---|
| 77 | 80 | - (IBAction)quit:(id)sender; |
|---|
| rb4bea3c |
r3a361d2 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: intf_macosx.c,v 1.12 2002/04/16 23:00:54 massiot Exp $ |
|---|
| | 5 | * $Id: intf_macosx.c,v 1.13 2002/05/06 22:59:46 massiot Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Colin Delacroix <colin@zoy.org> |
|---|
| … | … | |
| 68 | 68 | p_intf->p_sys->o_pool = [[NSAutoreleasePool alloc] init]; |
|---|
| 69 | 69 | p_intf->p_sys->o_port = [[NSPort port] retain]; |
|---|
| | 70 | p_intf->p_sys->b_mute = 0; |
|---|
| 70 | 71 | |
|---|
| 71 | 72 | [[NSApplication sharedApplication] autorelease]; |
|---|
| r30a5f36 |
r3a361d2 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: intf_open.h,v 1.1 2002/04/23 03:21:21 jlj Exp $ |
|---|
| | 5 | * $Id: intf_open.h,v 1.2 2002/05/06 22:59:46 massiot Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> |
|---|
| … | … | |
| 26 | 26 | *****************************************************************************/ |
|---|
| 27 | 27 | #import <Cocoa/Cocoa.h> |
|---|
| | 28 | |
|---|
| | 29 | NSArray *GetEjectableMediaOfClass( const char *psz_class ); |
|---|
| 28 | 30 | |
|---|
| 29 | 31 | /***************************************************************************** |
|---|
| r30a5f36 |
r3a361d2 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: intf_vlc_wrapper.c,v 1.10 2002/04/23 03:21:21 jlj Exp $ |
|---|
| | 5 | * $Id: intf_vlc_wrapper.c,v 1.11 2002/05/06 22:59:46 massiot Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Florian G. Pflug <fgp@phlo.org> |
|---|
| 8 | 8 | * Jon Lech Johansen <jon-vl@nanocrew.net> |
|---|
| | 9 | * Christophe Massiot <massiot@via.ecp.fr> |
|---|
| 9 | 10 | * |
|---|
| 10 | 11 | * This program is free software; you can redistribute it and/or modify |
|---|
| … | … | |
| 27 | 28 | #include <string.h> |
|---|
| 28 | 29 | |
|---|
| | 30 | #include <IOKit/storage/IOCDMedia.h> |
|---|
| | 31 | #include <IOKit/storage/IODVDMedia.h> |
|---|
| | 32 | |
|---|
| 29 | 33 | #include <videolan/vlc.h> |
|---|
| 30 | 34 | |
|---|
| 31 | 35 | #include "interface.h" |
|---|
| 32 | 36 | #include "intf_playlist.h" |
|---|
| | 37 | #include "intf_eject.h" |
|---|
| 33 | 38 | |
|---|
| 34 | 39 | #include "video.h" |
|---|
| 35 | 40 | #include "video_output.h" |
|---|
| | 41 | #include "audio_output.h" |
|---|
| | 42 | |
|---|
| 36 | 43 | #include "stream_control.h" |
|---|
| 37 | 44 | #include "input_ext-intf.h" |
|---|
| … | … | |
| 78 | 85 | |
|---|
| 79 | 86 | return( 1 ); |
|---|
| | 87 | } |
|---|
| | 88 | |
|---|
| | 89 | if( p_input_bank->pp_input[0] != NULL ) |
|---|
| | 90 | { |
|---|
| | 91 | vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock ); |
|---|
| | 92 | |
|---|
| | 93 | if( !p_input_bank->pp_input[0]->b_die ) |
|---|
| | 94 | { |
|---|
| | 95 | /* New input or stream map change */ |
|---|
| | 96 | if( p_input_bank->pp_input[0]->stream.b_changed || |
|---|
| | 97 | p_main->p_intf->p_sys->i_part != |
|---|
| | 98 | p_input_bank->pp_input[0]->stream.p_selected_area->i_part ) |
|---|
| | 99 | { |
|---|
| | 100 | [self setupMenus]; |
|---|
| | 101 | } |
|---|
| | 102 | } |
|---|
| | 103 | |
|---|
| | 104 | vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock ); |
|---|
| | 105 | } |
|---|
| | 106 | else |
|---|
| | 107 | { |
|---|
| | 108 | [self setupMenus]; |
|---|
| 80 | 109 | } |
|---|
| 81 | 110 | |
|---|
| … | … | |
| 196 | 225 | } |
|---|
| 197 | 226 | |
|---|
| | 227 | - (void)mute |
|---|
| | 228 | { |
|---|
| | 229 | if( p_aout_bank->pp_aout[0] == NULL ) return; |
|---|
| | 230 | |
|---|
| | 231 | if( p_main->p_intf->p_sys->b_mute ) |
|---|
| | 232 | { |
|---|
| | 233 | p_aout_bank->pp_aout[0]->i_volume = |
|---|
| | 234 | p_main->p_intf->p_sys->i_saved_volume; |
|---|
| | 235 | } |
|---|
| | 236 | else |
|---|
| | 237 | { |
|---|
| | 238 | p_main->p_intf->p_sys->i_saved_volume = |
|---|
| | 239 | p_aout_bank->pp_aout[0]->i_volume; |
|---|
| | 240 | p_aout_bank->pp_aout[0]->i_volume = 0; |
|---|
| | 241 | } |
|---|
| | 242 | p_main->p_intf->p_sys->b_mute = !p_main->p_intf->p_sys->b_mute; |
|---|
| | 243 | } |
|---|
| | 244 | |
|---|
| | 245 | - (void)fullscreen |
|---|
| | 246 | { |
|---|
| | 247 | if( p_vout_bank->pp_vout[0] != NULL ) |
|---|
| | 248 | { |
|---|
| | 249 | p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE; |
|---|
| | 250 | } |
|---|
| | 251 | } |
|---|
| | 252 | |
|---|
| | 253 | - (void)eject |
|---|
| | 254 | { |
|---|
| | 255 | /* FIXME : this will only eject the first drive found */ |
|---|
| | 256 | NSArray * o_devices = GetEjectableMediaOfClass(kIODVDMediaClass); |
|---|
| | 257 | const char * psz_device; |
|---|
| | 258 | |
|---|
| | 259 | if ( o_devices == nil ) |
|---|
| | 260 | { |
|---|
| | 261 | o_devices = GetEjectableMediaOfClass(kIOCDMediaClass); |
|---|
| | 262 | } |
|---|
| | 263 | |
|---|
| | 264 | psz_device = [[o_devices objectAtIndex:0] cString]; |
|---|
| | 265 | intf_Eject( psz_device ); |
|---|
| | 266 | } |
|---|
| | 267 | |
|---|
| 198 | 268 | /* playback info */ |
|---|
| 199 | 269 | |
|---|
| … | … | |
| 419 | 489 | } |
|---|
| 420 | 490 | |
|---|
| | 491 | - (void)setupMenus |
|---|
| | 492 | { |
|---|
| | 493 | #if 0 |
|---|
| | 494 | NSMenu * o_main_menu = [NSApp mainMenu]; |
|---|
| | 495 | NSMenuItem * o_program_item = [o_main_menu itemWithTitle:@"Program"]; |
|---|
| | 496 | |
|---|
| | 497 | if( p_input_bank->pp_input[0] == NULL ) |
|---|
| | 498 | { |
|---|
| | 499 | NSMenu * o_program = [o_program_item submenu]; |
|---|
| | 500 | [o_program_item setEnabled:0]; |
|---|
| | 501 | [o_program removeItemAtIndex:0]; |
|---|
| | 502 | } |
|---|
| | 503 | else |
|---|
| | 504 | { |
|---|
| | 505 | NSMenu * o_program = [o_program_item submenu]; |
|---|
| | 506 | [o_program_item setEnabled:1]; |
|---|
| | 507 | [o_program removeItemAtIndex:0]; |
|---|
| | 508 | } |
|---|
| | 509 | #endif |
|---|
| | 510 | } |
|---|
| | 511 | |
|---|
| 421 | 512 | @end |
|---|
| r30a5f36 |
r3a361d2 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: intf_vlc_wrapper.h,v 1.5 2002/04/23 03:21:21 jlj Exp $ |
|---|
| | 5 | * $Id: intf_vlc_wrapper.h,v 1.6 2002/05/06 22:59:46 massiot Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Florian G. Pflug <fgp@phlo.org> |
|---|
| … | … | |
| 46 | 46 | - (void)playSlower; |
|---|
| 47 | 47 | - (void)playFaster; |
|---|
| | 48 | - (void)mute; |
|---|
| | 49 | - (void)fullscreen; |
|---|
| | 50 | - (void)eject; |
|---|
| 48 | 51 | |
|---|
| 49 | 52 | /* playback info */ |
|---|
| … | … | |
| 68 | 71 | - (void)openNet:(NSString*)o_protocol addr:(NSString*)o_addr port:(int)i_port baddr:(NSString*)o_baddr; |
|---|
| 69 | 72 | - (void)openNetChannel:(NSString*)o_addr port:(int)i_port; |
|---|
| | 73 | - (void)setupMenus; |
|---|
| 70 | 74 | |
|---|
| 71 | 75 | @end |
|---|
| r848637d |
r3a361d2 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: macosx.h,v 1.7 2002/04/25 23:07:23 massiot Exp $ |
|---|
| | 5 | * $Id: macosx.h,v 1.8 2002/05/06 22:59:46 massiot Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Colin Delacroix <colin@zoy.org> |
|---|
| … | … | |
| 38 | 38 | NSPort *o_port; |
|---|
| 39 | 39 | NSAutoreleasePool *o_pool; |
|---|
| | 40 | |
|---|
| | 41 | boolean_t b_mute; |
|---|
| | 42 | int i_saved_volume; |
|---|
| | 43 | |
|---|
| | 44 | int i_part; |
|---|
| 40 | 45 | } intf_sys_t; |
|---|
| 41 | 46 | |
|---|
| … | … | |
| 53 | 58 | boolean_t b_mouse_pointer_visible; |
|---|
| 54 | 59 | mtime_t i_time_mouse_last_moved; |
|---|
| 55 | | |
|---|
| | 60 | |
|---|
| 56 | 61 | CodecType i_codec; |
|---|
| 57 | 62 | CGrafPtr p_qdport; |
|---|
| r054b90a |
r3a361d2 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001, 2002 VideoLAN |
|---|
| 5 | | * $Id: intf_eject.c,v 1.9 2002/04/04 22:08:05 massiot Exp $ |
|---|
| | 5 | * $Id: intf_eject.c,v 1.10 2002/05/06 22:59:46 massiot Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Author: Julien Blache <jb@technologeek.org> for the Linux part |
|---|
| 8 | 8 | * with code taken from the Linux "eject" command |
|---|
| | 9 | * Jon Lech Johanson <jon-vl@nanocrew.net> for Darwin |
|---|
| 9 | 10 | * |
|---|
| 10 | 11 | * This program is free software; you can redistribute it and/or modify |
|---|
| … | … | |
| 82 | 83 | int intf_Eject( const char *psz_device ) |
|---|
| 83 | 84 | { |
|---|
| 84 | | int i_fd; |
|---|
| 85 | 85 | int i_ret; |
|---|
| 86 | 86 | |
|---|
| … | … | |
| 100 | 100 | strlen( psz_disk ) > 4 ) |
|---|
| 101 | 101 | { |
|---|
| 102 | | #define EJECT_CMD "disktool -e %s 0" |
|---|
| | 102 | #define EJECT_CMD "/usr/sbin/disktool -e %s 0" |
|---|
| 103 | 103 | snprintf( sz_cmd, sizeof(sz_cmd), EJECT_CMD, psz_disk ); |
|---|
| 104 | 104 | #undef EJECT_CMD |
|---|
| … | … | |
| 128 | 128 | return 1; |
|---|
| 129 | 129 | |
|---|
| 130 | | #endif |
|---|
| | 130 | #else /* SYS_DARWIN */ |
|---|
| | 131 | |
|---|
| | 132 | int i_fd; |
|---|
| 131 | 133 | |
|---|
| 132 | 134 | /* This code could be extended to support CD/DVD-ROM chargers */ |
|---|
| … | … | |
| 165 | 167 | |
|---|
| 166 | 168 | return i_ret; |
|---|
| | 169 | #endif |
|---|
| 167 | 170 | } |
|---|
| 168 | 171 | |
|---|