• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

CocoaでAVFoundationを使うサンプル


Commit MetaInfo

Revision0da93e320d95838d5df7734c2dc9a4054c811390 (tree)
Time2012-06-10 11:29:12
AuthorHori <masaki@MBP....>
CommiterHori

Log Message

再生速度とか

Change Summary

Incremental Difference

--- a/testAVFoundation/HMDocument.m
+++ b/testAVFoundation/HMDocument.m
@@ -150,10 +150,12 @@
150150 self.caption = @"x 1/2";
151151 } else if(rate == 0.25) {
152152 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 = @"<<";
157159 } else {
158160 self.caption = @"";
159161 }
@@ -276,6 +278,7 @@
276278
277279 - (IBAction)fastForward:(id)sender
278280 {
281+ if(_player.rate > 8) return;
279282 _player.rate *= 2;
280283 }
281284 - (IBAction)backward:(id)sender
@@ -284,6 +287,7 @@
284287 }
285288 - (IBAction)slow:(id)sender
286289 {
290+ if(_player.rate < 0.13) return;
287291 _player.rate *= 0.5;
288292 }
289293 @end