CocoaでAVFoundationを使うサンプル
| Revision | 0da93e320d95838d5df7734c2dc9a4054c811390 (tree) |
|---|---|
| Time | 2012-06-10 11:29:12 |
| Author | Hori <masaki@MBP....> |
| Commiter | Hori |
再生速度とか
| @@ -150,10 +150,12 @@ | ||
| 150 | 150 | self.caption = @"x 1/2"; |
| 151 | 151 | } else if(rate == 0.25) { |
| 152 | 152 | self.caption = @"x 1/4"; |
| 153 | - } else if(rate == 2.0) { | |
| 154 | - self.caption = @"x 2"; | |
| 155 | - } else if(rate == 4.0) { | |
| 156 | - self.caption = @"x 4"; | |
| 153 | + } else if(rate == 0.125) { | |
| 154 | + self.caption = @"x 1/8"; | |
| 155 | + } else if(rate > 1) { | |
| 156 | + self.caption = [NSString stringWithFormat:@"x %.0f", rate]; | |
| 157 | + } else if(rate < 0) { | |
| 158 | + self.caption = @"<<"; | |
| 157 | 159 | } else { |
| 158 | 160 | self.caption = @""; |
| 159 | 161 | } |
| @@ -276,6 +278,7 @@ | ||
| 276 | 278 | |
| 277 | 279 | - (IBAction)fastForward:(id)sender |
| 278 | 280 | { |
| 281 | + if(_player.rate > 8) return; | |
| 279 | 282 | _player.rate *= 2; |
| 280 | 283 | } |
| 281 | 284 | - (IBAction)backward:(id)sender |
| @@ -284,6 +287,7 @@ | ||
| 284 | 287 | } |
| 285 | 288 | - (IBAction)slow:(id)sender |
| 286 | 289 | { |
| 290 | + if(_player.rate < 0.13) return; | |
| 287 | 291 | _player.rate *= 0.5; |
| 288 | 292 | } |
| 289 | 293 | @end |