freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于ios的在線音樂播放系統(tǒng)的開發(fā)畢業(yè)論文(已改無錯字)

2023-04-10 09:48:31 本頁面
  

【正文】 entPlayViewController alloc]initWithTitle:@當(dāng)前播放 navTitle:@當(dāng)前播放 tabImageName:@]。 //創(chuàng)建導(dǎo)航控制器 UINavigationController * navCurrent = [[UINavigationController alloc]initWithRootViewController:current]。 [ setBackgroundImage:[UIImage imageNamed:@tabbar_bg] forBarMetrics:UIBarMetricsDefault]。 //添加到數(shù)組中 [tabArray addObject:navCurrent]。 //3:在線音樂 OnLineMusicViewController * onLine = [[OnLineMusicViewController alloc]initWithTitle:@在線音樂 navTitle:@在線音樂 tabImageName:@]。 //創(chuàng)建導(dǎo)航控制器 UINavigationController * navOnline = [[UINavigationController alloc]initWithRootViewController:onLine]。 34 [ setBackgroundImage:[UIImage imageNamed:@tabbar_bg] forBarMetrics:UIBarMetricsDefault]。 //添加到數(shù)組中 [tabArray addObject:navOnline]。 //4:正在下載列表 DownLoadingViewController * downLoad = [[DownLoadingViewController alloc]initWithTitle:@正在下載 navTitle:@正在下載 tabImageName:@]。 //創(chuàng)建導(dǎo)航控制器 UINavigationController * navDownLoad = [[UINavigationController alloc]initWithRootViewController:downLoad]。 [ setBackgroundImage:[UIImage imageNamed:@tabbar_bg] forBarMetrics:UIBarMetricsDefault]。 //添加到數(shù)組 [tabArray addObject:navDownLoad]。 //系統(tǒng)菜單 SysteMenu * menu = [[SysteMenu alloc]initWithTitle:@系統(tǒng)菜單 navTitle:@系統(tǒng)菜單 tabImageName:@]。 UINavigationController * navMenu = [[UINavigationController alloc]initWithRootViewController:menu]。 [ setBackgroundImage:[UIImage imageNamed:@tabbar_bg] forBarMetrics:UIBarMetricsDefault]。 35 [tabArray addObject:navMenu]。 [menu release]; = tabArray。 = tabCtrl。 [navOnline release]。 [onLine release]。 [navDownLoad release]。 [downLoad release]。 [navCurrent release]。 [current release]。 [navLocal release]。 [myLocal release]。 [tabCtrl release]。 [tabArray release]。 } 在下面的凼數(shù)中調(diào)用該凼數(shù)即可實現(xiàn)該功能 . (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]。 // Override point for customization after application launch. //調(diào)用創(chuàng)建分欄控制器凼數(shù) 36 [self createTabBarController]。 = [UIColor whiteColor]。 [ makeKeyAndVisible]。 return YES。 } 音樂播放的實現(xiàn) 使用了 iphone 中一個 API AVAudioPlayer 來實現(xiàn)了音樂的播放,切換,拖動播放 ,另外界面上能調(diào)整音量 ,快進(jìn)等。 主要代碼如下 //播放音樂 (void)playMusicWithSongName:(NSString *)name { [self playlrc]。 NSLog(@name=%@,name)。 = name。 //首先到 NSBudle里面找 ,如果沒找到就到本地 Documents里面找 NSString * path = [[NSBundle mainBundle]pathForResource:name ofType:@mp3]。 NSString * headImagePath = [[NSBundle mainBundle]pathForResource:name ofType:@png]。 NSLog(@headimage=%@,headImagePath)。 37 if ( 0) { //在資源里面找到音樂 NSURL * musicFile = [NSURL fileURLWithPath:path]。 //NSLog(@musicFile = %@,musicFile)。 //創(chuàng)建音樂播放實例 = nil。 [musicPlayer release]。 musicPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:musicFile error:nil]。 = self。 //可以得到波形 [musicPlayer setMeteringEnabled:YES]。 //準(zhǔn)備播放 [musicPlayer prepareToPlay]。 //播放音樂 [musicPlayer play]。 if (0) { NSData * data = [NSData dataWithContentsOfFile:headImagePath]。 //NSURL * headImageUrl=[NSURL URLWithString:headImagePath]。 UIImage * image = [UIImage imageWithData:data]。 38 = image。 } } else { //到 Documents里面去找 NSString * path1 = [NSHomeDirectory() stringByAppendingPathComponent:@Document/Music]。 path = [NSString stringWithFormat:@%@/%@.mp3,path1,name]。 NSURL * musicFile = [NSURL fileURLWithPath:path]。 //創(chuàng)建音樂播放器實例 [musicPlayer release]。 musicPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:musicFile error:nil]。 //可以得到波形 [musicPlayer setMeteringEnabled:YES]。 [musicPlayer prepareToPlay]。 [musicPlayer play]。 } } 音樂播放列 表的實現(xiàn) 通過 iphone 自帶的控件 UITableView,將歌曲列表展現(xiàn)在 cell 上,點擊 39 播放使用的代理模式進(jìn)行回調(diào)。 主要代碼如下 (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:YES]。 NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@Documents/Music]。 NSLog(@CCC=%@,path)。 //創(chuàng)建文件管理實例 NSFileManager * fm = [NSFileManager defaultManager]。 //subpathsAtPath獲得路徑下的所有子文件 ,也就是歌名 NSArray * array = [fm subpathsAtPath:path]。 for (NSString *name in array) { if ([name hasSuffix:@.mp3]) { NSLog(@s = %@,name)。 NSArray *songName = [name ponentsSeparatedByString:@.]。 if ([songName count] 0) { NSString *song = [songName objectAtIndex:0]。 if (![[musicDict allValues] containsObject:song]) { //存迚字典 [musicDict setObject:song forKey:[NSString stringWithFormat:@%i,[musicDict allKeys].count]]。 40 } } } } NSLog(@dict is %@, musicDict)。 [[DownloadManager sharedDownloadManager].musicDictionary release]。 [DownloadManager sharedDownloadManager].musicDictionary = [[NSMutableDictionary alloc] initWithDictionary:musicDict]。 [mTableView reloadData]。 } //給每個 cell數(shù)據(jù) (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { MyMusicCell * cell = [tableView dequeueReusableCellWithIdentifier:@ID]。 if (cell == nil) { cell = [[MyMusicCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@ID]。 = UITableViewCellSelectionStyleNone。 } NSString * text
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1