Commit aa9bce0b authored by Felix Paul Kühne's avatar Felix Paul Kühne

Reworked the Media Information panel

Nicer, easier to use, less memory consuming, faster and prepared for meta data editing.
parent 84dee346
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>328 138 478 430 0 0 1280 778 </string>
<key>IBEditorPositions</key>
<dict>
<key>1617</key>
<string>788 586 109 149 0 0 1440 878 </string>
<key>2197</key>
<string>342 466 596 143 0 0 1280 778 </string>
<key>2709</key>
<string>305 626 508 82 0 0 1024 746 </string>
<key>2730</key>
<string>348 431 130 249 0 0 1280 778 </string>
<key>29</key>
<string>109 706 438 44 0 0 1280 778 </string>
<key>915</key>
<string>777 479 187 249 0 0 1440 878 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBLockedObjects</key>
<array/>
<string>644</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../../vlc.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>2769</integer>
<integer>21</integer>
<integer>2730</integer>
<integer>2416</integer>
<integer>1789</integer>
<integer>29</integer>
<integer>2197</integer>
<integer>21</integer>
<integer>24</integer>
<integer>2769</integer>
<integer>1779</integer>
</array>
<key>IBSystem Version</key>
<string>8S2167</string>
<string>9C31</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>CLASS</key>
<string>NSApplication</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSResponder</string>
</dict>
<dict>
<key>CLASS</key>
<string>NSObject</string>
<key>LANGUAGE</key>
<string>ObjC</string>
</dict>
<dict>
<key>ACTIONS</key>
<dict>
<key>createOutlineGroup</key>
<string>id</string>
<key>deleteOutlineGroup</key>
<string>id</string>
<key>saveMetaData</key>
<string>id</string>
<key>toggleInfoPanel</key>
<string>id</string>
<key>togglePlaylistInfoPanel</key>
<string>id</string>
</dict>
<key>CLASS</key>
<string>VLCInfo</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>OUTLETS</key>
<dict>
<key>o_audio_box</key>
<string>id</string>
<key>o_audio_decoded_lbl</key>
<string>id</string>
<key>o_audio_decoded_txt</key>
<string>id</string>
<key>o_author_lbl</key>
<string>id</string>
<key>o_author_txt</key>
<string>id</string>
<key>o_collection_lbl</key>
<string>id</string>
<key>o_collection_txt</key>
<string>id</string>
<key>o_copyright_lbl</key>
<string>id</string>
<key>o_copyright_txt</key>
<string>id</string>
<key>o_date_lbl</key>
<string>id</string>
<key>o_date_txt</key>
<string>id</string>
<key>o_demux_bitrate_lbl</key>
<string>id</string>
<key>o_demux_bitrate_txt</key>
<string>id</string>
<key>o_demux_bytes_lbl</key>
<string>id</string>
<key>o_demux_bytes_txt</key>
<string>id</string>
<key>o_description_lbl</key>
<string>id</string>
<key>o_description_txt</key>
<string>id</string>
<key>o_displayed_lbl</key>
<string>id</string>
<key>o_displayed_txt</key>
<string>id</string>
<key>o_fps_lbl</key>
<string>id</string>
<key>o_fps_txt</key>
<string>id</string>
<key>o_genre_lbl</key>
<string>id</string>
<key>o_genre_txt</key>
<string>id</string>
<key>o_image_well</key>
<string>id</string>
<key>o_info_window</key>
<string>id</string>
<key>o_input_bitrate_lbl</key>
<string>id</string>
<key>o_input_bitrate_txt</key>
<string>id</string>
<key>o_input_box</key>
<string>id</string>
<key>o_language_lbl</key>
<string>id</string>
<key>o_language_txt</key>
<string>id</string>
<key>o_lost_abuffers_lbl</key>
<string>id</string>
<key>o_lost_abuffers_txt</key>
<string>id</string>
<key>o_lost_frames_lbl</key>
<string>id</string>
<key>o_lost_frames_txt</key>
<string>id</string>
<key>o_nowPlaying_lbl</key>
<string>id</string>
<key>o_nowPlaying_txt</key>
<string>id</string>
<key>o_outline_view</key>
<string>id</string>
<key>o_played_abuffers_lbl</key>
<string>id</string>
<key>o_played_abuffers_txt</key>
<string>id</string>
<key>o_publisher_lbl</key>
<string>id</string>
<key>o_publisher_txt</key>
<string>id</string>
<key>o_read_bytes_lbl</key>
<string>id</string>
<key>o_read_bytes_txt</key>
<string>id</string>
<key>o_saveMetaData_btn</key>
<string>id</string>
<key>o_sent_bitrate_lbl</key>
<string>id</string>
<key>o_sent_bitrate_txt</key>
<string>id</string>
<key>o_sent_bytes_lbl</key>
<string>id</string>
<key>o_sent_bytes_txt</key>
<string>id</string>
<key>o_sent_packets_lbl</key>
<string>id</string>
<key>o_sent_packets_txt</key>
<string>id</string>
<key>o_seqNum_lbl</key>
<string>id</string>
<key>o_seqNum_txt</key>
<string>id</string>
<key>o_sout_box</key>
<string>id</string>
<key>o_tab_view</key>
<string>id</string>
<key>o_title_lbl</key>
<string>id</string>
<key>o_title_txt</key>
<string>id</string>
<key>o_uri_lbl</key>
<string>id</string>
<key>o_uri_txt</key>
<string>id</string>
<key>o_video_box</key>
<string>id</string>
<key>o_video_decoded_lbl</key>
<string>id</string>
<key>o_video_decoded_txt</key>
<string>id</string>
</dict>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>644</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../../vlc.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>8</integer>
</array>
<key>IBSystem Version</key>
<string>9C31</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
/*****************************************************************************
* intf.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2007 the VideoLAN team
* Copyright (C) 2002-2008 the VideoLAN team
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan dot org>
* Felix Kühne <fkuehne at videolan dot org>
* Felix Paul Kühne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -106,6 +106,7 @@ struct intf_sys_t
id o_embedded_list; /* VLCEmbeddedList*/
id o_interaction_list; /* VLCInteractionList*/
id o_sfilters; /* VLCsFilters */
id o_info; /* VLCInformation */
#ifdef UPDATE_CHECK
id o_update; /* VLCUpdate */
#endif
......@@ -119,6 +120,7 @@ struct intf_sys_t
BOOL nib_sfilters_loaded; /* sfilters nibfile */
BOOL nib_prefs_loaded; /* preferences nibfile */
BOOL nib_update_loaded; /* update nibfile */
BOOL nib_info_loaded; /* information panel nibfile */
IBOutlet id o_window; /* main window */
IBOutlet id o_playlist_view;/* playlist view */
......@@ -148,7 +150,6 @@ struct intf_sys_t
IBOutlet id o_controls; /* VLCControls */
IBOutlet id o_playlist; /* VLCPlaylist */
IBOutlet id o_info; /* VLCInfo */
IBOutlet id o_messages; /* messages tv */
IBOutlet id o_msgs_panel; /* messages panel */
......@@ -156,8 +157,6 @@ struct intf_sys_t
NSLock * o_msg_lock; /* messages lock */
IBOutlet id o_msgs_btn_crashlog; /* messages open crashlog */
IBOutlet id o_info_window; /* Info panel */
/* main menu */
IBOutlet id o_mi_about;
......@@ -370,6 +369,7 @@ struct intf_sys_t
- (IBAction)openCrashLog:(id)sender;
- (IBAction)viewErrorsAndWarnings:(id)sender;
- (IBAction)showMessagesPanel:(id)sender;
- (IBAction)showInformationPanel:(id)sender;
- (IBAction)togglePlaylist:(id)sender;
- (void)updateTogglePlaylistState;
......
/*****************************************************************************
* intf.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2007 the VideoLAN team
* Copyright (C) 2002-2008 the VideoLAN team
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -41,6 +41,7 @@
#import "vout.h"
#import "prefs.h"
#import "playlist.h"
#import "playlistinfo.h"
#import "controls.h"
#import "about.h"
#import "open.h"
......@@ -427,6 +428,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_bookmarks = [[VLCBookmarks alloc] init];
o_embedded_list = [[VLCEmbeddedList alloc] init];
o_interaction_list = [[VLCInteractionList alloc] init];
o_info = [[VLCInfo alloc] init];
o_sfilters = nil;
#ifdef UPDATE_CHECK
o_update = [[VLCUpdate alloc] init];
......@@ -781,8 +783,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_vmi_mute setTitle: _NS("Mute")];
[o_vmi_fullscreen setTitle: _NS("Fullscreen")];
[o_vmi_snapshot setTitle: _NS("Snapshot")];
[o_info_window setTitle: _NS("Media Information")];
}
- (void)applicationWillFinishLaunching:(NSNotification *)o_notification
......@@ -1812,6 +1812,9 @@ static VLCMain *_o_sharedMainInstance = nil;
if( nib_bookmarks_loaded && o_bookmarks )
[o_bookmarks release];
if( nib_info_loaded && o_info )
[o_info release];
if( nib_wizard_loaded && o_wizard )
[o_wizard release];
......@@ -2096,7 +2099,7 @@ static VLCMain *_o_sharedMainInstance = nil;
}
else
{
NSBeginInformationalAlertSheet(_NS("No CrashLog found"), @"Continue", nil, nil, o_msgs_panel, self, NULL, NULL, nil, _NS("Couldn't find any trace of a previous crash.") );
NSBeginInformationalAlertSheet(_NS("No CrashLog found"), _NS("Continue"), nil, nil, o_msgs_panel, self, NULL, NULL, nil, _NS("Couldn't find any trace of a previous crash.") );
}
}
......@@ -2111,6 +2114,14 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_msgs_panel makeKeyAndOrderFront: sender];
}
- (IBAction)showInformationPanel:(id)sender
{
if(! nib_info_loaded )
nib_info_loaded = [NSBundle loadNibNamed:@"MediaInfo" owner: self];
[o_info initPanel];
}
- (void)windowDidBecomeKey:(NSNotification *)o_notification
{
if( [o_notification object] == o_msgs_panel )
......
/*****************************************************************************
* playlistinfo.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2006 the VideoLAN team
* Copyright (C) 2002-2008 the VideoLAN team
* $Id$
*
* Authors: Benjamin Pracht <bigben at videolan dot org>
* Felix Kühne <fkuehne at videolan dot org>
* Felix Paul Kühne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -36,10 +36,6 @@
IBOutlet id o_uri_txt;
IBOutlet id o_title_txt;
IBOutlet id o_author_txt;
IBOutlet id o_btn_ok;
IBOutlet id o_btn_cancel;
IBOutlet id o_btn_delete_group;
IBOutlet id o_btn_add_group;
IBOutlet id o_outline_view;
IBOutlet id o_tab_view;
......@@ -60,10 +56,10 @@
IBOutlet id o_nowPlaying_txt;
IBOutlet id o_publisher_lbl;
IBOutlet id o_publisher_txt;
IBOutlet id o_rating_lbl;
IBOutlet id o_rating_txt;
IBOutlet id o_seqNum_lbl;
IBOutlet id o_seqNum_txt;
IBOutlet id o_image_well;
IBOutlet id o_saveMetaData_btn;
IBOutlet id o_audio_box;
IBOutlet id o_audio_decoded_lbl;
......@@ -102,17 +98,16 @@
NSTimer * o_statUpdateTimer;
}
- (IBAction)togglePlaylistInfoPanel:(id)sender;
- (IBAction)toggleInfoPanel:(id)sender;
- (void)initPanel:(id)sender;
- (void)initPanel;
- (IBAction)saveMetaData:(id)sender;
- (void)updatePanel;
- (IBAction)infoCancel:(id)sender;
- (IBAction)infoOk:(id)sender;
- (playlist_item_t *)getItem;
- (BOOL)isItemInPlaylist:(playlist_item_t *)p_item;
- (void)setMeta: (char *)meta forLabel: (id)theItem;
- (void)updateStatistics: (NSTimer*)theTimer;
+ (VLCInfo *)sharedInstance;
@end
@interface VLCInfoTreeItem : NSObject
......
/*****************************************************************************
r playlistinfo.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2007 the VideoLAN team
* Copyright (C) 2002-2008 the VideoLAN team
* $Id$
*
* Authors: Benjamin Pracht <bigben at videolan dot org>
* Felix Kühne <fkuehne at videolan dot org>
* Felix Paul Kühne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -36,31 +36,42 @@
@implementation VLCInfo
static VLCInfo *_o_sharedInstance = nil;
+ (VLCInfo *)sharedInstance
{
return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
}
- (id)init
{
self = [super init];
if( _o_sharedInstance ) {
[self dealloc];
} else {
_o_sharedInstance = [super init];
if( self != nil )
if( _o_sharedInstance != nil )
{
p_item = NULL;
o_statUpdateTimer = nil;
}
return( self );
}
return _o_sharedInstance;
}
- (void)awakeFromNib
{
[o_info_window setExcludedFromWindowsMenu: TRUE];
[o_info_window setTitle: _NS("Information")];
[o_uri_lbl setStringValue: _NS("URI")];
[o_info_window setTitle: _NS("Media Information")];
[o_uri_lbl setStringValue: _NS("Location")];
[o_title_lbl setStringValue: _NS("Title")];
[o_author_lbl setStringValue: _NS("Author")];
[o_btn_ok setTitle: _NS("OK")];
[o_btn_cancel setTitle: _NS("Cancel")];
[o_author_lbl setStringValue: _NS("Artist")];
[o_saveMetaData_btn setStringValue: _NS("Save Metadata" )];
[[o_tab_view tabViewItemAtIndex: 0] setLabel: _NS("General")];
[[o_tab_view tabViewItemAtIndex: 1] setLabel: _NS("Advanced Information")];
[[o_tab_view tabViewItemAtIndex: 1] setLabel: _NS("Codec Details")];
[[o_tab_view tabViewItemAtIndex: 2] setLabel: _NS("Statistics")];
[o_tab_view selectTabViewItemAtIndex: 0];
......@@ -70,7 +81,6 @@
[o_collection_lbl setStringValue: _NS(VLC_META_COLLECTION)];
[o_seqNum_lbl setStringValue: _NS(VLC_META_SEQ_NUM)];
[o_description_lbl setStringValue: _NS(VLC_META_DESCRIPTION)];
[o_rating_lbl setStringValue: _NS(VLC_META_RATING)];
[o_date_lbl setStringValue: _NS(VLC_META_DATE)];
[o_language_lbl setStringValue: _NS(VLC_META_LANGUAGE)];
[o_nowPlaying_lbl setStringValue: _NS(VLC_META_NOW_PLAYING)];
......@@ -112,40 +122,7 @@
[super dealloc];
}
- (IBAction)togglePlaylistInfoPanel:(id)sender
{
if( [o_info_window isVisible] )
{
[self windowShouldClose: nil];
[o_info_window orderOut: sender];
}
else
{
p_item = [[[VLCMain sharedInstance] getPlaylist] selectedPlaylistItem];
[self initPanel:sender];
}
}
- (IBAction)toggleInfoPanel:(id)sender
{
if( [o_info_window isVisible] )
{
[self windowShouldClose: nil];
[o_info_window orderOut: sender];
}
else
{
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Yield( p_intf );
p_item = p_playlist->status.p_item;
vlc_object_release( p_playlist );
[self initPanel:sender];
}
}
- (void)initPanel:(id)sender
- (void)initPanel
{
BOOL b_stats = config_GetInt(VLCIntf, "stats");
if( b_stats )
......@@ -163,7 +140,7 @@
}
[self updatePanel];
[o_info_window makeKeyAndOrderFront: sender];
[o_info_window makeKeyAndOrderFront: self];
}
- (void)updatePanel
......@@ -198,7 +175,6 @@
SET( seqNum, TrackNum );
SET( genre, Genre );
SET( copyright, Copyright );
SET( rating, Rating );
SET( publisher, Publisher );
SET( nowPlaying, NowPlaying );
SET( language, Language );
......@@ -206,6 +182,18 @@
#undef SET
char *psz_meta;
NSImage *o_image;
/* FIXME!!
psz_meta = input_item_GetArtURL( p_item );
if( psz_meta && !strncmp( psz_meta, "file://", 7 ) )
o_image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString: [NSString stringWithUTF8String: psz_meta]]];
else */
o_image = [[NSImage imageNamed: @"noart.png"] retain];
[o_image_well setImage: o_image];
[o_image release];
//free( psz_meta );
/* reload the advanced table */
[[VLCInfoTreeItem rootItem] refresh];
[o_outline_view reloadData];
......@@ -218,16 +206,12 @@
{
if( psz_meta != NULL && *psz_meta)
[theItem setStringValue: [NSString stringWithUTF8String:psz_meta]];
else
[theItem setStringValue: @"-"];
}
- (void)updateStatistics:(NSTimer*)theTimer
{
if( [self isItemInPlaylist: p_item] )
{
/* we can only do that if there's a valid input around */
vlc_mutex_lock( &p_item->p_input->p_stats->lock );
/* input */
......@@ -241,42 +225,32 @@
@"%6.0f kb/s", (float)(p_item->p_input->p_stats->f_demux_bitrate)*8000]];
/* Video */
[o_video_decoded_txt setStringValue: [NSString stringWithFormat: @"%5i",
p_item->p_input->p_stats->i_decoded_video]];
[o_displayed_txt setStringValue: [NSString stringWithFormat: @"%5i",
p_item->p_input->p_stats->i_displayed_pictures]];
[o_lost_frames_txt setStringValue: [NSString stringWithFormat: @"%5i",
p_item->p_input->p_stats->i_lost_pictures]];
[o_video_decoded_txt setIntValue: p_item->p_input->p_stats->i_decoded_video];
[o_displayed_txt setIntValue: p_item->p_input->p_stats->i_displayed_pictures];
[o_lost_frames_txt setIntValue: p_item->p_input->p_stats->i_lost_pictures];
float f_fps = 0;
/* FIXME! input_Control( p_item->p_input, INPUT_GET_VIDEO_FPS, &f_fps ); */
[o_fps_txt setFloatValue: f_fps];
/* Sout */
[o_sent_packets_txt setStringValue: [NSString stringWithFormat: @"%5i",
p_item->p_input->p_stats->i_sent_packets]];
[o_sent_packets_txt setIntValue: p_item->p_input->p_stats->i_sent_packets];
[o_sent_bytes_txt setStringValue: [NSString stringWithFormat: @"%8.0f kB",
(float)(p_item->p_input->p_stats->i_sent_bytes)/1000]];
[o_sent_bitrate_txt setStringValue: [NSString stringWithFormat:
@"%6.0f kb/s", (float)(p_item->p_input->p_stats->f_send_bitrate*8)*1000]];
/* Audio */
[o_audio_decoded_txt setStringValue: [NSString stringWithFormat: @"%5i",
p_item->p_input->p_stats->i_decoded_audio]];
[o_played_abuffers_txt setStringValue: [NSString stringWithFormat: @"%5i",
p_item->p_input->p_stats->i_played_abuffers]];
[o_lost_abuffers_txt setStringValue: [NSString stringWithFormat: @"%5i",
p_item->p_input->p_stats->i_lost_abuffers]];
[o_audio_decoded_txt setIntValue: p_item->p_input->p_stats->i_decoded_audio];
[o_played_abuffers_txt setIntValue: p_item->p_input->p_stats->i_played_abuffers];
[o_lost_abuffers_txt setIntValue: p_item->p_input->p_stats->i_lost_abuffers];
vlc_mutex_unlock( &p_item->p_input->p_stats->lock );
}
}
- (IBAction)infoCancel:(id)sender
{
[self windowShouldClose: nil];
[o_info_window orderOut: self];
}
- (IBAction)infoOk:(id)sender
- (IBAction)saveMetaData:(id)sender
{
/* TODO: implement this feature
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Yield( p_intf );
vlc_value_t val;
......@@ -293,9 +267,7 @@
val.b_bool = VLC_TRUE;
var_Set( p_playlist, "intf-change", val );
}
vlc_object_release( p_playlist );
[self windowShouldClose: nil];
[o_info_window orderOut: self];
vlc_object_release( p_playlist );*/
}
- (playlist_item_t *)getItem
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment