当前位置: 首页>>代码示例>>Python>>正文


Python NSSound.soundNamed_方法代码示例

本文整理汇总了Python中AppKit.NSSound.soundNamed_方法的典型用法代码示例。如果您正苦于以下问题:Python NSSound.soundNamed_方法的具体用法?Python NSSound.soundNamed_怎么用?Python NSSound.soundNamed_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppKit.NSSound的用法示例。


在下文中一共展示了NSSound.soundNamed_方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: executeCapture

# 需要导入模块: from AppKit import NSSound [as 别名]
# 或者: from AppKit.NSSound import soundNamed_ [as 别名]
 def executeCapture(self):
     self.photoView.setHidden_(False)
     self.captureView.setHidden_(True)
     self.previewButton.setHidden_(False)
     self.countdownCheckbox.setHidden_(True)
     self.captureButton.setHidden_(True)
     self.useButton.setEnabled_(True)
     if self.captureSession is not None:
         self.captureImage()
         NSSound.soundNamed_("Grab").play()
         self.captureSession.stopRunning()
开发者ID:bitsworking,项目名称:blink-cocoa,代码行数:13,代码来源:PhotoPicker.py

示例2: executeTimerCapture_

# 需要导入模块: from AppKit import NSSound [as 别名]
# 或者: from AppKit.NSSound import soundNamed_ [as 别名]
 def executeTimerCapture_(self, timer):
     if self.countdown_counter == 1:
         self.executeCapture()
         self.countdownProgress.stopAnimation_(None)
         self.countdownCheckbox.setHidden_(True)
         self.countdownProgress.setHidden_(True)
         self.timer.invalidate()
         self.timer = None
     else:
         self.countdown_counter = self.countdown_counter - 1
         NSSound.soundNamed_("Tink").play()
         self.countdownProgress.setDoubleValue_(self.countdown_counter)
开发者ID:bitsworking,项目名称:blink-cocoa,代码行数:14,代码来源:PhotoPicker.py

示例3: present

# 需要导入模块: from AppKit import NSSound [as 别名]
# 或者: from AppKit.NSSound import soundNamed_ [as 别名]
    def present(self):
        """Present the Alert, giving up after configured time..

        Returns: Int result code, based on PyObjC enums. See NSAlert
            Class reference, but result should be one of:
                User clicked the cancel button:
                    NSAlertFirstButtonReturn = 1000
                Alert timed out:
                    NSRunAbortedResponse = -1001
        """
        if self.timer:
            NSRunLoop.currentRunLoop().addTimer_forMode_(self.timer, NSModalPanelRunLoopMode)
        # Start a Cocoa application by getting the shared app object.
        # Make the python app the active app so alert is noticed.
        app = NSApplication.sharedApplication()
        app.activateIgnoringOtherApps_(True)
        if self.alert_sound:
            sound = NSSound.soundNamed_(self.alert_sound).play()
        result = self.runModal()  # pylint: disable=no-member
        print result
        return result
开发者ID:mattlavine,项目名称:auto_logout,代码行数:23,代码来源:auto_logout.py


注:本文中的AppKit.NSSound.soundNamed_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。