Community Forums Archive

Go Back

Subject:IsCurrent {get; set;}
Posted by: GPD
Date:4/2/2009 10:05:25 AM

What is the proper syntax to use this file function:

IsCurrent {get; set;}

I would like set the "file" object to the currently opened/slected file in SF.

Subject:RE: IsCurrent {get; set;}
Reply by: GPD
Date:4/2/2009 10:50:42 AM

Also:

file.GetSample(x, 1)

Returns the sample value of a selected sample. Is there an equivalent "SetSample" that would overwrite the selected sample? Or must we use overwiteAudio with selection methods?

For example how could I DC offset or Gain a single sample value efficiently using code, not the doEffects methods.

Subject:RE: IsCurrent {get; set;}
Reply by: ForumAdmin
Date:4/3/2009 7:49:00 AM

IsCurrent can be treated as a property of ISfFileHost, e.g.
file.IsCurrent = true;
brings the file to the top.

If you just want to fetch the current file, use
ISfFileHost file = app.CurrentFile;
A file only needs to be current for things that operate on files, but do not explicitly take one (e.g. DoMenu, etc.).

There is no SetSample method. If you want to operate on raw samples without going through effects, use a buffer and ISfFileHost's ReadAudio() and WriteAudio() methods. There should be a script called "WriteAudioTest.cs" in the SDK's Unit Tests folder that demonstrates this method.

J.

Message last edited on4/3/2009 7:49:59 AM byForumAdmin.

Go Back