Example #1
0
        /// <summary>
        /// Make the host show an open file dialog - if supported.
        /// </summary>
        /// <returns>Returns null when the host does not support opening a file selector.</returns>
        public IDisposable?OpenFileSelector(VstFileSelect fileSelect)
        {
            // check capability of the host
            if ((_host.Capabilities & VstHostCapabilities.OpenFileSelector) > 0)
            {
                return(new FileSelectorScope(_commands, fileSelect));
            }

            return(null);
        }
Example #2
0
            public FileSelectorScope(VstHost host, VstFileSelect fileSelect)
            {
                _host       = host;
                _fileSelect = fileSelect;

                if (_host.HostCommandStub.OpenFileSelector(_fileSelect) == false)
                {
                    throw new InvalidOperationException(Properties.Resources.FileSelectorScope_OpenNotSupported);
                }
            }
Example #3
0
            public FileSelectorScope(IVstHostCommands20 commands, VstFileSelect fileSelect)
            {
                _commands   = commands;
                _fileSelect = fileSelect;

                if (!_commands.OpenFileSelector(_fileSelect))
                {
                    throw new InvalidOperationException(
                              Properties.Resources.FileSelectorScope_OpenNotSupported);
                }
            }
Example #4
0
        public void Test_MaxLength_VstFileSelect_Title()
        {
            VstFileSelect fs = new VstFileSelect();

            Assert.AreEqual(null, fs.Title);

            fs.Title = String.Empty;
            Assert.AreEqual(String.Empty, fs.Title);

            string testData = CreateString(Constants.MaxFileSelectorTitle);

            fs.Title = testData;
            Assert.AreEqual(testData, fs.Title);

            testData += "X";
            fs.Title  = testData;
            Assert.Fail("should have thrown an exception.");
        }
Example #5
0
        public void Test_MaxLength_VstFileSelect_Title()
        {
            var fs = new VstFileSelect();

            fs.Title.Should().BeEmpty();

            fs.Title = String.Empty;
            fs.Title.Should().BeEmpty();

            var testData = CreateString(Constants.MaxFileSelectorTitle);

            fs.Title = testData;
            fs.Title.Should().Be(testData);

            testData += "X";
            fs.Title  = testData;
            Assert.Fail("should have thrown an exception.");
        }
Example #6
0
        private void OpenBtn_Click(object sender, RoutedEventArgs e)
        {
            VstFileSelect fileSelect = new VstFileSelect();

            fileSelect.Command                = VstFileSelectCommand.FileLoad;
            fileSelect.FileTypes              = new VstFileType[2];
            fileSelect.FileTypes[0]           = new VstFileType();
            fileSelect.FileTypes[0].Name      = "Text Files";
            fileSelect.FileTypes[0].Extension = "txt";
            fileSelect.FileTypes[1]           = new VstFileType();
            fileSelect.FileTypes[1].Name      = "All Files";
            fileSelect.FileTypes[1].Extension = "*";
            fileSelect.Title = "Select a file";

            if (Host.OpenFileSelector(fileSelect))
            {
                if (fileSelect.ReturnPaths != null && fileSelect.ReturnPaths.Length > 0)
                {
                    MessageBox.Show(fileSelect.ReturnPaths[0], "VST.NET CorePlugin WPF", MessageBoxButton.OK, MessageBoxImage.Information);
                }

                Host.CloseFileSelector(fileSelect);
            }
        }
Example #7
0
 public bool CloseFileSelector(VstFileSelect fileSelect)
 {
     Debug($"CloseFileSelector {fileSelect.Title} {fileSelect.InitialPath}");
     return(false);
 }
Example #8
0
 /// <inheritdoc />
 public bool OpenFileSelector(VstFileSelect fileSelect)
 {
     Debug($"OpenFileSelector");
     return(false);
 }
Example #9
0
 public bool CloseFileSelector(VstFileSelect fileSelect)
 {
     throw new NotImplementedException();
 }
Example #10
0
 /// <inheritdoc />
 public bool CloseFileSelector(VstFileSelect fileSelect)
 {
     RaisePluginCalled("CloseFileSelector(" + fileSelect.Command + ")");
     return false;
 }
Example #11
0
 public bool CloseFileSelector(VstFileSelect fileSelect)
 {
     throw new NotImplementedException();
 }
Example #12
0
 public bool OpenFileSelector(VstFileSelect fileSelect)
 {
     return(false);
 }
            public FileSelectorScope(VstHost host, VstFileSelect fileSelect)
            {
                this.host = host;
                this.fileSelect = fileSelect;

                if (host.HostCommandStub.OpenFileSelector(fileSelect) == false)
                    throw new InvalidOperationException(Resources.FileSelectorScope_OpenNotSupported);
            }
        /// <summary>
        /// Under construction!
        /// </summary>
        /// <returns>Returns null when the host does not support opening a file selector.</returns>
        public IDisposable OpenFileSelector(VstFileSelect fileSelect)
        {
            // check capability of the host
            if ((host.Capabilities & VstHostCapabilities.OpenFileSelector) > 0)
                return new FileSelectorScope(host, fileSelect);

            return null;
        }
Example #15
0
 public bool CloseFileSelector(VstFileSelect fileSelect)
 {
     return(false);
 }
 public bool OpenFileSelector(VstFileSelect fileSelect)
 {
     return(_hostCmdStub.OpenFileSelector(fileSelect));
 }
 public bool CloseFileSelector(VstFileSelect fileSelect)
 {
     return(_hostCmdStub.CloseFileSelector(fileSelect));
 }
Example #18
0
 /// <inheritdoc />
 public bool CloseFileSelector(VstFileSelect fileSelect)
 {
     RaisePluginCalled("CloseFileSelector(" + fileSelect.Command + ")");
     return(false);
 }