Skip to content

Commit

Permalink
Added IDesktopFirstRunView, IMobileFirstRunView and IEditSongMetadata…
Browse files Browse the repository at this point in the history
…View (and their presenters). They are empty for now. Edit Song Metadata can now be opened on Windows. The Song Browser contextual menu is now working again on Windows.

Related to issue #422.
  • Loading branch information
ycastonguay committed Aug 20, 2013
1 parent c27a302 commit 24977a0
Show file tree
Hide file tree
Showing 30 changed files with 1,144 additions and 843 deletions.
3 changes: 3 additions & 0 deletions MPfm/MPfm.MVP/Bootstrap/Bootstrapper.cs
Expand Up @@ -84,6 +84,9 @@ static Bootstrapper()
container.Register<ISyncWebBrowserPresenter, SyncWebBrowserPresenter>().AsMultiInstance();
container.Register<ISyncMenuPresenter, SyncMenuPresenter>().AsMultiInstance();
container.Register<ISyncDownloadPresenter, SyncDownloadPresenter>().AsMultiInstance();
container.Register<IEditSongMetadataPresenter, EditSongMetadataPresenter>().AsSingleton();
container.Register<IDesktopFirstRunPresenter, DesktopFirstRunPresenter>().AsSingleton();
container.Register<IMobileFirstRunPresenter, MobileFirstRunPresenter>().AsSingleton();
container.Register<IAboutPresenter, AboutPresenter>().AsSingleton();
}

Expand Down
9 changes: 9 additions & 0 deletions MPfm/MPfm.MVP/MPfm.MVP.csproj
Expand Up @@ -112,6 +112,12 @@
<Compile Include="Messages\MobileLibraryBrowserItemClickedMessage.cs" />
<Compile Include="Navigation\MobileNavigationManager.cs" />
<Compile Include="Presenters\AudioPreferencesPresenter.cs" />
<Compile Include="Presenters\MobileFirstRunPresenter.cs" />
<Compile Include="Presenters\DesktopFirstRunPresenter.cs" />
<Compile Include="Presenters\EditSongMetadataPresenter.cs" />
<Compile Include="Presenters\Interfaces\IMobileFirstRunPresenter.cs" />
<Compile Include="Presenters\Interfaces\IDesktopFirstRunPresenter.cs" />
<Compile Include="Presenters\Interfaces\IEditSongMetadataPresenter.cs" />
<Compile Include="Presenters\Interfaces\IMobileOptionsMenuPresenter.cs" />
<Compile Include="Presenters\MobileOptionsMenuPresenter.cs" />
<Compile Include="Presenters\MobileLibraryBrowserPresenter.cs" />
Expand All @@ -121,6 +127,9 @@
<Compile Include="Presenters\Interfaces\IAudioPreferencesPresenter.cs" />
<Compile Include="Presenters\UpdateLibraryPresenter.cs" />
<Compile Include="Models\PlayerPositionEntity.cs" />
<Compile Include="Views\IMobileFirstRunView.cs" />
<Compile Include="Views\IDesktopFirstRunView.cs" />
<Compile Include="Views\IEditSongMetadataView.cs" />
<Compile Include="Views\IMobileOptionsMenuView.cs" />
<Compile Include="Views\IMobileLibraryBrowserView.cs" />
<Compile Include="Views\ILibraryPreferencesView.cs" />
Expand Down
83 changes: 83 additions & 0 deletions MPfm/MPfm.MVP/Navigation/NavigationManager.cs
Expand Up @@ -19,6 +19,7 @@
using System.Collections.Generic;
using MPfm.Library.UpdateLibrary;
using MPfm.MVP.Bootstrap;
using MPfm.Player.Objects;
using TinyIoC;
using MPfm.MVP.Views;
using MPfm.MVP.Presenters.Interfaces;
Expand All @@ -45,6 +46,18 @@ public abstract class NavigationManager
ITimeShiftingPresenter _timeShiftingPresenter;
IPitchShiftingPresenter _pitchShiftingPresenter;

IMarkerDetailsView _markerDetailsView;
IMarkerDetailsPresenter _markerDetailsPresenter;

ILoopDetailsView _loopDetailsView;
ILoopDetailsPresenter _loopDetailsPresenter;

IDesktopFirstRunView _firstRunView;
IDesktopFirstRunPresenter _firstRunPresenter;

