Compare commits

..

14 Commits

Author SHA1 Message Date
Rob Watson
80d4cbfae1 Merge branch 'master' of git://github.com/acarabott/supercollider-tmbundle 2009-04-25 14:35:18 +01:00
Rob Watson
98c779684b update README 2009-04-25 14:33:44 +01:00
Stephen Lumenta
1bd7dc79e2 supercollider language selection key command is now similar to other textmate-language bundles 2009-04-25 14:30:14 +01:00
Stephen Lumenta
326c83c145 fixed a BUG when sclang somethimes didn't read my /usr/bin/local path and thus not find my mate command. added a matePath classvar to Textmate.sc 2009-04-25 14:28:39 +01:00
Arthur Carabott
e71bcf18c6 Fixed break snippet syntax 2009-04-18 19:07:51 +01:00
Arthur Carabott
e2c13bbc83 Added break snippet 2009-04-18 19:06:07 +01:00
Arthur Carabott
ec3d0d1ff5 Added .select snippet.
Actually included renamed snippets.
2009-04-18 11:59:12 +01:00
Arthur Carabott
89337785a9 Added .collect snippet with mirroring. Added mirroring to .any snippet.
Renamed the untitled snippets with correct names.
2009-04-18 11:16:46 +01:00
Arthur Carabott
9d040a8024 Added new print variable snippet. 2009-04-17 11:43:13 +01:00
Rob Watson
53d22df833 Merge branch 'master' of git://github.com/acarabott/supercollider-tmbundle into arthur-changes
Conflicts:
	Snippets/untitled 8.tmSnippet
2009-04-17 00:04:27 +01:00
Arthur Carabott
a6a09d97a9 Replaced Print Variable command with a Print Variable snippet using << syntax; now works with array indexes etc. 2009-04-16 09:41:38 +01:00
Rob Watson
1081a9ebc3 limit incoming connections to localhost 2009-04-15 11:24:45 +01:00
Arthur Carabott
f49e2fbb9a Added new snippets, and printing command. 2009-03-23 18:16:03 +00:00
Rob Watson
508fb4719e updated for new SCMenuItem implementation, also some updates to snippets/readme 2009-02-24 09:53:25 +00:00
37 changed files with 499 additions and 69 deletions

View File

@ -10,7 +10,7 @@
def could_not_locate def could_not_locate
puts "&lt;span style='color:red'&gt;There was a problem&lt;/span&gt;&lt;br/&gt;" puts "&lt;span style='color:red'&gt;There was a problem&lt;/span&gt;&lt;br/&gt;"
puts "Probably, you do not have SuperCollider installed, or you are using a non-standard user support directory.&lt;br/&gt;&lt;br/&gt;" puts "Probably, you do not have SuperCollider installed, or you are using a non-standard user support directory.&lt;br/&gt;&lt;br/&gt;"
puts "You will need to manually copy &lt;code&gt;supercollider-tmbundle/Support/classes/TextMate.sc&lt;/code&gt; into your SC class path" puts "You will need to manually link &lt;code&gt;supercollider-tmbundle/Support/classes/TextMate.sc&lt;/code&gt; into your SC class path"
end end
puts "=======================================&lt;br/&gt;" puts "=======================================&lt;br/&gt;"
@ -44,7 +44,7 @@ end
<key>keyEquivalent</key> <key>keyEquivalent</key>
<string>$@</string> <string>$@</string>
<key>name</key> <key>name</key>
<string>Install</string> <string>Complete installation</string>
<key>output</key> <key>output</key>
<string>showAsHTML</string> <string>showAsHTML</string>
<key>scope</key> <key>scope</key>

View File

@ -8,6 +8,8 @@ h2. Requirements
A "recent build":http://sourceforge.net/projects/supercollider of SC (>= 3.3 alpha) A "recent build":http://sourceforge.net/projects/supercollider of SC (>= 3.3 alpha)
"TextMate":http://macromates.com, with terminal usage enabled (see Help -> Terminal Usage in TM menu)
h2. Installation h2. Installation
h3. With git h3. With git
@ -20,6 +22,10 @@ h3. With git
@osascript -e 'tell app "TextMate" to reload bundles'@ @osascript -e 'tell app "TextMate" to reload bundles'@
In Textmate menu: Bundles > SuperCollider > Complete installation
h3. Without git h3. Without git
@mkdir -p ~/Library/Application\ Support/TextMate/Bundles@ @mkdir -p ~/Library/Application\ Support/TextMate/Bundles@
@ -36,13 +42,13 @@ h3. Without git
@osascript -e 'tell app "TextMate" to reload bundles'@ @osascript -e 'tell app "TextMate" to reload bundles'@
h3. After installing In Textmate menu: Bundles > SuperCollider > Complete installation
* Open TextMate and select 'SuperCollider' bundle
* Press CMD-SHIFT-F1 to complete installation.
h2. Key controls h2. Key controls
All key controls can be reprogrammed in Bundles editor.
* @ENTER@<br/>Execute current selection/line * @ENTER@<br/>Execute current selection/line
* @CTRL-PERIOD@<br/> * @CTRL-PERIOD@<br/>
@ -69,24 +75,26 @@ Post window to front
* @CMD-SHIFT-C@<br/> * @CMD-SHIFT-C@<br/>
Clear post window Clear post window
* @CMD-ALT-CTRL-S@<br/> * @ALT-CTRL-SHIFT-S@<br/>
Switch to SuperCollider mode Switch to SuperCollider bundle
<br/> <br/>
*plus* various snippets - check the bundle. *plus* various snippets - check the bundle.
h2. Limitations h2. Notes
TextMate does not handle .rtf documents. So .rtf files will have to be copy-and-pasted into .sc text files. This is not a problem for classes. TextMate does not handle .rtf documents. So .rtf files will have to be copy-and-pasted into .sc text files. This is not a problem for classes.
Some controls (browse class file, etc) depend upon TM terminal command (see Help -> Terminal Usage in TM menu)
CMD-period cannot be programmed in TextMate, so to stop audio output use CTRL-period instead CMD-period cannot be programmed in TextMate, so to stop audio output use CTRL-period instead
Class lib can only currently be recompiled from within TextMate (CMD-K) if there's been no previous error compiling it. Recompile from within SC in that case
h2. Notes
I've extracted the underlying code to allow control of SC.app from any command line application.<br/>"sc3ctrl on github":http://github.com/rfwatson/sc3ctrl I've extracted the underlying code to allow control of SC.app from any command line application.<br/>"sc3ctrl on github":http://github.com/rfwatson/sc3ctrl
h2. TODO
Might repackage this as a quark .. ?
h2. Contact me h2. Contact me
Via "github":http://github.com/rfwatson Via "github":http://github.com/rfwatson

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.classVarNames.dump;</string>
<key>name</key>
<string>All Class Vars</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.acvars</string>
<key>uuid</key>
<string>3FC8E89C-7BAF-4C66-9327-C544EBF53DFE</string>
</dict>
</plist>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.instVarNames.dump;</string>
<key>name</key>
<string>All Vars</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.avars</string>
<key>uuid</key>
<string>93CDD123-97D9-40CB-9F63-A6F0A42D8622</string>
</dict>
</plist>

22
Snippets/Break.tmSnippet Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>block {|break|
if (${1:true}) { break.value(${2:nil}) };
}
</string>
<key>keyEquivalent</key>
<string>^~@b</string>
<key>name</key>
<string>Break</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>break</string>
<key>uuid</key>
<string>76D2572D-8E53-4EC8-93C0-2DFADF94E687</string>
</dict>
</plist>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>//
$1.postln;
//
</string>
<key>name</key>
<string>BugNumbers</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>n.</string>
<key>uuid</key>
<string>4C6C9C58-92F3-4FD2-AE39-00F01AC3F7B2</string>
</dict>
</plist>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>Post &lt;&lt; "$TM_SELECTED_TEXT: " &lt;&lt; $TM_SELECTED_TEXT &lt;&lt; "\n";
</string>
<key>keyEquivalent</key>
<string>~@p</string>
<key>name</key>
<string>Print Variable</string>
<key>scope</key>
<string>source.supercollider</string>
<key>uuid</key>
<string>C94CF802-251A-44FE-87CB-4C50FA4D4D02</string>
</dict>
</plist>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>while({${1:condition}}, {
${2:do}
});</string>
<key>name</key>
<string>While...</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>while</string>
<key>uuid</key>
<string>D3FF72CE-4B17-47E2-8A3A-E2E4A6BAC859</string>
</dict>
</plist>

18
Snippets/_any.tmSnippet Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.any { |${1:i}tem, $1|
$2
};</string>
<key>name</key>
<string>.any</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.any</string>
<key>uuid</key>
<string>DF09CE07-5704-4932-8DC7-86A1ECE54401</string>
</dict>
</plist>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.collect({|${1:i}tem, $1| $2 })
</string>
<key>name</key>
<string>.collect</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.collect</string>
<key>uuid</key>
<string>36B59028-5F9E-4023-B0CB-46BA991E4A0F</string>
</dict>
</plist>

18
Snippets/_every.tmSnippet Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>every { |${1:i}tem, $1|
$2
};</string>
<key>name</key>
<string>.every</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.every</string>
<key>uuid</key>
<string>43EED273-EF78-473E-8BF0-650D2FC19CCA</string>
</dict>
</plist>

16
Snippets/_get.tmSnippet Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.get(${1:0}, {|msg| ${2:msg.postln}});</string>
<key>name</key>
<string>.get</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.get</string>
<key>uuid</key>
<string>43E979D3-9639-4DCC-9E57-24A5C72A30F1</string>
</dict>
</plist>

16
Snippets/_isNil.tmSnippet Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.isNil </string>
<key>name</key>
<string>.isNil</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.n</string>
<key>uuid</key>
<string>ABFD1872-DD86-4099-B758-28E319EF479D</string>
</dict>
</plist>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.notNil</string>
<key>name</key>
<string>.notNil</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.nn</string>
<key>uuid</key>
<string>A138C3A1-AEF7-4C4A-AD57-80B0564A61A8</string>
</dict>
</plist>

View File

@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>content</key> <key>content</key>
<string>.postln</string> <string>.postln;</string>
<key>name</key> <key>name</key>
<string>.postln</string> <string>.postln</string>
<key>scope</key> <key>scope</key>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.select({|${1:i}tem, $1| $2 })
</string>
<key>name</key>
<string>.select</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.select</string>
<key>uuid</key>
<string>A29A295B-A0A4-4E8E-B144-802098C5D806</string>
</dict>
</plist>

16
Snippets/_set.tmSnippet Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.set(\\${1:arg}, ${2:val});</string>
<key>name</key>
<string>.set</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.set</string>
<key>uuid</key>
<string>AB35A021-A800-4B82-B603-295CFD714A5B</string>
</dict>
</plist>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>switch ($1)
{$2} {$3}
{$4} {$5};
</string>
<key>name</key>
<string>case copy</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>switch</string>
<key>uuid</key>
<string>A2B8FE76-A086-4FD3-B832-7154B7CE88F4</string>
</dict>
</plist>

19
Snippets/case.tmSnippet Normal file
View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>case
{$1} {$2}
{$3} {$4};
</string>
<key>name</key>
<string>case</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>case</string>
<key>uuid</key>
<string>44331733-E717-4546-BA68-C254284E1089</string>
</dict>
</plist>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.dumpAllMethods;</string>
<key>name</key>
<string>dumpAllMethods</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.dm</string>
<key>uuid</key>
<string>78E00F80-2133-42C8-94E8-C570693BEC8E</string>
</dict>
</plist>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.dumpInterface;</string>
<key>name</key>
<string>dumpInterface</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.di</string>
<key>uuid</key>
<string>533A6101-A0FB-4F3B-A94A-E04A8DC46C0F</string>
</dict>
</plist>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>if(${1:condition}) {
${2:true}
};</string>
<key>name</key>
<string>if ...</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>if</string>
<key>uuid</key>
<string>44E4E852-1518-4E8C-84F1-9990A1B910ED</string>
</dict>
</plist>

View File

@ -13,7 +13,7 @@
<key>scope</key> <key>scope</key>
<string>source.supercollider</string> <string>source.supercollider</string>
<key>tabTrigger</key> <key>tabTrigger</key>
<string>if</string> <string>ife</string>
<key>uuid</key> <key>uuid</key>
<string>C0F1C9B0-6393-4B2B-86B4-40010363DCDE</string> <string>C0F1C9B0-6393-4B2B-86B4-40010363DCDE</string>
</dict> </dict>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>interpolation:</string>
<key>name</key>
<string>interpolation</string>
<key>tabTrigger</key>
<string>int</string>
<key>uuid</key>
<string>D36563CB-A0CE-43EB-8F19-2EF1D5E42B81</string>
</dict>
</plist>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.makeBundle(${1:0.2}, {
$2
});</string>
<key>name</key>
<string>makeBundle</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>.mb</string>
<key>uuid</key>
<string>66B16E22-D3FB-464F-B820-2FEEFD79DBA5</string>
</dict>
</plist>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>${1:Classname} : ${2:Object} {
*new { $3
^super.new.init$4;
}
init { $5
$6
}
}</string>
<key>name</key>
<string>Class</string>
<key>scope</key>
<string>source.supercollider</string>
<key>tabTrigger</key>
<string>class</string>
<key>uuid</key>
<string>7581E1DB-6946-44BB-B836-6F5CE5E99B55</string>
</dict>
</plist>

View File

@ -23,37 +23,40 @@ TextMate {
}; };
try { try {
menu = CocoaMenuItem(nil, 7, "TextMate", true); menu = SCMenuGroup(nil, "TextMate", 7);
opt = CocoaMenuItem(menu, 0, "TextMate to front", false) { opt = SCMenuItem(menu, "TextMate to front")
"osascript << END .action_{
tell application \"TextMate\" to activate "osascript << END
END tell application \"TextMate\" to activate
".unixCmd(postOutput: false) END
}; ".unixCmd(postOutput: false)
opt.setShortCut("T"); }
.setShortCut("T");
openClassInTextMate = CocoaMenuItem(menu, 1, "Open class files in TextMate", false) { |item|
item.state = item.state.not;
this.saveState;
};
openClassInTextMate.state = settings.classfiles;
openReferencesInTextMate = CocoaMenuItem(menu, 2, "Open references in TextMate", false) { |item|
item.state = item.state.not;
this.saveState;
};
openReferencesInTextMate.state = settings.references;
CocoaMenuItem(menu, 3, "About SuperCollider bundle", false) { |item| SCMenuSeparator(menu);
Document.new.string = "TextMate-SuperCollider bundle
by R.Watson openClassInTextMate = SCMenuItem(menu, "Open class files in TextMate")
.action_{ |item|
item.state = item.state.not;
this.saveState;
}
.state_(settings.classfiles);
openReferencesInTextMate = SCMenuItem(menu, "Open references in TextMate")
.action_{ |item|
item.state = item.state.not;
this.saveState;
}
.state_(settings.references);
For documentation and source code, SCMenuSeparator(menu, 4);
http://rfwatson.github.com"
}; SCMenuItem(menu, "About SuperCollider bundle")
} { .action_{ |item|
"open 'http://github.com/rfwatson/supercollider-tmbundle'".unixCmd(postOutput:false);
}
} {
"TextMate found a problem installing CocoaMenuItems - you may be running SC 3.2 or older, or booting from command-line.".warn "TextMate found a problem installing CocoaMenuItems - you may be running SC 3.2 or older, or booting from command-line.".warn
} }
} }
@ -61,12 +64,20 @@ http://rfwatson.github.com"
// adapted from http://github.com/rfwatson/sc3ctrl // adapted from http://github.com/rfwatson/sc3ctrl
SC3Controller { SC3Controller {
classvar nodes; classvar nodes, <>matePath;
*initClass { *initClass {
nodes = List[]; nodes = List[];
Platform.case(\osx) { Platform.case(\osx) {
var whichMate = "which mate".unixCmdGetStdOut;
if(whichMate.isEmpty){
matePath = "/usr/local/bin/mate";
} {
matePath = whichMate;
};
StartUp.add { StartUp.add {
this.addListeners; this.addListeners;
} }
@ -81,7 +92,7 @@ SC3Controller {
}; };
if(nodes.isEmpty) { if(nodes.isEmpty) {
node = OSCresponderNode(nil, '/sc3ctrl/cmd') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/cmd') { |t, r, msg|
{ {
thisThread.clock = SystemClock; thisThread.clock = SystemClock;
msg[1].asString.interpretPrint; msg[1].asString.interpretPrint;
@ -89,15 +100,15 @@ SC3Controller {
}.defer }.defer
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/help') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/help') { |t, r, msg|
{ {
msg[1].asString.openHelpFile; msg[1].asString.openHelpFile;
}.defer }.defer
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/class') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/class') { |t, r, msg|
// TM version only // TM version only
var fname, cmd; var fname, cmd;
var klass = msg[1].asString; var klass = msg[1].asString;
@ -113,11 +124,14 @@ SC3Controller {
var content = f.readAllString; var content = f.readAllString;
var split = content.split($:); var split = content.split($:);
if("^[0-9]+$".matchRegexp(split.first.asString)) { if("^[0-9]+$".matchRegexp(split.first.asString)) {
("mate -l" ++ split.first + "\"" ++ fname ++ "\"").unixCmd(postOutput: false); (matePath ++ " -l"++ split.first + "\"" ++ fname ++ "\"").unixCmd(postOutput: false);
} { } {
("mate -l1 \"" ++ fname ++ "\"").unixCmd(postOutput: false); (matePath ++ " -l1 \"" ++ fname ++ "\"").unixCmd(postOutput: false);
} };
f.close;
}; };
}); });
} }
} { // open in SC.app } { // open in SC.app
@ -127,7 +141,7 @@ SC3Controller {
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/implementations') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/implementations') { |t, r, msg|
if(TextMate.openReferencesInTextMate.state) { if(TextMate.openReferencesInTextMate.state) {
{ this.methodTemplates(msg[1], true) }.defer { this.methodTemplates(msg[1], true) }.defer
} { // open in SC.app } { // open in SC.app
@ -136,7 +150,7 @@ SC3Controller {
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/references') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/references') { |t, r, msg|
if(TextMate.openReferencesInTextMate.state) { if(TextMate.openReferencesInTextMate.state) {
{ this.methodReferences(msg[1], true) }.defer { this.methodReferences(msg[1], true) }.defer
} { // open in SC.app } { // open in SC.app
@ -145,12 +159,12 @@ SC3Controller {
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/stop') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/stop') { |t, r, msg|
thisProcess.stop; nil; thisProcess.stop; nil;
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/clear') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/clear') { |t, r, msg|
{ {
Document.listener.string = ""; ""; Document.listener.string = ""; "";
postToFront.(); postToFront.();
@ -158,12 +172,12 @@ SC3Controller {
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/postfront') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/postfront') { |t, r, msg|
{ postToFront.() }.defer; { postToFront.() }.defer;
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/recompile') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/recompile') { |t, r, msg|
{ {
thisProcess.recompile; thisProcess.recompile;
postToFront.(); postToFront.();
@ -220,7 +234,7 @@ SC3Controller {
fname = "/tmp/" ++ Date.seed ++ ".sc"; fname = "/tmp/" ++ Date.seed ++ ".sc";
File.use(fname, "w") { |f| File.use(fname, "w") { |f|
f << out.collection.asString; f << out.collection.asString;
("mate" + fname).unixCmd(postOutput: false); (matePath + fname).unixCmd(postOutput: false);
}; };
} { } {
out.collection.newTextWindow(name.asString); out.collection.newTextWindow(name.asString);
@ -243,7 +257,7 @@ SC3Controller {
fname = "/tmp/" ++ Date.seed ++ ".sc"; fname = "/tmp/" ++ Date.seed ++ ".sc";
File.use(fname, "w") { |f| File.use(fname, "w") { |f|
f << out.collection.asString; f << out.collection.asString;
("mate" + fname).unixCmd(postOutput: false); (matePath + fname).unixCmd(postOutput: false);
}; };
} { } {
out.collection.newTextWindow(name.asString); out.collection.newTextWindow(name.asString);

View File

@ -21,38 +21,38 @@ SC3Controller {
}; };
if(nodes.isEmpty) { if(nodes.isEmpty) {
node = OSCresponderNode(nil, '/sc3ctrl/cmd') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/cmd') { |t, r, msg|
msg[1].asString.interpretPrint; msg[1].asString.interpretPrint;
{ postToFront.() }.defer; { postToFront.() }.defer;
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/help') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/help') { |t, r, msg|
{ msg[1].asString.openHelpFile }.defer { msg[1].asString.openHelpFile }.defer
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/class') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/class') { |t, r, msg|
{ msg[1].asString.interpret.openCodeFile }.defer { msg[1].asString.interpret.openCodeFile }.defer
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/implementations') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/implementations') { |t, r, msg|
{ SC3Controller.methodTemplates(msg[1]) }.defer { SC3Controller.methodTemplates(msg[1]) }.defer
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/references') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/references') { |t, r, msg|
{ SC3Controller.methodReferences(msg[1]) }.defer { SC3Controller.methodReferences(msg[1]) }.defer
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/stop') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/stop') { |t, r, msg|
thisProcess.stop; thisProcess.stop;
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/clear') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/clear') { |t, r, msg|
{ {
Document.listener.string = ""; ""; Document.listener.string = ""; "";
postToFront.(); postToFront.();
@ -60,12 +60,12 @@ SC3Controller {
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/postfront') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/postfront') { |t, r, msg|
{ postToFront.() }.defer; { postToFront.() }.defer;
}.add; }.add;
nodes.add(node); nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/recompile') { |t, r, msg| node = OSCresponderNode(NetAddr("localhost", nil), '/sc3ctrl/recompile') { |t, r, msg|
{ {
thisProcess.recompile; thisProcess.recompile;
postToFront.(); postToFront.();

View File

@ -11,7 +11,7 @@
<key>foldingStopMarker</key> <key>foldingStopMarker</key>
<string>\}|\*\/</string> <string>\}|\*\/</string>
<key>keyEquivalent</key> <key>keyEquivalent</key>
<string>^~@s</string> <string>^~S</string>
<key>name</key> <key>name</key>
<string>SuperCollider</string> <string>SuperCollider</string>
<key>patterns</key> <key>patterns</key>

View File

@ -25,6 +25,7 @@
<string>59AA6C90-F786-434B-B10E-DA608EFBC824</string> <string>59AA6C90-F786-434B-B10E-DA608EFBC824</string>
<string>89218E54-78ED-4C0B-92C9-8FEC7E3B2664</string> <string>89218E54-78ED-4C0B-92C9-8FEC7E3B2664</string>
<string>8FA2A21C-E1C9-41AE-AEAB-7FF573747A7C</string> <string>8FA2A21C-E1C9-41AE-AEAB-7FF573747A7C</string>
<string>7581E1DB-6946-44BB-B836-6F5CE5E99B55</string>
<string>2635D12B-F4B6-45B6-8BA4-B50215737165</string> <string>2635D12B-F4B6-45B6-8BA4-B50215737165</string>
<string>FD6AB222-41B0-4851-AE06-D91F5422D7E1</string> <string>FD6AB222-41B0-4851-AE06-D91F5422D7E1</string>
<string>BA4AE872-4314-4D57-B2C6-6A66CCC5F55E</string> <string>BA4AE872-4314-4D57-B2C6-6A66CCC5F55E</string>
@ -38,6 +39,27 @@
<string>293C4F9B-E1A4-4D01-83E7-0698112C7FA4</string> <string>293C4F9B-E1A4-4D01-83E7-0698112C7FA4</string>
<string>3BAE7DE4-D06A-422B-94A3-7F542C47ED0F</string> <string>3BAE7DE4-D06A-422B-94A3-7F542C47ED0F</string>
<string>22917CBF-054E-49ED-8AFA-7B72C0CFFA3A</string> <string>22917CBF-054E-49ED-8AFA-7B72C0CFFA3A</string>
<string>A138C3A1-AEF7-4C4A-AD57-80B0564A61A8</string>
<string>ABFD1872-DD86-4099-B758-28E319EF479D</string>
<string>BB37ACE9-8262-4AF6-B3C6-43DC0AF2B370</string>
<string>D36563CB-A0CE-43EB-8F19-2EF1D5E42B81</string>
<string>43E979D3-9639-4DCC-9E57-24A5C72A30F1</string>
<string>AB35A021-A800-4B82-B603-295CFD714A5B</string>
<string>3FC8E89C-7BAF-4C66-9327-C544EBF53DFE</string>
<string>93CDD123-97D9-40CB-9F63-A6F0A42D8622</string>
<string>4C6C9C58-92F3-4FD2-AE39-00F01AC3F7B2</string>
<string>D3FF72CE-4B17-47E2-8A3A-E2E4A6BAC859</string>
<string>DF09CE07-5704-4932-8DC7-86A1ECE54401</string>
<string>44331733-E717-4546-BA68-C254284E1089</string>
<string>A2B8FE76-A086-4FD3-B832-7154B7CE88F4</string>
<string>78E00F80-2133-42C8-94E8-C570693BEC8E</string>
<string>533A6101-A0FB-4F3B-A94A-E04A8DC46C0F</string>
<string>43EED273-EF78-473E-8BF0-650D2FC19CCA</string>
<string>44E4E852-1518-4E8C-84F1-9990A1B910ED</string>
<string>66B16E22-D3FB-464F-B820-2FEEFD79DBA5</string>
<string>C94CF802-251A-44FE-87CB-4C50FA4D4D02</string>
<string>36B59028-5F9E-4023-B0CB-46BA991E4A0F</string>
<string>A29A295B-A0A4-4E8E-B144-802098C5D806</string>
</array> </array>
<key>uuid</key> <key>uuid</key>
<string>7613A472-3FAB-454C-8CF2-2E62F0D00920</string> <string>7613A472-3FAB-454C-8CF2-2E62F0D00920</string>