-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.cs
120 lines (94 loc) · 4.27 KB
/
window.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
using System.Diagnostics;
namespace danverter {
public partial class Danverter : Form
{
public Danverter()
{
InitializeComponent();
this.MinimumSize = new Size(600, 600);
this.Size = new Size(600, 600);
string[] mp3_to_wav_quality = new string[] { "44100 Hz", "48000 Hz" };
string[] audio_quality = new string[] { "320 kbps (Insane)", "256 kbps (Extreme)", "192 kbps (Standard) (default)", "128 kbps (Medium)" };
combobox_wav_quality.Items.AddRange(mp3_to_wav_quality);
combobox_wav_quality.SelectedIndex = 1;
combobox_audio_quality.Items.AddRange(audio_quality);
combobox_audio_quality.SelectedIndex = 2;
checkbox_automatic_quality.Checked = true;
radiobutton_mp4.Checked = true;
textbox_average_bps.Text = "4000000";
}
// some organization on this, but this might be really messy anyways
private void mp3_button_browse_files_click(object sender, EventArgs e)
{
MP3FileExplorer.Instance.open_file_explorer();
MP3FileExplorer.Instance.refresh(display_selected_mp3_files, label_number_files);
}
private void mp3_button_delete_selected_files_click(object sender, EventArgs e)
{
MP3FileExplorer.Instance.delete_selected_files(display_selected_mp3_files);
MP3FileExplorer.Instance.refresh(display_selected_mp3_files, label_number_files);
}
private void mp3_button_clear_click(object sender, EventArgs e)
{
MP3FileExplorer.Instance.clear();
MP3FileExplorer.Instance.refresh(display_selected_mp3_files, label_number_files);
}
private void mp3_button_output_directory(object sender, EventArgs e)
{
MP3FileExplorer.Instance.set_output_directory(textbox_output_directory_mp3);
}
private void mp3_button_start(object sender, EventArgs e)
{
MP3FileExplorer.Instance.start_mp3_to_wav(combobox_wav_quality, progress_mp3);
}
private void button_select_file_shadowplay_click(object sender, EventArgs e)
{
ShadowplayFileExplorer.Instance.open_file_explorer();
textbox_file_shadowplay.Text = ShadowplayFileExplorer.Instance.get_file();
}
private void button_shadowplay_start_click(object sender, EventArgs e)
{
if (radiobutton_mp3.Checked)
{
ShadowplayFileExplorer.Instance.start_mp4_to_mp3_conversion(masked_time_start.Text, masked_time_end.Text, combobox_audio_quality.SelectedIndex, textbox_filename.Text);
}
else {
ShadowplayFileExplorer.Instance.start_mp4_to_trimmed_mp4_conversion(masked_time_start.Text, masked_time_end.Text, checkbox_automatic_quality.Checked, Int32.Parse(textbox_average_bps.Text), textbox_filename.Text);
}
}
private void radiobutton_mp3_CheckedChanged(object sender, EventArgs e)
{
ShadowplayFileExplorer.Instance.set_output_type("mp3");
groupbox_mp4_options.Enabled = false;
groupbox_mp3_options.Enabled = true;
}
private void radiobutton_mp4_CheckedChanged(object sender, EventArgs e)
{
ShadowplayFileExplorer.Instance.set_output_type("mp4");
groupbox_mp3_options.Enabled = false;
groupbox_mp4_options.Enabled = true;
}
private void checkbox_automatic_quality_CheckedChanged(object sender, EventArgs e)
{
if (checkbox_automatic_quality.Checked)
{
groupbox_advanced_options.Enabled = false;
}
else
{
groupbox_advanced_options.Enabled = true;
}
}
private void textbox_advanced_bitrate(object sender, KeyPressEventArgs e)
{
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '.'))
{
e.Handled = true;
}
}
private void button_output_directory_shadowplay_click(object sender, EventArgs e)
{
ShadowplayFileExplorer.Instance.set_output_directory(textbox_output_directory_shadowplay);
}
}
}