private void SetButtonAppearance(Button button) { MixdownInfo info = button.Tag as MixdownInfo; if (info == null) { button.Text = "<Empty>"; button.Font = EmptyFont; toolTip1.SetToolTip(button, null); } else { if (shuffled) { button.Text = "?"; toolTip1.SetToolTip(button, null); button.Font = BigFont; } else { button.Text = info.Letter; toolTip1.SetToolTip(button, info.FileName); button.Font = BigFont; } } }
public PropertiesForm(MixdownInfo mixdownInfo) { InitializeComponent(); this.mixdownInfo = mixdownInfo; textBoxDelay.Text = mixdownInfo.DelayMilliseconds.ToString(); textBoxOffset.Text = mixdownInfo.OffsetMilliseconds.ToString(); trackBarVolume.Value = mixdownInfo.VolumeDecibels; trackBarVolume_Scroll(this, EventArgs.Empty); }
private void SetButtonInfo(Button button, MixdownInfo info) { if (button.Tag != null) { ClearFile(button); } button.Tag = info; SetButtonAppearance(button); mixer.AddInputStream(info.Stream); SetLengthLabel(); }
private void ClearFile(Button button) { if (button.Tag != null) { MixdownInfo buttonInfo = button.Tag as MixdownInfo; mixer.RemoveInputStream(buttonInfo.Stream); buttonInfo.Stream.Close(); button.Tag = null; SetButtonAppearance(button); } }
private void WriteMixdownInfo(XmlWriter writer, MixdownInfo mixdownInfo) { if (mixdownInfo != null) { writer.WriteStartElement("Mix"); writer.WriteAttributeString("FileName", mixdownInfo.FileName); writer.WriteAttributeString("DelayMilliseconds", mixdownInfo.DelayMilliseconds.ToString()); writer.WriteAttributeString("OffsetMilliseconds", mixdownInfo.OffsetMilliseconds.ToString()); writer.WriteAttributeString("VolumeDecibels", mixdownInfo.VolumeDecibels.ToString()); writer.WriteEndElement(); } }
private void propertiesToolStripMenuItem_Click(object sender, EventArgs e) { Button button = (Button)contextMenuStrip1.SourceControl; if (button.Tag != null) { MixdownInfo mixdownInfo = button.Tag as MixdownInfo; PropertiesForm propertiesForm = new PropertiesForm(mixdownInfo); if (propertiesForm.ShowDialog() == DialogResult.OK) { } } }
private bool LoadFile(Button button) { // prompt for file load OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "WAV Files (*.wav)|*.wav"; if (openFileDialog.ShowDialog() == DialogResult.OK) { MixdownInfo info = new MixdownInfo(openFileDialog.FileName); // TODO: sort this out - post shuffle info.Letter = button.Name.Substring(button.Name.Length - 1); SetButtonInfo(button, info); return true; } return false; }
private bool LoadFile(Button button) { // prompt for file load OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "WAV Files (*.wav)|*.wav"; if (openFileDialog.ShowDialog() == DialogResult.OK) { MixdownInfo info = new MixdownInfo(openFileDialog.FileName); // TODO: sort this out - post shuffle info.Letter = button.Name.Substring(button.Name.Length - 1); SetButtonInfo(button, info); return(true); } return(false); }
private void LoadComparison(string fileName) { XmlDocument document = new XmlDocument(); document.Load(fileName); XmlNode compareModeNode = document.SelectSingleNode("MixDiff/Settings/@CompareMode"); CompareMode = (CompareMode)Enum.Parse(typeof(CompareMode), compareModeNode.Value); XmlNodeList mixes = document.SelectNodes("MixDiff/Mix"); int buttonIndex = 0; foreach (XmlNode mixNode in mixes) { Button button = fileButtons[buttonIndex++]; MixdownInfo info = new MixdownInfo(mixNode.SelectSingleNode("@FileName").Value); info.DelayMilliseconds = Int32.Parse(mixNode.SelectSingleNode("@DelayMilliseconds").Value); info.OffsetMilliseconds = Int32.Parse(mixNode.SelectSingleNode("@OffsetMilliseconds").Value); info.VolumeDecibels = Int32.Parse(mixNode.SelectSingleNode("@VolumeDecibels").Value); info.Letter = button.Name.Substring(button.Name.Length - 1); info.Stream.Mute = true; SetButtonInfo(button, info); } SelectButton(fileButtons[0]); }
private void LoadComparison(string fileName) { XmlDocument document = new XmlDocument(); document.Load(fileName); XmlNode compareModeNode = document.SelectSingleNode("MixDiff/Settings/@CompareMode"); CompareMode = (CompareMode)Enum.Parse(typeof(CompareMode), compareModeNode.Value); XmlNodeList mixes = document.SelectNodes("MixDiff/Mix"); int buttonIndex = 0; foreach(XmlNode mixNode in mixes) { Button button = fileButtons[buttonIndex++]; MixdownInfo info = new MixdownInfo(mixNode.SelectSingleNode("@FileName").Value); info.DelayMilliseconds = Int32.Parse(mixNode.SelectSingleNode("@DelayMilliseconds").Value); info.OffsetMilliseconds = Int32.Parse(mixNode.SelectSingleNode("@OffsetMilliseconds").Value); info.VolumeDecibels = Int32.Parse(mixNode.SelectSingleNode("@VolumeDecibels").Value); info.Letter = button.Name.Substring(button.Name.Length - 1); info.Stream.Mute = true; SetButtonInfo(button,info); } SelectButton(fileButtons[0]); }