From 97feb8c7edea24b9920b673885a90113ba76e94c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20Paul=20K=C3=BChne?= Date: Thu, 23 Aug 2012 11:12:09 +0200 Subject: [PATCH] macosx/Open: merge the QTCapture and QTSound views This also allows to set QTSound as an input slave for QTCapture to capture both ES at the same time. (close #6851) --- NEWS | 1 + .../macosx/Resources/English.lproj/Open.xib | 742 +++++++++--------- modules/gui/macosx/open.h | 11 +- modules/gui/macosx/open.m | 80 +- 4 files changed, 441 insertions(+), 393 deletions(-) diff --git a/NEWS b/NEWS index ce9116be28..bdbfde3dce 100644 --- a/NEWS +++ b/NEWS @@ -76,6 +76,7 @@ Mac OS X Port: Mac OS X Interface: * add a GUI for the QTSound access module to process audio captured locally + - This also allows to capture input from a webcam and a mic at the same time. * add an option to let the Apple Remote control the system volume instead of VLC's internal volume level * add an option to show next / previous buttons diff --git a/extras/package/macosx/Resources/English.lproj/Open.xib b/extras/package/macosx/Resources/English.lproj/Open.xib index a86595c203..a772e64849 100644 --- a/extras/package/macosx/Resources/English.lproj/Open.xib +++ b/extras/package/macosx/Resources/English.lproj/Open.xib @@ -2,9 +2,9 @@ 1050 - 11G15 + 11G36 851 - 1138.47 + 1138.50 569.00 com.apple.InterfaceBuilder.CocoaPlugin @@ -12,9 +12,7 @@ YES - - - + YES @@ -52,7 +50,7 @@ {1.7976931348623157e+308, 1.7976931348623157e+308} {213, 107} - + 256 YES @@ -595,7 +593,7 @@ 1211912703 2 - + NSImage NSSwitch @@ -1010,7 +1008,6 @@ {574, 380} - 2 @@ -3275,7 +3272,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA NSResponder - + 256 YES @@ -3661,7 +3658,6 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA 256 {{49, 119}, {135, 14}} - YES 67239424 @@ -3746,31 +3742,145 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA {528, 222} - NSView NSResponder - + 256 YES - + 256 - {{17, 157}, {494, 32}} + + YES + + + 274 + + YES + + + 268 + {{102, 11}, {286, 26}} + + YES + + -2076049856 + 2048 + + + 109199615 + 129 + + + 400 + 75 + + + Item 1 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + YES + + + + Item 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + -1 + 1 + YES + YES + 2 + + + + + 268 + {{15, 39}, {290, 18}} + + _NS:682 + YES + + 67239424 + 0 + Audio + + LucidaGrande-Bold + 14 + 16 + + _NS:682 + + 1211912703 + 2 + + + + + 200 + 25 + + + + {{2, 2}, {490, 66}} + + + + + {{17, 16}, {494, 70.77734375}} - - YES - + + {0, 0} + 67239424 - 138412032 - This input allows you to process input signals from QuickTime-compatible video devices.\nSimultaneous live audio input is not supported. - - - - + 0 + Title + + + + 3 + MCAwLjgwMDAwMDAxAA + + + 3 + 0 + 0 + NO @@ -3785,7 +3895,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA 268 - {{102, 84}, {286, 26}} + {{102, 49}, {286, 26}} YES @@ -3852,7 +3962,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA 256 - {{189, 49}, {43, 19}} + {{157, 14}, {43, 19}} YES @@ -3870,7 +3980,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA 256 - {{28, 51}, {156, 14}} + {{23, 16}, {129, 14}} YES @@ -3887,7 +3997,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA 256 - {{396, 49}, {43, 19}} + {{364, 14}, {43, 19}} YES @@ -3905,7 +4015,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA 256 - {{257, 51}, {134, 14}} + {{225, 16}, {134, 14}} YES @@ -3922,7 +4032,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA 256 - {{238, 47}, {15, 22}} + {{206, 12}, {15, 22}} YES @@ -3939,7 +4049,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA 256 - {{446, 47}, {15, 22}} + {{414, 12}, {15, 22}} YES @@ -3952,147 +4062,39 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA YES - - {{2, 2}, {490, 119}} - - - - - {{17, 28}, {494, 123}} - - - {0, 0} - - 67239424 - 0 - Title - - - - 3 - MCAwLjgwMDAwMDAxAA - - - - 3 - 0 - 0 - NO - - - {528, 222} - - NSView - NSResponder - - - - 256 - - YES - - - 256 - {{17, 157}, {494, 32}} - - - YES - - 67239424 - 138412032 - This input allows you to process input signals from QuickTime-compatible audio devices. - - - - - - - - - 256 - - YES - - - 274 - - YES - - + + 268 - {{102, 84}, {286, 26}} - + {{15, 86}, {290, 18}} + + _NS:682 YES - - -2076049856 - 2048 - - - 109199615 - 129 + + 67239424 + 0 + Video + + _NS:682 + + 1211912703 + 2 + + - 400 - 75 - - - Item 1 - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - - - YES - - OtherViews - - YES - - - - Item 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Item 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - - -1 - 1 - YES - YES - 2 + 200 + 25 - {{2, 2}, {490, 119}} - - + {{2, 2.22265625}, {490, 113}} + + - {{17, 28}, {494, 123}} - - + {{17, 86.77734375}, {494, 117.22265625}} + + {0, 0} 67239424 @@ -4105,7 +4107,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA MCAwLjgwMDAwMDAxAA - + 3 0 0 @@ -4113,7 +4115,7 @@ cmUgaXMgaW5zdGFsbGVkIGFuZCB0cnkgYWdhaW4uA {528, 222} - + NSView NSResponder @@ -4746,7 +4748,7 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA YES - + 256 YES @@ -4780,12 +4782,10 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA {{2, 2}, {494, 41}} - {{38, 3}, {498, 45}} - {0, 0} 67239424 @@ -4806,8 +4806,6 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA {553, 52} - - NSView NSResponder @@ -7251,22 +7249,6 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA 3068 - - - o_qtk_long_lbl - - - - 3070 - - - - o_qtk_device_pop - - - - 3077 - qtkChanged: @@ -7935,57 +7917,33 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA o_capture_height_stp - - - 3370 - - - - o_file_sub_icon_view - - - - 3377 - - - - o_file_sub_path_fld - - - - 3378 - - - - o_file_sub_path_lbl - - + - 3379 + 3370 - o_qtkaudio_long_lbl + o_file_sub_icon_view - + - 3457 + 3377 - o_qtkaudio_device_pop + o_file_sub_path_fld - + - 3458 + 3378 - o_qtkaudio_view + o_file_sub_path_lbl - + - 3460 + 3379 @@ -8083,6 +8041,54 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA 3489 + + + o_qtk_audio_ckb + + + + 3494 + + + + o_qtk_video_ckb + + + + 3495 + + + + o_qtk_audio_device_pop + + + + 3499 + + + + o_qtk_video_device_pop + + + + 3501 + + + + qtkToggleUIElements: + + + + 3502 + + + + qtkToggleUIElements: + + + + 3503 + @@ -10470,7 +10476,7 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA YES - + QTKit @@ -10487,23 +10493,10 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA + - - 3016 - - - YES - - - - - - 3017 - - - 3071 @@ -11351,84 +11344,6 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA - - 3428 - - - YES - - - - - QTKit - - - 3429 - - - YES - - - - - - 3430 - - - YES - - - - - - 3431 - - - - - 3438 - - - YES - - - - - - 3439 - - - YES - - - - - - 3440 - - - YES - - - - - - - - 3441 - - - - - 3442 - - - - - 3443 - - - 3462 @@ -11558,6 +11473,88 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA + + 3429 + + + YES + + + + + + + 3438 + + + YES + + + + + + 3439 + + + YES + + + + + + 3440 + + + YES + + + + + + + + 3443 + + + + + 3442 + + + + + 3441 + + + + + 3490 + + + YES + + + + + + 3491 + + + + + 3492 + + + YES + + + + + + 3493 + + + @@ -11873,11 +11870,12 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA 3005.IBPluginDependency 3008.IBPluginDependency 3009.IBPluginDependency + 3013.IBEditorWindowLastContentRect 3013.IBPluginDependency 3014.IBPluginDependency - 3016.IBPluginDependency - 3017.IBPluginDependency + 3014.IBViewBoundsToFrameTransform 3071.IBPluginDependency + 3071.IBViewBoundsToFrameTransform 3072.IBPluginDependency 3073.IBPluginDependency 3074.IBPluginDependency @@ -11974,11 +11972,17 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA 3342.IBPluginDependency 3343.IBPluginDependency 3346.IBPluginDependency + 3346.IBViewBoundsToFrameTransform 3347.IBPluginDependency + 3347.IBViewBoundsToFrameTransform 3348.IBPluginDependency + 3348.IBViewBoundsToFrameTransform 3349.IBPluginDependency + 3349.IBViewBoundsToFrameTransform 3350.IBPluginDependency + 3350.IBViewBoundsToFrameTransform 3351.IBPluginDependency + 3351.IBViewBoundsToFrameTransform 3352.IBPluginDependency 3353.IBPluginDependency 3354.IBPluginDependency @@ -11991,11 +11995,10 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA 3374.IBPluginDependency 3375.IBPluginDependency 3376.IBPluginDependency - 3428.IBPluginDependency 3429.IBPluginDependency - 3430.IBPluginDependency - 3431.IBPluginDependency + 3429.IBViewBoundsToFrameTransform 3438.IBPluginDependency + 3438.IBViewBoundsToFrameTransform 3439.IBPluginDependency 3440.IBPluginDependency 3441.IBPluginDependency @@ -12025,6 +12028,12 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA 3485.IBViewBoundsToFrameTransform 3486.IBPluginDependency 3487.IBViewBoundsToFrameTransform + 3490.IBPluginDependency + 3490.IBViewBoundsToFrameTransform + 3491.IBPluginDependency + 3492.IBPluginDependency + 3492.IBViewBoundsToFrameTransform + 3493.IBPluginDependency 408.IBPluginDependency 636.IBEditorWindowLastContentRect 636.IBPluginDependency @@ -12181,7 +12190,7 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{752, 534}, {528, 222}} + {{440, 534}, {528, 222}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -12359,9 +12368,16 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{329, 512}, {528, 222}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + AUH4AABC6gAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCzAAAwswAAA + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -12458,11 +12474,29 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDGAAAwnAAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBkAAAwmQAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDs4AAwnAAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDXAAAwmQAAA + com.apple.InterfaceBuilder.CocoaPlugin + + AUNJAABCJAAAA + com.apple.InterfaceBuilder.CocoaPlugin + + AUPMgABCJAAAA + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -12476,12 +12510,13 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + AUGIAABCOOQAA + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBYAAAwlQAAA + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -12528,6 +12563,16 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA AT+AAABBgAAAA com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBcAAAwswAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBcAAAwlQAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin {{366, 327}, {574, 380}} com.apple.InterfaceBuilder.CocoaPlugin {{366, 327}, {574, 380}} @@ -12567,7 +12612,7 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA - 3489 + 3503 @@ -14300,6 +14345,7 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA panelOk: qtkAudioChanged: qtkChanged: + qtkToggleUIElements: screenChanged: subCloseSheet: subDelayStepperChanged: @@ -14340,6 +14386,7 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA id id id + id @@ -14365,6 +14412,7 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA panelOk: qtkAudioChanged: qtkChanged: + qtkToggleUIElements: screenChanged: subCloseSheet: subDelayStepperChanged: @@ -14453,6 +14501,10 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA qtkChanged: id + + qtkToggleUIElements: + id + screenChanged: id @@ -14628,13 +14680,11 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA o_net_udpm_port_stp o_output_ckbox o_panel - o_qtk_device_pop - o_qtk_label_view - o_qtk_long_lbl + o_qtk_audio_ckb + o_qtk_audio_device_pop + o_qtk_video_ckb + o_qtk_video_device_pop o_qtk_view - o_qtkaudio_device_pop - o_qtkaudio_long_lbl - o_qtkaudio_view o_screen_follow_mouse_ckb o_screen_fps_fld o_screen_fps_lbl @@ -14820,8 +14870,6 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA id id id - id - id @@ -14961,13 +15009,11 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA o_net_udpm_port_stp o_output_ckbox o_panel - o_qtk_device_pop - o_qtk_label_view - o_qtk_long_lbl + o_qtk_audio_ckb + o_qtk_audio_device_pop + o_qtk_video_ckb + o_qtk_video_device_pop o_qtk_view - o_qtkaudio_device_pop - o_qtkaudio_long_lbl - o_qtkaudio_view o_screen_follow_mouse_ckb o_screen_fps_fld o_screen_fps_lbl @@ -15526,31 +15572,23 @@ eHQAAAAAQ29weXJpZ2h0IEFwcGxlLCBJbmMuLCAyMDA5AA id - o_qtk_device_pop - id - - - o_qtk_label_view - id - - - o_qtk_long_lbl + o_qtk_audio_ckb id - o_qtk_view + o_qtk_audio_device_pop id - o_qtkaudio_device_pop + o_qtk_video_ckb id - o_qtkaudio_long_lbl + o_qtk_video_device_pop id - o_qtkaudio_view + o_qtk_view id diff --git a/modules/gui/macosx/open.h b/modules/gui/macosx/open.h index 17ffd2d103..f1aa519ac0 100644 --- a/modules/gui/macosx/open.h +++ b/modules/gui/macosx/open.h @@ -213,12 +213,10 @@ /* QTK support */ IBOutlet id o_qtk_view; - IBOutlet id o_qtk_long_lbl; - IBOutlet id o_qtk_device_pop; - IBOutlet id o_qtk_label_view; - IBOutlet id o_qtkaudio_view; - IBOutlet id o_qtkaudio_long_lbl; - IBOutlet id o_qtkaudio_device_pop; + IBOutlet id o_qtk_video_device_pop; + IBOutlet id o_qtk_video_ckb; + IBOutlet id o_qtk_audio_device_pop; + IBOutlet id o_qtk_audio_ckb; IBOutlet id o_capture_width_lbl; IBOutlet id o_capture_width_fld; IBOutlet id o_capture_width_stp; @@ -291,6 +289,7 @@ - (IBAction)openCaptureModeChanged:(id)sender; - (IBAction)qtkChanged:(id)sender; - (IBAction)qtkAudioChanged:(id)sender; +- (IBAction)qtkToggleUIElements:(id)sender; - (IBAction)screenChanged:(id)sender; - (IBAction)eyetvSwitchChannel:(id)sender; - (IBAction)eyetvLaunch:(id)sender; diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m index 0088116098..ac053dd70f 100644 --- a/modules/gui/macosx/open.m +++ b/modules/gui/macosx/open.m @@ -199,8 +199,7 @@ static VLCOpen *_o_sharedMainInstance = nil; [o_eyetv_chn_bgbar setUsesThreadedAnimation: YES]; [o_capture_mode_pop removeAllItems]; - [o_capture_mode_pop addItemWithTitle: _NS("Video Device")]; - [o_capture_mode_pop addItemWithTitle: _NS("Audio Device")]; + [o_capture_mode_pop addItemWithTitle: _NS("Input Devices")]; [o_capture_mode_pop addItemWithTitle: _NS("Screen")]; [o_capture_mode_pop addItemWithTitle: @"EyeTV"]; [o_screen_long_lbl setStringValue: _NS("This input allows you to save, stream or display your current screen contents.")]; @@ -219,12 +218,11 @@ static VLCOpen *_o_sharedMainInstance = nil; [o_eyetv_noInstanceLong_lbl setStringValue: _NS("VLC could not connect to EyeTV.\nMake sure that you installed VLC's EyeTV plugin.")]; [o_eyetv_launchEyeTV_btn setTitle: _NS("Launch EyeTV now")]; [o_eyetv_getPlugin_btn setTitle: _NS("Download Plugin")]; - [o_qtk_long_lbl setStringValue: _NS("This input allows you to process input signals from QuickTime-compatible video devices.\nSimultaneous live Audio input is not supported.")]; [o_capture_width_lbl setStringValue: _NS("Image width:")]; [o_capture_height_lbl setStringValue: _NS("Image height:")]; [self qtkvideoDevices]; - [o_qtk_device_pop removeAllItems]; + [o_qtk_video_device_pop removeAllItems]; msg_Dbg( VLCIntf, "Found %lu video capture devices", [qtkvideoDevices count] ); if([qtkvideoDevices count] >= 1) @@ -237,20 +235,20 @@ static VLCOpen *_o_sharedMainInstance = nil; for(int ivideo = 0; ivideo < deviceCount; ivideo++){ QTCaptureDevice *qtk_device; qtk_device = [qtkvideoDevices objectAtIndex:ivideo]; - [o_qtk_device_pop addItemWithTitle: [qtk_device localizedDisplayName]]; + [o_qtk_video_device_pop addItemWithTitle: [qtk_device localizedDisplayName]]; if([[[qtk_device uniqueID]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:qtk_currdevice_uid]){ - [o_qtk_device_pop selectItemAtIndex:ivideo]; + [o_qtk_video_device_pop selectItemAtIndex:ivideo]; } } } else { - [o_qtk_device_pop addItemWithTitle: _NS("None")]; + [o_qtk_video_device_pop addItemWithTitle: _NS("None")]; [qtk_currdevice_uid release]; } [self qtkaudioDevices]; - [o_qtkaudio_device_pop removeAllItems]; + [o_qtk_audio_device_pop removeAllItems]; msg_Dbg( VLCIntf, "Found %lu audio capture devices", [qtkaudioDevices count] ); if([qtkaudioDevices count] >= 1) @@ -263,15 +261,15 @@ static VLCOpen *_o_sharedMainInstance = nil; for(int iaudio = 0; iaudio < deviceCount; iaudio++){ QTCaptureDevice *qtkaudio_device; qtkaudio_device = [qtkaudioDevices objectAtIndex:iaudio]; - [o_qtkaudio_device_pop addItemWithTitle: [qtkaudio_device localizedDisplayName]]; + [o_qtk_audio_device_pop addItemWithTitle: [qtkaudio_device localizedDisplayName]]; if([[[qtkaudio_device uniqueID]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:qtkaudio_currdevice_uid]){ - [o_qtkaudio_device_pop selectItemAtIndex:iaudio]; + [o_qtk_audio_device_pop selectItemAtIndex:iaudio]; } } } else { - [o_qtkaudio_device_pop addItemWithTitle: _NS("None")]; + [o_qtk_audio_device_pop addItemWithTitle: _NS("None")]; [qtkaudio_currdevice_uid release]; } @@ -319,19 +317,20 @@ static VLCOpen *_o_sharedMainInstance = nil; [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidMountNotification object:nil]; [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidUnmountNotification object:nil]; - [self performSelector:@selector(scanOpticalMedia:) withObject:nil afterDelay:2.0]; - [self performSelector:@selector(qtkChanged:) withObject:nil afterDelay:2.5]; - [self performSelector:@selector(qtkAudioChanged:) withObject:nil afterDelay:3.0]; + [self performSelector:@selector(qtkToggleUIElements:) withObject:nil afterDelay:.3]; + [self performSelector:@selector(scanOpticalMedia:) withObject:nil afterDelay:.5]; [self setMRL: @""]; } - (void)setMRL:(NSString *)newMRL { - [o_mrl release]; + if (o_mrl) + [o_mrl release]; + o_mrl = newMRL; [o_mrl retain]; - [o_mrl_fld setStringValue: newMRL]; + [o_mrl_fld setStringValue: o_mrl]; if ([o_mrl length] > 0) [o_btn_ok setEnabled: YES]; else @@ -505,10 +504,15 @@ static VLCOpen *_o_sharedMainInstance = nil; else [o_options addObject: @"no-screen-follow-mouse"]; } - else if( [[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Video Device")] ) + else if( [[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Input Devices")] ) { - [o_options addObject: [NSString stringWithFormat: @"qtcapture-width=%i", [o_capture_width_fld intValue]]]; - [o_options addObject: [NSString stringWithFormat: @"qtcapture-height=%i", [o_capture_height_fld intValue]]]; + if ([o_qtk_video_ckb state]) + { + [o_options addObject: [NSString stringWithFormat: @"qtcapture-width=%i", [o_capture_width_fld intValue]]]; + [o_options addObject: [NSString stringWithFormat: @"qtcapture-height=%i", [o_capture_height_fld intValue]]]; + if ([o_qtk_audio_ckb state] && qtkaudio_currdevice_uid) + [o_options addObject: [NSString stringWithFormat: @"input-slave=qtsound://%@", qtkaudio_currdevice_uid]]; + } } } @@ -537,7 +541,7 @@ static VLCOpen *_o_sharedMainInstance = nil; - (IBAction)qtkChanged:(id)sender { - NSInteger i_selectedDevice = [o_qtk_device_pop indexOfSelectedItem]; + NSInteger i_selectedDevice = [o_qtk_video_device_pop indexOfSelectedItem]; if( [qtkvideoDevices count] >= 1 ) { NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex: 0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute]; @@ -547,20 +551,32 @@ static VLCOpen *_o_sharedMainInstance = nil; [o_capture_width_stp setIntValue: [o_capture_width_fld intValue]]; [o_capture_height_stp setIntValue: [o_capture_height_fld intValue]]; qtk_currdevice_uid = [[(QTCaptureDevice *)[qtkvideoDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; - [self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]]; } } - (IBAction)qtkAudioChanged:(id)sender { - NSInteger i_selectedDevice = [o_qtkaudio_device_pop indexOfSelectedItem]; + NSInteger i_selectedDevice = [o_qtk_audio_device_pop indexOfSelectedItem]; if( [qtkaudioDevices count] >= 1 ) { qtkaudio_currdevice_uid = [[(QTCaptureDevice *)[qtkaudioDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; - [self setMRL:[NSString stringWithFormat:@"qtsound://%@", qtkaudio_currdevice_uid]]; } } +- (IBAction)qtkToggleUIElements:(id)sender +{ + [o_qtk_audio_device_pop setEnabled:[o_qtk_audio_ckb state]]; + BOOL b_state = [o_qtk_video_ckb state]; + [o_qtk_video_device_pop setEnabled:b_state]; + [o_capture_width_fld setEnabled:b_state]; + [o_capture_width_stp setEnabled:b_state]; + [o_capture_height_fld setEnabled:b_state]; + [o_capture_height_stp setEnabled:b_state]; + [self qtkAudioChanged:sender]; + [self qtkChanged:sender]; + [self openCaptureModeChanged:sender]; +} + #pragma mark - #pragma mark Main Actions @@ -1402,25 +1418,19 @@ static VLCOpen *_o_sharedMainInstance = nil; free( ids ); } } - else if( [[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Video Device")] ) + else if( [[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Input Devices")] ) { [self showCaptureView: o_qtk_view]; if ([o_capture_width_fld intValue] <= 0) [self qtkChanged:nil]; - if(!qtk_currdevice_uid) - [self setMRL: @""]; - else - [self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]]; - } - else if( [[[o_capture_mode_pop selectedItem] title] isEqualToString: _NS("Audio Device")] ) - { - [self showCaptureView: o_qtkaudio_view]; [self qtkAudioChanged:nil]; - if(!qtkaudio_currdevice_uid) - [self setMRL: @""]; - else + [self setMRL: @""]; + + if ([o_qtk_video_ckb state] && qtk_currdevice_uid) + [self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]]; + else if([o_qtk_audio_ckb state] && qtkaudio_currdevice_uid) [self setMRL:[NSString stringWithFormat:@"qtsound://%@", qtkaudio_currdevice_uid]]; } } -- 2.39.2