some more tweaks

This commit is contained in:
rob 2008-12-21 21:33:49 +00:00
parent a9221e8716
commit 071646f5cc
7 changed files with 1221 additions and 155 deletions

25
README
View File

@ -1,6 +1,3 @@
sc3ctrl
=======
**************************************************************************
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -23,23 +20,25 @@ Introduction
============
sc3ctrl is a command line utility which uses OpenSoundControl to control
the SuperCollider3.app in OSX.
SuperCollider3.app in OSX.
Source code/downloads: http://github.com/rfwatson/sc3ctrl
Consists of a small CoreFoundation bundle written in Objective-C and a
single SuperCollider class.
Source code: http://github.com/rfwatson/sc3ctrl
Installation
============
1) Drag the bundle into a suitable location on your machine
(such as /Application/Utilities/)
(e.g. /Application/Utilities/)
2) Double click "install.rb". (This will create an executable script in
/usr/local/lib. This allows sc3ctrl to be run from the command-line. It also
copies the required SuperCollider class file to ~/Application\
Support/SuperCollider/Extensions/).
2) cd /Application/Utilities/sc3ctrl/
3) Start SuperCollider.app
3) sudo install.rb
4) Start SuperCollider.app
Usage
@ -49,9 +48,9 @@ sc3ctrl -x Execute the SC code in environment variable SC_INTERPR
sc3ctrl -x VARIABLE_NAME Execute the SC code in environment variable VARIABLE_NAME
sc3ctrl -d classname Open the help file for classname
sc3ctrl -d classname Open help file for classname
sc3ctrl -j classname Open the class definition for classname
sc3ctrl -j classname Open class definition for classname
sc3ctrl -y methodname Examine implementations of methodname

16
install.rb Normal file → Executable file
View File

@ -1,3 +1,17 @@
#!/usr/bin/env ruby
echo "This script will "
puts "Ready to install sc3ctrl."
puts "Press ENTER to continue."
gets
puts "Creating executable in /usr/local/bin .."
%x{echo "`pwd`/sc3ctrl \\$1 \\$2" > /usr/local/bin/sc3ctrl}
%x{chmod a+x /usr/local/bin/sc3ctrl}
puts "Done."
puts
puts "Copying SuperCollider class to Extensions folder .."
system 'cp SC3Controller.sc ~/Library/Application\ Support/SuperCollider/Extensions/'
puts "Done."
puts

View File

