|
@@ -132,6 +132,7 @@
|
|
|
@property (nonatomic) PCSAutherView *authView;
|
|
|
|
|
|
@property (nonatomic) dispatch_queue_t videoQueue;
|
|
|
+@property (nonatomic) BOOL isDuringTakePhoto;
|
|
|
|
|
|
@end
|
|
|
|
|
@@ -1017,6 +1018,8 @@
|
|
|
- (void)takeStillPhoto:(AVCaptureVideoPreviewLayer*)previewLayer {
|
|
|
|
|
|
if ([self showAuthorCamerIfNeed]) {
|
|
|
+ self.panGesture.enabled = YES;
|
|
|
+ self.isDuringTakePhoto = NO;
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -1025,6 +1028,8 @@
|
|
|
// connection.preferredVideoStabilizationMode = AVCaptureVideoStabilizationModeAuto;
|
|
|
}
|
|
|
if(connection == nil){
|
|
|
+ self.panGesture.enabled = YES;
|
|
|
+ self.isDuringTakePhoto = NO;
|
|
|
return;
|
|
|
}
|
|
|
if (connection.supportsVideoOrientation) {
|
|
@@ -1857,18 +1862,12 @@
|
|
|
|
|
|
|
|
|
- (void)takePhotoButtonTouchUpInside:(id)sender{
|
|
|
- self.takePhotoButton.enabled = NO;
|
|
|
- if ((self.outputSettings.flashMode == AVCaptureFlashModeOn || self.outputSettings.flashMode == AVCaptureFlashModeAuto) && (self.mode == SDK_CAPTURE_MODE_SINGLE || self.mode == SDK_CAPTURE_MODE_CONTINUOUS || self.mode == SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA)) {
|
|
|
- self.panGesture.enabled = NO;
|
|
|
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
- self.takePhotoButton.enabled = YES;
|
|
|
- self.panGesture.enabled = YES;
|
|
|
- });
|
|
|
- } else {
|
|
|
- dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
- self.takePhotoButton.enabled = YES;
|
|
|
- });
|
|
|
+ if (self.isDuringTakePhoto) {
|
|
|
+ return;
|
|
|
}
|
|
|
+ self.panGesture.enabled = NO;
|
|
|
+ self.isDuringTakePhoto = YES;
|
|
|
+
|
|
|
if(![self.currentOperationNode respondsToSelector:@selector(enable)] || self.currentOperationNode.enable){
|
|
|
|
|
|
if (self.mode == SDK_CAPTURE_MODE_MOVIE) {
|
|
@@ -2221,6 +2220,9 @@
|
|
|
}
|
|
|
#pragma mark 相机单拍,和连拍的代理
|
|
|
- (void)captureOutput:(AVCapturePhotoOutput *)output didFinishProcessingPhoto:(AVCapturePhoto *)photo error:(NSError *)error{
|
|
|
+ self.panGesture.enabled = YES;
|
|
|
+ self.isDuringTakePhoto = NO;
|
|
|
+
|
|
|
NSData* imageData = [photo fileDataRepresentation];
|
|
|
if (imageData == nil){
|
|
|
return;
|
|
@@ -2720,61 +2722,17 @@
|
|
|
// In a storyboard-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].
|
|
|
- if([segue.identifier isEqualToString:@"show-photos"]){
|
|
|
- if([segue.destinationViewController isKindOfClass:[PhotoListViewController class]]){
|
|
|
- PhotoListViewController* dst = segue.destinationViewController;
|
|
|
- OperationNodeMultiple* node = self.currentOperationNode;
|
|
|
- dst.transitioningDelegate = self;
|
|
|
- [dst setImagesInMemory:node.cachesInMemory andImageNamesOnDisk:node.cachesOnDisk];
|
|
|
- dst.delegate = self;
|
|
|
- }
|
|
|
- }
|
|
|
- else if([segue.identifier isEqualToString:@"show-movies"]){
|
|
|
- if([segue.destinationViewController isKindOfClass:[MovieListViewController class]]){
|
|
|
- MovieListViewController* dst = segue.destinationViewController;
|
|
|
- OperationNodeMovie* node = self.currentOperationNode;
|
|
|
- dst.transitioningDelegate = self;
|
|
|
- dst.movieModels = node.cachedMovies;
|
|
|
- dst.delegate = self;
|
|
|
- }
|
|
|
- }
|
|
|
- else if([segue.identifier isEqualToString:@"preview_single"]){
|
|
|
+ if([segue.identifier isEqualToString:@"preview_single"]){
|
|
|
PreviewSingleViewController* dst = segue.destinationViewController;
|
|
|
dst.singleModeNode = self.currentOperationNode;
|
|
|
if (self.resourceModel.singleArray.count > 0) {
|
|
|
LenzResourceItemModel *model = self.resourceModel.singleArray.firstObject;
|
|
|
dst.image = model.image;
|
|
|
}
|
|
|
-// dst.image = self.capturedImage;
|
|
|
- }else if ([segue.identifier isEqualToString:@"show-photoalbum"]){
|
|
|
-
|
|
|
- PhotoAlbumListViewController *dst = segue.destinationViewController;
|
|
|
- dst.typeArray = self.typeArray;
|
|
|
-
|
|
|
- //图片数据
|
|
|
- NSString *typeStr = self.typeArray.lastObject;
|
|
|
-// if ([typeStr isEqualToString:@"photo"]) {
|
|
|
- OperationNodeMultiple* node = (__kindof id<OperationNodeProtocol>)self.operationNodes[@(0)];
|
|
|
-
|
|
|
-// OperationNodeMultiple* node = self.currentOperationNode;
|
|
|
-
|
|
|
- dst.node = node;
|
|
|
- dst.photoListVC.transitioningDelegate = self;
|
|
|
- [dst.photoListVC setImagesInMemory:node.cachesInMemory andImageNamesOnDisk:node.cachesOnDisk];
|
|
|
- dst.photoListVC.delegate = self;
|
|
|
-
|
|
|
-// }else if ([typeStr isEqualToString:@"movie"]) {
|
|
|
- OperationNodeMovie* movieNode = (__kindof id<OperationNodeProtocol>)self.operationNodes[@(2)];
|
|
|
- dst.movieListVC.transitioningDelegate = self;
|
|
|
- dst.movieListVC.movieModels = movieNode.cachedMovies;
|
|
|
- dst.movieListVC.delegate = self;
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-//*/
|
|
|
+
|
|
|
- (void)clearSingleData {
|
|
|
[self.resourceModel.singleArray removeAllObjects];
|
|
|
[self updateViewStatus];
|