/// <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); }
public FileSelectorScope(VstHost host, VstFileSelect fileSelect) { _host = host; _fileSelect = fileSelect; if (_host.HostCommandStub.OpenFileSelector(_fileSelect) == false) { throw new InvalidOperationException(Properties.Resources.FileSelectorScope_OpenNotSupported); } }
public FileSelectorScope(IVstHostCommands20 commands, VstFileSelect fileSelect) { _commands = commands; _fileSelect = fileSelect; if (!_commands.OpenFileSelector(_fileSelect)) { throw new InvalidOperationException( Properties.Resources.FileSelectorScope_OpenNotSupported); } }
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."); }
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."); }
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); } }
public bool CloseFileSelector(VstFileSelect fileSelect) { Debug($"CloseFileSelector {fileSelect.Title} {fileSelect.InitialPath}"); return(false); }
/// <inheritdoc /> public bool OpenFileSelector(VstFileSelect fileSelect) { Debug($"OpenFileSelector"); return(false); }
public bool CloseFileSelector(VstFileSelect fileSelect) { throw new NotImplementedException(); }
/// <inheritdoc /> public bool CloseFileSelector(VstFileSelect fileSelect) { RaisePluginCalled("CloseFileSelector(" + fileSelect.Command + ")"); return false; }
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; }
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)); }
/// <inheritdoc /> public bool CloseFileSelector(VstFileSelect fileSelect) { RaisePluginCalled("CloseFileSelector(" + fileSelect.Command + ")"); return(false); }