static bool checkProgressPanel (void *);
static void destroyProgressPanel (void *);
-static void MsgCallback( void *, const msg_item_t * );
+static void MsgCallback( void *data, int type, const msg_item_t *item, const char *format, va_list ap );
static int InputEvent( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
* ready to be displayed. We store everything in a NSArray in our Cocoa part
* of this file.
*****************************************************************************/
-static void MsgCallback( void *data, const msg_item_t *item )
+static void MsgCallback( void *data, int type, const msg_item_t *item, const char *format, va_list ap )
{
int canc = vlc_savecancel();
+ char *str;
- /* this may happen from time to time, let's bail out as info would be useless anyway */
- if( !item->psz_module || !item->psz_msg )
+ if (vasprintf( &str, format, ap ) == -1)
+ {
+ vlc_restorecancel( canc );
return;
+ }
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
- [[VLCMain sharedInstance] processReceivedlibvlcMessage: item];
+ [[VLCMain sharedInstance] processReceivedlibvlcMessage: item ofType: type withStr: str];
[o_pool release];
vlc_restorecancel( canc );
+ free( str );
}
static int InputEvent( vlc_object_t *p_this, const char *psz_var,
break;
case INPUT_EVENT_ABORT:
+ [[VLCMain sharedInstance] updateName];
+ [[VLCMain sharedInstance] updatePlaybackPosition];
break;
default:
[o_remote setDelegate: _o_sharedMainInstance];
/* yeah, we are done */
+ b_nativeFullscreenMode = config_GetInt( p_intf, "macosx-nativefullscreenmode" );
nib_main_loaded = TRUE;
}
playlist_t * p_playlist = pl_Get( VLCIntf );
BOOL b_fullscreen = var_GetBool( p_playlist, "fullscreen" );
- if (OSX_LION)
+ if (OSX_LION && b_nativeFullscreenMode)
{
[o_mainwindow toggleFullScreen: self];
if(b_fullscreen)
[self playbackStatusUpdated];
[o_playlist playlistUpdated];
[o_mainwindow updateWindow];
+ [o_mainwindow updateName];
}
- (void)updateRecordState: (BOOL)b_value
}
}
-- (void)processReceivedlibvlcMessage:(const msg_item_t *)item
+- (void)processReceivedlibvlcMessage:(const msg_item_t *) item ofType: (int)i_type withStr: (char *)str
{
NSColor *o_white = [NSColor whiteColor];
NSColor *o_red = [NSColor redColor];
NSDictionary *o_attr;
NSAttributedString *o_msg_color;
- int i_type = item->i_type;
-
[o_msg_lock lock];
if( [o_msg_arr count] + 2 > 600 )
[o_msg_arr addObject: [o_msg_color autorelease]];
o_attr = [NSDictionary dictionaryWithObject: pp_color[i_type] forKey: NSForegroundColorAttributeName];
- o_msg_color = [[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%s\n", item->psz_msg] attributes: o_attr];
+ o_msg_color = [[NSAttributedString alloc] initWithString: [NSString stringWithFormat: @"%s\n", str] attributes: o_attr];
[o_msg_arr addObject: [o_msg_color autorelease]];
b_msg_arr_changed = YES;