Changeset 47d57d6db23a6bd693dfba2abaec210b1cdb15c3
- Timestamp:
- 20/09/03 15:46:00
(5 years ago)
- Author:
- Derk-Jan Hartman <hartman@videolan.org>
- git-committer:
- Derk-Jan Hartman <hartman@videolan.org> 1064065560 +0000
- git-parent:
[92b1b630f65ead2270fa4557d94f6e326def03ec]
- git-author:
- Derk-Jan Hartman <hartman@videolan.org> 1064065560 +0000
- Message:
* modules/gui/macosx/*:
- implemented the new input variables for control.
- reevaltuated the locking mechanisms in the osx intf.
a lot of this can now be removed, because of the new input structures,
and the vout garbage collector of playlist.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r53f8728 |
r47d57d6 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2002-2003 VideoLAN |
|---|
| 5 | | * $Id: controls.m,v 1.47 2003/07/29 21:14:10 gbazin Exp $ |
|---|
| | 5 | * $Id: controls.m,v 1.48 2003/09/20 13:46:00 hartman Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> |
|---|
| … | … | |
| 75 | 75 | { |
|---|
| 76 | 76 | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 77 | | |
|---|
| 78 | 77 | playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, |
|---|
| 79 | 78 | FIND_ANYWHERE ); |
|---|
| 80 | | if( p_playlist == NULL ) |
|---|
| 81 | | { |
|---|
| 82 | | return; |
|---|
| 83 | | } |
|---|
| 84 | | |
|---|
| 85 | | playlist_Stop( p_playlist ); |
|---|
| 86 | | vlc_object_release( p_playlist ); |
|---|
| | 79 | if( p_playlist != NULL ) |
|---|
| | 80 | { |
|---|
| | 81 | playlist_Stop( p_playlist ); |
|---|
| | 82 | vlc_object_release( p_playlist ); |
|---|
| | 83 | } |
|---|
| 87 | 84 | } |
|---|
| 88 | 85 | |
|---|
| … | … | |
| 90 | 87 | { |
|---|
| 91 | 88 | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 92 | | |
|---|
| 93 | | playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, |
|---|
| 94 | | FIND_ANYWHERE ); |
|---|
| 95 | | if( p_playlist == NULL ) |
|---|
| 96 | | { |
|---|
| 97 | | return; |
|---|
| 98 | | } |
|---|
| 99 | | |
|---|
| 100 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 101 | | if( p_playlist->p_input != NULL ) |
|---|
| 102 | | { |
|---|
| 103 | | input_SetStatus( p_playlist->p_input, INPUT_STATUS_FASTER ); |
|---|
| 104 | | } |
|---|
| 105 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 106 | | |
|---|
| 107 | | vlc_object_release( p_playlist ); |
|---|
| | 89 | input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, |
|---|
| | 90 | FIND_ANYWHERE ); |
|---|
| | 91 | if( p_input != NULL ) |
|---|
| | 92 | { |
|---|
| | 93 | vlc_value_t val; val.b_bool = VLC_TRUE; |
|---|
| | 94 | |
|---|
| | 95 | var_Set( p_input, "rate-faster", val ); |
|---|
| | 96 | vlc_object_release( p_input ); |
|---|
| | 97 | } |
|---|
| 108 | 98 | } |
|---|
| 109 | 99 | |
|---|
| … | … | |
| 111 | 101 | { |
|---|
| 112 | 102 | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 113 | | |
|---|
| 114 | | playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, |
|---|
| 115 | | FIND_ANYWHERE ); |
|---|
| 116 | | if( p_playlist == NULL ) |
|---|
| 117 | | { |
|---|
| 118 | | return; |
|---|
| 119 | | } |
|---|
| 120 | | |
|---|
| 121 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 122 | | if( p_playlist->p_input != NULL ) |
|---|
| 123 | | { |
|---|
| 124 | | input_SetStatus( p_playlist->p_input, INPUT_STATUS_SLOWER ); |
|---|
| 125 | | } |
|---|
| 126 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 127 | | |
|---|
| 128 | | vlc_object_release( p_playlist ); |
|---|
| | 103 | input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, |
|---|
| | 104 | FIND_ANYWHERE ); |
|---|
| | 105 | if( p_input != NULL ) |
|---|
| | 106 | { |
|---|
| | 107 | vlc_value_t val; val.b_bool = VLC_TRUE; |
|---|
| | 108 | |
|---|
| | 109 | var_Set( p_input, "rate-slower", val ); |
|---|
| | 110 | vlc_object_release( p_input ); |
|---|
| | 111 | } |
|---|
| 129 | 112 | } |
|---|
| 130 | 113 | |
|---|
| … | … | |
| 245 | 228 | { |
|---|
| 246 | 229 | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 247 | | playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, |
|---|
| 248 | | FIND_ANYWHERE ); |
|---|
| 249 | | if( p_playlist == NULL || p_playlist->p_input == NULL ) |
|---|
| 250 | | { |
|---|
| 251 | | if ( p_playlist != NULL ) vlc_object_release( p_playlist ); |
|---|
| 252 | | return; |
|---|
| 253 | | } |
|---|
| 254 | | |
|---|
| 255 | | playlist_Play( p_playlist ); |
|---|
| 256 | | input_Seek( p_playlist->p_input, 5, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); |
|---|
| 257 | | vlc_object_release( p_playlist ); |
|---|
| | 230 | input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, |
|---|
| | 231 | FIND_ANYWHERE ); |
|---|
| | 232 | if( p_input != NULL ) |
|---|
| | 233 | { |
|---|
| | 234 | vlc_value_t time; |
|---|
| | 235 | time.f_float = 5; |
|---|
| | 236 | var_Set( p_input, "time-offset", time ); |
|---|
| | 237 | vlc_object_release( p_input ); |
|---|
| | 238 | } |
|---|
| 258 | 239 | } |
|---|
| 259 | 240 | |
|---|
| … | … | |
| 261 | 242 | { |
|---|
| 262 | 243 | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 263 | | playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, |
|---|
| 264 | | FIND_ANYWHERE ); |
|---|
| 265 | | if( p_playlist == NULL || p_playlist->p_input == NULL ) |
|---|
| 266 | | { |
|---|
| 267 | | if ( p_playlist != NULL ) vlc_object_release( p_playlist ); |
|---|
| 268 | | return; |
|---|
| 269 | | } |
|---|
| 270 | | |
|---|
| 271 | | playlist_Play( p_playlist ); |
|---|
| 272 | | input_Seek( p_playlist->p_input, -5, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); |
|---|
| 273 | | vlc_object_release( p_playlist ); |
|---|
| | 244 | input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, |
|---|
| | 245 | FIND_ANYWHERE ); |
|---|
| | 246 | if( p_input != NULL ) |
|---|
| | 247 | { |
|---|
| | 248 | vlc_value_t time; |
|---|
| | 249 | time.f_float = -5; |
|---|
| | 250 | var_Set( p_input, "time-offset", time ); |
|---|
| | 251 | vlc_object_release( p_input ); |
|---|
| | 252 | } |
|---|
| 274 | 253 | } |
|---|
| 275 | 254 | |
|---|
| r567eba1 |
r47d57d6 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: info.m,v 1.6 2003/05/25 17:27:13 massiot Exp $ |
|---|
| | 5 | * $Id: info.m,v 1.7 2003/09/20 13:46:00 hartman Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> |
|---|
| … | … | |
| 85 | 85 | |
|---|
| 86 | 86 | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 87 | | playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, |
|---|
| | 87 | input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, |
|---|
| 88 | 88 | FIND_ANYWHERE ); |
|---|
| 89 | 89 | |
|---|
| 90 | | if( p_playlist == NULL ) |
|---|
| | 90 | if ( p_input == NULL ) |
|---|
| 91 | 91 | { |
|---|
| 92 | | return; |
|---|
| 93 | | } |
|---|
| 94 | | |
|---|
| 95 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 96 | | |
|---|
| 97 | | if ( p_playlist->p_input == NULL ) |
|---|
| 98 | | { |
|---|
| 99 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 100 | | vlc_object_release( p_playlist ); |
|---|
| 101 | 92 | return; |
|---|
| 102 | 93 | } |
|---|
| … | … | |
| 105 | 96 | [o_selector removeAllItems]; |
|---|
| 106 | 97 | |
|---|
| 107 | | vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock ); |
|---|
| 108 | | input_info_category_t * p_category = p_playlist->p_input->stream.p_info; |
|---|
| | 98 | vlc_mutex_lock( &p_input->stream.stream_lock ); |
|---|
| | 99 | input_info_category_t * p_category = p_input->stream.p_info; |
|---|
| 109 | 100 | |
|---|
| 110 | 101 | while( p_category ) |
|---|
| … | … | |
| 114 | 105 | } |
|---|
| 115 | 106 | |
|---|
| 116 | | vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock ); |
|---|
| 117 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 118 | | vlc_object_release( p_playlist ); |
|---|
| | 107 | vlc_mutex_unlock( &p_input->stream.stream_lock ); |
|---|
| | 108 | vlc_object_release( p_input ); |
|---|
| 119 | 109 | |
|---|
| 120 | 110 | int i_select = [o_selector indexOfItemWithTitle:o_selectedPane]; |
|---|
| … | … | |
| 162 | 152 | |
|---|
| 163 | 153 | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 164 | | playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, |
|---|
| | 154 | input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, |
|---|
| 165 | 155 | FIND_ANYWHERE ); |
|---|
| 166 | | |
|---|
| 167 | | if( p_playlist != NULL ) |
|---|
| 168 | | { |
|---|
| 169 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 170 | | } |
|---|
| 171 | 156 | |
|---|
| 172 | 157 | if( [[o_mi title] isEqualToString: _NS("Info")] ) |
|---|
| 173 | 158 | { |
|---|
| 174 | | if( p_playlist == NULL || p_playlist->p_input == NULL ) |
|---|
| | 159 | if( p_input == NULL ) |
|---|
| 175 | 160 | { |
|---|
| 176 | 161 | bEnabled = FALSE; |
|---|
| 177 | 162 | } |
|---|
| 178 | | } |
|---|
| 179 | | |
|---|
| 180 | | if( p_playlist != NULL ) |
|---|
| 181 | | { |
|---|
| 182 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 183 | | vlc_object_release( p_playlist ); |
|---|
| | 163 | else |
|---|
| | 164 | { |
|---|
| | 165 | vlc_object_release( p_input ); |
|---|
| | 166 | } |
|---|
| 184 | 167 | } |
|---|
| 185 | 168 | |
|---|
| r07d406a |
r47d57d6 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2002-2003 VideoLAN |
|---|
| 5 | | * $Id: intf.h,v 1.43 2003/09/19 23:03:27 hartman Exp $ |
|---|
| | 5 | * $Id: intf.h,v 1.44 2003/09/20 13:46:00 hartman Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> |
|---|
| … | … | |
| 226 | 226 | |
|---|
| 227 | 227 | - (void)manage; |
|---|
| 228 | | - (void)manage:(playlist_t *)p_playlist; |
|---|
| 229 | | - (void)manageMode:(playlist_t *)p_playlist; |
|---|
| 230 | 228 | - (void)manageIntf:(NSTimer *)o_timer; |
|---|
| 231 | 229 | - (void)setupMenus; |
|---|
| r07d406a |
r47d57d6 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2002-2003 VideoLAN |
|---|
| 5 | | * $Id: intf.m,v 1.94 2003/09/19 23:03:27 hartman Exp $ |
|---|
| | 5 | * $Id: intf.m,v 1.95 2003/09/20 13:46:00 hartman Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> |
|---|
| … | … | |
| 484 | 484 | { |
|---|
| 485 | 485 | var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self ); |
|---|
| 486 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 487 | | |
|---|
| 488 | | [self manage: p_playlist]; |
|---|
| 489 | | |
|---|
| 490 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| | 486 | #define p_input p_playlist->p_input |
|---|
| | 487 | |
|---|
| | 488 | if( p_input ) |
|---|
| | 489 | { |
|---|
| | 490 | if( !p_input->b_die ) |
|---|
| | 491 | { |
|---|
| | 492 | vlc_value_t val; |
|---|
| | 493 | |
|---|
| | 494 | /* New input or stream map change */ |
|---|
| | 495 | if( p_input->stream.b_changed ) |
|---|
| | 496 | { |
|---|
| | 497 | msg_Dbg( p_intf, "stream has changed, refreshing interface" ); |
|---|
| | 498 | p_intf->p_sys->b_playing = TRUE; |
|---|
| | 499 | p_intf->p_sys->b_current_title_update = 1; |
|---|
| | 500 | p_input->stream.b_changed = 0; |
|---|
| | 501 | p_intf->p_sys->b_intf_update = TRUE; |
|---|
| | 502 | } |
|---|
| | 503 | |
|---|
| | 504 | if( var_Get( (vlc_object_t *)p_input, "intf-change", &val ) |
|---|
| | 505 | >= 0 && val.b_bool ) |
|---|
| | 506 | { |
|---|
| | 507 | p_intf->p_sys->b_input_update = TRUE; |
|---|
| | 508 | } |
|---|
| | 509 | } |
|---|
| | 510 | } |
|---|
| | 511 | else if( p_intf->p_sys->b_playing && !p_intf->b_die ) |
|---|
| | 512 | { |
|---|
| | 513 | p_intf->p_sys->b_playing = FALSE; |
|---|
| | 514 | p_intf->p_sys->b_intf_update = TRUE; |
|---|
| | 515 | } |
|---|
| | 516 | |
|---|
| | 517 | #undef p_input |
|---|
| 491 | 518 | vlc_object_release( p_playlist ); |
|---|
| 492 | 519 | } |
|---|
| … | … | |
| 499 | 526 | |
|---|
| 500 | 527 | [self terminate]; |
|---|
| 501 | | |
|---|
| 502 | 528 | [o_pool release]; |
|---|
| 503 | | } |
|---|
| 504 | | |
|---|
| 505 | | - (void)manage:(playlist_t *)p_playlist |
|---|
| 506 | | { |
|---|
| 507 | | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 508 | | |
|---|
| 509 | | #define p_input p_playlist->p_input |
|---|
| 510 | | |
|---|
| 511 | | if( p_input ) |
|---|
| 512 | | { |
|---|
| 513 | | vlc_mutex_lock( &p_input->stream.stream_lock ); |
|---|
| 514 | | |
|---|
| 515 | | if( !p_input->b_die ) |
|---|
| 516 | | { |
|---|
| 517 | | /* New input or stream map change */ |
|---|
| 518 | | if( p_input->stream.b_changed ) |
|---|
| 519 | | { |
|---|
| 520 | | p_intf->p_sys->b_playing = TRUE; |
|---|
| 521 | | [self manageMode: p_playlist]; |
|---|
| 522 | | } |
|---|
| 523 | | |
|---|
| 524 | | vlc_value_t val; |
|---|
| 525 | | |
|---|
| 526 | | if( var_Get( (vlc_object_t *)p_input, "intf-change", &val ) |
|---|
| 527 | | >= 0 && val.b_bool ) |
|---|
| 528 | | { |
|---|
| 529 | | p_intf->p_sys->b_input_update = TRUE; |
|---|
| 530 | | } |
|---|
| 531 | | } |
|---|
| 532 | | vlc_mutex_unlock( &p_input->stream.stream_lock ); |
|---|
| 533 | | } |
|---|
| 534 | | else if( p_intf->p_sys->b_playing && !p_intf->b_die ) |
|---|
| 535 | | { |
|---|
| 536 | | p_intf->p_sys->b_playing = FALSE; |
|---|
| 537 | | [self manageMode: p_playlist]; |
|---|
| 538 | | } |
|---|
| 539 | | |
|---|
| 540 | | #undef p_input |
|---|
| 541 | | } |
|---|
| 542 | | |
|---|
| 543 | | - (void)manageMode:(playlist_t *)p_playlist |
|---|
| 544 | | { |
|---|
| 545 | | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 546 | | |
|---|
| 547 | | if( p_playlist->p_input != NULL ) |
|---|
| 548 | | { |
|---|
| 549 | | p_intf->p_sys->b_current_title_update = 1; |
|---|
| 550 | | p_playlist->p_input->stream.b_changed = 0; |
|---|
| 551 | | |
|---|
| 552 | | msg_Dbg( p_intf, "stream has changed, refreshing interface" ); |
|---|
| 553 | | } |
|---|
| 554 | | |
|---|
| 555 | | p_intf->p_sys->b_intf_update = VLC_TRUE; |
|---|
| 556 | 529 | } |
|---|
| 557 | 530 | |
|---|
| … | … | |
| 615 | 588 | vlc_bool_t b_seekable = VLC_FALSE; |
|---|
| 616 | 589 | vlc_bool_t b_chapters = VLC_FALSE; |
|---|
| | 590 | vlc_value_t val; |
|---|
| 617 | 591 | |
|---|
| 618 | 592 | b_plmul = p_playlist->i_size > 1; |
|---|
| … | … | |
| 630 | 604 | /* chapters & titles */ |
|---|
| 631 | 605 | b_chapters = p_input->stream.i_area_nb > 1; |
|---|
| | 606 | |
|---|
| | 607 | vlc_mutex_unlock( &p_input->stream.stream_lock ); |
|---|
| 632 | 608 | |
|---|
| 633 | 609 | /* play status */ |
|---|
| 634 | | p_intf->p_sys->b_play_status = |
|---|
| 635 | | p_input->stream.control.i_status != PAUSE_S; |
|---|
| 636 | | |
|---|
| 637 | | vlc_mutex_unlock( &p_input->stream.stream_lock ); |
|---|
| | 610 | var_Get( p_input, "state", &val ); |
|---|
| | 611 | p_intf->p_sys->b_play_status = val.i_int != PAUSE_S; |
|---|
| 638 | 612 | } |
|---|
| 639 | 613 | else |
|---|
| … | … | |
| 660 | 634 | p_intf->p_sys->b_intf_update = VLC_FALSE; |
|---|
| 661 | 635 | } |
|---|
| 662 | | |
|---|
| 663 | | #define p_area p_input->stream.p_selected_area |
|---|
| 664 | 636 | |
|---|
| 665 | 637 | if( p_intf->p_sys->b_playing && p_input != NULL ) |
|---|
| 666 | 638 | { |
|---|
| 667 | | vlc_bool_t b_field_update = TRUE; |
|---|
| 668 | | vlc_mutex_lock( &p_input->stream.stream_lock ); |
|---|
| 669 | | |
|---|
| | 639 | vlc_value_t time, val; |
|---|
| | 640 | NSString * o_time; |
|---|
| | 641 | mtime_t i_seconds; |
|---|
| | 642 | var_Get( p_input, "state", &val ); |
|---|
| | 643 | |
|---|
| 670 | 644 | if( !p_input->b_die && ( p_intf->p_sys->b_play_status != |
|---|
| 671 | | ( p_input->stream.control.i_status != PAUSE_S ) ) ) |
|---|
| | 645 | ( val.i_int != PAUSE_S ) ) ) |
|---|
| 672 | 646 | { |
|---|
| 673 | 647 | p_intf->p_sys->b_play_status = |
|---|
| … | … | |
| 679 | 653 | if( p_input->stream.b_seekable ) |
|---|
| 680 | 654 | { |
|---|
| 681 | | if( f_slider == f_slider_old ) |
|---|
| | 655 | vlc_value_t pos; |
|---|
| | 656 | float f_updated; |
|---|
| | 657 | |
|---|
| | 658 | var_Get( p_input, "position", &pos ); |
|---|
| | 659 | f_updated = 10000. * pos.f_float; |
|---|
| | 660 | |
|---|
| | 661 | if( f_slider != f_updated ) |
|---|
| 682 | 662 | { |
|---|
| 683 | | float f_updated = ( 10000. * p_area->i_tell ) / |
|---|
| 684 | | p_area->i_size; |
|---|
| 685 | | |
|---|
| 686 | | if( f_slider != f_updated ) |
|---|
| 687 | | { |
|---|
| 688 | | [o_timeslider setFloatValue: f_updated]; |
|---|
| 689 | | } |
|---|
| | 663 | [o_timeslider setFloatValue: f_updated]; |
|---|
| 690 | 664 | } |
|---|
| 691 | | else |
|---|
| 692 | | { |
|---|
| 693 | | off_t i_seek = ( f_slider * p_area->i_size ) / 10000; |
|---|
| 694 | | |
|---|
| 695 | | /* release the lock to be able to seek */ |
|---|
| 696 | | vlc_mutex_unlock( &p_input->stream.stream_lock ); |
|---|
| 697 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 698 | | playlist_Play( p_playlist ); |
|---|
| 699 | | input_Seek( p_input, i_seek, INPUT_SEEK_SET ); |
|---|
| 700 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 701 | | vlc_mutex_lock( &p_input->stream.stream_lock ); |
|---|
| 702 | | |
|---|
| 703 | | /* update the old value */ |
|---|
| 704 | | f_slider_old = f_slider; |
|---|
| 705 | | |
|---|
| 706 | | b_field_update = VLC_FALSE; |
|---|
| 707 | | } |
|---|
| 708 | | } |
|---|
| 709 | | |
|---|
| 710 | | if( b_field_update ) |
|---|
| 711 | | { |
|---|
| 712 | | NSString * o_time; |
|---|
| 713 | | char psz_time[ OFFSETTOTIME_MAX_SIZE ]; |
|---|
| 714 | | |
|---|
| 715 | | input_OffsetToTime( p_input, psz_time, p_area->i_tell ); |
|---|
| 716 | | |
|---|
| 717 | | o_time = [NSString stringWithUTF8String: psz_time]; |
|---|
| 718 | | [o_timefield setStringValue: o_time]; |
|---|
| 719 | | } |
|---|
| 720 | | vlc_mutex_unlock( &p_input->stream.stream_lock ); |
|---|
| | 665 | } |
|---|
| | 666 | |
|---|
| | 667 | var_Get( p_input, "time", &time ); |
|---|
| | 668 | i_seconds = time.i_time / 1000000; |
|---|
| | 669 | |
|---|
| | 670 | o_time = [NSString stringWithFormat: @"%d:%02d:%02d", |
|---|
| | 671 | (int) (i_seconds / (60 * 60)), |
|---|
| | 672 | (int) (i_seconds / 60 % 60), |
|---|
| | 673 | (int) (i_seconds % 60)]; |
|---|
| | 674 | [o_timefield setStringValue: o_time]; |
|---|
| 721 | 675 | |
|---|
| 722 | 676 | /* disable screen saver */ |
|---|
| 723 | 677 | UpdateSystemActivity( UsrActivity ); |
|---|
| 724 | | } |
|---|
| 725 | | |
|---|
| 726 | | #undef p_area |
|---|
| 727 | | |
|---|
| 728 | | if( p_input != NULL ) |
|---|
| 729 | | { |
|---|
| 730 | | vlc_mutex_unlock( &p_input->stream.stream_lock ); |
|---|
| 731 | 678 | } |
|---|
| 732 | 679 | |
|---|
| … | … | |
| 929 | 876 | - (IBAction)timesliderUpdate:(id)sender |
|---|
| 930 | 877 | { |
|---|
| | 878 | intf_thread_t * p_intf; |
|---|
| | 879 | input_thread_t * p_input; |
|---|
| 931 | 880 | float f_updated; |
|---|
| 932 | 881 | |
|---|
| … | … | |
| 935 | 884 | case NSLeftMouseUp: |
|---|
| 936 | 885 | case NSLeftMouseDown: |
|---|
| 937 | | f_slider = [sender floatValue]; |
|---|
| 938 | | return; |
|---|
| 939 | | |
|---|
| 940 | 886 | case NSLeftMouseDragged: |
|---|
| 941 | 887 | f_updated = [sender floatValue]; |
|---|
| … | … | |
| 946 | 892 | } |
|---|
| 947 | 893 | |
|---|
| 948 | | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| 949 | | |
|---|
| 950 | | playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, |
|---|
| 951 | | FIND_ANYWHERE ); |
|---|
| 952 | | |
|---|
| 953 | | if( p_playlist == NULL ) |
|---|
| 954 | | { |
|---|
| 955 | | return; |
|---|
| 956 | | } |
|---|
| 957 | | |
|---|
| 958 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 959 | | |
|---|
| 960 | | if( p_playlist->p_input != NULL ) |
|---|
| 961 | | { |
|---|
| 962 | | off_t i_tell; |
|---|
| | 894 | p_intf = [NSApp getIntf]; |
|---|
| | 895 | p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, |
|---|
| | 896 | FIND_ANYWHERE ); |
|---|
| | 897 | |
|---|
| | 898 | if( p_input != NULL ) |
|---|
| | 899 | { |
|---|
| | 900 | vlc_value_t time; |
|---|
| | 901 | mtime_t i_seconds; |
|---|
| 963 | 902 | NSString * o_time; |
|---|
| 964 | | char psz_time[ OFFSETTOTIME_MAX_SIZE ]; |
|---|
| 965 | | |
|---|
| 966 | | #define p_area p_playlist->p_input->stream.p_selected_area |
|---|
| 967 | | vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock ); |
|---|
| 968 | | i_tell = f_updated / 10000. * p_area->i_size; |
|---|
| 969 | | input_OffsetToTime( p_playlist->p_input, psz_time, i_tell ); |
|---|
| 970 | | vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock ); |
|---|
| 971 | | #undef p_area |
|---|
| 972 | | |
|---|
| 973 | | o_time = [NSString stringWithUTF8String: psz_time]; |
|---|
| 974 | | [o_timefield setStringValue: o_time]; |
|---|
| 975 | | } |
|---|
| 976 | | |
|---|
| 977 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 978 | | vlc_object_release( p_playlist ); |
|---|
| | 903 | |
|---|
| | 904 | if( p_input->stream.b_seekable ) |
|---|
| | 905 | { |
|---|
| | 906 | vlc_value_t pos; |
|---|
| | 907 | pos.f_float = f_updated / 10000.; |
|---|
| | 908 | if( f_slider != f_updated ) |
|---|
| | 909 | { |
|---|
| | 910 | var_Set( p_input, "position", pos ); |
|---|
| | 911 | [o_timeslider setFloatValue: f_updated]; |
|---|
| | 912 | } |
|---|
| | 913 | } |
|---|
| | 914 | |
|---|
| | 915 | var_Get( p_input, "time", &time ); |
|---|
| | 916 | i_seconds = time.i_time / 1000000; |
|---|
| | 917 | |
|---|
| | 918 | o_time = [NSString stringWithFormat: @"%d:%02d:%02d", |
|---|
| | 919 | (int) (i_seconds / (60 * 60)), |
|---|
| | 920 | (int) (i_seconds / 60 % 60), |
|---|
| | 921 | (int) (i_seconds % 60)]; |
|---|
| | 922 | [o_timefield setStringValue: o_time]; |
|---|
| | 923 | vlc_object_release( p_input ); |
|---|
| | 924 | } |
|---|
| 979 | 925 | } |
|---|
| 980 | 926 | |
|---|
| … | … | |
| 982 | 928 | { |
|---|
| 983 | 929 | NSEvent * o_event; |
|---|
| 984 | | vout_thread_t * p_vout; |
|---|
| 985 | 930 | playlist_t * p_playlist; |
|---|
| 986 | 931 | intf_thread_t * p_intf = [NSApp getIntf]; |
|---|
| … | … | |
| 996 | 941 | vlc_object_release( p_playlist ); |
|---|
| 997 | 942 | playlist_Destroy( p_playlist ); |
|---|
| 998 | | } |
|---|
| 999 | | |
|---|
| 1000 | | /* |
|---|
| 1001 | | * Free video outputs |
|---|
| 1002 | | */ |
|---|
| 1003 | | msg_Dbg( p_intf, "removing all video outputs" ); |
|---|
| 1004 | | while( (p_vout = vlc_object_find( p_intf->p_vlc, |
|---|
| 1005 | | VLC_OBJECT_VOUT, FIND_CHILD )) ) |
|---|
| 1006 | | { |
|---|
| 1007 | | vlc_object_detach( p_vout ); |
|---|
| 1008 | | vlc_object_release( p_vout ); |
|---|
| 1009 | | vout_Destroy( p_vout ); |
|---|
| 1010 | 943 | } |
|---|
| 1011 | 944 | |
|---|
| r07d406a |
r47d57d6 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2002-2003 VideoLAN |
|---|
| 5 | | * $Id: playlist.m,v 1.31 2003/09/19 23:03:27 hartman Exp $ |
|---|
| | 5 | * $Id: playlist.m,v 1.32 2003/09/20 13:46:00 hartman Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> |
|---|
| … | … | |
| 33 | 33 | #include "intf.h" |
|---|
| 34 | 34 | #include "playlist.h" |
|---|
| | 35 | #include "controls.h" |
|---|
| 35 | 36 | |
|---|
| 36 | 37 | int MacVersion102 = -1; |
|---|
| … | … | |
| 81 | 82 | { |
|---|
| 82 | 83 | case ' ': |
|---|
| 83 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 84 | | if( p_playlist->p_input != NULL ) |
|---|
| 85 | | { |
|---|
| 86 | | input_SetStatus( p_playlist->p_input, INPUT_STATUS_PAUSE ); |
|---|
| 87 | | } |
|---|
| 88 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| | 84 | [(VLCControls *)[[NSApp delegate] getControls] play: nil]; |
|---|
| 89 | 85 | break; |
|---|
| 90 | 86 | |
|---|
| … | … | |
| 232 | 228 | FIND_ANYWHERE ); |
|---|
| 233 | 229 | |
|---|
| 234 | | if( p_playlist == NULL ) |
|---|
| 235 | | { |
|---|
| 236 | | return; |
|---|
| 237 | | } |
|---|
| 238 | | |
|---|
| 239 | | playlist_Goto( p_playlist, [o_table_view selectedRow] ); |
|---|
| 240 | | |
|---|
| 241 | | vlc_object_release( p_playlist ); |
|---|
| | 230 | if( p_playlist != NULL ) |
|---|
| | 231 | { |
|---|
| | 232 | playlist_Goto( p_playlist, [o_table_view selectedRow] ); |
|---|
| | 233 | vlc_object_release( p_playlist ); |
|---|
| | 234 | } |
|---|
| 242 | 235 | } |
|---|
| 243 | 236 | |
|---|
| … | … | |
| 258 | 251 | |
|---|
| 259 | 252 | o_to_delete = [NSMutableArray arrayWithArray:[[o_table_view selectedRowEnumerator] allObjects]]; |
|---|
| 260 | | c = [o_to_delete count]; |
|---|
| | 253 | c = (int)[o_to_delete count]; |
|---|
| 261 | 254 | |
|---|
| 262 | 255 | for( i = 0; i < c; i++ ) { |
|---|
| r00a3f0e |
r47d57d6 |
|
| 4 | 4 | ***************************************************************************** |
|---|
| 5 | 5 | * Copyright (C) 2001-2003 VideoLAN |
|---|
| 6 | | * $Id: vout.m,v 1.55 2003/08/25 14:51:47 garf Exp $ |
|---|
| | 6 | * $Id: vout.m,v 1.56 2003/09/20 13:46:00 hartman Exp $ |
|---|
| 7 | 7 | * |
|---|
| 8 | 8 | * Authors: Colin Delacroix <colin@zoy.org> |
|---|
| … | … | |
| 428 | 428 | { |
|---|
| 429 | 429 | vlc_bool_t b_playing = NO; |
|---|
| 430 | | playlist_t * p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST, |
|---|
| | 430 | input_thread_t * p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, |
|---|
| 431 | 431 | FIND_ANYWHERE ); |
|---|
| 432 | 432 | |
|---|
| 433 | | if ( p_playlist != nil ) |
|---|
| | 433 | if ( p_input != NULL ) |
|---|
| 434 | 434 | { |
|---|
| 435 | | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 436 | | if( p_playlist->p_input != NULL ) |
|---|
| 437 | | { |
|---|
| 438 | | vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock ); |
|---|
| 439 | | b_playing = p_playlist->p_input->stream.control.i_status != PAUSE_S; |
|---|
| 440 | | vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock ); |
|---|
| 441 | | } |
|---|
| 442 | | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 443 | | vlc_object_release( p_playlist ); |
|---|
| | 435 | vlc_value_t state; |
|---|
| | 436 | var_Get( p_input, "state", &state ); |
|---|
| | 437 | b_playing = state.i_int != PAUSE_S; |
|---|
| | 438 | vlc_object_release( p_input ); |
|---|
| 444 | 439 | } |
|---|
| 445 | 440 | if ( !b_playing ) |
|---|
| … | … | |
| 986 | 981 | - (void)keyDown:(NSEvent *)o_event |
|---|
| 987 | 982 | { |
|---|
| | 983 | playlist_t * p_playlist; |
|---|
| 988 | 984 | unichar key = 0; |
|---|
| 989 | 985 | vlc_value_t val; |
|---|
| … | … | |
| 1012 | 1008 | |
|---|
| 1013 | 1009 | case ' ': |
|---|
| 1014 | | input_SetStatus( p_vout, INPUT_STATUS_PAUSE ); |
|---|
| | 1010 | p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST, |
|---|
| | 1011 | FIND_ANYWHERE ); |
|---|
| | 1012 | if ( p_playlist != NULL ) |
|---|
| | 1013 | { |
|---|
| | 1014 | playlist_Pause( p_playlist ); |
|---|
| | 1015 | vlc_object_release( p_playlist); |
|---|
| | 1016 | } |
|---|
| 1015 | 1017 | break; |
|---|
| 1016 | 1018 | |
|---|