|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.ComponentModel; |
| 4 | +using System.Data; |
| 5 | +using System.Drawing; |
| 6 | +using System.Linq; |
| 7 | +using System.Text; |
| 8 | +using System.Threading.Tasks; |
| 9 | +using System.Windows.Forms; |
| 10 | + |
| 11 | +namespace MPVMediaControl |
| 12 | +{ |
| 13 | + public partial class CommandEditor : Form |
| 14 | + { |
| 15 | + private static readonly string[] _defaultCommands = { "set_property pause false", "set_property pause true", "playlist-prev weak", "playlist-next weak" }; |
| 16 | + |
| 17 | + public CommandEditor() |
| 18 | + { |
| 19 | + InitializeComponent(); |
| 20 | + } |
| 21 | + |
| 22 | + private void CommandEditor_Load(object sender, EventArgs e) |
| 23 | + { |
| 24 | + playCmdText.Text = Properties.Settings.Default.PlayCommand; |
| 25 | + pauseCmdText.Text = Properties.Settings.Default.PauseCommand; |
| 26 | + prevCmdText.Text = Properties.Settings.Default.PrevCommand; |
| 27 | + nextCmdText.Text = Properties.Settings.Default.NextCommand; |
| 28 | + } |
| 29 | + |
| 30 | + private void button1_Click(object sender, EventArgs e) |
| 31 | + { |
| 32 | + playCmdText.Text = _defaultCommands[0]; |
| 33 | + } |
| 34 | + |
| 35 | + private void button4_Click(object sender, EventArgs e) |
| 36 | + { |
| 37 | + pauseCmdText.Text = _defaultCommands[1]; |
| 38 | + } |
| 39 | + |
| 40 | + private void button5_Click(object sender, EventArgs e) |
| 41 | + { |
| 42 | + prevCmdText.Text = _defaultCommands[2]; |
| 43 | + } |
| 44 | + |
| 45 | + private void button6_Click(object sender, EventArgs e) |
| 46 | + { |
| 47 | + nextCmdText.Text = _defaultCommands[3]; |
| 48 | + } |
| 49 | + |
| 50 | + private void button2_Click(object sender, EventArgs e) |
| 51 | + { |
| 52 | + Properties.Settings.Default.PlayCommand = playCmdText.Text; |
| 53 | + Properties.Settings.Default.PauseCommand = pauseCmdText.Text; |
| 54 | + Properties.Settings.Default.PrevCommand = prevCmdText.Text; |
| 55 | + Properties.Settings.Default.NextCommand = nextCmdText.Text; |
| 56 | + |
| 57 | + Properties.Settings.Default.Save(); |
| 58 | + Close(); |
| 59 | + } |
| 60 | + |
| 61 | + private void button3_Click(object sender, EventArgs e) |
| 62 | + { |
| 63 | + Close(); |
| 64 | + } |
| 65 | + } |
| 66 | +} |
0 commit comments