} // ColorOrganForm /// <summary> /// Add a new band to the list of bands and open a dialog for it /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonNewColorGroup_Click(object sender, EventArgs e) { ColorOrganBand band = m_colorOrgan.CreateBand(); populateColorOrganBandSelectList(); ColorOrganForm temp = this; ColorOrganBandForm cobf = new ColorOrganBandForm(ref band, ref temp); cobf.Show(); } // buttonNewColorGroup_Click
} // buttonNewColorGroup_Click /// <summary> /// User has pressed edit or double clicked an entry in the table /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonEditColorGroup_Click(object sender, EventArgs e) { do { // are there any bands to edit? if (0 == m_mapOfColorOrganBands.Count) { break; } // end no bands to edit ColorOrganBand band = m_mapOfColorOrganBands[listBoxColorBands.SelectedIndex]; ColorOrganForm temp = this; ColorOrganBandForm cobf = new ColorOrganBandForm(ref band, ref temp); cobf.Show(); } while (false); } // buttonEditColorGroup_Click
public ColorOrganBandForm(ref ColorOrganBand colorOrganBand, ref ColorOrganForm parentForm) { InitializeComponent(); // save the reference to this band m_colorOrganBand = colorOrganBand; m_parentForm = parentForm; // set up the table grid dataGridViewFrequencyBands.CellValueChanged -= dataGridViewFrequencyBands_CellValueChanged; dataGridViewFrequencyBands.AllowUserToOrderColumns = false; dataGridViewFrequencyBands.AllowUserToAddRows = false; dataGridViewFrequencyBands.AllowUserToDeleteRows = false; dataGridViewFrequencyBands.Enabled = true; dataGridViewFrequencyBands.CellValueChanged += dataGridViewFrequencyBands_CellValueChanged; } // ColorOrganBandForm
} // buttonClearChannels_Click /// <summary> /// user has requested that we make a copy of the current band /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonCopy_Click(object sender, EventArgs e) { do { // are there any bands to copy? if (0 == m_mapOfColorOrganBands.Count) { break; } // end no bands to copy ColorOrganBand destinationBand = m_colorOrgan.CreateBand(m_mapOfColorOrganBands[listBoxColorBands.SelectedIndex]); // copy to body of the data populateColorOrganBandSelectList(); ColorOrganForm temp = this; ColorOrganBandForm cobf = new ColorOrganBandForm(ref destinationBand, ref temp); cobf.Show(); } while (false); } // buttonCopy_Click
/// <summary> /// Main entry point /// </summary> /// <param name="sequence"></param> /// <returns></returns> public bool Execute(EventSequence sequence) { if (sequence == null) { throw new Exception("Color Organ add-in requires a sequence."); } if (sequence.Audio == null) { throw new Exception("Color Organ add-in requires the sequence to have audio assigned."); } // find out which version of vixen we are running on Process currentProcess = Process.GetCurrentProcess(); #if VIXEN_VERSION_2_1 if ((2 != currentProcess.MainModule.FileVersionInfo.FileMajorPart) || (1 != currentProcess.MainModule.FileVersionInfo.FileMinorPart)) { throw new Exception("Color Organ add-in does not support this version of Vixen."); } #elif VIXEN_VERSION_2_5 if ((2 != currentProcess.MainModule.FileVersionInfo.FileMajorPart) || (5 != currentProcess.MainModule.FileVersionInfo.FileMinorPart)) { throw new Exception("Color Organ add-in does not support this version of Vixen."); } #else #error "Unsupported Vixen build version" #endif ColorOrgan colorOrgan = new ColorOrgan(ref m_dataNode, sequence); ColorOrganForm colorOrganDialog = new ColorOrganForm(ref colorOrgan); colorOrganDialog.ShowDialog(); // output the color organ info // m_dataNode.RemoveAll(); colorOrgan.SaveToXml(ref m_dataNode); colorOrganDialog.Dispose(); return(true); }