зеркало из https://github.com/xamarin/ios-samples.git
Adding SysSound sample ready for MonoTouch
This commit is contained in:
Родитель
582a6811bd
Коммит
fa4691f2f2
Двоичный файл не отображается.
|
@ -0,0 +1,26 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SysSound", "SysSound\SysSound.csproj", "{B538DD79-C235-4E39-B3E9-0F90A6D07F78}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Release|iPhone = Release|iPhone
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B538DD79-C235-4E39-B3E9-0F90A6D07F78}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{B538DD79-C235-4E39-B3E9-0F90A6D07F78}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{B538DD79-C235-4E39-B3E9-0F90A6D07F78}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{B538DD79-C235-4E39-B3E9-0F90A6D07F78}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{B538DD79-C235-4E39-B3E9-0F90A6D07F78}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{B538DD79-C235-4E39-B3E9-0F90A6D07F78}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{B538DD79-C235-4E39-B3E9-0F90A6D07F78}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{B538DD79-C235-4E39-B3E9-0F90A6D07F78}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = SysSound\SysSound.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
Двоичный файл не отображается.
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MonoTouch.Foundation;
|
||||
using MonoTouch.UIKit;
|
||||
using System.Drawing;
|
||||
|
||||
namespace SysSound {
|
||||
|
||||
/// <summary>
|
||||
/// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
/// User Interface of the application, as well as listening (and optionally responding) to
|
||||
/// application events from iOS.
|
||||
/// </summary>
|
||||
[Register ("AppDelegate")]
|
||||
public partial class AppDelegate : UIApplicationDelegate {
|
||||
|
||||
// class-level declarations
|
||||
UIWindow window;
|
||||
SysSoundViewController _SysSoundViewController;
|
||||
|
||||
/// <summary>
|
||||
/// This method is invoked when the application has loaded and is ready to run. In this
|
||||
/// method you should instantiate the window, load the UI into it and then make the window
|
||||
/// visible.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// You have 5 seconds to return from this method, or iOS will terminate your application.
|
||||
/// </remarks>
|
||||
public override bool FinishedLaunching (UIApplication app, NSDictionary options) {
|
||||
|
||||
// create a new window instance based on the screen size
|
||||
window = new UIWindow (UIScreen.MainScreen.Bounds);
|
||||
|
||||
// If you have defined a view, add it here:
|
||||
|
||||
|
||||
// window.AddSubview (navigationController.View);
|
||||
this._SysSoundViewController = new SysSoundViewController();
|
||||
this._SysSoundViewController.View.Frame = new RectangleF(0.0f, 20.0f, 320.0f, 460.0f);
|
||||
this.window.AddSubview(this._SysSoundViewController.View);
|
||||
|
||||
// make the window visible
|
||||
window.MakeKeyAndVisible ();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using MonoTouch.ObjCRuntime;
|
||||
using MonoTouch.Foundation;
|
||||
|
||||
namespace SysSound.Extensions {
|
||||
|
||||
//helper methods for withing with bundles
|
||||
public static class NSBundleExtensions {
|
||||
private static readonly IntPtr _Selector_URLForResource = Selector.GetHandle ("URLForResource:withExtension:");
|
||||
|
||||
/// <summary>
|
||||
/// Returns the file URL for the resource identified by the specified name and file extension.
|
||||
/// </summary>
|
||||
public static NSUrl URLForResource (this NSBundle source, string for_resource, string with_extension) {
|
||||
var ns_for = new NSString(for_resource);
|
||||
var ns_extension = new NSString(with_extension);
|
||||
|
||||
//try and get the resource
|
||||
var result = Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr(
|
||||
source.Handle,
|
||||
NSBundleExtensions._Selector_URLForResource,
|
||||
ns_for.Handle,
|
||||
ns_extension.Handle);
|
||||
|
||||
//return back as a NSUrl
|
||||
return Runtime.GetNSObject(result) as NSUrl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MonoTouch.Foundation;
|
||||
using MonoTouch.UIKit;
|
||||
|
||||
namespace SysSound {
|
||||
public class Application {
|
||||
/// <summary>
|
||||
/// This is the main entry point of the application.
|
||||
/// </summary>
|
||||
static void Main (string[] args) {
|
||||
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
// you can specify it here.
|
||||
UIApplication.Main (args, null, "AppDelegate");
|
||||
}
|
||||
}
|
||||
}
|
Двоичный файл не отображается.
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProductVersion>10.0.0</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{B538DD79-C235-4E39-B3E9-0F90A6D07F78}</ProjectGuid>
|
||||
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>SysSound</RootNamespace>
|
||||
<AssemblyName>SysSound</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="monotouch" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<Compile Include="SysSoundViewControllerController.cs" />
|
||||
<Compile Include="SysSoundViewController.designer.cs">
|
||||
<DependentUpon>SysSoundViewController.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Extensions\NSBundleExtensions.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="SysSoundViewController.xib" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Sounds\tap.aif" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Extensions\" />
|
||||
<Folder Include="Sounds\" />
|
||||
<Folder Include="..\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,23 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by MonoDevelop to store outlets and
|
||||
// actions made in the Xcode designer. If it is removed, they will be lost.
|
||||
// Manual changes to this file may not be handled correctly.
|
||||
//
|
||||
using MonoTouch.Foundation;
|
||||
|
||||
namespace SysSound
|
||||
{
|
||||
[Register ("SysSoundViewController")]
|
||||
partial class SysSoundViewController
|
||||
{
|
||||
[Action ("playSystemSound:")]
|
||||
partial void playSystemSound (MonoTouch.Foundation.NSObject sender);
|
||||
|
||||
[Action ("playAlertSound:")]
|
||||
partial void playAlertSound (MonoTouch.Foundation.NSObject sender);
|
||||
|
||||
[Action ("vibrate:")]
|
||||
partial void vibrate (MonoTouch.Foundation.NSObject sender);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,408 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">512</int>
|
||||
<string key="IBDocument.SystemVersion">11B26</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1617</string>
|
||||
<string key="IBDocument.AppKitVersion">1138</string>
|
||||
<string key="IBDocument.HIToolboxVersion">566.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">534</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBUINavigationItem</string>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUIView</string>
|
||||
<string>IBUINavigationBar</string>
|
||||
<string>IBProxyObject</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="843779117">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUIButton" id="848744846">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">1316</int>
|
||||
<object class="NSPSMatrix" key="NSFrameMatrix"/>
|
||||
<string key="NSFrame">{{20, 142}, {280, 37}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="544942593"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<object class="NSFont" key="IBUIFont" id="427785210">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUIHighlightedTitle">System Sound</string>
|
||||
<string key="IBUIDisabledTitle">System Sound</string>
|
||||
<string key="IBUISelectedTitle">System Sound</string>
|
||||
<string key="IBUINormalTitle">System Sound</string>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor" id="102832784">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MSAxIDEAA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUIDisabledTitleColor" id="90838490">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
<reference key="IBUISelectedTitleColor" ref="90838490"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
|
||||
</object>
|
||||
<reference key="IBUIHighlightedTitleShadowColor" ref="90838490"/>
|
||||
<reference key="IBUIDisabledTitleShadowColor" ref="90838490"/>
|
||||
<reference key="IBUISelectedTitleShadowColor" ref="90838490"/>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="90838490"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="544942593">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">1316</int>
|
||||
<object class="NSPSMatrix" key="NSFrameMatrix"/>
|
||||
<string key="NSFrame">{{20, 197}, {280, 37}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="350734455"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<reference key="IBUIFont" ref="427785210"/>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">Alert Sound</string>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="102832784"/>
|
||||
<reference key="IBUIDisabledTitleColor" ref="90838490"/>
|
||||
<reference key="IBUISelectedTitleColor" ref="90838490"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
|
||||
</object>
|
||||
<reference key="IBUIHighlightedTitleShadowColor" ref="90838490"/>
|
||||
<reference key="IBUIDisabledTitleShadowColor" ref="90838490"/>
|
||||
<reference key="IBUISelectedTitleShadowColor" ref="90838490"/>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="90838490"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="350734455">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">1828</int>
|
||||
<object class="NSPSMatrix" key="NSFrameMatrix"/>
|
||||
<string key="NSFrame">{{20, 257}, {280, 37}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<reference key="IBUIFont" ref="427785210"/>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUIHighlightedTitle">Vibration</string>
|
||||
<string key="IBUIDisabledTitle">Vibration</string>
|
||||
<string key="IBUISelectedTitle">Vibration</string>
|
||||
<string key="IBUINormalTitle">Vibration</string>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="102832784"/>
|
||||
<reference key="IBUIDisabledTitleColor" ref="90838490"/>
|
||||
<reference key="IBUISelectedTitleColor" ref="90838490"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA</bytes>
|
||||
</object>
|
||||
<reference key="IBUIHighlightedTitleShadowColor" ref="90838490"/>
|
||||
<reference key="IBUIDisabledTitleShadowColor" ref="90838490"/>
|
||||
<reference key="IBUISelectedTitleShadowColor" ref="90838490"/>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="90838490"/>
|
||||
</object>
|
||||
<object class="IBUINavigationBar" id="1044949436">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">290</int>
|
||||
<string key="NSFrameSize">{320, 44}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="848744846"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSArray" key="IBUIItems">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUINavigationItem" id="466676816">
|
||||
<reference key="IBUINavigationBar" ref="1044949436"/>
|
||||
<string key="IBUITitle">SysSound</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{320, 460}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1044949436"/>
|
||||
<reference key="IBUIBackgroundColor" ref="102832784"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">playSystemSound:</string>
|
||||
<reference key="source" ref="848744846"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">1</int>
|
||||
</object>
|
||||
<int key="connectionID">25</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">playAlertSound:</string>
|
||||
<reference key="source" ref="544942593"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">1</int>
|
||||
</object>
|
||||
<int key="connectionID">26</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">vibrate:</string>
|
||||
<reference key="source" ref="350734455"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">1</int>
|
||||
</object>
|
||||
<int key="connectionID">28</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="1044949436"/>
|
||||
<reference ref="350734455"/>
|
||||
<reference ref="544942593"/>
|
||||
<reference ref="848744846"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="843779117"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="848744846"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">11</int>
|
||||
<reference key="object" ref="1044949436"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="466676816"/>
|
||||
</object>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">12</int>
|
||||
<reference key="object" ref="466676816"/>
|
||||
<reference key="parent" ref="1044949436"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">13</int>
|
||||
<reference key="object" ref="350734455"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">15</int>
|
||||
<reference key="object" ref="544942593"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>1.IBUserGuides</string>
|
||||
<string>11.IBPluginDependency</string>
|
||||
<string>12.IBPluginDependency</string>
|
||||
<string>13.IBAttributePlaceholdersKey</string>
|
||||
<string>13.IBPluginDependency</string>
|
||||
<string>15.IBAttributePlaceholdersKey</string>
|
||||
<string>15.IBPluginDependency</string>
|
||||
<string>6.IBAttributePlaceholdersKey</string>
|
||||
<string>6.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>SysSoundViewController</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>UIResponder</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<object class="NSMutableArray">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<object class="NSMutableDictionary">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<object class="NSMutableDictionary">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<object class="NSMutableDictionary">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">29</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">SysSoundViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>playAlertSound:</string>
|
||||
<string>playSystemSound:</string>
|
||||
<string>vibrate:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>playAlertSound:</string>
|
||||
<string>playSystemSound:</string>
|
||||
<string>vibrate:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">playAlertSound:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">playSystemSound:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">vibrate:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/SysSoundViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<integer value="512" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">534</string>
|
||||
</data>
|
||||
</archive>
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MonoTouch.UIKit;
|
||||
using MonoTouch.Foundation;
|
||||
using SysSound.Extensions;
|
||||
using MonoTouch.AudioToolbox;
|
||||
|
||||
namespace SysSound {
|
||||
|
||||
public partial class SysSoundViewController : UIViewController {
|
||||
|
||||
//loads the SysSoundViewController.xib file and connects it to this object
|
||||
public SysSoundViewController ()
|
||||
: base ("SysSoundViewController", null) {
|
||||
}
|
||||
|
||||
//holds the sound to play
|
||||
private SystemSound _Sound;
|
||||
|
||||
//prepares the audio
|
||||
public override void ViewDidLoad () {
|
||||
base.ViewDidLoad ();
|
||||
|
||||
//enable audio
|
||||
AudioSession.Initialize();
|
||||
|
||||
//load the sound
|
||||
var url = NSBundle.MainBundle.URLForResource("tap", "aif");
|
||||
this._Sound = SystemSound.FromFile(url);
|
||||
|
||||
}
|
||||
|
||||
partial void playSystemSound(NSObject sender) {
|
||||
this._Sound.PlaySystemSound();
|
||||
}
|
||||
|
||||
partial void playAlertSound (NSObject sender) {
|
||||
this._Sound.PlayAlertSound();
|
||||
}
|
||||
|
||||
partial void vibrate (NSObject sender) {
|
||||
SystemSound.Vibrate.PlaySystemSound();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 3.2 KiB |
Загрузка…
Ссылка в новой задаче