@ -6,18 +6,18 @@ int main (int argc, const char **argv) {
SC3Controller *controller = [[SC3Controller alloc] init];
if(argv[1] == NULL) {
NSLog(@"Usage: sc3ctrl -x");
printf("Usage:\nEnsure SC3Controller.sc is in SC class load path. Then\n\nsc3ctrl -x (executes code in environment variable SC_INTERPRET_TEXT)\nsc3ctrl -x A_DIFFERENT_VARIABLE_NAME\n\nOther usages: see README\n");
} else {
NSString *arg = [NSString stringWithUTF8String:argv[1]];
if([arg isEqual:@"-x"]) {
[controller interpretContentsOfEnvironmentVariable:(argv[2] == NULL ? "SC3_INTERPRET_TEXT" : argv[2])];
[controller interpretContentsOfEnvironmentVariable:(argv[2] == NULL ? "SC_INTERPRET_TEXT" : argv[2])];
return 0;
}
if([arg isEqual:@"-d"]) {
if(argc < 3) {
NSLog(@"Usage: sc3ctrl -d classname");
printf("Usage: sc3ctrl -d classname\n");
} else {
[controller openHelpFile:[NSString stringWithUTF8String:argv[2]]];
}
@ -25,7 +25,7 @@ int main (int argc, const char **argv) {
if([arg isEqual:@"-j"]) {
if(argc < 3) {
NSLog(@"Usage: sc3ctrl -j classname");
printf("Usage: sc3ctrl -j classname\n");
} else {
[controller openClassFile:[NSString stringWithUTF8String:argv[2]]];
}
@ -33,7 +33,7 @@ int main (int argc, const char **argv) {
if([arg isEqual:@"-y"]) {
if(argc < 3) {
NSLog(@"Usage: sc3ctrl -y methodname");
printf("Usage: sc3ctrl -y methodname\n");
} else {
[controller openImplementations:[NSString stringWithUTF8String:argv[2]]];
}
@ -41,7 +41,7 @@ int main (int argc, const char **argv) {
if([arg isEqual:@"-Y"]) {
if(argc < 3) {
NSLog(@"Usage: sc3ctrl -Y methodname");
printf("Usage: sc3ctrl -Y methodname\n");
} else {
[controller openReferences:[NSString stringWithUTF8String:argv[2]]];
}

View File

@ -13,7 +13,7 @@
5671672F0EFECD9B0047EA2B /* VVOSC.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 567165400EFE98A90047EA2B /* VVOSC.framework */; };
567167640EFECFDC0047EA2B /* SC3Controller.sc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 567167630EFECFD80047EA2B /* SC3Controller.sc */; };
5671676B0EFEDC6E0047EA2B /* README in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5671676A0EFEDC650047EA2B /* README */; };
567167770EFEDCBC0047EA2B /* install.rb in CopyFiles */ = {isa = PBXBuildFile; fileRef = 567167760EFEDCB50047EA2B /* install.rb */; };
5671679B0EFEE2270047EA2B /* install.rb in CopyFiles */ = {isa = PBXBuildFile; fileRef = 567167760EFEDCB50047EA2B /* install.rb */; };
8DD76F9A0486AA7600D96B5E /* sc3ctrl.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* sc3ctrl.m */; settings = {ATTRIBUTES = (); }; };
8DD76F9F0486AA7600D96B5E /* sc3ctrl.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = C6859EA3029092ED04C91782 /* sc3ctrl.1 */; };
/* End PBXBuildFile section */
@ -25,8 +25,8 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
567167770EFEDCBC0047EA2B /* install.rb in CopyFiles */,
5671676B0EFEDC6E0047EA2B /* README in CopyFiles */,
5671679B0EFEE2270047EA2B /* install.rb in CopyFiles */,
567167640EFECFDC0047EA2B /* SC3Controller.sc in CopyFiles */,
5671672F0EFECD9B0047EA2B /* VVOSC.framework in CopyFiles */,
);
@ -235,7 +235,7 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PREPROCESSOR_DEFINITIONS = Debug_Enabled;
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = "@executable_path/../Frameworks";

File diff suppressed because it is too large Load Diff

View File

@ -197,7 +197,48 @@
<key>Notifications</key>
<array/>
<key>OpenEditors</key>
<array/>
<array>
<dict>
<key>Content</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>567167890EFEDFF90047EA2B</string>
<key>PBXProjectModuleLabel</key>
<string>install.rb</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>5671678A0EFEDFF90047EA2B</string>
<key>PBXProjectModuleLabel</key>
<string>install.rb</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
<string>567167FB0EFEEDAA0047EA2B</string>
<key>history</key>
<array>
<string>567167AA0EFEE3560047EA2B</string>
</array>
</dict>
<key>SplitCount</key>
<string>1</string>
</dict>
<key>StatusBarVisibility</key>
<true/>
</dict>
<key>Geometry</key>
<dict>
<key>Frame</key>
<string>{{0, 20}, {948, 874}}</string>
<key>PBXModuleWindowStatusBarHidden2</key>
<false/>
<key>RubberWindowFrame</key>
<string>15 108 948 915 0 0 1680 1028 </string>
</dict>
</dict>
</array>
<key>PerspectiveWidths</key>
<array>
<integer>1680</integer>
@ -231,8 +272,6 @@
<key>Layout</key>
<array>
<dict>
<key>BecomeActive</key>
<true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@ -285,7 +324,7 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
<integer>15</integer>
<integer>9</integer>
<integer>0</integer>
</array>
</array>
@ -318,12 +357,14 @@
<key>Dock</key>
<array>
<dict>
<key>BecomeActive</key>
<true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>567162000EFD3EA50047EA2B</string>
<key>PBXProjectModuleLabel</key>
<string>install.rb</string>
<string>README</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@ -331,11 +372,11 @@
<key>PBXProjectModuleGUID</key>
<string>567162010EFD3EA50047EA2B</string>
<key>PBXProjectModuleLabel</key>
<string>install.rb</string>
<string>README</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
<string>5671677C0EFEDCBF0047EA2B</string>
<string>567167FA0EFEEDAA0047EA2B</string>
<key>history</key>
<array>
<string>567164430EFE8E370047EA2B</string>
@ -343,11 +384,11 @@
<string>567166FD0EFEC78D0047EA2B</string>
<string>5671670B0EFEC8B00047EA2B</string>
<string>567167290EFECD490047EA2B</string>
<string>5671676D0EFEDC740047EA2B</string>
<string>5671676E0EFEDC740047EA2B</string>
<string>5671676F0EFEDC740047EA2B</string>
<string>567167790EFEDCBF0047EA2B</string>
<string>5671677A0EFEDCBF0047EA2B</string>
<string>567167960EFEE0EC0047EA2B</string>
<string>567167D00EFEEA010047EA2B</string>
<string>567167F50EFEEC780047EA2B</string>
<string>567167A60EFEE3560047EA2B</string>
</array>
<key>prevStack</key>
<array>
@ -432,6 +473,13 @@
<string>567167720EFEDC740047EA2B</string>
<string>567167730EFEDC740047EA2B</string>
<string>5671677B0EFEDCBF0047EA2B</string>
<string>567167820EFEDED30047EA2B</string>
<string>567167980EFEE0EC0047EA2B</string>
<string>5671679F0EFEE2290047EA2B</string>
<string>567167A00EFEE2290047EA2B</string>
<string>567167A80EFEE3560047EA2B</string>
<string>567167D20EFEEA010047EA2B</string>
<string>567167F60EFEEC780047EA2B</string>
</array>
</dict>
<key>SplitCount</key>
@ -471,8 +519,6 @@
<dict>
<key>Frame</key>
<string>{{10, 27}, {1473, 218}}</string>
<key>RubberWindowFrame</key>
<string>0 93 1680 935 0 0 1680 1028 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@ -488,7 +534,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{10, 27}, {1473, 455}}</string>
<string>{{10, 27}, {1473, 218}}</string>
<key>RubberWindowFrame</key>
<string>0 93 1680 935 0 0 1680 1028 </string>
</dict>
<key>Module</key>
<string>PBXProjectFindModule</string>
@ -744,6 +792,7 @@
<array>
<string>567165D60EFEA7DD0047EA2B</string>
<string>567165D70EFEA7DD0047EA2B</string>
<string>567167890EFEDFF90047EA2B</string>
<string>/Developer/Projects/sc3ctrl/sc3ctrl.xcodeproj</string>
</array>
<key>WindowString</key>

View File

@ -1,6 +1,69 @@
// http://github.com/rfwatson/sc3ctrl
SC3Controller {
classvar nodes;
*addListeners {
var node;
if(nodes.isEmpty) {
node = OSCresponderNode(nil, '/sc3ctrl/cmd') { |t, r, msg|
msg[1].asString.interpretPrint;
{ postToFront.() }.defer;
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/help') { |t, r, msg|
{ msg[1].asString.openHelpFile }.defer
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/class') { |t, r, msg|
{ msg[1].asString.interpret.openCodeFile }.defer
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/implementations') { |t, r, msg|
{ SC3Controller.methodTemplates(msg[1]) }.defer
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/references') { |t, r, msg|
{ SC3Controller.methodReferences(msg[1]) }.defer
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/stop') { |t, r, msg|
thisProcess.stop;
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/clear') { |t, r, msg|
{
Document.listener.string = ""; "";
postToFront.();
}.defer;
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/postfront') { |t, r, msg|
{ postToFront.() }.defer;
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/recompile') { |t, r, msg|
{
thisProcess.recompile;
postToFront.();
}.defer;
}.add;
nodes.add(node);
}
}
*removeAllListeners {
nodes.do(_.remove);
}
*initClass {
var postToFront;
nodes = List[];
@ -11,58 +74,7 @@ SC3Controller {
};
StartUp.add {
var node;
node = OSCresponderNode(nil, '/sc3ctrl/cmd') { |t, r, msg|
msg[1].asString.interpretPrint;
{ postToFront.() }.defer;
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/help') { |t, r, msg|
{ msg[1].asString.openHelpFile }.defer
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/class') { |t, r, msg|
{ msg[1].asString.interpret.openCodeFile }.defer
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/implementations') { |t, r, msg|
{ SC3Controller.methodTemplates(msg[1]) }.defer
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/references') { |t, r, msg|
{ SC3Controller.methodReferences(msg[1]) }.defer
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/stop') { |t, r, msg|
thisProcess.stop;
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/clear') { |t, r, msg|
{
Document.listener.string = ""; "";
postToFront.();
}.defer;
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/postfront') { |t, r, msg|
{ postToFront.() }.defer;
}.add;
nodes.add(node);
node = OSCresponderNode(nil, '/sc3ctrl/recompile') { |t, r, msg|
{
thisProcess.recompile;
postToFront.();
}.defer;
}.add;
nodes.add(node);
this.addListeners;
}
}
}