package com.domemusictechnologies.abxtester;


import voltage.controllers.*;
import voltage.core.*;
import voltage.core.Jack.JackType;
import voltage.sources.*;
import voltage.utility.*;
import voltage.processors.*;
import voltage.effects.*;
import java.awt.*;

//[user-imports]   Add your own imports here
//[/user-imports]


public class ABXTester extends VoltageModule
//[user-inheritance]
//[/user-inheritance]
{

public ABXTester( long moduleID, VoltageObjects voltageObjects )
{
   super( moduleID, voltageObjects, "ABX Tester", ModuleType.ModuleType_Switches, 2.0 );

   InitializeControls();


   canBeBypassed = false;
   SetSkin( "966d43341e9e4d588a35c24954c60ba9" );
}

void InitializeControls()
{

   textLabel1 = new VoltageLabel( "textLabel1", "textLabel1", this, "ABX Tester" );
   AddComponent( textLabel1 );
   textLabel1.SetWantsMouseNotifications( false );
   textLabel1.SetPosition( 15, 0 );
   textLabel1.SetSize( 114, 18 );
   textLabel1.SetEditable( false, false );
   textLabel1.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel1.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel1.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel1.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel1.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel1.SetBorderSize( 1 );
   textLabel1.SetMultiLineEdit( false );
   textLabel1.SetIsNumberEditor( false );
   textLabel1.SetNumberEditorRange( 0, 100 );
   textLabel1.SetNumberEditorInterval( 1 );
   textLabel1.SetNumberEditorUsesMouseWheel( false );
   textLabel1.SetHasCustomTextHoverColor( false );
   textLabel1.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel1.SetFont( "Verdana", 14, true, false );

   inputALeft = new VoltageAudioJack( "Input A Left", "Input A Left", this, JackType.JackType_AudioInput );
   AddComponent( inputALeft );
   inputALeft.SetWantsMouseNotifications( false );
   inputALeft.SetPosition( 10, 43 );
   inputALeft.SetSize( 25, 25 );
   inputALeft.SetSkin( "Jack Round White Ring" );

   inputARight = new VoltageAudioJack( "Input A Right", "Input A Right", this, JackType.JackType_AudioInput );
   AddComponent( inputARight );
   inputARight.SetWantsMouseNotifications( false );
   inputARight.SetPosition( 40, 43 );
   inputARight.SetSize( 25, 25 );
   inputARight.SetSkin( "Jack Round Red Ring" );

   inputBLeft = new VoltageAudioJack( "Input B Left", "Input B Left", this, JackType.JackType_AudioInput );
   AddComponent( inputBLeft );
   inputBLeft.SetWantsMouseNotifications( false );
   inputBLeft.SetPosition( 80, 43 );
   inputBLeft.SetSize( 25, 25 );
   inputBLeft.SetSkin( "Jack Round White Ring" );

   inputBRight = new VoltageAudioJack( "Input B Right", "Input B Right", this, JackType.JackType_AudioInput );
   AddComponent( inputBRight );
   inputBRight.SetWantsMouseNotifications( false );
   inputBRight.SetPosition( 110, 43 );
   inputBRight.SetSize( 25, 25 );
   inputBRight.SetSkin( "Jack Round Red Ring" );

   textLabel2 = new VoltageLabel( "textLabel2", "textLabel2", this, "Input A" );
   AddComponent( textLabel2 );
   textLabel2.SetWantsMouseNotifications( false );
   textLabel2.SetPosition( 10, 22 );
   textLabel2.SetSize( 54, 21 );
   textLabel2.SetEditable( false, false );
   textLabel2.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel2.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel2.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel2.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel2.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel2.SetBorderSize( 1 );
   textLabel2.SetMultiLineEdit( false );
   textLabel2.SetIsNumberEditor( false );
   textLabel2.SetNumberEditorRange( 0, 100 );
   textLabel2.SetNumberEditorInterval( 1 );
   textLabel2.SetNumberEditorUsesMouseWheel( false );
   textLabel2.SetHasCustomTextHoverColor( false );
   textLabel2.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel2.SetFont( "Verdana", 12, false, false );

   textLabel5 = new VoltageLabel( "textLabel5", "textLabel5", this, "A" );
   AddComponent( textLabel5 );
   textLabel5.SetWantsMouseNotifications( false );
   textLabel5.SetPosition( 28, 125 );
   textLabel5.SetSize( 16, 13 );
   textLabel5.SetEditable( false, false );
   textLabel5.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel5.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel5.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel5.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel5.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel5.SetBorderSize( 1 );
   textLabel5.SetMultiLineEdit( false );
   textLabel5.SetIsNumberEditor( false );
   textLabel5.SetNumberEditorRange( 0, 100 );
   textLabel5.SetNumberEditorInterval( 1 );
   textLabel5.SetNumberEditorUsesMouseWheel( false );
   textLabel5.SetHasCustomTextHoverColor( false );
   textLabel5.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel5.SetFont( "Verdana", 12, false, false );

   textLabel6 = new VoltageLabel( "textLabel6", "textLabel6", this, "B" );
   AddComponent( textLabel6 );
   textLabel6.SetWantsMouseNotifications( false );
   textLabel6.SetPosition( 99, 125 );
   textLabel6.SetSize( 16, 13 );
   textLabel6.SetEditable( false, false );
   textLabel6.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel6.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel6.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel6.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel6.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel6.SetBorderSize( 1 );
   textLabel6.SetMultiLineEdit( false );
   textLabel6.SetIsNumberEditor( false );
   textLabel6.SetNumberEditorRange( 0, 100 );
   textLabel6.SetNumberEditorInterval( 1 );
   textLabel6.SetNumberEditorUsesMouseWheel( false );
   textLabel6.SetHasCustomTextHoverColor( false );
   textLabel6.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel6.SetFont( "Verdana", 12, false, false );

   textLabel7 = new VoltageLabel( "textLabel7", "textLabel7", this, "Mute" );
   AddComponent( textLabel7 );
   textLabel7.SetWantsMouseNotifications( false );
   textLabel7.SetPosition( 57, 125 );
   textLabel7.SetSize( 31, 13 );
   textLabel7.SetEditable( false, false );
   textLabel7.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel7.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel7.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel7.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel7.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel7.SetBorderSize( 1 );
   textLabel7.SetMultiLineEdit( false );
   textLabel7.SetIsNumberEditor( false );
   textLabel7.SetNumberEditorRange( 0, 100 );
   textLabel7.SetNumberEditorInterval( 1 );
   textLabel7.SetNumberEditorUsesMouseWheel( false );
   textLabel7.SetHasCustomTextHoverColor( false );
   textLabel7.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel7.SetFont( "Verdana", 12, false, false );

   textLabel8 = new VoltageLabel( "textLabel8", "textLabel8", this, "X" );
   AddComponent( textLabel8 );
   textLabel8.SetWantsMouseNotifications( false );
   textLabel8.SetPosition( 10, 164 );
   textLabel8.SetSize( 16, 13 );
   textLabel8.SetEditable( false, false );
   textLabel8.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel8.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel8.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel8.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel8.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel8.SetBorderSize( 1 );
   textLabel8.SetMultiLineEdit( false );
   textLabel8.SetIsNumberEditor( false );
   textLabel8.SetNumberEditorRange( 0, 100 );
   textLabel8.SetNumberEditorInterval( 1 );
   textLabel8.SetNumberEditorUsesMouseWheel( false );
   textLabel8.SetHasCustomTextHoverColor( false );
   textLabel8.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel8.SetFont( "Verdana", 12, false, false );

   textLabel3 = new VoltageLabel( "textLabel3", "textLabel3", this, "Input B" );
   AddComponent( textLabel3 );
   textLabel3.SetWantsMouseNotifications( false );
   textLabel3.SetPosition( 80, 22 );
   textLabel3.SetSize( 54, 21 );
   textLabel3.SetEditable( false, false );
   textLabel3.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel3.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel3.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel3.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel3.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel3.SetBorderSize( 1 );
   textLabel3.SetMultiLineEdit( false );
   textLabel3.SetIsNumberEditor( false );
   textLabel3.SetNumberEditorRange( 0, 100 );
   textLabel3.SetNumberEditorInterval( 1 );
   textLabel3.SetNumberEditorUsesMouseWheel( false );
   textLabel3.SetHasCustomTextHoverColor( false );
   textLabel3.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel3.SetFont( "Verdana", 12, false, false );

   buttonSelectA = new VoltageButton( "Select Channel A", "Select Channel A", this );
   AddComponent( buttonSelectA );
   buttonSelectA.SetWantsMouseNotifications( false );
   buttonSelectA.SetPosition( 26, 104 );
   buttonSelectA.SetSize( 20, 20 );
   buttonSelectA.SetSkin( "Square Concave Blue-Blue" );
   buttonSelectA.ShowOverlay( false );
   buttonSelectA.SetOverlayText( "" );
   buttonSelectA.SetAutoRepeat( false );

   buttonSelectB = new VoltageButton( "Select Channel B", "Select Channel B", this );
   AddComponent( buttonSelectB );
   buttonSelectB.SetWantsMouseNotifications( false );
   buttonSelectB.SetPosition( 97, 104 );
   buttonSelectB.SetSize( 20, 20 );
   buttonSelectB.SetSkin( "Square Concave Blue-Blue" );
   buttonSelectB.ShowOverlay( false );
   buttonSelectB.SetOverlayText( "" );
   buttonSelectB.SetAutoRepeat( false );

   buttonTestX = new VoltageButton( "Select X Test", "Select X Test", this );
   AddComponent( buttonTestX );
   buttonTestX.SetWantsMouseNotifications( false );
   buttonTestX.SetPosition( 8, 143 );
   buttonTestX.SetSize( 20, 20 );
   buttonTestX.SetSkin( "Square Concave Blue-Blue" );
   buttonTestX.ShowOverlay( false );
   buttonTestX.SetOverlayText( "" );
   buttonTestX.SetAutoRepeat( false );

   buttonMute = new VoltageButton( "Select Mute", "Select Mute", this );
   AddComponent( buttonMute );
   buttonMute.SetWantsMouseNotifications( false );
   buttonMute.SetPosition( 63, 104 );
   buttonMute.SetSize( 20, 20 );
   buttonMute.SetSkin( "Square Concave Clear" );
   buttonMute.ShowOverlay( false );
   buttonMute.SetOverlayText( "" );
   buttonMute.SetAutoRepeat( false );

   textLabel4 = new VoltageLabel( "textLabel4", "textLabel4", this, "Input Selection" );
   AddComponent( textLabel4 );
   textLabel4.SetWantsMouseNotifications( false );
   textLabel4.SetPosition( 25, 69 );
   textLabel4.SetSize( 94, 21 );
   textLabel4.SetEditable( false, false );
   textLabel4.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel4.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel4.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel4.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel4.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel4.SetBorderSize( 1 );
   textLabel4.SetMultiLineEdit( false );
   textLabel4.SetIsNumberEditor( false );
   textLabel4.SetNumberEditorRange( 0, 100 );
   textLabel4.SetNumberEditorInterval( 1 );
   textLabel4.SetNumberEditorUsesMouseWheel( false );
   textLabel4.SetHasCustomTextHoverColor( false );
   textLabel4.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel4.SetFont( "Verdana", 12, false, false );

   textConfidence = new VoltageLabel( "Confidence Level", "Confidence Level", this, "10 or more tests required" );
   AddComponent( textConfidence );
   textConfidence.SetWantsMouseNotifications( false );
   textConfidence.SetPosition( 3, 273 );
   textConfidence.SetSize( 139, 21 );
   textConfidence.SetEditable( false, false );
   textConfidence.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textConfidence.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textConfidence.SetColor( new Color( 255, 255, 255, 255 ) );
   textConfidence.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textConfidence.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textConfidence.SetBorderSize( 1 );
   textConfidence.SetMultiLineEdit( false );
   textConfidence.SetIsNumberEditor( false );
   textConfidence.SetNumberEditorRange( 0, 100 );
   textConfidence.SetNumberEditorInterval( 1 );
   textConfidence.SetNumberEditorUsesMouseWheel( false );
   textConfidence.SetHasCustomTextHoverColor( false );
   textConfidence.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textConfidence.SetFont( "Verdana", 12, false, false );

   LEDMute = new VoltageLED( "Mute LED", "Mute LED", this );
   AddComponent( LEDMute );
   LEDMute.SetWantsMouseNotifications( false );
   LEDMute.SetPosition( 68, 89 );
   LEDMute.SetSize( 11, 11 );
   LEDMute.SetSkin( "Blue" );

   LEDChannelB = new VoltageLED( "Channel B LED", "Channel B LED", this );
   AddComponent( LEDChannelB );
   LEDChannelB.SetWantsMouseNotifications( false );
   LEDChannelB.SetPosition( 102, 89 );
   LEDChannelB.SetSize( 11, 11 );
   LEDChannelB.SetSkin( "Blue" );

   LEDChannelA = new VoltageLED( "Channel A LED", "Channel A LED", this );
   AddComponent( LEDChannelA );
   LEDChannelA.SetWantsMouseNotifications( false );
   LEDChannelA.SetPosition( 31, 89 );
   LEDChannelA.SetSize( 11, 11 );
   LEDChannelA.SetSkin( "Blue" );

   textLabel9 = new VoltageLabel( "textLabel9", "textLabel9", this, "A" );
   AddComponent( textLabel9 );
   textLabel9.SetWantsMouseNotifications( false );
   textLabel9.SetPosition( 46, 202 );
   textLabel9.SetSize( 16, 13 );
   textLabel9.SetEditable( false, false );
   textLabel9.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel9.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel9.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel9.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel9.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel9.SetBorderSize( 1 );
   textLabel9.SetMultiLineEdit( false );
   textLabel9.SetIsNumberEditor( false );
   textLabel9.SetNumberEditorRange( 0, 100 );
   textLabel9.SetNumberEditorInterval( 1 );
   textLabel9.SetNumberEditorUsesMouseWheel( false );
   textLabel9.SetHasCustomTextHoverColor( false );
   textLabel9.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel9.SetFont( "Verdana", 12, false, false );

   textLabel10 = new VoltageLabel( "textLabel10", "textLabel10", this, "B" );
   AddComponent( textLabel10 );
   textLabel10.SetWantsMouseNotifications( false );
   textLabel10.SetPosition( 117, 202 );
   textLabel10.SetSize( 16, 13 );
   textLabel10.SetEditable( false, false );
   textLabel10.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel10.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel10.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel10.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel10.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel10.SetBorderSize( 1 );
   textLabel10.SetMultiLineEdit( false );
   textLabel10.SetIsNumberEditor( false );
   textLabel10.SetNumberEditorRange( 0, 100 );
   textLabel10.SetNumberEditorInterval( 1 );
   textLabel10.SetNumberEditorUsesMouseWheel( false );
   textLabel10.SetHasCustomTextHoverColor( false );
   textLabel10.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel10.SetFont( "Verdana", 12, false, false );

   textLabel11 = new VoltageLabel( "textLabel11", "textLabel11", this, "Pass" );
   AddComponent( textLabel11 );
   textLabel11.SetWantsMouseNotifications( false );
   textLabel11.SetPosition( 75, 202 );
   textLabel11.SetSize( 31, 13 );
   textLabel11.SetEditable( false, false );
   textLabel11.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel11.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel11.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel11.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel11.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel11.SetBorderSize( 1 );
   textLabel11.SetMultiLineEdit( false );
   textLabel11.SetIsNumberEditor( false );
   textLabel11.SetNumberEditorRange( 0, 100 );
   textLabel11.SetNumberEditorInterval( 1 );
   textLabel11.SetNumberEditorUsesMouseWheel( false );
   textLabel11.SetHasCustomTextHoverColor( false );
   textLabel11.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel11.SetFont( "Verdana", 12, false, false );

   buttonAnswerA = new VoltageButton( "Answer Channel A", "Answer Channel A", this );
   AddComponent( buttonAnswerA );
   buttonAnswerA.SetWantsMouseNotifications( false );
   buttonAnswerA.SetPosition( 44, 181 );
   buttonAnswerA.SetSize( 20, 20 );
   buttonAnswerA.SetSkin( "Square Concave Blue-Blue" );
   buttonAnswerA.ShowOverlay( false );
   buttonAnswerA.SetOverlayText( "" );
   buttonAnswerA.SetAutoRepeat( false );

   buttonAnswerB = new VoltageButton( "Answer Channel B", "Answer Channel B", this );
   AddComponent( buttonAnswerB );
   buttonAnswerB.SetWantsMouseNotifications( false );
   buttonAnswerB.SetPosition( 116, 181 );
   buttonAnswerB.SetSize( 20, 20 );
   buttonAnswerB.SetSkin( "Square Concave Blue-Blue" );
   buttonAnswerB.ShowOverlay( false );
   buttonAnswerB.SetOverlayText( "" );
   buttonAnswerB.SetAutoRepeat( false );

   buttonPass = new VoltageButton( "Pass Test", "Pass Test", this );
   AddComponent( buttonPass );
   buttonPass.SetWantsMouseNotifications( false );
   buttonPass.SetPosition( 80, 181 );
   buttonPass.SetSize( 20, 20 );
   buttonPass.SetSkin( "Square Concave Clear" );
   buttonPass.ShowOverlay( false );
   buttonPass.SetOverlayText( "" );
   buttonPass.SetAutoRepeat( false );

   textLabel12 = new VoltageLabel( "textLabel12", "textLabel12", this, "Test Answer" );
   AddComponent( textLabel12 );
   textLabel12.SetWantsMouseNotifications( false );
   textLabel12.SetPosition( 41, 160 );
   textLabel12.SetSize( 96, 21 );
   textLabel12.SetEditable( false, false );
   textLabel12.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel12.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel12.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel12.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel12.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel12.SetBorderSize( 1 );
   textLabel12.SetMultiLineEdit( false );
   textLabel12.SetIsNumberEditor( false );
   textLabel12.SetNumberEditorRange( 0, 100 );
   textLabel12.SetNumberEditorInterval( 1 );
   textLabel12.SetNumberEditorUsesMouseWheel( false );
   textLabel12.SetHasCustomTextHoverColor( false );
   textLabel12.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel12.SetFont( "Verdana", 12, false, false );

   counterTests = new VoltageDigitalCounter( "Number of Tests", "Number of Tests", this, 2 );
   AddComponent( counterTests );
   counterTests.SetWantsMouseNotifications( false );
   counterTests.SetPosition( 7, 224 );
   counterTests.SetSize( 42, 33 );
   counterTests.SetSkin( "Gray" );
   counterTests.SetJustificationFlags( VoltageDigitalCounter.Justification.Centered );

   counterCorrect = new VoltageDigitalCounter( "Number of Correct Tests", "Number of Correct Tests", this, 2 );
   AddComponent( counterCorrect );
   counterCorrect.SetWantsMouseNotifications( false );
   counterCorrect.SetPosition( 95, 224 );
   counterCorrect.SetSize( 42, 33 );
   counterCorrect.SetSkin( "Gray" );
   counterCorrect.SetJustificationFlags( VoltageDigitalCounter.Justification.Centered );

   buttonReset = new VoltageButton( "Reset Test Counts", "Reset Test Counts", this );
   AddComponent( buttonReset );
   buttonReset.SetWantsMouseNotifications( false );
   buttonReset.SetPosition( 57, 225 );
   buttonReset.SetSize( 31, 31 );
   buttonReset.SetSkin( "Red-Red Square" );
   buttonReset.ShowOverlay( false );
   buttonReset.SetOverlayText( "" );
   buttonReset.SetAutoRepeat( false );

   textLabel13 = new VoltageLabel( "textLabel13", "textLabel13", this, "Tests" );
   AddComponent( textLabel13 );
   textLabel13.SetWantsMouseNotifications( false );
   textLabel13.SetPosition( 8, 258 );
   textLabel13.SetSize( 42, 13 );
   textLabel13.SetEditable( false, false );
   textLabel13.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel13.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel13.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel13.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel13.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel13.SetBorderSize( 1 );
   textLabel13.SetMultiLineEdit( false );
   textLabel13.SetIsNumberEditor( false );
   textLabel13.SetNumberEditorRange( 0, 100 );
   textLabel13.SetNumberEditorInterval( 1 );
   textLabel13.SetNumberEditorUsesMouseWheel( false );
   textLabel13.SetHasCustomTextHoverColor( false );
   textLabel13.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel13.SetFont( "Verdana", 12, false, false );

   textLabel14 = new VoltageLabel( "textLabel14", "textLabel14", this, "Correct" );
   AddComponent( textLabel14 );
   textLabel14.SetWantsMouseNotifications( false );
   textLabel14.SetPosition( 96, 258 );
   textLabel14.SetSize( 42, 13 );
   textLabel14.SetEditable( false, false );
   textLabel14.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel14.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel14.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel14.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel14.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel14.SetBorderSize( 1 );
   textLabel14.SetMultiLineEdit( false );
   textLabel14.SetIsNumberEditor( false );
   textLabel14.SetNumberEditorRange( 0, 100 );
   textLabel14.SetNumberEditorInterval( 1 );
   textLabel14.SetNumberEditorUsesMouseWheel( false );
   textLabel14.SetHasCustomTextHoverColor( false );
   textLabel14.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel14.SetFont( "Verdana", 12, false, false );

   textLabel15 = new VoltageLabel( "textLabel15", "textLabel15", this, "Reset" );
   AddComponent( textLabel15 );
   textLabel15.SetWantsMouseNotifications( false );
   textLabel15.SetPosition( 56, 258 );
   textLabel15.SetSize( 34, 13 );
   textLabel15.SetEditable( false, false );
   textLabel15.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel15.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel15.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel15.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel15.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel15.SetBorderSize( 1 );
   textLabel15.SetMultiLineEdit( false );
   textLabel15.SetIsNumberEditor( false );
   textLabel15.SetNumberEditorRange( 0, 100 );
   textLabel15.SetNumberEditorInterval( 1 );
   textLabel15.SetNumberEditorUsesMouseWheel( false );
   textLabel15.SetHasCustomTextHoverColor( false );
   textLabel15.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel15.SetFont( "Verdana", 12, false, false );

   textLabel16 = new VoltageLabel( "textLabel16", "textLabel16", this, "Dome Music Technologies" );
   AddComponent( textLabel16 );
   textLabel16.SetWantsMouseNotifications( false );
   textLabel16.SetPosition( 13, 342 );
   textLabel16.SetSize( 117, 17 );
   textLabel16.SetEditable( false, false );
   textLabel16.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel16.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel16.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel16.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel16.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel16.SetBorderSize( 1 );
   textLabel16.SetMultiLineEdit( false );
   textLabel16.SetIsNumberEditor( false );
   textLabel16.SetNumberEditorRange( 0, 100 );
   textLabel16.SetNumberEditorInterval( 1 );
   textLabel16.SetNumberEditorUsesMouseWheel( false );
   textLabel16.SetHasCustomTextHoverColor( false );
   textLabel16.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel16.SetFont( "Verdana", 10, false, false );

   outputRight = new VoltageAudioJack( "Output Right", "Output Right", this, JackType.JackType_AudioOutput );
   AddComponent( outputRight );
   outputRight.SetWantsMouseNotifications( false );
   outputRight.SetPosition( 80, 315 );
   outputRight.SetSize( 25, 25 );
   outputRight.SetSkin( "Jack Round Red Ring" );

   outputLeft = new VoltageAudioJack( "Output Left", "Output Left", this, JackType.JackType_AudioOutput );
   AddComponent( outputLeft );
   outputLeft.SetWantsMouseNotifications( false );
   outputLeft.SetPosition( 44, 315 );
   outputLeft.SetSize( 25, 25 );
   outputLeft.SetSkin( "Jack Round White Ring" );

   textLabel17 = new VoltageLabel( "textLabel17", "textLabel17", this, "Output" );
   AddComponent( textLabel17 );
   textLabel17.SetWantsMouseNotifications( false );
   textLabel17.SetPosition( 47, 295 );
   textLabel17.SetSize( 54, 21 );
   textLabel17.SetEditable( false, false );
   textLabel17.SetJustificationFlags( VoltageLabel.Justification.HorizCentered );
   textLabel17.SetJustificationFlags( VoltageLabel.Justification.VertCentered );
   textLabel17.SetColor( new Color( 255, 255, 255, 255 ) );
   textLabel17.SetBkColor( new Color( 65, 65, 65, 0 ) );
   textLabel17.SetBorderColor( new Color( 0, 0, 0, 0 ) );
   textLabel17.SetBorderSize( 1 );
   textLabel17.SetMultiLineEdit( false );
   textLabel17.SetIsNumberEditor( false );
   textLabel17.SetNumberEditorRange( 0, 100 );
   textLabel17.SetNumberEditorInterval( 1 );
   textLabel17.SetNumberEditorUsesMouseWheel( false );
   textLabel17.SetHasCustomTextHoverColor( false );
   textLabel17.SetTextHoverColor( new Color( 0, 0, 0, 255 ) );
   textLabel17.SetFont( "Verdana", 12, false, false );
}



//-------------------------------------------------------------------------------
//  public void Initialize()

//  Initialize will get called shortly after your module's constructor runs. You can use it to
//  do any initialization that the auto-generated code doesn't handle.
//-------------------------------------------------------------------------------
@Override
public void Initialize()
{
   //[user-Initialize]   Add your own initialization code here

   PerformReset();

   //[/user-Initialize]
}


//-------------------------------------------------------------------------------
//  public void Destroy()

//  Destroy will get called just before your module gets deleted. You can use it to perform any
//  cleanup that's not handled automatically by Java.
//-------------------------------------------------------------------------------
@Override
public void Destroy()
{
   super.Destroy();
   //[user-Destroy]   Add your own module-getting-deleted code here



   //[/user-Destroy]
}


//-------------------------------------------------------------------------------
//  public boolean Notify( VoltageComponent component, ModuleNotifications notification, double doubleValue, long longValue, int x, int y, Object object )

//  Notify will get called when various events occur - control values changing, timers firing, etc.
//-------------------------------------------------------------------------------
@Override
public boolean Notify( VoltageComponent component, ModuleNotifications notification, double doubleValue, long longValue, int x, int y, Object object )
{
   //[user-Notify]   Add your own notification handling code between this line and the notify-close comment
   switch( notification )
   {
      case Knob_Changed:   // doubleValue is the new VoltageKnob value
      {
      }
      break;
   
      case Slider_Changed:   // doubleValue is the new slider value
      {
      }
      break;
   
      case Button_Changed:   // doubleValue is the new button/toggle button value
      {
         // We are only interested in button push events
         if (doubleValue == 1.0)
         {
            if (component == buttonSelectA)
            {
               SetInputChannel (InputChannel.CHANNEL_A);
            }
            else if (component == buttonSelectB)
            {
               SetInputChannel (InputChannel.CHANNEL_B);
            }
            else if (component == buttonMute)
            {
                SetInputChannel (InputChannel.MUTE);
            }
            else if (component == buttonTestX)
            {
               EnterTestMode();
            }
            else if (component == buttonAnswerA)
            {
               CheckAnswer (true);
            }
            else if (component == buttonAnswerB)
            {
               CheckAnswer (false);
            }
            else if (component == buttonPass)
            {
               EnterMonitorMode();
            }
            else if (component == buttonReset)
            {
               PerformReset();
            }
         }
      }
      break;
   
      case Switch_Changed:   // doubleValue is the new switch value
      {
      }
      break;
   
      case Jack_Connected:   // longValue is the new cable ID
      {
      }
      break;
   
      case Jack_Disconnected:   // All cables have been disconnected from this jack
      {
      }
      break;
   
      case GUI_Update_Timer:   // Called every 50ms (by default) if turned on
      {
      }
      break;
   
      case Object_MouseMove:   // called when mouse is over an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_MouseLeave:  // called when mouse leaves an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_LeftButtonDown:   // called when user left-clicks on an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_LeftButtonUp:   // called when user releases left mouse button on an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_RightButtonDown:   // called when user releases right mouse button on an object that receives mouse notifications. 'object' parameter is a VoltageMouseKeyFlags object.
      {
      }
      break;
   
      case Object_RightButtonUp:   // called when user right-clicks on an object that receives mouse notifications
      {
      }
      break;
   
      case Object_LeftButtonDoubleClick: // called when user left-button double-clicks on an object that receives mouse notifications
      {
      }
      break;
   
      // Less common notifications:
   
      case Named_Timer:   // object contains a String with the name of the timer that has fired
      {
      }
      break;
   
      case Canvas_Painting:   // About to paint canvas.  object is a java.awt.Rectangle with painting boundaries
      {
      }
      break;
   
      case Canvas_Painted:   // Canvas painting is complete
      {
      }
      break;
   
      case Control_DragStart:    // A user has started dragging on a control that has been marked as draggable
      {
      }
      break;
   
      case Control_DragOn:       // This control has been dragged over during a drag operation. object contains the dragged object
      {
      }
      break;
   
      case Control_DragOff:      // This control has been dragged over during a drag operation. object contains the dragged object
      {
      }
      break;
   
      case Control_DragEnd:      // A user has ended their drag on a control that has been marked as draggable
      {
      }
      break;
   
      case Label_Changed:        // The text of an editable text control has changed
      {
      }
      break;
   
      case SoundPlayback_Start:   // A sound has begun playback
      {
      }
      break;
   
      case SoundPlayback_End:     // A sound has ended playback
      {
      }
      break;
   
      case Scrollbar_Position:    // longValue is the new scrollbar position
      {
      }
      break;
   
      case PolyVoices_Changed:    // longValue is the new number of poly voices
      {
      }
      break;
   
      case File_Dropped:     // 'object' is a String containing the file path
      {
      }
      break;
   
      case Preset_Loading_Start:   // called when preset loading begins
      {
      }
      break;
   
      case Preset_Loading_Finish:  // called when preset loading finishes
      {
      }
      break;
   
      case Variation_Loading_Start:    // sent when a variation is about to load
      {
      }
      break;
   
      case Variation_Loading_Finish:   // sent when a variation has just finished loading
      {
      }
      break;
   
      case Tempo_Changed:     // doubleValue is the new tempo
      {
      }
      break;
   
      case Randomized:     // called when the module's controls get randomized
      {
      }
      break;
   
      case VariationListChanged:   // sent when a variation gets added, deleted, or renamed, or the variations list gets reordered
      {
      }
      break;
   
      case Key_Press:     // sent when module has keyboard focus and a key is pressed; object is a VoltageKeyPressInfo object
      {
      }
      break;
   
      case Reset:    // sent when the module has been reset to default settings
      {
      }
      break;
   
      case Keyboard_NoteOn:   // sent when a note has been pressed on a VoltageKeyboard object. longValue is the note value ( 0-127 )
      {
      }
      break;
   
      case Keyboard_NoteOff:   // sent when a note has been released on a VoltageKeyboard object. longValue is the note value ( 0-127 )
      {
      }
      break;
   
      case Curve_Changed:   // sent when user has edited a curve's value. 'object' will be a VoltageCurve.CurveChangeNotification object.
      {
      }
      break;
   }



   return false;
   //[/user-Notify]
}


//-------------------------------------------------------------------------------
//  public void ProcessSample()

//  ProcessSample is called once per sample. Usually it's where you read
//  from input jacks, process audio, and write it to your output jacks.
//  Since ProcesssSample gets called 48,000 times per second, offload CPU-intensive operations
//  to other threads when possible and avoid calling native functions.
//-------------------------------------------------------------------------------
@Override
public void ProcessSample()
{
   //[user-ProcessSample]   Add your own process-sampling code here


   // Continually read white noise source so that button X timing governs randomness
   dCurrentRandomValue = randomSource.GetWhiteNoise();

   // Continually mix audio inputs to outputs
   outputLeft.SetValue((dChannel_A_Atten * inputALeft.GetValue()) +
                       (dChannel_B_Atten * inputBLeft.GetValue()));
   outputRight.SetValue((dChannel_A_Atten * inputARight.GetValue()) +
                        (dChannel_B_Atten * inputBRight.GetValue()));                       
                       
   //[/user-ProcessSample]
}


//-------------------------------------------------------------------------------
//  public String GetTooltipText( VoltageComponent component )

//  Gets called when a tooltip is about to display for a control. Override it if
//  you want to change what the tooltip displays - if you want a knob to work in logarithmic fashion,
//  for instance, you can translate the knob's current value to a log-based string and display it here.
//-------------------------------------------------------------------------------
@Override
public String GetTooltipText( VoltageComponent component )
{
   //[user-GetTooltipText]   Add your own code here



   return super.GetTooltipText( component );
   //[/user-GetTooltipText]
}


//-------------------------------------------------------------------------------
//  public void EditComponentValue( VoltageComponent component, double newValue, String newText )

//  Gets called after a user clicks on a tooltip and types in a new value for a control. Override this if
//  you've changed the default tooltip display (translating a linear value to logarithmic, for instance)
//  in GetTooltipText().
//-------------------------------------------------------------------------------
@Override
public void EditComponentValue( VoltageComponent component, double newValue, String newText )
{
   //[user-EditComponentValue]   Add your own code here



   //[/user-EditComponentValue]
   super.EditComponentValue( component, newValue, newText );
}


//-------------------------------------------------------------------------------
//  public void OnUndoRedo( String undoType, double newValue, Object optionalObject )

//  If you've created custom undo events via calls to CreateUndoEvent, you'll need to
//  process them in this function when they get triggered by undo/redo actions.
//-------------------------------------------------------------------------------
@Override
public void OnUndoRedo( String undoType, double newValue, Object optionalObject )
{
   //[user-OnUndoRedo]   Add your own code here



   //[/user-OnUndoRedo]
}


//-------------------------------------------------------------------------------
//  public byte[] GetStateInformation()

//  Gets called when the module's state gets saved, typically when the user saves a preset with
//  this module in it. Voltage Modular will automatically save the states of knobs, sliders, etc.,
//  but if you have any custom state information you need to save, return it from this function.
//-------------------------------------------------------------------------------
@Override
public byte[] GetStateInformation()
{
   //[user-GetStateInformation]   Add your own code here



   return null;
   //[/user-GetStateInformation]
}


//-------------------------------------------------------------------------------
//  public void SetStateInformation(byte[] stateInfo)

//  Gets called when this module's state is getting restored, typically when a user opens a preset with
//  this module in it. The stateInfo parameter will contain whatever custom data you stored in GetStateInformation().
//-------------------------------------------------------------------------------
@Override
public void SetStateInformation(byte[] stateInfo)
{
   //[user-SetStateInformation]   Add your own code here



   //[/user-SetStateInformation]
}


//-------------------------------------------------------------------------------
//  public byte[] GetStateInformationForVariations()

//  Gets called when a user saves a variation with this module in it.
//  Voltage Modular will automatically save the states of knobs, sliders, etc.,
//  but if you have any custom state information you need to save, return it from this function.
//-------------------------------------------------------------------------------
@Override
public byte[] GetStateInformationForVariations()
{
   //[user-GetStateInformationForVariations]   Add your own code here



   return GetStateInformation();
   //[/user-GetStateInformationForVariations]
}


//-------------------------------------------------------------------------------
//  public void SetStateInformationForVariations(byte[] stateInfo)

//  Gets called when a user loads a variation with this module in it.
//  The stateInfo parameter will contain whatever custom data you stored in GetStateInformationForVariations().
//-------------------------------------------------------------------------------
@Override
public void SetStateInformationForVariations(byte[] stateInfo)
{
   //[user-SetStateInformationForVariations]   Add your own code here
   SetStateInformation(stateInfo);



   //[/user-SetStateInformationForVariations]
}


// Auto-generated variables
private VoltageLabel textLabel17;
private VoltageAudioJack outputLeft;
private VoltageAudioJack outputRight;
private VoltageLabel textLabel16;
private VoltageLabel textLabel15;
private VoltageLabel textLabel14;
private VoltageLabel textLabel13;
private VoltageButton buttonReset;
private VoltageDigitalCounter counterCorrect;
private VoltageDigitalCounter counterTests;
private VoltageLabel textLabel12;
private VoltageButton buttonPass;
private VoltageButton buttonAnswerB;
private VoltageButton buttonAnswerA;
private VoltageLabel textLabel11;
private VoltageLabel textLabel10;
private VoltageLabel textLabel9;
private VoltageLED LEDChannelA;
private VoltageLED LEDChannelB;
private VoltageLED LEDMute;
private VoltageLabel textConfidence;
private VoltageLabel textLabel4;
private VoltageButton buttonMute;
private VoltageButton buttonTestX;
private VoltageButton buttonSelectB;
private VoltageButton buttonSelectA;
private VoltageLabel textLabel3;
private VoltageLabel textLabel8;
private VoltageLabel textLabel7;
private VoltageLabel textLabel6;
private VoltageLabel textLabel5;
private VoltageLabel textLabel2;
private VoltageAudioJack inputBRight;
private VoltageAudioJack inputBLeft;
private VoltageAudioJack inputARight;
private VoltageAudioJack inputALeft;
private VoltageLabel textLabel1;


//[user-code-and-variables]    Add your own variables and functions here


// Types

private enum OperatingMode
{
   MONITOR,
   TEST
}

private enum InputChannel
{
   CHANNEL_A,
   CHANNEL_B,
   MUTE
}

// Constants

private final int MIN_TESTS = 10;
private final int MAX_TESTS = 25;
private final int MAX_COUNTER = 99;

// Variables

private OperatingMode currentMode;

private int iTestCount;
private int iCorrectCount;
private int iMinimumCorrect;

private InputChannel currentInput;
private double dChannel_A_Atten;
private double dChannel_B_Atten;

private double dCurrentRandomValue;
private boolean xIsChannelA;

// Objects

protected NoiseSource randomSource = new NoiseSource();

void EnterMonitorMode()
{
   currentMode = OperatingMode.MONITOR;

   // Enable all monitoring buttons
   buttonSelectA.SetEnabled(true);
   buttonSelectB.SetEnabled(true);
   buttonMute.SetEnabled(true);
   buttonTestX.SetEnabled(true);
   
   // Disable all test guess buttons
   buttonAnswerA.SetEnabled(false);
   buttonAnswerB.SetEnabled(false);
   buttonPass.SetEnabled(false);
   
   Display_LEDs();

}

void EnterTestMode ()
{
   currentMode = OperatingMode.TEST;

   // Disable all monitoring buttons
   buttonSelectA.SetEnabled(false);
   buttonSelectB.SetEnabled(false);
   buttonMute.SetEnabled(false);
   buttonTestX.SetEnabled(false);
   
   // Enable all test guess buttons
   buttonAnswerA.SetEnabled(true);
   buttonAnswerB.SetEnabled(true);
   buttonPass.SetEnabled(true);
   
   Display_LEDs();
   
   xIsChannelA = (dCurrentRandomValue > 0.0);
   
   if (xIsChannelA)
   {
      SetInputChannel (InputChannel.CHANNEL_A);
   }
   else
   {
      SetInputChannel (InputChannel.CHANNEL_B);
   }

}

void CheckAnswer (boolean guessChannelA)
{
   
   iTestCount++;
   if (iTestCount > MAX_COUNTER)
   {
      iTestCount = MAX_COUNTER;
   }
   
   if (guessChannelA == xIsChannelA)
   {
      iCorrectCount++;
      if (iCorrectCount > MAX_COUNTER)
      {
         iCorrectCount = MAX_COUNTER;
      }
   }
   
   DisplayTestCounts();
   EnterMonitorMode();

}

void SetInputChannel (InputChannel channel)
{
   currentInput = channel;
   
   switch (currentInput)
   {
      case CHANNEL_A:
      {
         dChannel_A_Atten = 1.0;
         dChannel_B_Atten = 0.0;
      }
      break;
      
      case CHANNEL_B:
      {
         dChannel_A_Atten = 0.0;
         dChannel_B_Atten = 1.0;
      }
      break;
      
      case MUTE:
      {
         dChannel_A_Atten = 0.0;
         dChannel_B_Atten = 0.0;
      }
      break;
      
   }
   
   Display_LEDs();
}

void Display_LEDs()
{
   // Blank all LEDs first
   LEDChannelA.SetValue(0.0);
   LEDChannelB.SetValue(0.0);
   LEDMute.SetValue(0.0);
   
   if (currentMode == OperatingMode.MONITOR)
   {
      // Only reveal current input when in Monitor Mode
      switch (currentInput)
      {
         case CHANNEL_A:
         {
            LEDChannelA.SetValue(2.0);
         }
         break;
      
         case CHANNEL_B:
         {
            LEDChannelB.SetValue(2.0);
         }
         break;
      
         case MUTE:
         {
            LEDMute.SetValue(2.0);
         }
         break;
      
      }
      
   }
   
}

boolean MeetsConfidence(int testCount, int correctCount)
{
   int minCorrect = 9;
   
   switch (testCount)
   {
      case 10:
         minCorrect = 9;
      break;
      
      case 11:
         minCorrect = 9;
      break;
      
      case 12:
         minCorrect = 10;
      break;
      
      case 13:
         minCorrect = 10;
      break;
      
      case 14:
         minCorrect = 11;
      break;
      
      case 15:
         minCorrect = 12;
      break;
      
      case 16:
         minCorrect = 12;
      break;
      
      case 17:
         minCorrect = 13;
      break;
      
      case 18:
         minCorrect = 13;
      break;
      
      case 19:
         minCorrect = 14;
      break;
      
      case 20:
         minCorrect = 15;
      break;
      
      case 21:
         minCorrect = 15;
      break;
      
      case 22:
         minCorrect = 16;
      break;
      
      case 23:
         minCorrect = 16;
      break;
      
      case 24:
         minCorrect = 17;
      break;
      
      case 25:
         minCorrect = 18;
      break;
            
   }
   
   return (correctCount >= minCorrect);
}

void SetConfidenceText()
{
   if (iTestCount < MIN_TESTS)
   {
      textConfidence.SetColor(new Color( 255, 255, 255, 255 ));
      textConfidence.SetText("10 or more tests required");
   }
   else if (iTestCount > MAX_TESTS)
   {
      textConfidence.SetColor(new Color( 170, 0, 170, 255 ));
      textConfidence.SetText("25 tests are enough!");
   }
   else
   {
      if (MeetsConfidence(iTestCount, iCorrectCount))
      {
         textConfidence.SetColor(new Color( 0, 255, 0, 255 ));
         textConfidence.SetText("Confidence > 95% !");
      }
      else
      {
         textConfidence.SetColor(new Color( 127, 0, 0, 255 ));
         textConfidence.SetText("Confidence < 95%");
      }
   }

}

void DisplayTestCounts()
{
   // Update seven-segment counters
   counterTests.SetValue(iTestCount);
   counterCorrect.SetValue(iCorrectCount);
   
   SetConfidenceText();
}

void PerformReset()
{
   SetInputChannel(InputChannel.MUTE);
   EnterMonitorMode();
   
   iTestCount = 0;
   iCorrectCount = 0;
   DisplayTestCounts();
   
}


//[/user-code-and-variables]
}

 