-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configurable commands, resolves #16
- Loading branch information
Showing
9 changed files
with
575 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<configuration> | ||
<configSections> | ||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > | ||
<section name="MPVMediaControl.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
</sectionGroup> | ||
</configSections> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup> | ||
<userSettings> | ||
<MPVMediaControl.Properties.Settings> | ||
<setting name="PlayCommand" serializeAs="String"> | ||
<value>set_property pause false</value> | ||
</setting> | ||
<setting name="PauseCommand" serializeAs="String"> | ||
<value>set_property pause true</value> | ||
</setting> | ||
<setting name="PrevCommand" serializeAs="String"> | ||
<value>playlist-prev weak</value> | ||
</setting> | ||
<setting name="NextCommand" serializeAs="String"> | ||
<value>playlist-next weak</value> | ||
</setting> | ||
</MPVMediaControl.Properties.Settings> | ||
</userSettings> | ||
</configuration> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace MPVMediaControl | ||
{ | ||
public partial class CommandEditor : Form | ||
{ | ||
private static readonly string[] _defaultCommands = { "set_property pause false", "set_property pause true", "playlist-prev weak", "playlist-next weak" }; | ||
|
||
public CommandEditor() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void CommandEditor_Load(object sender, EventArgs e) | ||
{ | ||
playCmdText.Text = Properties.Settings.Default.PlayCommand; | ||
pauseCmdText.Text = Properties.Settings.Default.PauseCommand; | ||
prevCmdText.Text = Properties.Settings.Default.PrevCommand; | ||
nextCmdText.Text = Properties.Settings.Default.NextCommand; | ||
} | ||
|
||
private void button1_Click(object sender, EventArgs e) | ||
{ | ||
playCmdText.Text = _defaultCommands[0]; | ||
} | ||
|
||
private void button4_Click(object sender, EventArgs e) | ||
{ | ||
pauseCmdText.Text = _defaultCommands[1]; | ||
} | ||
|
||
private void button5_Click(object sender, EventArgs e) | ||
{ | ||
prevCmdText.Text = _defaultCommands[2]; | ||
} | ||
|
||
private void button6_Click(object sender, EventArgs e) | ||
{ | ||
nextCmdText.Text = _defaultCommands[3]; | ||
} | ||
|
||
private void button2_Click(object sender, EventArgs e) | ||
{ | ||
Properties.Settings.Default.PlayCommand = playCmdText.Text; | ||
Properties.Settings.Default.PauseCommand = pauseCmdText.Text; | ||
Properties.Settings.Default.PrevCommand = prevCmdText.Text; | ||
Properties.Settings.Default.NextCommand = nextCmdText.Text; | ||
|
||
Properties.Settings.Default.Save(); | ||
Close(); | ||
} | ||
|
||
private void button3_Click(object sender, EventArgs e) | ||
{ | ||
Close(); | ||
} | ||
} | ||
} |
Oops, something went wrong.