Ejemplo n.º 1
0
 public static AREntity newInstance(AudioReactor ar)
 {
     Console.WriteLine("AudioReactor Instance Created");
     instances.Add(new AREntity(ar));
     instancesCreated++;
     return(instances[instancesCreated - 1]);
 }
Ejemplo n.º 2
0
        private void dropHere_DragDrop(object sender, DragEventArgs e)
        {
            if (arSet)
            {
                return;
            }
            Console.WriteLine("DragDrop: ");
            int uiEntityID = (int)e.Data.GetData(typeof(int));

            if (uiEntityID == AREntity.beingDragged)
            {
                this.arEntity = AREntity.getDragged;
                Console.WriteLine("Audio component id: " + AudioReactor.getInstance(this.arEntity).instanceID);
                audioSourceLabel.Text = "AudioReactor entity: " + AudioReactor.getInstance(this.arEntity).instanceID;
                enableDLL.Enabled     = true;
            }
            if (AudioReactor.getInstance(this.arEntity).dataType == DataType.PCM)
            {
                AudioReactor.getInstance(this.arEntity).procPCMDataFetchReadyEvent += dataLoopSend;
            }
            else
            {
                AudioReactor.getInstance(this.arEntity).procFourierDataFetchReadyEvent += dataLoopSend;
            }
        }
Ejemplo n.º 3
0
 public static void removeInstance(AREntity rf)
 {
     AudioReactor.removeInstance(rf.arEntity);
     instances.Remove(rf);
     instancesCreated--;
     Console.WriteLine("AREntity Instance Removed");
 }
Ejemplo n.º 4
0
 private void StopAudio()
 {
     notifyIcon1.Visible = false;
     notifyIcon1.Dispose();
     AREntity.removeAllInstances();
     DLLitem.removeAllInstances();
     AudioReactor.removeAllInstances();
     DLLObject.removeAllInstances();
 }
Ejemplo n.º 5
0
        private AREntity(AudioReactor ar)
        {
            _instanceID = instancesCreated;
            Console.WriteLine("this is " + ar.instanceID);
            InitializeComponent();
            arEntity = ar.instanceID;
            AudioReactor.getInstance(arEntity).procSumFetchReadyEvent += setEntityDataValueEvent;
            AudioReactor.getInstance(arEntity).procFPSEvent           += setAvgFPSValueEvent;

            deviceTypeBox.Items.Add("Microphone");
            //deviceTypeBox.Items.Add("Speaker");

            fpsLimitLabel.Text  = ar.fps_limit.ToString();
            fpsLimitRange.Value = ar.fps_limit;
        }
Ejemplo n.º 6
0
 private void enableEntity_CheckedChanged(object sender, EventArgs e)
 {
     if (enableEntity.Checked)
     {
         if ((AudioTypeMethod.Parse(AudioReactor.getInstance(arEntity).audioType) != -1) &&
             (DataTypeMethod.Parse(AudioReactor.getInstance(arEntity).dataType) != -1))
         {
             AudioReactor.getInstance(arEntity).start();
         }
         else
         {
             enableEntity.Checked = false;
         }
     }
     else
     {
         AudioReactor.getInstance(arEntity).stop();
     }
 }
Ejemplo n.º 7
0
        private void deviceTypeBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            deviceSelectorBox.Items.Clear();
            deviceSelectorBox.Enabled = false;
            AudioReactor.getInstance(arEntity).audioDeviceNumber = 0;
            AudioReactor.getInstance(arEntity).audioType         = AudioTypeMethod.Parse(deviceTypeBox.SelectedIndex);

            if (AudioTypeMethod.Parse(deviceTypeBox.SelectedIndex) == AudioType.MICROPHONE)
            {
                deviceSelectorBox.Enabled = true;
                Dictionary <int, string> d = AudioReactor.getInputDeviceDict();
                int i = 0;
                foreach (KeyValuePair <int, string> entry in d)
                {
                    deviceSelectorBox.Items.Add(entry.Key + " >-> " + entry.Value);
                    i++;
                }
            }
        }
Ejemplo n.º 8
0
 private void deleteAllInstancesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AudioReactor.removeAllInstances();
     entityHolder.Controls.Clear();
 }
Ejemplo n.º 9
0
 private void newInstanceToolStripMenu1_Click(object sender, EventArgs e)
 {
     //create instance
     //create arentity
     entityHolder.Controls.Add(AREntity.newInstance((AudioReactor.newInstance())));
 }
Ejemplo n.º 10
0
 private void fpsLimitRange_ValueChanged(object sender, EventArgs e)
 {
     AudioReactor.getInstance(arEntity).fps_limit = (short)fpsLimitRange.Value;
     fpsLimitLabel.Text = AudioReactor.getInstance(arEntity).fps_limit.ToString();
 }
Ejemplo n.º 11
0
 private void deviceSelectorBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     AudioReactor.getInstance(arEntity).audioDeviceNumber = deviceSelectorBox.SelectedIndex - 1;
     Console.WriteLine("Entity capture from " + (deviceSelectorBox.SelectedIndex - 1));
 }
Ejemplo n.º 12
0
 private void dataTypeBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     AudioReactor.getInstance(arEntity).dataType = DataTypeMethod.Parse(dataTypeBox.SelectedIndex);
 }