From c2f3b382932175cc6aceb441edf33186a17e7b7f Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 30 Nov 2009 18:06:36 -0500 Subject: [PATCH] Updated the sample to work --- avTouch/avTouch.csproj | 8 +++++- avTouch/avTouchViewController.cs | 7 +++-- avTouch/avTouchViewController.xib | 25 ++++++++++-------- avTouch/avTouchViewController.xib.designer.cs | 2 ++ avTouch/{ => images}/forward.png | Bin 5 files changed, 26 insertions(+), 16 deletions(-) rename avTouch/{ => images}/forward.png (100%) diff --git a/avTouch/avTouch.csproj b/avTouch/avTouch.csproj index 2ee54e6f..01c5b999 100644 --- a/avTouch/avTouch.csproj +++ b/avTouch/avTouch.csproj @@ -12,6 +12,7 @@ avTouch v3.5 avTouch + 3.0 true @@ -22,6 +23,8 @@ prompt 4 -debug + None + True none @@ -29,6 +32,7 @@ bin\iPhoneSimulator\Release prompt 4 + False true @@ -39,6 +43,7 @@ prompt 4 iPhone Developer + True none @@ -47,6 +52,7 @@ prompt 4 iPhone Developer + False @@ -81,7 +87,6 @@ - @@ -91,6 +96,7 @@ + diff --git a/avTouch/avTouchViewController.cs b/avTouch/avTouchViewController.cs index 30fc6055..b0cec670 100644 --- a/avTouch/avTouchViewController.cs +++ b/avTouch/avTouchViewController.cs @@ -36,8 +36,8 @@ namespace avTouch public override void AwakeFromNib () { - playBtnBg = UIImage.FromFile ("play.png").StretchableImage (12, 0); - pauseBtnBg = UIImage.FromFile ("pause.png").StretchableImage (12, 0); + playBtnBg = UIImage.FromFile ("images/play.png").StretchableImage (12, 0); + pauseBtnBg = UIImage.FromFile ("images/pause.png").StretchableImage (12, 0); _playButton.SetImage (playBtnBg, UIControlState.Normal); _duration.AdjustsFontSizeToFitWidth = true; @@ -46,6 +46,7 @@ namespace avTouch var fileUrl = NSBundle.MainBundle.PathForResource ("sample", "m4a"); player = AVAudioPlayer.FromUrl (new NSUrl (fileUrl, false)); + player.FinishedPlaying += delegate(object sender, AVStatusEventArgs e) { if (!e.Status) Console.WriteLine ("Did not complete successfully"); @@ -65,8 +66,6 @@ namespace avTouch _fileName.Text = String.Format ("Mono {0} ({1} ch)", Path.GetFileName (player.Url.RelativePath), player.NumberOfChannels); UpdateViewForPlayerInfo (); UpdateViewForPlayerState (); - - } public void UpdateCurrentTime () diff --git a/avTouch/avTouchViewController.xib b/avTouch/avTouchViewController.xib index c0104bef..aacf0bc8 100644 --- a/avTouch/avTouchViewController.xib +++ b/avTouch/avTouchViewController.xib @@ -3,9 +3,9 @@ 528 10B504 - 732 - 1038.2 - 437.00 + 740 + 1038.22 + 457.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 62 @@ -63,7 +63,7 @@ NO NSImage - sound_meter_background.png + images/sound_meter_background.png @@ -157,14 +157,14 @@ 292 - {{16, 355}, {9, 15}} + {{20, 355}, {5, 15}} NO NO NO NSImage - volume_down.png + images/volume_down.png @@ -177,7 +177,7 @@ NO NSImage - volume_up.png + images/volume_up.png @@ -214,7 +214,7 @@ NSImage - rewind.png + images/rewind.png @@ -239,7 +239,7 @@ NSImage - play.png + images/play.png @@ -268,7 +268,10 @@ - + + NSImage + images/forward.png + {{-1, 416}, {320, 44}} @@ -319,7 +322,7 @@ NO NSImage - sound_meter_glare.png + images/sound_meter_glare.png diff --git a/avTouch/avTouchViewController.xib.designer.cs b/avTouch/avTouchViewController.xib.designer.cs index 23b385ff..8470fe52 100644 --- a/avTouch/avTouchViewController.xib.designer.cs +++ b/avTouch/avTouchViewController.xib.designer.cs @@ -15,6 +15,7 @@ namespace avTouch { [MonoTouch.Foundation.Register("avTouchViewController")] public partial class avTouchViewController { + #pragma warning disable 0169 [MonoTouch.Foundation.Connect("view")] private MonoTouch.UIKit.UIView view { get { @@ -40,6 +41,7 @@ namespace avTouch { [MonoTouch.Foundation.Register("avTouchController")] public partial class avTouchController { + #pragma warning disable 0169 [MonoTouch.Foundation.Export("volumeSliderMoved:")] partial void volumeSliderMoved (MonoTouch.UIKit.UISlider sender); diff --git a/avTouch/forward.png b/avTouch/images/forward.png similarity index 100% rename from avTouch/forward.png rename to avTouch/images/forward.png