volume

AudioServicesPlaySystemSound Volume?

我们两清 提交于 2019-11-28 06:27:44
I have this code: -(void)createAndPlaySoundID: (NSString*)name { NSString *path = [NSString stringWithFormat: @"%@/%@", [[NSBundle mainBundle] resourcePath], name]; NSURL* filePath = [NSURL fileURLWithPath: path isDirectory: NO]; SystemSoundID soundID; AudioServicesCreateSystemSoundID((__bridge CFURLRef)filePath, &soundID); AudioServicesPlaySystemSound(soundID); } I call this like so: [self createAndPlaySoundID: @"mySound.caf"]; This works great, however I have no control over the volume. I simply want the volume to be controlled by the user using the standard physical volume buttons on their

How to implement a volume key shutter for iPhone?

梦想与她 提交于 2019-11-28 04:24:27
I want to implement the same behavior with the native camera of iOS5 : press the volume + button to take a photo What's the ideal way to archive it? Are there any ways to capture the volume key pressed event? After googling & searching around for hours, I found 1 solution: using NSNotificationCenter : ... [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumeChanged:) name:@"AVSystemController_SystemVolumeDidChangeNotification" object:nil]; ... - (void)volumeChanged:(NSNotification *)notification{ [self takePhoto]; } However, it has 2 issues: There is an semi

Change Volume on Mac programmatically

无人久伴 提交于 2019-11-28 04:02:30
问题 I'm looking for a not applescript way to change the system volume on Mac OS X programmatically. I just couldn't find a solution. Anyone any ideas? 回答1: Take a look at this class: https://github.com/InerziaSoft/ISSoundAdditions It can change system volume and make use of CoreAudio API. An example of usage should look like this: [NSSound setSystemVolume:0.5] 来源: https://stackoverflow.com/questions/6278589/change-volume-on-mac-programmatically

Docker数据卷Volume实现文件共享、数据迁移备份(三)

梦想的初衷 提交于 2019-11-28 03:11:32
数据卷volume功能特性 数据卷 是一个可供一个或多个容器使用的特殊目录,实现让容器中的一个目录和宿主机中的一个文件或者目录进行绑定。数据卷 是被设计用来持久化数据的 对于数据卷你可以理解为NFS中的哪个分享出来的挂载点,指宿主机共享的目录。 主要有如下的功能和特性 容器中数据的持久存储 容器间的资源共享 容器的迁移(分布式) 对数据卷的修改会立马生效 对数据卷的更新,不会影响镜像 数据卷默认会一直存在,即使容器被删除 (注意docker自主管理的会被删除,容器删除前一定要对数据卷进行备份) 数据卷volume共享方式 实现数据卷有如下三种方法 Bind mount volume:用户需要明确指定容器中的目录和宿主机中的哪个目录进行绑定 Docker Management Volume:docker daemon自行管理将容器中的目录和宿主机中的哪个目录进行绑定 基于一个现有容器实现多个容器之间文件共享 数据卷volume文件共享之Bind Mount Volume 1. Bind mount volume 第一步:在宿主机创建目录并准备测试文件 [root@ken ~]# mkdir /ken [root@ken ~]# echo "test for volumes by ken">/ken/index.html 第二步:启动容器 -it:互动模式登录容器,并分配一个终端

kvm虚拟化存储管理(3)

