Skip to content

Commit

Permalink
iOS: Now using IPeakGenerator instead of PeakGenerator.
Browse files Browse the repository at this point in the history
IPeakGenerator was missing from the iOS csproj file.

Related to issue #405.
  • Loading branch information
ycastonguay committed Mar 15, 2013
1 parent fed9c4c commit 62b612a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 5 additions & 3 deletions MPfm/MPfm.MVP/Bootstrap/Bootstrapper.cs
Expand Up @@ -17,10 +17,11 @@

using MPfm.Library.Database;
using MPfm.Library.Database.Interfaces;
using MPfm.MVP.Services;
using MPfm.MVP.Presenters.Interfaces;
using MPfm.MVP.Presenters;
using MPfm.Sound.PeakFiles;
using MPfm.MVP.Helpers;
using MPfm.MVP.Presenters;
using MPfm.MVP.Presenters.Interfaces;
using MPfm.MVP.Services;
using MPfm.MVP.Services.Interfaces;
using TinyMessenger;

Expand Down Expand Up @@ -48,6 +49,7 @@ static Bootstrapper()
container.Register<ILibraryService, LibraryService>().AsSingleton();
container.Register<IAudioFileCacheService, AudioFileCacheService>().AsSingleton();
container.Register<IUpdateLibraryService, UpdateLibraryService>().AsSingleton();
container.Register<IPeakFileGenerator, PeakFileGenerator>().AsSingleton();

// Register presenters
container.Register<ISplashPresenter, SplashPresenter>().AsSingleton();
Expand Down
1 change: 1 addition & 0 deletions MPfm/MPfm.Sound/MPfm.Sound.iOS.csproj
Expand Up @@ -224,5 +224,6 @@
<Compile Include="Tags\SV8Metadata.cs" />
<Compile Include="XingInfoHeaderReader.cs" />
<Compile Include="PeakFiles\PeakFileGenerator.cs" />
<Compile Include="PeakFiles\IPeakFileGenerator.cs" />
</ItemGroup>
</Project>
11 changes: 6 additions & 5 deletions MPfm/MPfm.iOS/Classes/Controls/MPfmWaveFormView.cs
Expand Up @@ -18,25 +18,26 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using MPfm.Core;
using MPfm.MVP.Bootstrap;
using MPfm.MVP.Navigation;
using MPfm.Sound;
using MPfm.Sound.AudioFiles;
using MPfm.Sound.PeakFiles;
using MonoTouch.CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.IO;
using System.Threading.Tasks;
using MPfm.iOS.Helpers;

namespace MPfm.iOS.Classes.Controls
{
[Register("MPfmWaveFormView")]
public class MPfmWaveFormView : UIView
{
private PeakFileGenerator _peakFileGenerator;
private IPeakFileGenerator _peakFileGenerator;
private string _status = "Initial status";
private bool _isLoading = false;
private UIImage _imageCache = null;
Expand All @@ -63,7 +64,7 @@ private void Initialize()
_waveDataHistory = new List<WaveDataMinMax>();
DisplayType = WaveFormDisplayType.Stereo;

_peakFileGenerator = new PeakFileGenerator();
_peakFileGenerator = Bootstrapper.GetContainer().Resolve<IPeakFileGenerator>();
_peakFileGenerator.OnProcessStarted += HandleOnPeakFileProcessStarted;
_peakFileGenerator.OnProcessData += HandleOnPeakFileProcessData;
_peakFileGenerator.OnProcessDone += HandleOnPeakFileProcessDone;
Expand Down Expand Up @@ -107,7 +108,7 @@ void HandleOnPeakFileProcessDone(PeakFileDoneData data)
{
InvokeOnMainThread(() => {
//if(data.Cancelled)
if(data.AudioFilePath != _currentAudioFile.FilePath)
if(_currentAudioFile != null && data.AudioFilePath != _currentAudioFile.FilePath)
{
if(_imageCache != null)
{
Expand Down

0 comments on commit 62b612a

Please sign in to comment.