Adding first draft of our text application.
This is most useful for testing stuff without MediaPortal.
2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Threading.Tasks;
9 using System.Windows.Forms;
11 using System.Runtime.InteropServices;
15 public partial class MainForm : Form
17 iMON.Display iDisplay;
18 System.Timers.Timer iTimer;
21 iMON.Display.DSPEQDATA iEqLeft;
22 iMON.Display.DSPEQDATA iEqRight;
23 iMON.Display.DSPEQDATA iEqMono;
29 iDisplay = new iMON.Display();
30 InitializeComponent();
31 iTimer = new System.Timers.Timer(500); // Set up the timer for N ms
32 iTimer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
33 iTimer.Enabled = false; // Enable it
35 iEqLeft =new iMON.Display.DSPEQDATA();
36 iEqRight = new iMON.Display.DSPEQDATA();
37 iEqMono = new iMON.Display.DSPEQDATA();
39 iRandom = new Random();
42 private void buttonInit_Click(object sender, EventArgs e)
44 if (!iDisplay.DoInit())
46 labelStatus.Text = iDisplay.StatusMessage;
50 labelStatus.Text = iDisplay.Name();
54 private void buttonUninit_Click(object sender, EventArgs e)
59 private void buttonSetLcdText_Click(object sender, EventArgs e)
61 iMON.Display.IDW_SetLcdText(textBoxLcd.Text);
64 private void timer_Elapsed(object sender, ElapsedEventArgs e)
68 if (!checkBoxRandomEq.Checked)
70 iMON.Display.IDW_SetLcdText(iFrameCount.ToString());
75 for (int i = 0; i < 16; i++)
77 iEqLeft.BandData[i] = iRandom.Next(0,101);
78 iEqRight.BandData[i] = iRandom.Next(0, 101);
81 iMON.Display.IDW_SetLcdEqData(iEqLeft, iEqRight);
87 private void buttonToggleTimer_Click(object sender, EventArgs e)
92 iTimer.Enabled = false;
93 buttonToggleTimer.Text = "Start";
99 iTimer.Interval = (double)numericTimerInterval.Value;
100 iTimer.Enabled = true;
101 buttonToggleTimer.Text = "Stop";