吃可爱长大的小学妹 提交于 2019-11-28 03:10:46
一、KVM 存储虚拟化介绍 KVM 的存储虚拟化是通过存储池(Storage Pool)和卷(Volume)来管理的。 Storage Pool 是宿主机上可以看到的一片存储空间,可以是多种型; Volume 是在 Storage Pool 中划分出的一块空间,宿主机将 Volume 分配给虚拟机,Volume 在虚拟机中看到的就是一块硬盘。 二、目录类型的 Storage Pool 文件目录是最常用的 Storage Pool 类型。KVM 将宿主机目录 /var/lib/libvirt/images/ 作为默认的 Storage Pool Volume 是该目录下面的文件了,一个文件就是一个 Volume。 那 KVM 是怎么知道要把 /var/lib/libvirt/images 这个目录当做默认 Storage Pool 的呢? 实际上 KVM 所有可以使用的 Storage Pool 都定义在宿主机的 /etc/libvirt/storage 目录下,每个 Pool 一个 xml 文件,如下: 默认有一个 default.xml,其内容如下:注意:Storage Pool 的类型是 “dir”,目录的路径就是/var/lib/libvirt/images 三、创建Storage Pool (1)在 virt-manager 中打开一台虚拟机,为其添加硬盘,执行如下: (2

Check volume button usage when screen is off

一笑奈何 提交于 2019-11-28 03:09:16
问题 For this question I'm going to quote another user who got no response to their question: I've written an Andoid app that uses the hardware Volume buttons for another purpose. It works fine if the app is running and visible, but when I turn the screen off or let it time out, the button clicks don't get into my handlers. Does anyone know if there is a way to detect these button clicks when the screen is off? Source: AV695's question I'm working on an app myself that makes use of the volume

How to take a photo on the volume-up event when using UIImagePickerController with custom camera controls?

笑着哭i 提交于 2019-11-28 02:25:55
问题 In iOS 5, the volume-up button will now take a photo in the camera app, and on a UIImagePickerController instance where .showsCameraControlls == YES . Happy days. However, when I set showsCameraControlls to NO , and supply my own (which in turn triggers takePicture method), the volume-up button will no longer work. How can I detect the volume event while the UIImagePickerController is showing? The old way to detect volume changes was like so: AudioSessionSetActive(true); [

Reference a Volume/Drive by Label

走远了吗. 提交于 2019-11-28 01:38:08
问题 I'm trying to write a batch file to xcopy a folder to a removable USB drive. The problem that I face, however, is that drive letters are subject to change, so I would like to be able to do this by referencing the volume label instead of the drive letter. Any ideas? An hour of Google-ing has proved fruitless. :( 回答1: This command should discover the drive with the correct label and store the drive letter (with colon) in variable "usb" for /f %%D in ('wmic volume get DriveLetter^, Label ^| find

Having Docker access External files

旧巷老猫 提交于 2019-11-28 00:09:46
I am interested in having docker have access to external files, however, I do not wish to include them as a volume. The files that I need access to will change over time, and this means I would need to re-mount repeatedly. Unless, I can mount a mere directory, and whatever is in that directory is also mounted. I am just in need of allowing a software program pushed into a container, to run "over" my local system, where this software program has access to files on my local system. Advice? Is there another way besides adding the files needing to be processed as a volume? I solved the same

继续我们的学习。这次鸟哥讲的是LVM。。。磁盘管理

旧时模样 提交于 2019-11-28 00:05:29
LVM。。。让我理解就是一个将好多分区磁盘帮到一起的玩意,类似于烙大饼。。。然后再切 新建了一个虚拟机,然后又挂了一个5G的硬盘,然后分出了5块空间,挂载到了虚拟机上。这些步骤很简单 fdisk mkdir mount......不赘述了。。。鸟哥也不赘述我也就不赘述了。继续看重点 这是鸟哥的官方解释,看看,是不是跟我说的一样摊大饼,在切割?买过饼吃的人都应该懂的。。。。 LVM概念 好了。概念讲完了,鸟哥讲了动态分配的实现原理,继续截图 这几个东东的关系,你看明白了么?没看明白不要紧,我给你做大饼吃 首先,将磁盘都做成LVM可识别的格式。就是PV 然后,用VG将这些PV串成一张大饼 最后,就是切大饼 LV。那LV的最基础的组成部分是什么呢?就是PE。PE就是切块的最小单元。 看完我做的大饼,再看上面的图,是否会更理解一下。 也就是说,你要扩充只能扩充VG中未被LV切块的饼,是否能明白,稍微懂点分区的都明白应该。比如你现在空间不够了,需要干嘛,先PV,然后加入到VG,然后再切饼。 LVM硬盘写入,鸟哥说有两种模式 线性模式,写完一张再写另一张 交错模式,文件分成两部分,两张硬盘,交互写入。注:我没看明白为啥当初要设计这种模式的原因 [root@localhost ~]# pvcreate /dev/sdb{1,2,3,4,5} Device /dev/sdb1 excluded