From a42f479c85d3e4368e75a0f9d397f450cfa5d581 Mon Sep 17 00:00:00 2001 From: jpd002 Date: Fri, 31 Dec 2010 00:04:55 +0000 Subject: [PATCH] PsfPlayer: Added file info viewer. git-svn-id: http://svn.purei.org/purei/trunk@729 b36208d7-6611-0410-8bec-b1987f11c4a2 --- .../Classes/FileInfoViewController.h | 15 + .../Classes/FileInfoViewController.mm | 72 +++ .../iphone_ui/Classes/PsfPlayerAppDelegate.h | 12 +- .../iphone_ui/Classes/PsfPlayerAppDelegate.mm | 1 + tools/PsfPlayer/Source/iphone_ui/Info.plist | 2 + .../PsfPlayer/Source/iphone_ui/MainWindow.xib | 510 +++++++++++------- .../PsfPlayer.xcodeproj/project.pbxproj | 6 + 7 files changed, 419 insertions(+), 199 deletions(-) create mode 100644 tools/PsfPlayer/Source/iphone_ui/Classes/FileInfoViewController.h create mode 100644 tools/PsfPlayer/Source/iphone_ui/Classes/FileInfoViewController.mm diff --git a/tools/PsfPlayer/Source/iphone_ui/Classes/FileInfoViewController.h b/tools/PsfPlayer/Source/iphone_ui/Classes/FileInfoViewController.h new file mode 100644 index 00000000..646f5843 --- /dev/null +++ b/tools/PsfPlayer/Source/iphone_ui/Classes/FileInfoViewController.h @@ -0,0 +1,15 @@ +#import +#import +#import "PsfTags.h" + +typedef std::vector TagStringList; + +@interface FileInfoViewController : UITableViewController +{ + CPsfTags m_tags; + TagStringList m_rawTags; +} + +-(void)setTags: (const CPsfTags&)tags; + +@end diff --git a/tools/PsfPlayer/Source/iphone_ui/Classes/FileInfoViewController.mm b/tools/PsfPlayer/Source/iphone_ui/Classes/FileInfoViewController.mm new file mode 100644 index 00000000..4c9f9fb2 --- /dev/null +++ b/tools/PsfPlayer/Source/iphone_ui/Classes/FileInfoViewController.mm @@ -0,0 +1,72 @@ +#import "FileInfoViewController.h" + +@implementation FileInfoViewController + +-(void)dealloc +{ + [super dealloc]; +} + +-(void)setTags: (const CPsfTags&)tags +{ + m_tags = tags; + m_rawTags.clear(); + + for(CPsfTags::ConstTagIterator tagIterator(m_tags.GetTagsBegin()); + tagIterator != m_tags.GetTagsEnd(); tagIterator++) + { + std::string rawTag; + rawTag = tagIterator->first + ": " + tagIterator->second; + m_rawTags.push_back(rawTag); + } + + [self.tableView reloadData]; +} + +-(NSInteger)numberOfSectionsInTableView: (UITableView*)tableView +{ + return 1; +} + +-(NSInteger)tableView: (UITableView*)tableView numberOfRowsInSection: (NSInteger)section +{ + if(section == 0) + { + return m_rawTags.size(); + } + return 0; +} + +-(NSString*)tableView: (UITableView*)tableView titleForHeaderInSection: (NSInteger)section +{ + NSString *sectionHeader = nil; + + if(section == 0) + { + sectionHeader = @"Raw Tags"; + } + + return sectionHeader; +} + +-(UITableViewCell*)tableView: (UITableView*)tableView cellForRowAtIndexPath: (NSIndexPath*)indexPath +{ + static NSString* CellIdentifier = @"Cell"; + + UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier]; + if(cell == nil) + { + cell = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: CellIdentifier] autorelease]; + } + + if(indexPath.section == 0) + { + std::string rawTag = m_rawTags[indexPath.row]; + cell.textLabel.text = [NSString stringWithUTF8String: rawTag.c_str()]; + } + + return cell; +} + +@end + diff --git a/tools/PsfPlayer/Source/iphone_ui/Classes/PsfPlayerAppDelegate.h b/tools/PsfPlayer/Source/iphone_ui/Classes/PsfPlayerAppDelegate.h index 63a1c451..3309bccf 100644 --- a/tools/PsfPlayer/Source/iphone_ui/Classes/PsfPlayerAppDelegate.h +++ b/tools/PsfPlayer/Source/iphone_ui/Classes/PsfPlayerAppDelegate.h @@ -1,8 +1,9 @@ #import -#include "PsfVm.h" -#include "PlaylistSelectViewController.h" -#include "PlaylistViewController.h" -#include "Playlist.h" +#import "PsfVm.h" +#import "PlaylistSelectViewController.h" +#import "PlaylistViewController.h" +#import "FileInfoViewController.h" +#import "Playlist.h" @interface PsfPlayerAppDelegate : NSObject { @@ -10,7 +11,8 @@ UITabBarController* m_tabBarController; IBOutlet PlaylistSelectViewController* m_playlistSelectViewController; IBOutlet PlaylistViewController* m_playlistViewController; - + IBOutlet FileInfoViewController* m_fileInfoViewController; + IBOutlet UILabel* m_trackTitleLabel; IBOutlet UILabel* m_currentTimeLabel; IBOutlet UIButton* m_playButton; diff --git a/tools/PsfPlayer/Source/iphone_ui/Classes/PsfPlayerAppDelegate.mm b/tools/PsfPlayer/Source/iphone_ui/Classes/PsfPlayerAppDelegate.mm index 4c421d30..9960fc9c 100644 --- a/tools/PsfPlayer/Source/iphone_ui/Classes/PsfPlayerAppDelegate.mm +++ b/tools/PsfPlayer/Source/iphone_ui/Classes/PsfPlayerAppDelegate.mm @@ -179,6 +179,7 @@ m_trackTitleLabel.text = titleString; [titleString release]; } + [m_fileInfoViewController setTags: psfTags]; m_playing = true; m_playButton.enabled = YES; diff --git a/tools/PsfPlayer/Source/iphone_ui/Info.plist b/tools/PsfPlayer/Source/iphone_ui/Info.plist index 693f20e1..2e901a89 100644 --- a/tools/PsfPlayer/Source/iphone_ui/Info.plist +++ b/tools/PsfPlayer/Source/iphone_ui/Info.plist @@ -30,5 +30,7 @@ audio + UIFileSharingEnabled + diff --git a/tools/PsfPlayer/Source/iphone_ui/MainWindow.xib b/tools/PsfPlayer/Source/iphone_ui/MainWindow.xib index 88f23779..5604cc77 100644 --- a/tools/PsfPlayer/Source/iphone_ui/MainWindow.xib +++ b/tools/PsfPlayer/Source/iphone_ui/MainWindow.xib @@ -1,7 +1,7 @@ - 528 + 784 10H574 823 1038.35 @@ -12,7 +12,7 @@ YES - + YES @@ -74,166 +74,61 @@ IBCocoaTouchFramework NO - - + + 274 YES - - - 292 - - YES - - - 292 - {{23, 6}, {274, 21}} - - NO - YES - 7 - NO - IBCocoaTouchFramework - PsfPlayer - - Helvetica - 14 - 16 - - - 3 - MQA - - - 1 - 10 - 1 - - - - 292 - {{23, 24}, {274, 21}} - - NO - YES - 7 - NO - IBCocoaTouchFramework - 00:00 - - Helvetica - 12 - 16 - - - - 1 - 10 - 1 - - - {320, 51} - - + + + 274 + {{0, 44}, {320, 367}} + + 3 - MC4zMzMzMzMzMzMzAA + MQA - IBCocoaTouchFramework - - - - 292 - - YES - - - 292 - {{20, 20}, {52, 37}} - - NO - IBCocoaTouchFramework - NO - 0 - 0 - - Helvetica-Bold - 15 - 16 - - 1 - << - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - - - 292 - {{80, 20}, {160, 37}} - - NO - IBCocoaTouchFramework - NO - 0 - 0 - - 1 - Play - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - - 292 - {{248, 20}, {52, 37}} - - NO - IBCocoaTouchFramework - NO - 0 - 0 - - 1 - >> - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - {{0, 334}, {320, 77}} - - + NO YES + NO IBCocoaTouchFramework + YES + 1 + 0 + YES + 44 + 22 + 22 + + + + 290 + {320, 44} + + IBCocoaTouchFramework + + YES + + + + Open + IBCocoaTouchFramework + 1 + + + IBCocoaTouchFramework + + {320, 411} - - 3 - MQA - - 2 - - + IBCocoaTouchFramework - - Now Playing + + Playlist IBCocoaTouchFramework @@ -247,57 +142,210 @@ YES - - + + + 274 YES - - - 274 - {{0, 44}, {320, 367}} - - - NO - YES - NO - IBCocoaTouchFramework - YES - 1 - 0 - YES - 44 - 22 - 22 - - - - 290 - {320, 44} - - IBCocoaTouchFramework - + + + 292 + YES - - - - Open - IBCocoaTouchFramework - 1 - - + + + 292 + {{23, 6}, {274, 21}} + + NO + YES + 7 + NO IBCocoaTouchFramework + PsfPlayer + + Helvetica + 14 + 16 + + + + 1 + 10 + 1 + + + + 292 + {{23, 24}, {274, 21}} + + NO + YES + 7 + NO + IBCocoaTouchFramework + 00:00 + + Helvetica + 12 + 16 + + + + 1 + 10 + 1 + {320, 51} + + + 3 + MC4zMzMzMzMzMzMzAA + + IBCocoaTouchFramework + + + + 292 + + YES + + + 292 + {{20, 20}, {52, 37}} + + NO + IBCocoaTouchFramework + NO + 0 + 0 + + Helvetica-Bold + 15 + 16 + + 1 + << + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + + + 292 + {{80, 20}, {160, 37}} + + NO + IBCocoaTouchFramework + NO + 0 + 0 + + 1 + Play + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + + 292 + {{248, 20}, {52, 37}} + + NO + IBCocoaTouchFramework + NO + 0 + 0 + + 1 + >> + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + + + {{0, 334}, {320, 77}} + + + YES + IBCocoaTouchFramework + + + + 274 + {{0, 51}, {320, 283}} + + + 10 + + 549453824 + {84, 1} + + YES + + YES + + + + TU0AKgAAAVjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ +y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ +xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ +xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ +xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ +xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P8ADQEAAAMAAAABAFQAAAEB +AAMAAAABAAEAAAECAAMAAAAEAAAB+gEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES +AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABAAEAAAEXAAQAAAABAAABUAEcAAMAAAABAAEAAAFS +AAMAAAABAAEAAAFTAAMAAAAEAAACAgAAAAAACAAIAAgACAABAAEAAQABA + + + + + + 3 + MCAwAA + + + groupTableViewBackgroundColor + + YES + IBCocoaTouchFramework + YES + 1 + 1 + 0 + 44 + 10 + 10 {320, 411} - + + 3 + MQA + + 2 + + IBCocoaTouchFramework - - Playlist + + Now Playing IBCocoaTouchFramework @@ -309,7 +357,6 @@ IBCocoaTouchFramework NO - SPU0 @@ -343,10 +390,7 @@ 266 {{129, 330}, {163, 49}} - - 3 - MCAwAA - + NO IBCocoaTouchFramework @@ -389,6 +433,14 @@ IBCocoaTouchFramework NO + + + + 1 + + IBCocoaTouchFramework + NO + @@ -522,6 +574,38 @@ 236 + + + view + + + + 239 + + + + delegate + + + + 240 + + + + dataSource + + + + 241 + + + + m_fileInfoViewController + + + + 242 + @@ -676,6 +760,7 @@ YES + @@ -763,6 +848,16 @@ + + 237 + + + + + 238 + + + @@ -807,6 +902,11 @@ 226.IBViewBoundsToFrameTransform 227.IBPluginDependency 231.IBPluginDependency + 237.IBPluginDependency + 237.IBViewBoundsToFrameTransform + 238.CustomClassName + 238.IBEditorWindowLastContentRect + 238.IBPluginDependency 3.CustomClassName 3.IBPluginDependency @@ -814,7 +914,7 @@ YES UIApplication UIResponder - {{504, 53}, {320, 480}} + {{301, 122}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin PlaylistSelectViewController @@ -864,6 +964,13 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + P4AAAL+AAABB6AAAw5YAAA + + FileInfoViewController + {{0, 254}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin PsfPlayerAppDelegate com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -884,11 +991,19 @@ - 236 + 242 YES + + FileInfoViewController + UITableViewController + + IBProjectSource + Classes/FileInfoViewController.h + + PlaylistSelectViewController UITableViewController @@ -978,6 +1093,7 @@ YES m_currentTimeLabel + m_fileInfoViewController m_playButton m_playlistSelectViewController m_playlistViewController @@ -988,6 +1104,7 @@ YES UILabel + FileInfoViewController UIButton PlaylistSelectViewController PlaylistViewController @@ -1001,6 +1118,7 @@ YES m_currentTimeLabel + m_fileInfoViewController m_playButton m_playlistSelectViewController m_playlistViewController @@ -1014,6 +1132,10 @@ m_currentTimeLabel UILabel + + m_fileInfoViewController + FileInfoViewController + m_playButton UIButton @@ -1338,7 +1460,7 @@ IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS diff --git a/tools/PsfPlayer/Source/iphone_ui/PsfPlayer.xcodeproj/project.pbxproj b/tools/PsfPlayer/Source/iphone_ui/PsfPlayer.xcodeproj/project.pbxproj index dda73c81..e3574a73 100644 --- a/tools/PsfPlayer/Source/iphone_ui/PsfPlayer.xcodeproj/project.pbxproj +++ b/tools/PsfPlayer/Source/iphone_ui/PsfPlayer.xcodeproj/project.pbxproj @@ -112,6 +112,7 @@ 7E844858123C9499003250D7 /* Playlist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E844856123C9499003250D7 /* Playlist.cpp */; }; 7E8448EB123D41CC003250D7 /* PlaylistViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E8448EA123D41CC003250D7 /* PlaylistViewController.mm */; }; 7EDF2BB512C675BC001CB546 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EDF2BB412C675BC001CB546 /* AVFoundation.framework */; }; + 7EECCE8E12CBC333006251EB /* FileInfoViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EECCE8D12CBC333006251EB /* FileInfoViewController.mm */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -332,6 +333,8 @@ 7E8448EA123D41CC003250D7 /* PlaylistViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlaylistViewController.mm; sourceTree = ""; }; 7EDF2B2712C556C6001CB546 /* ObjCMemberFunctionPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjCMemberFunctionPointer.h; sourceTree = ""; }; 7EDF2BB412C675BC001CB546 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 7EECCE8C12CBC333006251EB /* FileInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileInfoViewController.h; sourceTree = ""; }; + 7EECCE8D12CBC333006251EB /* FileInfoViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileInfoViewController.mm; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -362,6 +365,8 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( + 7EECCE8C12CBC333006251EB /* FileInfoViewController.h */, + 7EECCE8D12CBC333006251EB /* FileInfoViewController.mm */, 7EDF2B2712C556C6001CB546 /* ObjCMemberFunctionPointer.h */, 7E1C4334123430FC00BB4E9C /* PlaylistSelectViewController.h */, 7E1C4335123430FC00BB4E9C /* PlaylistSelectViewController.m */, @@ -865,6 +870,7 @@ 7E1C4336123430FC00BB4E9C /* PlaylistSelectViewController.m in Sources */, 7E844858123C9499003250D7 /* Playlist.cpp in Sources */, 7E8448EB123D41CC003250D7 /* PlaylistViewController.mm in Sources */, + 7EECCE8E12CBC333006251EB /* FileInfoViewController.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };