~ubuntu-branches/ubuntu/utopic/vlc/utopic

« back to all changes in this revision

Viewing changes to modules/gui/macosx/intf.m

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2012-02-18 01:29:48 UTC
  • mfrom: (1.1.45) (3.5.32 sid)
  • Revision ID: package-import@ubuntu.com-20120218012948-tvq9nhnfi98kra44
Tags: 2.0.0-1
* New upstream release (Closes: #499381, #573064, #624027, LP: #455825,
  #573775, #695882, #705151, #708448, #738381, #743581, #747757, #817924,
  #931083).
* Remove dropped mozilla-plugin-vlc, vlc-plugin-ggi, and vlc-plugin-svgalib.
  The Mozilla browser plug-in is now provided by a separate source tarball.
* Add new plugins to and remove dropped plugins from vlc-nox.
* Add new and remove dropped build dependencies:
  + libbluray-dev (for Blu-ray support)
  + libresid-builder-dev
  + libsamplerate0-dev
  + libsidplay2-dev
  + lbspeexdsp-dev
  + libxcb-composite0-dev
  - libgtk2.0-dev
  - xulrunner-dev
* vlc-plugin-fluidsynth depends on fluid-soundfont-gm or
  musescore-soundfont-gm for having a sound font for playing MIDI files.
* Drop all patches (they were either backported or accepted by upstream).
* Update symbols for libvlc5.
* Install plugins.dat instead of running vlc-cache-gen in postinst.
* Update minimum version of build dependencies.
* Change Build-Dependency from libupnp3-dev to unversioned libupnp-dev.
  (Closes: #656831)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * intf.m: MacOS X interface module
3
3
 *****************************************************************************
4
4
 * Copyright (C) 2002-2012 VLC authors and VideoLAN
5
 
 * $Id: 88148db2195ba0c2824e09f5a26aea1b31dfdbff $
 
5
 * $Id: b635111a30f08a8fc2574e667cdd9297c4cf5a3b $
6
6
 *
7
7
 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8
8
 *          Christophe Massiot <massiot@via.ecp.fr>
188
188
 * Run: main loop
189
189
 *****************************************************************************/
190
190
static NSLock * o_appLock = nil;    // controls access to f_appExit
191
 
static int f_appExit = 0;           // set to 1 when application termination signaled
192
191
 
193
192
static void Run( intf_thread_t *p_intf )
194
193
{
195
 
    sigset_t set;
196
 
 
197
 
    /* Make sure the "force quit" menu item does quit instantly.
198
 
     * VLC overrides SIGTERM which is sent by the "force quit"
199
 
     * menu item to make sure daemon mode quits gracefully, so
200
 
     * we un-override SIGTERM here. */
201
 
    sigemptyset( &set );
202
 
    sigaddset( &set, SIGTERM );
203
 
    pthread_sigmask( SIG_UNBLOCK, &set, NULL );
204
 
 
205
194
    NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
206
195
    [VLCApplication sharedApplication];
207
196
 
688
677
 
689
678
- (void)applicationWillTerminate:(NSNotification *)notification
690
679
{
691
 
    if( !p_intf )
692
 
        return;
693
 
 
694
680
    /* don't allow a double termination call. If the user has
695
681
     * already invoked the quit then simply return this time. */
696
 
    int isTerminating = false;
 
682
    static bool f_appExit = false;
 
683
    bool isTerminating;
697
684
 
698
685
    [o_appLock lock];
699
 
    isTerminating = (f_appExit++ > 0 ? 1 : 0);
 
686
    isTerminating = f_appExit;
 
687
    f_appExit = true;
700
688
    [o_appLock unlock];
701
689
 
702
690
    if (isTerminating)
713
701
    config_PutInt( p_intf, "loop", var_GetBool( p_playlist, "loop" ) );
714
702
    config_PutInt( p_intf, "repeat", var_GetBool( p_playlist, "repeat" ) );
715
703
 
716
 
    // save stuff
717
 
    config_SaveConfigFile( p_intf );
718
 
 
719
704
    msg_Dbg( p_intf, "Terminating" );
720
705
 
721
706
    /* unsubscribe from the interactive dialogues */
740
725
    var_DelCallback(p_intf->p_libvlc, "intf-toggle-fscontrol", ShowController, self);
741
726
    var_DelCallback(p_intf->p_libvlc, "intf-show", ShowController, self);
742
727
 
 
728
    input_thread_t * p_input = playlist_CurrentInput( p_playlist );
 
729
    if( p_input )
 
730
    {
 
731
        var_DelCallback( p_input, "intf-event", InputEvent, [VLCMain sharedInstance] );
 
732
        vlc_object_release( p_input );
 
733
    }
 
734
 
743
735
    /* remove global observer watching for vout device changes correctly */
744
736
    [[NSNotificationCenter defaultCenter] removeObserver: self];
745
737
 
878
870
    if( !psz_uri )
879
871
        return( FALSE );
880
872
 
 
873
    input_thread_t * p_input = pl_CurrentInput( VLCIntf );
 
874
    BOOL b_returned = NO;
 
875
 
 
876
    if (p_input)
 
877
    {
 
878
        b_returned = input_AddSubtitle( p_input, psz_uri, true );
 
879
        vlc_object_release( p_input );
 
880
        if(!b_returned)
 
881
        {
 
882
            free( psz_uri );
 
883
            return YES;
 
884
        }
 
885
    }
 
886
    else if( p_input )
 
887
        vlc_object_release( p_input );
 
888
 
881
889
    NSDictionary *o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
882
890
 
883
891
    free( psz_uri );
1365
1373
            if( p_input != NULL && [self activeVideoPlayback] )
1366
1374
            {
1367
1375
                [o_mainwindow performSelectorOnMainThread:@selector(enterFullscreen) withObject:nil waitUntilDone:NO];
 
1376
            }
 
1377
            if (p_input)
1368
1378
                vlc_object_release( p_input );
1369
 
            }
1370
1379
        }
1371
1380
        else
1372
1381
        {
1385
1394
    {
1386
1395
        var_AddCallback( p_input, "intf-event", InputEvent, [VLCMain sharedInstance] );
1387
1396
        [o_mainmenu setRateControlsEnabled: YES];
1388
 
        vlc_object_release( p_input );
1389
1397
    }
1390
1398
    else
1391
1399
        [o_mainmenu setRateControlsEnabled: NO];
1392
1400
 
 
1401
    if (p_input)
 
1402
        vlc_object_release( p_input );
 
1403
 
1393
1404
    [o_playlist updateRowSelection];
1394
1405
    [o_mainwindow updateWindow];
1395
1406
    [self updateMainMenu];