Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Item
- bool discard()
- bool online(bool on_off)
- bool missing()
- bool show(bool on_off)
- bool selected(bool on_off)
- bool hasDuplicate()
- int duplicateCounter() // 0-base counter for the item's "duplicate" id
- string getFilename()
- int getFileSz()
- string getRelFilepath()
- string getAbsFilepath()
- srting getRelDir()
- string getAbsDir()
- string getExt()
- void export()
- setExportFilepath(string path) // by default equal to original directory + itemname
- setExportBitdepth(int bits) // by default equal to original bitdepth
- setExportSamplerate(int rate) // by default equal to original smaplerate
- double getSourceStart()
- double setSourceStart(double time, bool adjust_contents = true)
- double getSourceEnd()
- double setSourceEnd(double time, bool adjust_contents = false)
- dougle getLength()
- dougle setLength(double time, bool adjust_contents = false)
- int bitdepth()
- int samplerate()
- string getName()
- void setName(string name) // by default equal to filename
- void setSortName // by default equal to nam
- void setDisplayText // by default equal to name
- Color getTextColor()
- void setTextColor(Color color) // black by default
- Envelope getEnvelope(int index)
- class Envelope
- string getName()
- setName(string name)
- int id()
- string getTarget()
- void setTarget(string target)
- class Point
- int id()
- void set(double pos, double val, [int shape, double tens])
- double getPos()
- void setPos(double p)
- double getVal()
- void setVal(double v)
- int getShape()
- void setShape(double s)
- double getTens()
- void setTens(double t)
- Marker getMarker(int index)
- class Marker
- int id()
- string getName()
- void setName(string name)
- double getPos()
- void setPos(double p)
- double getLength() // marker with non-zero length becomes a region
- void setLength(double len)
- void embed(bool on_off) // if true, marker is embedded in the wav
- void show(bool on_off)
- Color getColor()
- void setColor(Color color)
- void setTag(string name, string text)
- void removeTag(string name)
- void setTagAlias(string name, string alias) // equal to tag name by default
- string getTagText(string name)
- void setTagText(string name, string text) // equal to value by default
- var getTagValue(string name)
- void setTagValue(string name, var value) // 0 by default
- Color getTagColor(string name)
- void setTagColor(string name, Color color)
- void addMultitag(string name)
- void removeMultiTag(string name)
- void addToMultitag(string name, string arguments)
- bool MultitagHas(string name, string tag)
- double getGain()
- void setGain(double val)
- double getRate()
- void setRate(double val)
- double getPreroll()
- void setPreroll(double val)
- double getPostroll()
- void setPostroll(double val)
- string getTree()
- void setTree(string tree_directory)
- class List
- columns
- class File
- move(item, directory)
- rename(item, filename)
- copy(item, filepath)
- item duplicate(item) // adds a copy of an item, return item
- delete(item)
- export(item) // reads export settings from item and renders file
- exportMini(item, double minlen, double maxlen) // renders file except with render settings that produce the smallest possible file, min/max length dictates length of wav file to create.
- item import(filepath) // return item
- item create(filepath, length, samplerate, bitdepth, length, pitch) // return item
- create(itemname) // adds an item to the project without creating a file and status is "missing/offline" and path is blank
- assign(item, filepath) // assigns filepath to item. if file is not found, status of item is missing/offline
- exists(filepath) // check if file exists
- InstrumentValueList = createValueList("Cello=1,Violin=2");
- for each (var item in ITEMS) {
- item.tag("name").text = item.name;
- item.tag("note").text = GetMidiNoteFromText(item.name);
- item.tag("note").value = MidiNoteToNum(item.tag("note")); // sets internal value for sorting purposes
- item.gain(10); // set item gain
- item.tag("gain").text = item.gain(); // get item gain and send text value to gain tag
- item.tag("rr").value = regex.replace(item.name, "_(\d+)", "$1");
- item.tag("status").text = "discard"; // add this tag just for fun
- item.tag("status").remove(); // now remove the tag... can an object remove itself like this?
- if (item.tag("instrument") == "Violin") item.multitag("quality") = "loud,bad";
- item.tag("instrument").text = regex.replace(item.name, "((.*?)_", "$1");
- item.tag("instrument").value = InstrumentValueList.getValue(item.tag("instrument"));
- item.tag("project").text = "Orchestral Strings";
- item.tree("project/instrument/~rr/gain")
- if (item.multitag("quality").find("bad")) {
- item.discard();
- item.displaytext = item.name + " (discard)";
- item.textcolor = color.red;
- }
- }
- LIST.addcolumn("Name, Instrument, gain, note, rr, multitag");
- LIST.displayExt(false); //false by default
- MyItemList = GetItemsInTree("Violin"); // Can we search every item to see if they in the violin group?
- MyItemList = GetItemsInTree("Orchestral Strings/Violin"); // This is a more specific search.
- for each (var item : MyItemList) { item.gain = 5; } // I set all items in the violin group to have 5 gain.
- for each (var item : ITEMS) { if (item.gain > 5) item.tag("gain").color = color.green; } // color the text of gain column green
- /*
- Tree view looks like this:
- project Orchestral Strings
- instrument Cello
- rr 2
- gain 10
- Cell_C3_rr2.wav
- instrument Violin
- gain 5
- Violin_C4.wav
- List view looks like this:
- name | instrument | gain | note | rr | quality
- Cello_C3_rr2 Cello 10 C3 2
- Violin_C4 (discard) Violin 5 C4 loud,bad
- Internally, looks like this:
- name | instrument | gain | note | rr | quality
- Cello_C3_rr2.wav 1 10 48 2
- Violin_C4.wav (discard) 2 5 60 loud,bad
- */
- //how the tree might be created in C++
- void CreateTree() {
- for (const auto item : items) {
- for (const auto grp : groups) {
- if (!grp[0] == "~" && item.getTag("grp").empty()) tag = "*ERROR*/";
- else tag = item.getTag(grp) + "/";
- directory += tag;
- // if you try to get a tag that does not exist for the item, maybe default can be "*ERROR*"
- }
- AddToTree(directory, item)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment