public MPCAPI(MainWindow main)
{
m_MainWindow = main;
m_hWnd = new WindowInteropHelper(m_MainWindow).Handle;
m_Source = HwndSource.FromHwnd(m_hWnd);
m_Source.AddHook(WndProc);
AniDBAPI.AppendDebugLine("MPC-HC hook added");
using (Process MPC = new Process())
{
MPC.StartInfo = new ProcessStartInfo(ConfigFile.Read("mpcPath").ToString(), String.Format("/slave {0}", m_hWnd.ToInt32()));
MPC.Start();
m_mpcProcID = MPC.Id;
}
m_PlayTimer = new DispatcherTimer();
m_PlayTimer.Interval = TimeSpan.FromMilliseconds(1000);
m_PlayTimer.Tick += delegate
{
++m_currentFileTick;
SendData(MPCAPI_SENDCOMMAND.CMD_GETCURRENTPOSITION, String.Empty);
};
}