Esempio n. 1
0
        private void SetupSoundSystemWithSoundtrack()
        {
            var registrationEmail = ProjectSettings.TryGet("Tooll.Sound.BassNetLicense.Email", "");
            var registrationKey   = ProjectSettings.TryGet("Tooll.Sound.BassNetLicense.Key", "");

            if (!String.IsNullOrEmpty(registrationEmail) && !String.IsNullOrEmpty(registrationKey))
            {
                BassNet.Registration(registrationEmail, registrationKey);
            }

            Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_LATENCY, IntPtr.Zero);

            while (!ProjectSettings.Contains("Soundtrack.Path") ||
                   !File.Exists((string)ProjectSettings["Soundtrack.Path"]))
            {
                ProjectSettings["Soundtrack.Path"] = UIHelper.PickFileWithDialog(".", ProjectSettings.TryGet("Soundtrack.Path", "."), "Select Soundtrack");
            }

            if (!ProjectSettings.Contains("Soundtrack.ImagePath"))
            {
                ProjectSettings["Soundtrack.ImagePath"] = UIHelper.PickFileWithDialog(".", ProjectSettings.TryGet("Soundtrack.Path", "."), "Select optional frequency image for soundtrack");
            }

            var soundFilePath = (string)ProjectSettings["Soundtrack.Path"];

            SetProjectSoundFile(soundFilePath);
        }
Esempio n. 2
0
        void PickFileButton_Click(object sender, RoutedEventArgs e)
        {
            var defaultPath = ".\\assets";
            var tmpContext  = new OperatorPartContext();
            var startPath   = ValueHolder.Eval(tmpContext).Text;
            var dialogTitle = "Select file";

            var pickedFilePath = UIHelper.PickFileWithDialog(defaultPath, startPath, dialogTitle);

            if (pickedFilePath != "")
            {
                if (_updateValueCommand == null)
                {
                    XTextEdit_EditingStarted();
                }
                XTextEdit.XTextEdit.Text = pickedFilePath;
                XTextEdit_EditingCompleted();
            }
        }