예제 #1
0
        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;
                }
            }
        }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }
예제 #4
0
 private void SetButtonInfo(Button button, MixdownInfo info)
 {
     if (button.Tag != null)
     {
         ClearFile(button);
     }
     button.Tag = info;
     SetButtonAppearance(button);
     mixer.AddInputStream(info.Stream);
     SetLengthLabel();
 }
예제 #5
0
 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);
     }
 }
예제 #6
0
 private void SetButtonInfo(Button button, MixdownInfo info)
 {
     if (button.Tag != null)
     {
         ClearFile(button);
     }
     button.Tag = info;
     SetButtonAppearance(button);
     mixer.AddInputStream(info.Stream);
     SetLengthLabel();
 }
예제 #7
0
 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();
     }
 }
예제 #8
0
        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)
                {
                }
            }
        }
예제 #9
0
 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;
 }
예제 #10
0
        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);
        }
예제 #11
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]);
        }
예제 #12
0
 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();
     }
 }
예제 #13
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]);
 }