Skip to content

Commit

Permalink
iOS: Refactored wave form generation and cache into a new class, Wave…
Browse files Browse the repository at this point in the history
…FormCacheManager.

This created a few minor bugs but the peak file are generating fine.
The goal is to share the same wave form cache and generating threads between wave form controls.

Related to issue #405.
  • Loading branch information
ycastonguay committed Apr 8, 2013
1 parent b00ab4a commit de0deac
Show file tree
Hide file tree
Showing 10 changed files with 688 additions and 469 deletions.
2 changes: 1 addition & 1 deletion MPfm/MPfm.MVP/MPfm.MVP.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,6 @@
<Compile Include="Views\IPlayerStatusView.cs" />
<Compile Include="Presenters\Interfaces\IPlayerStatusPresenter.cs" />
<Compile Include="Presenters\PlayerStatusPresenter.cs" />
<Compile Include="Messages\MobileNavigationManagerCommandMessage&#x5;.cs" />
<Compile Include="Messages\MobileNavigationManagerCommandMessage.cs" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions MPfm/MPfm.Sound/PeakFiles/PeakFileStartedData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ public class PeakFileStartedData
/// Defines the total number of blocks to read.
/// </summary>
public int TotalBlocks { get; set; }
public string AudioFilePath { get; set; }
}
}
4 changes: 0 additions & 4 deletions MPfm/MPfm.iOS/Classes/Controllers/PlayerViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ public override void DidReceiveMemoryWarning()

public override void ViewDidLoad()
{
// Set fonts
// lblPosition.Font = UIFont.FromName("OstrichSans-Black", 18);
// lblLength.Font = UIFont.FromName("OstrichSans-Black", 18);

// Load button bitmaps
btnPrevious.SetImage(UIImage.FromBundle("Images/Buttons/previous"), UIControlState.Normal);
btnPrevious.SetImage(UIImage.FromBundle("Images/Buttons/previous_on"), UIControlState.Highlighted);
Expand Down
10 changes: 5 additions & 5 deletions MPfm/MPfm.iOS/Classes/Controls/MPfmNavigationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public MPfmNavigationController(MobileNavigationTabType tabType) : base()
// Create messenger hub to listen to player changes
_messengerHub = Bootstrapper.GetContainer().Resolve<ITinyMessengerHub>();
_messengerHub.Subscribe<PlayerPlaylistIndexChangedMessage>((message) => {
Console.WriteLine("NavCtrl (" + TabType.ToString() + ") - PlayerPlaylistIndexChangedMessage");
//Console.WriteLine("NavCtrl (" + TabType.ToString() + ") - PlayerPlaylistIndexChangedMessage");
UpdateNowPlayingView();
});
_messengerHub.Subscribe<PlayerStatusMessage>((message) => {
Console.WriteLine("NavCtrl (" + TabType.ToString() + ") - PlayerStatusMessage - Status=" + message.Status.ToString());
//Console.WriteLine("NavCtrl (" + TabType.ToString() + ") - PlayerStatusMessage - Status=" + message.Status.ToString());
if(message.Status == PlayerStatusType.Playing)
_isPlayerPlaying = true;
else
Expand Down Expand Up @@ -122,7 +122,7 @@ public MPfmNavigationController(MobileNavigationTabType tabType) : base()

public override void ViewWillLayoutSubviews()
{
Console.WriteLine("MPfmNavCtrl - ViewWillLayoutSubviews");
//Console.WriteLine("MPfmNavCtrl - ViewWillLayoutSubviews");

float x = 12;
if(this.VisibleViewController.NavigationItem.LeftBarButtonItem != null)
Expand Down Expand Up @@ -163,10 +163,10 @@ public override void ViewWillLayoutSubviews()

private void UpdateNowPlayingView()
{
Console.WriteLine("NavCtrl (" + TabType.ToString() + ") - UpdateNowPlayingView: isPlayerPlaying=" + _isPlayerPlaying.ToString() + " isViewPlayer=" + _isViewPlayer.ToString());
//Console.WriteLine("NavCtrl (" + TabType.ToString() + ") - UpdateNowPlayingView: isPlayerPlaying=" + _isPlayerPlaying.ToString() + " isViewPlayer=" + _isViewPlayer.ToString());
if(_isPlayerPlaying && !_isViewPlayer)
{
Console.WriteLine("NavCtrl - Showing Now Playing view...");
//Console.WriteLine("NavCtrl - Showing Now Playing view...");
UIView.Animate(0.3f, () => {
_btnEffects.Frame = new RectangleF(UIScreen.MainScreen.Bounds.Width, 0, 44, 44);
_btnEffects.Alpha = 0;
Expand Down
Loading

0 comments on commit de0deac

Please sign in to comment.