IEditSongMetadataView _editSongMetadataView;
IEditSongMetadataPresenter _editSongMetadataPresenter;

IDesktopPreferencesView _preferencesView;
IAudioPreferencesPresenter _audioPreferencesPresenter;
IGeneralPreferencesPresenter _generalPreferencesPresenter;
Expand Down Expand Up @@ -295,5 +308,75 @@ public virtual IUpdateLibraryView CreateUpdateLibraryView(UpdateLibraryMode mode
};
return _updateLibraryView;
}

public virtual IDesktopFirstRunView CreateFirstRunView()
{
if (_firstRunView != null)
{
_firstRunView.ShowView(true);
return _firstRunView;
}

Action<IBaseView> onViewReady = (view) =>
{
_firstRunPresenter = Bootstrapper.GetContainer().Resolve<IDesktopFirstRunPresenter>();
_firstRunPresenter.BindView((IDesktopFirstRunView)view);
};

_firstRunView = Bootstrapper.GetContainer().Resolve<IDesktopFirstRunView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } });
_firstRunView.OnViewDestroy = (view) =>
{
_firstRunView = null;
_firstRunPresenter = null;
};
return _firstRunView;
}

public virtual IEditSongMetadataView CreateEditSongMetadataView(AudioFile audioFile)
{
if (_editSongMetadataView != null)
{
_editSongMetadataView.ShowView(true);
return _editSongMetadataView;
}

Action<IBaseView> onViewReady = (view) =>
{
_editSongMetadataPresenter = Bootstrapper.GetContainer().Resolve<IEditSongMetadataPresenter>();
_editSongMetadataPresenter.BindView((IEditSongMetadataView)view);
_editSongMetadataPresenter.SetAudioFile(audioFile);
};

_editSongMetadataView = Bootstrapper.GetContainer().Resolve<IEditSongMetadataView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } });
_editSongMetadataView.OnViewDestroy = (view) =>
{
_editSongMetadataView = null;
_editSongMetadataPresenter = null;
};
return _editSongMetadataView;
}

public virtual IMarkerDetailsView CreateMarkerDetailsView(Guid markerId)
{
if (_markerDetailsView != null)
{
_markerDetailsView.ShowView(true);
return _markerDetailsView;
}

Action<IBaseView> onViewReady = (view) =>
{
_markerDetailsPresenter = Bootstrapper.GetContainer().Resolve<IMarkerDetailsPresenter>(new NamedParameterOverloads() { { "markerId", markerId } });
_markerDetailsPresenter.BindView((IMarkerDetailsView)view);
};

_markerDetailsView = Bootstrapper.GetContainer().Resolve<IMarkerDetailsView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } });
_markerDetailsView.OnViewDestroy = (view) =>
{
_markerDetailsView = null;
_markerDetailsPresenter = null;
};
return _markerDetailsView;
}
}
}
39 changes: 39 additions & 0 deletions MPfm/MPfm.MVP/Presenters/DesktopFirstRunPresenter.cs
@@ -0,0 +1,39 @@
// Copyright © 2011-2013 Yanick Castonguay
//
// This file is part of MPfm.
//
// MPfm is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MPfm is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MPfm. If not, see <http://www.gnu.org/licenses/>.

using MPfm.MVP.Navigation;
using MPfm.MVP.Presenters.Interfaces;
using MPfm.MVP.Views;

namespace MPfm.MVP.Presenters
{
/// <summary>
/// First Run view presenter for desktop devices.
/// </summary>
public class DesktopFirstRunPresenter : BasePresenter<IDesktopFirstRunView>, IDesktopFirstRunPresenter
{
public DesktopFirstRunPresenter()
{
}

public override void BindView(IDesktopFirstRunView view)
{
base.BindView(view);
}
}
}

47 changes: 47 additions & 0 deletions MPfm/MPfm.MVP/Presenters/EditSongMetadataPresenter.cs
@@ -0,0 +1,47 @@
// Copyright © 2011-2013 Yanick Castonguay
//
// This file is part of MPfm.
//
// MPfm is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MPfm is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MPfm. If not, see <http://www.gnu.org/licenses/>.

using MPfm.MVP.Navigation;
using MPfm.MVP.Presenters.Interfaces;
using MPfm.MVP.Views;
using MPfm.Sound.AudioFiles;

