• R/O
  • HTTP
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

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

CocoaでAVFoundationを使うサンプル


Commit MetaInfo

修訂1d59899c4ebee589157acbb34d04085f3d60da38 (tree)
時間2012-06-13 22:34:33
作者Hori <masaki@MBP....>
CommiterHori

Log Message

UIのenabled

Change Summary

差異

--- a/testAVFoundation/HMDocument.h
+++ b/testAVFoundation/HMDocument.h
@@ -14,6 +14,7 @@
1414 @property (assign) IBOutlet NSButton *playButton;
1515
1616 @property (assign) NSTimeInterval currentTime;
17+@property (assign) BOOL canPlay;
1718
1819 - (IBAction)togglePlayAndPause:(id)sender;
1920 - (IBAction)changeCurrentTime:(id)sender;
--- a/testAVFoundation/HMDocument.m
+++ b/testAVFoundation/HMDocument.m
@@ -28,6 +28,7 @@
2828 @synthesize view = _view;
2929 @synthesize playButton = _playButton;
3030 @synthesize currentTime = _currentTime;
31+@synthesize canPlay = _canPlay;
3132
3233 @synthesize asset = _asset;
3334 @synthesize item = _item;
@@ -101,10 +102,10 @@
101102 {
102103 if((_player.currentItem != nil) &&
103104 ([_player.currentItem status] == AVPlayerItemStatusReadyToPlay)) {
104- _playButton.enabled = YES;
105+ self.canPlay = YES;
105106 }
106107 else {
107- _playButton.enabled = NO;
108+ self.canPlay = NO;
108109 }
109110
110111 CGFloat rate = _player.rate;
--- a/testAVFoundation/en.lproj/HMDocument.xib
+++ b/testAVFoundation/en.lproj/HMDocument.xib
@@ -24,6 +24,7 @@
2424 <string>NSView</string>
2525 <string>NSWindowTemplate</string>
2626 <string>NSTextField</string>
27+ <string>NSUserDefaultsController</string>
2728 </array>
2829 <array key="IBDocument.PluginDependencies">
2930 <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -380,6 +381,9 @@
380381 <object class="NSCustomObject" id="796877042">
381382 <string key="NSClassName">NSApplication</string>
382383 </object>
384+ <object class="NSUserDefaultsController" id="40310097">
385+ <bool key="NSSharedInstance">YES</bool>
386+ </object>
383387 </array>
384388 <object class="IBObjectContainer" key="IBDocument.Objects">
385389 <array class="NSMutableArray" key="connectionRecords">
@@ -416,14 +420,6 @@
416420 <int key="connectionID">100393</int>
417421 </object>
418422 <object class="IBConnectionRecord">
419- <object class="IBOutletConnection" key="connection">
420- <string key="label">playButton</string>
421- <reference key="source" ref="512844837"/>
422- <reference key="destination" ref="16104508"/>
423- </object>
424- <int key="connectionID">100053</int>
425- </object>
426- <object class="IBConnectionRecord">
427423 <object class="IBActionConnection" key="connection">
428424 <string key="label">fastForward:</string>
429425 <reference key="source" ref="512844837"/>
@@ -449,6 +445,14 @@
449445 </object>
450446 <object class="IBConnectionRecord">
451447 <object class="IBOutletConnection" key="connection">
448+ <string key="label">playButton</string>
449+ <reference key="source" ref="512844837"/>
450+ <reference key="destination" ref="16104508"/>
451+ </object>
452+ <int key="connectionID">100788</int>
453+ </object>
454+ <object class="IBConnectionRecord">
455+ <object class="IBOutletConnection" key="connection">
452456 <string key="label">delegate</string>
453457 <reference key="source" ref="275939982"/>
454458 <reference key="destination" ref="512844837"/>
@@ -465,6 +469,22 @@
465469 </object>
466470 <object class="IBConnectionRecord">
467471 <object class="IBBindingConnection" key="connection">
472+ <string key="label">enabled: canPlay</string>
473+ <reference key="source" ref="16104508"/>
474+ <reference key="destination" ref="512844837"/>
475+ <object class="NSNibBindingConnector" key="connector">
476+ <reference key="NSSource" ref="16104508"/>
477+ <reference key="NSDestination" ref="512844837"/>
478+ <string key="NSLabel">enabled: canPlay</string>
479+ <string key="NSBinding">enabled</string>
480+ <string key="NSKeyPath">canPlay</string>
481+ <int key="NSNibBindingConnectorVersion">2</int>
482+ </object>
483+ </object>
484+ <int key="connectionID">100787</int>
485+ </object>
486+ <object class="IBConnectionRecord">
487+ <object class="IBBindingConnection" key="connection">
468488 <string key="label">maxValue: asset.duration</string>
469489 <reference key="source" ref="491353793"/>
470490 <reference key="destination" ref="512844837"/>
@@ -502,6 +522,22 @@
502522 </object>
503523 <object class="IBConnectionRecord">
504524 <object class="IBBindingConnection" key="connection">
525+ <string key="label">enabled: canPlay</string>
526+ <reference key="source" ref="491353793"/>
527+ <reference key="destination" ref="512844837"/>
528+ <object class="NSNibBindingConnector" key="connector">
529+ <reference key="NSSource" ref="491353793"/>
530+ <reference key="NSDestination" ref="512844837"/>
531+ <string key="NSLabel">enabled: canPlay</string>
532+ <string key="NSBinding">enabled</string>
533+ <string key="NSKeyPath">canPlay</string>
534+ <int key="NSNibBindingConnectorVersion">2</int>
535+ </object>
536+ </object>
537+ <int key="connectionID">100786</int>
538+ </object>
539+ <object class="IBConnectionRecord">
540+ <object class="IBBindingConnection" key="connection">
505541 <string key="label">value: currentTime</string>
506542 <reference key="source" ref="868760446"/>
507543 <reference key="destination" ref="512844837"/>
@@ -558,6 +594,22 @@
558594 </object>
559595 <object class="IBConnectionRecord">
560596 <object class="IBBindingConnection" key="connection">
597+ <string key="label">enabled: canPlay</string>
598+ <reference key="source" ref="194457650"/>
599+ <reference key="destination" ref="512844837"/>
600+ <object class="NSNibBindingConnector" key="connector">
601+ <reference key="NSSource" ref="194457650"/>
602+ <reference key="NSDestination" ref="512844837"/>
603+ <string key="NSLabel">enabled: canPlay</string>
604+ <string key="NSBinding">enabled</string>
605+ <string key="NSKeyPath">canPlay</string>
606+ <int key="NSNibBindingConnectorVersion">2</int>
607+ </object>
608+ </object>
609+ <int key="connectionID">100785</int>
610+ </object>
611+ <object class="IBConnectionRecord">
612+ <object class="IBBindingConnection" key="connection">
561613 <string key="label">value: player.muted</string>
562614 <reference key="source" ref="872147288"/>
563615 <reference key="destination" ref="512844837"/>
@@ -572,6 +624,70 @@
572624 </object>
573625 <int key="connectionID">100439</int>
574626 </object>
627+ <object class="IBConnectionRecord">
628+ <object class="IBBindingConnection" key="connection">
629+ <string key="label">enabled: canPlay</string>
630+ <reference key="source" ref="872147288"/>
631+ <reference key="destination" ref="512844837"/>
632+ <object class="NSNibBindingConnector" key="connector">
633+ <reference key="NSSource" ref="872147288"/>
634+ <reference key="NSDestination" ref="512844837"/>
635+ <string key="NSLabel">enabled: canPlay</string>
636+ <string key="NSBinding">enabled</string>
637+ <string key="NSKeyPath">canPlay</string>
638+ <int key="NSNibBindingConnectorVersion">2</int>
639+ </object>
640+ </object>
641+ <int key="connectionID">100784</int>
642+ </object>
643+ <object class="IBConnectionRecord">
644+ <object class="IBBindingConnection" key="connection">
645+ <string key="label">enabled: canPlay</string>
646+ <reference key="source" ref="147538621"/>
647+ <reference key="destination" ref="512844837"/>
648+ <object class="NSNibBindingConnector" key="connector">
649+ <reference key="NSSource" ref="147538621"/>
650+ <reference key="NSDestination" ref="512844837"/>
651+ <string key="NSLabel">enabled: canPlay</string>
652+ <string key="NSBinding">enabled</string>
653+ <string key="NSKeyPath">canPlay</string>
654+ <int key="NSNibBindingConnectorVersion">2</int>
655+ </object>
656+ </object>
657+ <int key="connectionID">100783</int>
658+ </object>
659+ <object class="IBConnectionRecord">
660+ <object class="IBBindingConnection" key="connection">
661+ <string key="label">enabled: canPlay</string>
662+ <reference key="source" ref="796465416"/>
663+ <reference key="destination" ref="512844837"/>
664+ <object class="NSNibBindingConnector" key="connector">
665+ <reference key="NSSource" ref="796465416"/>
666+ <reference key="NSDestination" ref="512844837"/>
667+ <string key="NSLabel">enabled: canPlay</string>
668+ <string key="NSBinding">enabled</string>
669+ <string key="NSKeyPath">canPlay</string>
670+ <int key="NSNibBindingConnectorVersion">2</int>
671+ </object>
672+ </object>
673+ <int key="connectionID">100782</int>
674+ </object>
675+ <object class="IBConnectionRecord">
676+ <object class="IBBindingConnection" key="connection">
677+ <string key="label">enabled: canPlay</string>
678+ <reference key="source" ref="936500016"/>
679+ <reference key="destination" ref="512844837"/>
680+ <object class="NSNibBindingConnector" key="connector">
681+ <reference key="NSSource" ref="936500016"/>
682+ <reference key="NSDestination" ref="512844837"/>
683+ <string key="NSLabel">enabled: canPlay</string>
684+ <string key="NSBinding">enabled</string>
685+ <string key="NSKeyPath">canPlay</string>
686+ <int key="NSNibBindingConnectorVersion">2</int>
687+ </object>
688+ </object>
689+ <int key="connectionID">100781</int>
690+ </object>
575691 </array>
576692 <object class="IBMutableOrderedSet" key="objectRecords">
577693 <array key="orderedObjects">
@@ -1506,6 +1622,11 @@
15061622 <reference key="object" ref="139574575"/>
15071623 <reference key="parent" ref="568628114"/>
15081624 </object>
1625+ <object class="IBObjectRecord">
1626+ <int key="objectID">100778</int>
1627+ <reference key="object" ref="40310097"/>
1628+ <reference key="parent" ref="0"/>
1629+ </object>
15091630 </array>
15101631 </object>
15111632 <dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -1614,6 +1735,7 @@
16141735 <string key="100772.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
16151736 <string key="100773.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
16161737 <string key="100774.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
1738+ <string key="100778.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
16171739 <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
16181740 <string key="5.IBWindowTemplateEditedContentRect">{{133, 170}, {507, 413}}</string>
16191741 <array key="6.IBNSViewMetadataConstraints">
@@ -1643,7 +1765,7 @@
16431765 <nil key="activeLocalization"/>
16441766 <dictionary class="NSMutableDictionary" key="localizations"/>
16451767 <nil key="sourceID"/>
1646- <int key="maxID">100777</int>
1768+ <int key="maxID">100788</int>
16471769 </object>
16481770 <object class="IBClassDescriber" key="IBDocument.Classes">
16491771 <array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1709,6 +1831,47 @@
17091831 </object>
17101832 </object>
17111833 <object class="IBPartialClassDescription">
1834+ <string key="className">NSDocument</string>
1835+ <dictionary class="NSMutableDictionary" key="actions">
1836+ <string key="printDocument:">id</string>
1837+ <string key="revertDocumentToSaved:">id</string>
1838+ <string key="runPageLayout:">id</string>
1839+ <string key="saveDocument:">id</string>
1840+ <string key="saveDocumentAs:">id</string>
1841+ <string key="saveDocumentTo:">id</string>
1842+ </dictionary>
1843+ <dictionary class="NSMutableDictionary" key="actionInfosByName">
1844+ <object class="IBActionInfo" key="printDocument:">
1845+ <string key="name">printDocument:</string>
1846+ <string key="candidateClassName">id</string>
1847+ </object>
1848+ <object class="IBActionInfo" key="revertDocumentToSaved:">
1849+ <string key="name">revertDocumentToSaved:</string>
1850+ <string key="candidateClassName">id</string>
1851+ </object>
1852+ <object class="IBActionInfo" key="runPageLayout:">
1853+ <string key="name">runPageLayout:</string>
1854+ <string key="candidateClassName">id</string>
1855+ </object>
1856+ <object class="IBActionInfo" key="saveDocument:">
1857+ <string key="name">saveDocument:</string>
1858+ <string key="candidateClassName">id</string>
1859+ </object>
1860+ <object class="IBActionInfo" key="saveDocumentAs:">
1861+ <string key="name">saveDocumentAs:</string>
1862+ <string key="candidateClassName">id</string>
1863+ </object>
1864+ <object class="IBActionInfo" key="saveDocumentTo:">
1865+ <string key="name">saveDocumentTo:</string>
1866+ <string key="candidateClassName">id</string>
1867+ </object>
1868+ </dictionary>
1869+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
1870+ <string key="majorKey">IBProjectSource</string>
1871+ <string key="minorKey">./Classes/NSDocument.h</string>
1872+ </object>
1873+ </object>
1874+ <object class="IBPartialClassDescription">
17121875 <string key="className">NSLayoutConstraint</string>
17131876 <string key="superclassName">NSObject</string>
17141877 <object class="IBClassDescriptionSource" key="sourceIdentifier">