-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathSetupEncodeFormatTableViewController.m
More file actions
99 lines (77 loc) · 2.93 KB
/
SetupEncodeFormatTableViewController.m
File metadata and controls
99 lines (77 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//
// SetupEncodeFormatTableViewController.m
// FFmpegAudioRecorder
//
// Created by Liao KuoHsun on 2014/1/7.
// Copyright (c) 2014年 Liao KuoHsun. All rights reserved.
//
#import "SetupEncodeFormatTableViewController.h"
@interface SetupEncodeFormatTableViewController ()
@end
@implementation SetupEncodeFormatTableViewController
@synthesize encodeFileFormat, pSettingViewController;
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.encodeFileFormat=self.pViewController.encodeFileFormat;
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)viewWillDisappear:(BOOL)animated
{
[self.pViewController saveStatus];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return pSettingViewController.vEncodeFormatNumber;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if(cell == nil){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
NSInteger row = [indexPath row];
[cell.textLabel setText:[[NSString alloc]initWithUTF8String:
getAudioFormatString([[pSettingViewController.pEncodeFormat objectAtIndex:row]intValue])]];
if([[pSettingViewController.pEncodeFormat objectAtIndex:row]intValue]==self.encodeFileFormat)
cell.accessoryType = UITableViewCellAccessoryCheckmark;
else
cell.accessoryType = UITableViewCellAccessoryNone;
return cell;
}
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//self.encodeFileFormat = [indexPath row];
self.encodeFileFormat = [[pSettingViewController.pEncodeFormat objectAtIndex:[indexPath row]]intValue];
self.pViewController.encodeFileFormat = self.encodeFileFormat;
[self.tableView reloadData];
}
#pragma mark - Navigation
/*
// In a story board-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end