]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/intf.m
macosx: renamed getVoutView to voutView in order to make it conform to the cocoa...
[vlc] / modules / gui / macosx / intf.m
index 0b9360df257e4e6f3c9a995680c3d0634bd2a87c..4785786cdfa7095071ddbbe669ae8d3f218b7733 100644 (file)
@@ -55,6 +55,7 @@
 #import "AppleRemote.h"
 #import "eyetv.h"
 #import "simple_prefs.h"
+#import "vlm.h"
 
 #import <vlc_input.h>
 #import <vlc_interface.h>
@@ -248,6 +249,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     o_prefs = nil;
     o_open = [[VLCOpen alloc] init];
     o_wizard = [[VLCWizard alloc] init];
+    o_vlm = [[VLCVLMController alloc] init];
     o_extended = nil;
     o_bookmarks = [[VLCBookmarks alloc] init];
     o_embedded_list = [[VLCEmbeddedList alloc] init];
@@ -395,7 +397,7 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     o_size_with_playlist = [o_window contentRectForFrameRect:[o_window frame]].size;
 
-    p_playlist = pl_Yield( p_intf );
+    p_playlist = pl_Hold( p_intf );
 
     var_Create( p_playlist, "fullscreen", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
     val.b_bool = false;
@@ -745,7 +747,7 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     /* Kill the playlist, so that it doesn't accept new request
      * such as the play request from vlc.c (we are a blocking interface). */
-    p_playlist = pl_Yield( p_intf );
+    p_playlist = pl_Hold( p_intf );
     vlc_object_kill( p_playlist );
     pl_Release( p_intf );
 
@@ -1291,6 +1293,11 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
     return nil;
 }
 
+- (id)getVLM
+{
+    return o_vlm;
+}
+
 - (id)getBookmarks
 {
     if( o_bookmarks )
@@ -1394,7 +1401,7 @@ static void * manage_cleanup( void * args )
 
     vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW );
 
-    p_playlist = pl_Yield( p_intf );
+    p_playlist = pl_Hold( p_intf );
 
     var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self );
     var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
@@ -1441,6 +1448,7 @@ static void * manage_cleanup( void * args )
         vlc_mutex_unlock( &p_intf->change_lock );
 
         msleep( INTF_IDLE_SLEEP );
+
         [pool release];
     }
 
@@ -1486,7 +1494,7 @@ static void * manage_cleanup( void * args )
         bool b_seekable = false;
         bool b_chapters = false;
 
-        playlist_t * p_playlist = pl_Yield( p_intf );
+        playlist_t * p_playlist = pl_Hold( p_intf );
     /* TODO: fix i_size use */
         b_plmul = p_playlist->items.i_size > 1;
 
@@ -1591,7 +1599,7 @@ static void * manage_cleanup( void * args )
             [self setScrollField: aString stopAfter:-1];
             [[[self getControls] getFSPanel] setStreamTitle: aString];
 
-            [[o_controls getVoutView] updateTitle];
+            [[o_controls voutView] updateTitle];
  
             [o_playlist updateRowSelection];
             p_intf->p_sys->b_current_title_update = FALSE;
@@ -1674,7 +1682,7 @@ end:
 
 - (void)setupMenus
 {
-    playlist_t * p_playlist = pl_Yield( p_intf );
+    playlist_t * p_playlist = pl_Hold( p_intf );
     input_thread_t * p_input = playlist_CurrentInput( p_playlist );
     if( p_input != NULL )
     {
@@ -1787,19 +1795,18 @@ end:
 
 - (void)resetScrollField
 {
-    playlist_t * p_playlist = pl_Yield( p_intf );
+    playlist_t * p_playlist = pl_Hold( p_intf );
     input_thread_t * p_input = playlist_CurrentInput( p_playlist );
 
     i_end_scroll = -1;
     if( p_input && vlc_object_alive (p_input) )
     {
         NSString *o_temp;
-        if( input_item_GetNowPlaying ( p_playlist->status.p_item->p_input ) )
-            o_temp = [NSString stringWithUTF8String: 
-                input_item_GetNowPlaying ( p_playlist->status.p_item->p_input )];
+        playlist_item_t * p_item = playlist_CurrentPlayingItem( p_playlist );
+        if( input_item_GetNowPlaying( p_item->p_input ) )
+            o_temp = [NSString stringWithUTF8String:input_item_GetNowPlaying( p_item->p_input )];
         else
-            o_temp = [NSString stringWithUTF8String:
-                p_playlist->status.p_item->p_input->psz_name];
+            o_temp = [NSString stringWithUTF8String:p_item->p_input->psz_name];
         [self setScrollField: o_temp stopAfter:-1];
         [[[self getControls] getFSPanel] setStreamTitle: o_temp];
         vlc_object_release( p_input );
@@ -1869,7 +1876,7 @@ end:
         default:
             return;
     }
-    p_playlist = pl_Yield( p_intf );
+    p_playlist = pl_Hold( p_intf );
     p_input = playlist_CurrentInput( p_playlist );
     if( p_input != NULL )
     {
@@ -1984,6 +1991,14 @@ end:
     }
 }
 
+- (IBAction)showVLM:(id)sender
+{
+    if( !nib_vlm_loaded )
+        nib_vlm_loaded = [NSBundle loadNibNamed:@"VLM" owner:self];
+
+    [o_vlm showVLMWindow];
+}
+
 - (IBAction)showExtended:(id)sender
 {
     if( o_extended == nil )
@@ -2276,7 +2291,7 @@ end:
         return;
     }
 
-    NSArray * ourPreferences = [NSArray arrayWithObjects:@"org.videolan.vlc.plist", @"VLC"];
+    NSArray * ourPreferences = [NSArray arrayWithObjects:@"org.videolan.vlc.plist", @"VLC", nil];
 
     /* Move the file to trash so that user can find them later */
     [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:nil files:ourPreferences tag:0];