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

* implemented the statistics-tab. No auto-update yet.

parent f31cba35
......@@ -110,6 +110,9 @@
CLASS = VLCInfo;
LANGUAGE = ObjC;
OUTLETS = {
"o_audio_box" = id;
"o_audio_decoded_lbl" = id;
"o_audio_decoded_txt" = id;
"o_author_lbl" = id;
"o_author_txt" = id;
"o_btn_cancel" = id;
......@@ -120,27 +123,54 @@
"o_copyright_txt" = id;
"o_date_lbl" = id;
"o_date_txt" = id;
"o_demux_bitrate_lbl" = id;
"o_demux_bitrate_txt" = id;
"o_demux_bytes_lbl" = id;
"o_demux_bytes_txt" = id;
"o_description_lbl" = id;
"o_description_txt" = id;
"o_displayed_lbl" = id;
"o_displayed_txt" = id;
"o_genre_lbl" = id;
"o_genre_txt" = id;
"o_info_window" = id;
"o_input_bitrate_lbl" = id;
"o_input_bitrate_txt" = id;
"o_input_box" = id;
"o_language_lbl" = id;
"o_language_txt" = id;
"o_lost_abuffers_lbl" = id;
"o_lost_abuffers_txt" = id;
"o_lost_frames_lbl" = id;
"o_lost_frames_txt" = id;
"o_nowPlaying_lbl" = id;
"o_nowPlaying_txt" = id;
"o_outline_view" = id;
"o_played_abuffers_lbl" = id;
"o_played_abuffers_txt" = id;
"o_publisher_lbl" = id;
"o_publisher_txt" = id;
"o_rating_lbl" = id;
"o_rating_txt" = id;
"o_read_bytes_lbl" = id;
"o_read_bytes_txt" = id;
"o_sent_bitrate_lbl" = id;
"o_sent_bitrate_txt" = id;
"o_sent_bytes_lbl" = id;
"o_sent_bytes_txt" = id;
"o_sent_packets_lbl" = id;
"o_sent_packets_txt" = id;
"o_seqNum_lbl" = id;
"o_seqNum_txt" = id;
"o_sout_box" = id;
"o_tab_view" = id;
"o_title_lbl" = id;
"o_title_txt" = id;
"o_uri_lbl" = id;
"o_uri_txt" = id;
"o_video_box" = id;
"o_video_decoded_lbl" = id;
"o_video_decoded_txt" = id;
};
SUPERCLASS = NSObject;
},
......
/*****************************************************************************
* playlistinfo.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2004 the VideoLAN team
* Copyright (C) 2002-2006 the VideoLAN team
* $Id$
*
* Authors: Benjamin Pracht <bigben at videolan dot org>
* Felix Khne <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
......@@ -64,6 +65,37 @@
IBOutlet id o_seqNum_lbl;
IBOutlet id o_seqNum_txt;
IBOutlet id o_audio_box;
IBOutlet id o_audio_decoded_lbl;
IBOutlet id o_audio_decoded_txt;
IBOutlet id o_demux_bitrate_lbl;
IBOutlet id o_demux_bitrate_txt;
IBOutlet id o_demux_bytes_lbl;
IBOutlet id o_demux_bytes_txt;
IBOutlet id o_displayed_lbl;
IBOutlet id o_displayed_txt;
IBOutlet id o_input_bitrate_lbl;
IBOutlet id o_input_bitrate_txt;
IBOutlet id o_input_box;
IBOutlet id o_lost_abuffers_lbl;
IBOutlet id o_lost_abuffers_txt;
IBOutlet id o_lost_frames_lbl;
IBOutlet id o_lost_frames_txt;
IBOutlet id o_played_abuffers_lbl;
IBOutlet id o_played_abuffers_txt;
IBOutlet id o_read_bytes_lbl;
IBOutlet id o_read_bytes_txt;
IBOutlet id o_sent_bitrate_lbl;
IBOutlet id o_sent_bitrate_txt;
IBOutlet id o_sent_bytes_lbl;
IBOutlet id o_sent_bytes_txt;
IBOutlet id o_sent_packets_lbl;
IBOutlet id o_sent_packets_txt;
IBOutlet id o_sout_box;
IBOutlet id o_video_box;
IBOutlet id o_video_decoded_lbl;
IBOutlet id o_video_decoded_txt;
playlist_item_t * p_item;
}
......@@ -76,7 +108,10 @@
- (BOOL)isItemInPlaylist:(playlist_item_t *)p_item;
- (void)setMeta: (char *)meta forLabel: (id)theItem;
- (void)updateStatistics;
/*- (void)setIntStat: (int)value forLabel: (id)theItem withFormat: (NSString *)format;
- (void)setFloatStat: (float)value forLabel: (id)theItem withFormat: (NSString *)format;
*/
@end
@interface VLCInfoTreeItem : NSObject
......
/*****************************************************************************
r playlistinfo.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-2005 the VideoLAN team
* Copyright (C) 2002-2006 the VideoLAN team
* $Id$
*
* Authors: Benjamin Pracht <bigben at videolan dot org>
* Felix 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
......@@ -73,6 +74,28 @@
[o_language_lbl setStringValue: _NS(VLC_META_LANGUAGE)];
[o_nowPlaying_lbl setStringValue: _NS(VLC_META_NOW_PLAYING)];
[o_publisher_lbl setStringValue: _NS(VLC_META_PUBLISHER)];
/* statistics */
[o_input_box setTitle: _NS("Input")];
[o_read_bytes_lbl setStringValue: _NS("Read at media")];
[o_input_bitrate_lbl setStringValue: _NS("Input bitrate")];
[o_demux_bytes_lbl setStringValue: _NS("Demuxed")];
[o_demux_bitrate_lbl setStringValue: _NS("Stream bitrate")];
[o_video_box setTitle: _NS("Video")];
[o_video_decoded_lbl setStringValue: _NS("Decoded blocks")];
[o_displayed_lbl setStringValue: _NS("Displayed frames")];
[o_lost_frames_lbl setStringValue: _NS("Lost frames")];
[o_sout_box setTitle: _NS("Streaming")];
[o_sent_packets_lbl setStringValue: _NS("Sent packets")];
[o_sent_bytes_lbl setStringValue: _NS("Sent bytes")];
[o_sent_bitrate_lbl setStringValue: _NS("Send rate")];
[o_audio_box setTitle: _NS("Audio")];
[o_audio_decoded_lbl setStringValue: _NS("Decoded blocks")];
[o_played_abuffers_lbl setStringValue: _NS("Played buffers")];
[o_lost_abuffers_lbl setStringValue: _NS("Lost buffers")];
}
- (IBAction)togglePlaylistInfoPanel:(id)sender
......@@ -156,6 +179,8 @@
[[VLCInfoTreeItem rootItem] refresh];
[o_outline_view reloadData];
[self updateStatistics];
[o_info_window makeKeyAndOrderFront: sender];
}
......@@ -169,6 +194,47 @@
[theItem setStringValue: @"-"];
}
- (void)updateStatistics
{
vlc_mutex_lock( &p_item->input.p_stats->lock );
/* input */
[o_read_bytes_txt setStringValue: [NSString stringWithFormat: @"%8.0f kB", \
(float)(p_item->input.p_stats->i_read_bytes)/1000]];
[o_input_bitrate_txt setStringValue: [NSString stringWithFormat: @"%6.0f kb/s", \
(float)(p_item->input.p_stats->f_input_bitrate)/1000]];
[o_demux_bytes_txt setStringValue: [NSString stringWithFormat: @"%8.0f kB",\
(float)(p_item->input.p_stats->i_demux_read_bytes)/1000]];
[o_demux_bitrate_txt setStringValue: [NSString stringWithFormat: @"%6.0f kb/s", \
(float)(p_item->input.p_stats->f_demux_bitrate)/1000]];
/* Video */
[o_video_decoded_txt setStringValue: [NSString stringWithFormat: @"%8.0f kB", \
p_item->input.p_stats->i_decoded_video]];
[o_displayed_txt setStringValue: [NSString stringWithFormat: @"%5i", \
p_item->input.p_stats->i_displayed_pictures]];
[o_lost_frames_txt setStringValue: [NSString stringWithFormat: @"%5i", \
p_item->input.p_stats->i_lost_pictures]];
/* Sout */
[o_sent_packets_txt setStringValue: [NSString stringWithFormat: @"%5i", \
p_item->input.p_stats->i_sent_packets]];
[o_sent_bytes_txt setStringValue: [NSString stringWithFormat: @"%6.0f kB", \
(float)(p_item->input.p_stats->i_sent_bytes)/1000]];
[o_sent_bitrate_txt setStringValue: [NSString stringWithFormat: @"%6.0f kb/s", \
(float)(p_item->input.p_stats->f_send_bitrate*8)*1000]];
/* Audio */
[o_audio_decoded_txt setStringValue: [NSString stringWithFormat: @"%5i", \
p_item->input.p_stats->i_decoded_audio]];
[o_played_abuffers_txt setStringValue: [NSString stringWithFormat: @"%5i", \
p_item->input.p_stats->i_played_abuffers]];
[o_lost_abuffers_txt setStringValue: [NSString stringWithFormat: @"%5i", \
p_item->input.p_stats->i_lost_abuffers]];
vlc_mutex_unlock( &p_item->input.p_stats->lock );
}
- (IBAction)infoCancel:(id)sender
{
[o_info_window orderOut: self];
......
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