欢迎来到课桌文档! | 帮助中心 课桌文档-建筑工程资料库
课桌文档
全部分类
  • 党建之窗>
  • 感悟体会>
  • 百家争鸣>
  • 教育整顿>
  • 文笔提升>
  • 热门分类>
  • 计划总结>
  • 致辞演讲>
  • 在线阅读>
  • ImageVerifierCode 换一换
    首页 课桌文档 > 资源分类 > DOCX文档下载  

    SDEASYCAM 手机APP软件 前30页代码.docx

    • 资源ID:273238       资源大小:74.96KB        全文页数:29页
    • 资源格式: DOCX        下载积分:5金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要5金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    SDEASYCAM 手机APP软件 前30页代码.docx

    #import'MKHorizMenu.h"#defineKButtonBaseTag10000#defineKLeftOffset5implemeniationMKHorizMenuSyntheSiZetitles=Jitles;©synthesizeSelectedlmage-_selectedlmage;©synthesizeitemSelectedDelegate;SyZheSiZedataSource:SynmeSiZeitemCount=JtemCount;-(void)awakeFromNib(self.bonces=YES;self.scrollEnabled=YES;self.alwaysBounceHorizontalYES;self.alwaysBounceVertical=NO;Self.ShowsHorizontaiscroIIIndicator=NO;Self-ShowsverticaiscrolllndicatorNO;SeIfreloadData;-(void)TeIoadSoundBtn()-(void)reloadData(NSArray*viewsToRemove-selfsubviews;for(UIView*vinViewsToRemove)vremoveFromSperview);)SeIfJtemCount=dataSourcenumberOfltemsForMenu:self;self.backgroundColor=dataSourcebackgroundColorForMenuzself;/Self.Selectedlmage=dataSourceSelecteclltemImageForMenuiseIf;UIFont*buttonFont=(UIFontboldSystemFonlOfSizer15;intbultoPadding-5;inttag=KButtonBaseTag;intxPosRLeftOffset;CGFIoatbtnTotalWidth=O.Of;for(inti=O;i<self.itemCount;i+)Ullmage*bglmg=UllmageimageNamed:dataSourcehorizMenu:selftitleForltemAtlndex:i;btnTotalWidth+=bgImg.size.width;if(i3)NSLog("OK");)计算左右变距CGFIoattotalLen=(self.itemCount-1)*buttonPadding+btnTotalWidth;CGFIoatleft×-(self.superview.frame.size.width-totalLe)2;f(leftX<O)IeftX=XPos;XPos=IeftX;for(intiO;i<self.itemCount;i+)(NSString,title=UIButton*customButtonUIButtonbuttonWithTypeUIBultonTypeCuslom;CustomButtonsetTitle:titleforState:UIControlStateNormal;CustomButtonJitleLabeLfont=buttonFont;Ullmage*bglmg=UllmageimageNamed:dataSourcehorizMenu:selftitleForltemAtlndex:i:(CustomButtonSetBackgroundImagerbgImgforState:UIcontroIStateNormaI;CustomButtonsetBackgroundlmage:UllmageimageNamedJdatasourceselectedltemlmageForMenuiseIfitemAtIndexiiforState:UIcontroIStateSeIected;(CustomButtonsetBackgroundlmage:UllmageimageNamed:dataSourceselectedltemlmageForMenu:selfitemAtlndex:iforState:IJlContrOIStaIeHighlighted;CustomButtonJag=tag+;CustomButtonaddTarget:selfaction:selector(buttonTapped:)forControlEvents:UIControlEventTouchUplnside;CustomButtonaddTarget:selfaction:selector(buttonTouchDown:)forControlEvents:UIControlEventTouchDown:CustomButtonJrame-CGRectMake(xPos,3,bglmg.size.width,38):×Pos+=bglmg.size.width;if(i÷1<self.itemCount)xPos+=buttonPadding;sefaddSubviewxustomButto;xPos+=IeftX:if(xPos<self.frame.size.width)xPos-self.frame.size.width;self.cotentSize=CGSizeMake(×Pos,self.frame.size.height);(SelflayoutSubviews;)#import<IOTCameraGLog.h>#import<IOTCameraGLogZone.h>#importCameraMultiLiveViewController.h"#import<IOTCameraAVFRAMEINFO.h>#importVloTCamera/ImageBufflnfo.h>#import<systime.h>#import<AVFoudationAVFoundatio.h>#import'AppDelegate.h"#import*MyNavViewController.h""import-UIDevice+Device,h"#defineDEF_WAIT4ST0PSH0W_TIME250#CIefineDEF-SplitViewNm4#defineDEFReTryConnectlnterval25*1000#defineDEF_ReTryTimes10interfaceCameraMultiLiveViewController()MyCamera*mDummyCam:NSMutabIeArray,marlmg-Vdo:intmReTryTimesArrayDEFSpIitViewNum;UnsignedintmnLastReTryTickArray(DEF-SplitViewNum;)end(implementationCameraMultiLiveviewControIIerSynmeSiZebStopShowCompletedLock;©synthesizeSelectedAudioMode;SyntheSiZecamNeedReconnect;©synthesizeSeIectCameraArray;©synthesizeCameraArray;SyntheSiZeChanneIArray;#PragmamarkMethods-(Ullnterfaceorientation)PreferredlnterfaceorienlationForPresentation(returnUllntertaceOrientationLandscapeLeft;)(CGRect)ZoomRectForscroliviewxuiscroIIView*)_scrollViewwithScale:(CGFIoat)scaleWithCenter:(CGPoint)CenterCGReclzoomRect:HThezoomrectisinthententview'sordinates.HAtazoomscaleof1.0.itwouldbethesizeofIhe/imageScrollView,sbounds.HAsthezoomscaledecreases,somorententisvisible,hesizeoftherectgrows.ZoomReCISiZe.height=_scrollView.frame.size.height/scale;zoomRect.size.width=scrollView.frame.size.width/scale;Uchooseanoriginsoastogettherightcenter.zoomRct.origin.x=center.x-(zoomRect.size.width/2.0);zmRect.origin.y=center.y-(zoomRect.size.height/2.0);returnzoomRect;)-(Ullmage*)getUllmage:(char*)buffWidth:(NSInteger)WidthHeight:(NSInteger)heightCGDataProviderRefprovider=CGDataPrOViderereateWithData(NULL,buff,width*height*3tNULL);CGcoIorSpaceRefcolorspace=CGColorSpaceCreatDeviceRGB():CGlmageRefimgRef=CGlmageCreat(width,height,8l24,width*3,colorSpace1kCGBitmapByteOrderDefaut,provider,NULL,true,kCGRenderingIntentDefauIt);Ullmage*img=UIImageimageWithCGImagejmgRef;f(imgRef!=nil)(CGImageRelease(imgRef);imgRef=nil;if(colorSpace!=nil)CGcolorspaceRelease(CoIorSpace);lorSpace=nil;f(providerlnil)CGDataPrOViderReleaSe(ProVider);provider-nil;returnimgcopyautorelease;)-(void)camStopShowr(int)algnoreldxisCamStopShow=YES:for(inti-O;i<DEF_SplitViewNum;i+)if(i=algnored×)continue;MyCamera*testCamera=(CameraArrayobjectAtIndexzi;if(testCamera.id!=nil&&!testCamera.uidisEqualToString:"(null)")NSNumber*tempChannelChanneIArrayobjectAtIndex:1;if(testCamera.sssionState=CONNECTIONSTATE_CONNECTED&&(testCameragetConnectionStateOfChannel:0=CONNECTION_STATE_CONNECTED)testCamera.isShowlnMltiView=NO;testCamerastopShow:tempChannelintVaue;)-(void)reStartShowisCamStopShowNO;for(inti=0ji<DEFSpIitViewNum;i+)MyCamera*tempCamera=CameraArrayobjectAtldex:i;if(tempCamera.uid!=nil&&ltempCamera.uidisEqualToString:*(null)N)(NSNumbertempChannel=ChanneIArrayobjectAtIndex:1;if(tempCamera.sessionStateCONNECTION_STATE_CONNECTED&&temCameragetConnectionStateOfChannekOCONNECTION_STATE_CONNECTED)if(!isGoPlayEvent)tempCamera.isShowlnMultiViewYES;(tempCameraStartShoWjtempChanneIIntegerVaIueJScreenObjectiseIf;)-(vod)reConnectAndShowfor(inti=O;i<DEF_SplitViewNum;i+)MyCamera*tempCameracameraArrayObjectAtIndex:i;if(tempCamera.uid!=nil&&!tempCamera.uidisEqualToString:"(null)")ChanneIArrayobjectAtIndex:1;SelfdisconnectCameralempCamera.Uid;tempCameradisconnect:tempCameraconnect:tempCamera.uidJ;tempCamerastartz;if(!isGoPlayEvent)tempCamera.isShowlMultiViewYES;/tempCamerastartShow:0ScreenObject:self;)tempCamera.delegate2=self;)-(void)disnnectCameraNSStrig)strUID(for(inti=0;i<DEFSpIitViewNum;i+)MyCamera*cam-CameraArrayobjectAtIndex:1);NSNumber*numChannel=ChannelArrayobjectAtIndexJ:if(cam.uidisEqualToString:strUID)camstop:numChannelintValue;)进入播放界面(IBAction)goLiveView:(id)sender(intnld×=(int)(UIView*)sendertag;MyCameraVempCamera=CameraArrayobjectAtIndex:nld×if(tempCamera.uid!=nil&&!(tempCamera.uidisEqualToString:'(null)"&&(tempCamera.SeSSionState=CONNECTION_STATE_CONNECTED&&tempCameragetConnectionStateOfChannel:0=CONNECTION_STATE_CONNECTED)ntchannel=(int)channelArrayobjectAtlndex:nldxintVaue;SelfcamStopShow:nldx;CameraLiveviewControIIer,controller=(CameraLiveViewControllerallocinitWithNibName:"CameraLiveView"bundle:nil;controller.cameratempCamera;ControIIer.ViewTag=NSNumbernumberWithlnt:(int)(UIView*)sendertag;cotroller.delegate=self;ControIIer-SelectedChannel=channel;UlNavigationControIIer*customNavControllerMyNavViewControllerallocinit:SelfpresentviewcontrollerrcustomNavControIIeranimated:YESOOmPlelion:nil;(CustomNavControIIerpushViewControllerxontrolleranimatedzYES;controllerrelease;(CustomNavControIIerrelease;)返回摄像机列表界面-(void)backMyCamera(AppDeIegateappDelegate(AppDeIegate*)(UIApplicationsharedApplication.delegate;appDelegate.allowRotatio=O;for(inti-O;i<DEF_SplitViewNum;i+)(MyCamera,cameraldx=CameraArrayobjectAtIndexj;camerald×si。PShoW:0;)selfdismissViewControllerAnimatecl:YEScompIetion:nil;)#Pragmamark-Viewlifecycle-(vod)dealloc(Lvdoirelease;Lvdo2release:vdo3releas;Lvdo4release;(marrlmg-Vdorelease;mDummyCamrelease;(superdealloc);)-(void)viewWillLayoutSbviews(SuperviewWilILayoUtSUbViews;floatbuttonW;floatbuttonH;floatspace=1.5;buttonW=(self.view.frame.size.width-space)2.0;buttonH-self.view.frame.size.height-space)2.0;_vdol.frame=CGReetMake(O,O,buttonW,buttonH);_vdo2Jrame-CGRectMake(buttonW+space.O.buttoW,buttonH);_vdo3.frame=CGRectMake(0,buttonH+space,buttonW,buttonH);_vdo4.frame=CGRectMake(buttonW+space,buttoH+space,buttoW,buttonH);for(inti=0;i<DEF-SplitViewNum;i+)MyCamera*camera=cameraArrayi;if(camera.sessionState=CONNECTION_STATE_CONNECTED&&(cameragetConnectionSlateOfChannel:0-CONNECTION_STATE_CONNECTED)(cameraStartShOWQScreenObjectseIf);camera.delegate2-self;UIlmageView,vdo×x=marrlmgVdoi;vdoxx.image=nil;vdoxx.backgrondColorUIColorblackColor;UlActivityIndicatorView*activity=UIActivitylndicatorViewallocinit);activity,tag-1;activity.center=CGPointMake(vdoxx.frame.size.width2,vdo××.frame.size.height2);activity.color=UIColorwhiteColor;activityStartAnimating:vdoxxaddSubview:activity;activityrelease:)fullScreenButtonl.frame-self.vdo1.frame;fullScreenButton2.frame=self.vdo2.frame;fullScreeButton3.frame=self.vdo3.frame;fIIScreenButton4.frameself.vdo4.frame;)-(VOid)CheckStatus(NSUserDefauIts,userDefaults=(NsuserDefaultsstandardUserDefauIts;if(mDummyCam=nil)mDummyCam=MyCameraaIIoc)init;)MyCameradefaullCam=mDummyCam;NSNumber,defaultChannel=NSNumbernumberWithInt:-1;if(CameraArray)CameraAnayreIease;)if(ChanneIArray)ChannelAnayreIease;CameraArray(NsMutabIeArrayaIIocinit;ChanneIAaay=UNSMUtabIeArrayaIIoCJinit;for(intIbO;i<camerajist.count;i+)MyCamera,camera=(cameraIistobjectAtIncIexu;CameraArrayaddObjecticamera;Hif(camera.sessionState=CONNECTION_STATE_CONNECTED&&cameragetConnectionStateOfChannel:0=CONNECTION_STATE_CONNECTED)HHCameraArrayaddbject:camera;for(NSIntegerj=cameraArray.count;j<4;j+)CameraArrayaddObjeccdefauItCam;for(inti=O;i<DEF_SplitViewNum;i+)(NSNumber*numSelChannel=userDefaultsobjectForKey:(NSStringstringWithFormat:"ChannelMultiSetting_%d",i;if(numSelChannel)ChannelArrayaddobjectrnumSeIChanneI;else(channelArrayaddObject:defaultChannel;)for(inti=0ji<DEFSpIitViewNumji+)(MyCamera*tempCamera=cameraArrayObjectAtIdex:i;f(tempCamera.ud!=nil&&!(tempCamera.uidisEqualToString(S),'(ull)"J&&(ChanneIArrayobjectAtIndex:tintValue!=-1)(SelfcameralempCamera_didChangeChannelStatus:(NSNumber*)channelArrayobjectAtlndex:iintValueChannelStatus:tempCamera.sessionState|;)-(Void)ViewDidLoad(SuperviewDidLoad);返回按钮UIButton'backBtn=(UIButtonallocinitWithFrame:CGRectMake(O,O,60,60);(backBtnSetlmageIUllmageimageNamed:-back_main"forState:UlCOntrOIStateNOrmaI);backBtnsellmage:UllmageimageNamed:"back_clicked"forState:UIControlStateHighlighted;backBtnaddTarget:selfaction:selector(backMyCamera)forControlEvents:UIControlEventTouchUplnside;self.viewaddSubview:backBtn;(backBtnrelease:返回按钮加拖动手势UlPanGestureRecognizer*pan=(UipanGestureRecognizeraIIocinitWithTarget:selfaction:selector(panButton:);backBtnaddGestureRecognizer:pan:panrelease);marrlmg_Vdo-QNSMutabIeArrayaNocinitWithObjects:self.vdol,self.vdo2,self.vdo3,self.vdo4,nil;(selfcheckStatus;NsNotificationCenterdefauItCenteraddbserver:selfselector:SeleCIOr(CameraStoPShoWComPleted:)name:"CameraStopShowCompleted"object:nil;(NsNotificationCenterdefauItCenteraddObserver:selfselector:selector(applicationWillResignActive:)name:UIApplicationwillResignActiveNotificationObjectznil;NSNotificationCeterdefaultCenteraddObserverrsefSeleCtOr:SeleCtOr(applicationDidBeComeACtiVe:)name:lllApplicationDidBeTOmeActiveNotificationObjectzniQ;-(Void)ViewDidUnloacI(CameraArraynil;(NsNotificationCenterdefauItCenterremoveObserver:selfforKeyPath:UIApplicationwillResignActiveNotification);NsNotificationCenterdefauItCenterremoveobserver:SeIfforKeyPath:UlAPPliCaIionDidBeCOmeACIiVeN。IifiCaIion;CVPiXelBUfferReIeaSe(mPixe旧Uffer);selfsetVdo1:nil;(selfsetVdo2:nil;selfsetVdo3:nil;selfsetVdo4:nil;(SuperviewDidUnIoad;-(VOie)VieWWillDiSaPPear:(BOe)L)animated(SuperviewwilIDisappearianimaled;for(MyCamera'cameraicameraArray)(camera.deiegate2=nil;(UlApplicationsharedAppIicationSetStatUSBarHiddenrfalse;HAppDeIegate*appDelegale-(AppDeIegate,)UIApplicationSharedAppIicalion.delegate;HappDelegate.allowRotation=O;self.navigatioController.navigatioBar.hiddenNO;(NsNotificationCenterdefauItCenterremoveObserver:selfname:kApplicationDidEnterBackgroundObjectznil;NsNotificationCenterdefauItCenterremoveObSerVer:SeIfname:kAppliCationWillEnIerForegroUndobject:nil;ImTimerstartshowRevokeinvaIidate;mTimerStartShowRevoke=nil;Ullmage*navigationbarBGUIImageimageNamed:"title_bk"(self.navigationController.navigationBarsetBackgroundlmage:navigationbarBGforBarMetrics:UIBarMetricsDefault;SelLnavigationItemsetPromptznjq;*pragmamark-Application'sDocumentsdirectory-(NSURL*)applicatioDocumentsDirectoryreturn(NSFiIeManagerdefauItManagerURLsForDirectory:NSDocumentDirectoryinDomains:NSUSerDOmainMaSkIastObjecU;)#Pragmamark-UlAppIicalionDelegate-(void)applicationWillResignActive:(NSNotification*)notification(for(intl«O;i<DEF_SplitViewNum;i+)MyCamera*testCamera=(CameraArrayobjectAtIndexzi;if(testCamera.idI=nil&&!testCamera.uidisEqualToString:"(null)")NSNumber,chNm-ChanneIArrayobjectAtIndex:1;intch=chNmitVale;testCameraStopShowblock:ch;testCameraStopSoundToDevice:ch;testCameraSlopsoundToPhonexh:)-(void)applicationDidBecomeActive:(NSNotification)notification(for(inti=O;i<DEF_SplitViewNum;i+)MyCamera*testCamra=CameraArrayobjectAtIndexj;if(testCamera.uid!=nil&&!(testCamera.uidisEqualToString:(S)"(null)")NSNumber*chNum=ChanneIArrayobjectAtIndex:1;intch=(chNumintValue;if(lisGoPlayEvent)testCameraStartShowxhScreenObjectseIf;if(SeIectedAudioMode=AUDIO_MODE_MICROPHONE)testCameraStartSoundToDevicexh;if(SeIectedAudioMode=AUDlO_MC)DESPEAKER)testCamerastartSoundToPhonexh;)更新画面-(VOid)UpdateTOSCreen2:(NSArTay*)arrs(autoreleasepool(Cllmage*cilmage=arrsObjectAtIndex:0;NSString*uid=arrsObjectAtIndexd;NSNumber,channel-arrsObjeCIAUndeX:2;UllmageHmg=(UllmageimageWithCIImagexiImageSCale:UUISCreenrnainSereenscaleOrientationzuiImageOrientationUp;for(inti=O;i<DEF_SplitViewNum;i+)(MyCamera*cameraldx-CameraArrayobjectAtIndex:i;NSNumber*channelld×=ChanneIArrayobjectAtIndexj;if(Cameraldx-UidisEqualToStringiuid&&channelld×intValue=channelintValue)(UIImageView,vdoXX=(marrlmg_VdoobjectAtlndex:i;if(vdoXX)vdoXX.image=img;UlActivityIndicatorView*activity(vdo××VieWWiIhTag:1:/停止并移除转圈if(activity)(activityStopAnimating;activityremoveFromSup

    注意事项

    本文(SDEASYCAM 手机APP软件 前30页代码.docx)为本站会员(夺命阿水)主动上传,课桌文档仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知课桌文档(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-1

    经营许可证:宁B2-20210002

    宁公网安备 64010402000986号

    课桌文档
    收起
    展开