예제 #1
0
파일: Yse.cs 프로젝트: yvanvds/interact
        public Yse()
        {
            Interface = new YSE.YseInterface(AddLogMessage);
            Interface.System.Init();
            Interface.Log.Level = IYse.ERROR_LEVEL.ERROR;
            Handle = this;

            Log.Log.Handle.AddEntry("Yse Version: " + Interface.System.Version);

            string hostName    = Properties.Settings.Default.AudioHostName;
            string deviceName  = Properties.Settings.Default.AudioDeviceName;
            string channelConf = Properties.Settings.Default.AudioChannelConf;

            if (hostName != string.Empty && deviceName != string.Empty && channelConf != string.Empty)
            {
                bool success = false;
                for (uint i = 0; i < Interface.System.NumDevices; i++)
                {
                    IDevice device = Interface.System.GetDevice(i);
                    if (device.OutputChannels.Count > 0 && device.Name.Equals(deviceName) && device.TypeName.Equals(hostName))
                    {
                        success = true;
                        OpenDevice(device, channelConf);
                        break;
                    }
                }
                if (!success)
                {
                    Dialogs.Error.Show("Invalid Audio Configuration", "The current audio configuration is invalid. Please open Application Options, Audio.");
                }
            }

            update.Interval = new TimeSpan(0, 0, 0, 0, 50);
            update.Tick    += new EventHandler(UpdateFunc);
            update.Start();
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();
            Handle = this;

            ThemeManager.CurrentTheme = "MetroDark";
            CodeEditor.SyntaxEditorHelper.UpdateHighlightingStyleRegistryForThemeChange();

            addPages();

            Yse.Yse audio = new Yse.Yse();             // will keep an internal handle at Yse.Yse.Handle;

            if (Properties.Settings.Default.OpenProjectOnStart)
            {
                if (Properties.Settings.Default.LastOpenProject.Length > 0)
                {
                    if (System.IO.File.Exists(Properties.Settings.Default.LastOpenProject))
                    {
                        Project.Project.OpenProject(Properties.Settings.Default.LastOpenProject);
                        Pages.ProjectExplorer.Handle.Refresh();
                    }
                }
            }
        }