Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Added methods for profile saving and removing
Browse files Browse the repository at this point in the history
  • Loading branch information
nefarius committed Nov 29, 2015
1 parent 560045b commit f614326
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions ScpControl/Profiler/DualShockProfileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,23 @@ public void PassThroughAllProfiles(ScpHidReport report)
profile.Remap(report);
}
}

/// <summary>
/// Stores a new <see cref="DualShockProfile"/> or overwrites an existing one.
/// </summary>
/// <param name="profile">The <see cref="DualShockProfile"/> to save.</param>
public void SubmitProfile(DualShockProfile profile)
{
profile.Save(Path.Combine(GlobalConfiguration.ProfilesPath, profile.FileName));
}

/// <summary>
/// Removes a given <see cref="DualShockProfile"/>.
/// </summary>
/// <param name="profile">The <see cref="DualShockProfile"/>to remove.</param>
public void RemoveProfile(DualShockProfile profile)
{
File.Delete(Path.Combine(GlobalConfiguration.ProfilesPath, profile.FileName));
}
}
}
6 changes: 3 additions & 3 deletions ScpControl/RootHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -601,17 +601,17 @@ var channel in _nativeFeedSubscribers.Select(nativeFeedSubscriber => nativeFeedS

public IEnumerable<DualShockProfile> GetProfiles()
{
throw new NotImplementedException();
return DualShockProfileManager.Instance.Profiles;
}

public void SubmitProfile(DualShockProfile profile)
{
throw new NotImplementedException();
DualShockProfileManager.Instance.SubmitProfile(profile);
}

public void RemoveProfile(DualShockProfile profile)
{
throw new NotImplementedException();
DualShockProfileManager.Instance.RemoveProfile(profile);
}
}
}

0 comments on commit f614326

Please sign in to comment.