namespace MPfm.MVP.Presenters
{
/// <summary>
/// Edit Song Metadata view presenter.
/// </summary>
public class EditSongMetadataPresenter : BasePresenter<IEditSongMetadataView>, IEditSongMetadataPresenter
{
AudioFile _audioFile;

public EditSongMetadataPresenter()
{
}

public override void BindView(IEditSongMetadataView view)
{
base.BindView(view);
}

public void SetAudioFile(AudioFile audioFile)
{
_audioFile = audioFile;
}
}
}

29 changes: 29 additions & 0 deletions MPfm/MPfm.MVP/Presenters/Interfaces/IDesktopFirstRunPresenter.cs
@@ -0,0 +1,29 @@
// Copyright © 2011-2013 Yanick Castonguay
//
// This file is part of MPfm.
//
// MPfm is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MPfm is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MPfm. If not, see <http://www.gnu.org/licenses/>.

using MPfm.MVP.Models;
using MPfm.MVP.Views;

namespace MPfm.MVP.Presenters.Interfaces
{
/// <summary>
/// First Run presenter interface for desktop devices.
/// </summary>
public interface IDesktopFirstRunPresenter : IBasePresenter<IDesktopFirstRunView>
{
}
}
30 changes: 30 additions & 0 deletions MPfm/MPfm.MVP/Presenters/Interfaces/IEditSongMetadataPresenter.cs
@@ -0,0 +1,30 @@
// Copyright © 2011-2013 Yanick Castonguay
//
// This file is part of MPfm.
//
// MPfm is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MPfm is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MPfm. If not, see <http://www.gnu.org/licenses/>.

using MPfm.MVP.Views;
using MPfm.Sound.AudioFiles;

namespace MPfm.MVP.Presenters.Interfaces
{
/// <summary>
/// Edit Song Metadata presenter interface.
/// </summary>
public interface IEditSongMetadataPresenter : IBasePresenter<IEditSongMetadataView>
{
void SetAudioFile(AudioFile audioFile);
}
}
29 changes: 29 additions & 0 deletions MPfm/MPfm.MVP/Presenters/Interfaces/IMobileFirstRunPresenter.cs
@@ -0,0 +1,29 @@
// Copyright © 2011-2013 Yanick Castonguay
//
// This file is part of MPfm.
//
// MPfm is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MPfm is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MPfm. If not, see <http://www.gnu.org/licenses/>.

using MPfm.MVP.Models;
using MPfm.MVP.Views;

namespace MPfm.MVP.Presenters.Interfaces
{
/// <summary>
/// First Run presenter interface for mobile devices.
/// </summary>
public interface IMobileFirstRunPresenter : IBasePresenter<IMobileFirstRunView>
{
}
}
68 changes: 33 additions & 35 deletions MPfm/MPfm.MVP/Presenters/Interfaces/ISongBrowserPresenter.cs
@@ -1,35 +1,33 @@
// Copyright © 2011-2013 Yanick Castonguay
//
// This file is part of MPfm.
//
// MPfm is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MPfm is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MPfm. If not, see <http://www.gnu.org/licenses/>.

using MPfm.MVP.Models;
using MPfm.MVP.Views;
using MPfm.Sound.AudioFiles;
using MPfm.Library.Objects;

namespace MPfm.MVP.Presenters.Interfaces
{
/// <summary>
/// Song browser presenter interface.
/// </summary>
public interface ISongBrowserPresenter : IBasePresenter<ISongBrowserView>
{
LibraryQuery Query { get; }

void ChangeQuery(LibraryQuery query);
void TableRowDoubleClicked(AudioFile audioFile);
}
}
// Copyright © 2011-2013 Yanick Castonguay
//
// This file is part of MPfm.
//
// MPfm is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// MPfm is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with MPfm. If not, see <http://www.gnu.org/licenses/>.

using System;
using MPfm.MVP.Models;
using MPfm.MVP.Views;
using MPfm.Sound.AudioFiles;
using MPfm.Library.Objects;

namespace MPfm.MVP.Presenters.Interfaces
{
/// <summary>
/// Song Browser presenter interface.
/// </summary>
public interface ISongBrowserPresenter : IBasePresenter<ISongBrowserView>
{

}
}

0 comments on commit 24977a0

Please sign in to comment.