| @@ -0,0 +1,146 @@ | |||
| ####### Compiler, tools and options | |||
| CC = gcc | |||
| CXX = g++ | |||
| CFLAGS = @CFLAGS@ | |||
| CXXFLAGS= @CXXFLAGS@ | |||
| INCPATH = -I/usr/X11R6/include | |||
| LINK = g++ -shared | |||
| LFLAGS = | |||
| LIBS = -L/usr/X11R6/lib @FLTK_LIBS@ -lGL -lXext -lX11 -ldl | |||
| MOC = moc | |||
| UIC = | |||
| TAR = tar -cf | |||
| GZIP = gzip -9f | |||
| INSTALL = @INSTALL@ | |||
| ###### Autoconf variables | |||
| prefix = @prefix@ | |||
| exec_prefix = @exec_prefix@ | |||
| bindir = @bindir@ | |||
| sbindir = @sbindir@ | |||
| libexecdir = @libexecdir@ | |||
| datadir = @datadir@ | |||
| sysconfdir = @sysconfdir@ | |||
| sharedstatedir = @sharedstatedir@ | |||
| localstatedir = @localstatedir@ | |||
| libdir = @libdir@ | |||
| infodir = @infodir@ | |||
| mandir = @mandir@ | |||
| ####### Files | |||
| HEADERS = ../SpiralPlugin.h \ | |||
| ../SpiralPluginGUI.h \ | |||
| ../../ChannelHandler.h \ | |||
| ../Widgets/Fl_DragBar.H \ | |||
| ../../Sample.h \ | |||
| TransposePlugin.h \ | |||
| TransposePluginGUI.h | |||
| SOURCES = ../SpiralPlugin.C \ | |||
| ../SpiralPluginGUI.C \ | |||
| ../../ChannelHandler.C \ | |||
| ../Widgets/Fl_DragBar.cxx \ | |||
| ../../Sample.C \ | |||
| TransposePlugin.C \ | |||
| TransposePluginGUI.C | |||
| OBJECTS = ../SpiralPlugin.o \ | |||
| ../SpiralPluginGUI.o \ | |||
| ../../ChannelHandler.o \ | |||
| ../Widgets/Fl_DragBar.o \ | |||
| ../../Sample.o \ | |||
| TransposePlugin.o \ | |||
| TransposePluginGUI.o | |||
| INTERFACES = | |||
| UICDECLS = | |||
| UICIMPLS = | |||
| SRCMOC = | |||
| OBJMOC = | |||
| DIST = | |||
| TARGET = TransposePlugin.so | |||
| ####### Implicit rules | |||
| .SUFFIXES: .cpp .cxx .cc .C .c | |||
| .cpp.o: | |||
| $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
| .cxx.o: | |||
| $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
| .cc.o: | |||
| $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
| .C.o: | |||
| $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< | |||
| .c.o: | |||
| $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< | |||
| ####### Build rules | |||
| all: $(TARGET) | |||
| $(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) | |||
| $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) | |||
| moc: $(SRCMOC) | |||
| dist: | |||
| $(TAR) TransposePlugin.tar TransposePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) | |||
| $(GZIP) TransposePlugin.tar | |||
| clean: | |||
| -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) | |||
| -rm -f *~ core | |||
| install: | |||
| $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins | |||
| ####### Sub-libraries | |||
| ###### Combined headers | |||
| ####### Compile | |||
| ../SpiralPlugin.o: ../SpiralPlugin.C \ | |||
| ../SpiralPlugin.h \ | |||
| ../../Sample.h | |||
| ../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ | |||
| ../SpiralPluginGUI.h \ | |||
| ../Widgets/Fl_DragBar.H \ | |||
| ../SpiralPlugin.h \ | |||
| ../../Sample.h | |||
| ../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ | |||
| ../Widgets/Fl_DragBar.H | |||
| ../../Sample.o: ../../Sample.C \ | |||
| ../../Sample.h \ | |||
| ../../SpiralInfo.h | |||
| TransposePlugin.o: TransposePlugin.C \ | |||
| TransposePlugin.h \ | |||
| TransposePluginGUI.h \ | |||
| ../../NoteTable.h \ | |||
| ../SpiralPlugin.h \ | |||
| ../SpiralPluginGUI.h \ | |||
| SpiralIcon.xpm | |||
| TransposePluginGUI.o: TransposePluginGUI.C \ | |||
| TransposePlugin.h \ | |||
| TransposePluginGUI.h \ | |||
| ../SpiralPlugin.h \ | |||
| ../SpiralPluginGUI.h | |||
| ../../ChannelHandler.o: ../../ChannelHandler.C \ | |||
| ../../ChannelHandler.h | |||
| @@ -0,0 +1,322 @@ | |||
| /* XPM */ | |||
| static char * SpiralIcon_xpm[] = { | |||
| "36 36 283 2", | |||
| " c None", | |||
| ". c #8B889B", | |||
| "+ c #9C99AA", | |||
| "@ c #ADAAB9", | |||
| "# c #837F94", | |||
| "$ c #7D7990", | |||
| "% c #9995A7", | |||
| "& c #67627C", | |||
| "* c #CDCBD4", | |||
| "= c #FCFCFC", | |||
| "- c #D1D0D8", | |||
| "; c #FFFFFF", | |||
| "> c #F1F1F3", | |||
| ", c #848095", | |||
| "' c #2A2248", | |||
| ") c #CFCED6", | |||
| "! c #68637D", | |||
| "~ c #ABA8B6", | |||
| "{ c #D5D3DB", | |||
| "] c #9490A2", | |||
| "^ c #C4C4C4", | |||
| "/ c #1D1C1D", | |||
| "( c #313134", | |||
| "_ c #EEEFEE", | |||
| ": c #FBFBFB", | |||
| "< c #EFEFEF", | |||
| "[ c #7B768D", | |||
| "} c #464060", | |||
| "| c #DEDEE1", | |||
| "1 c #CBCACC", | |||
| "2 c #EEEEF1", | |||
| "3 c #79758C", | |||
| "4 c #FBFBFC", | |||
| "5 c #A2A2A2", | |||
| "6 c #000000", | |||
| "7 c #F5F6F5", | |||
| "8 c #747474", | |||
| "9 c #2A2A2B", | |||
| "0 c #403958", | |||
| "a c #7D788F", | |||
| "b c #C0BEC8", | |||
| "c c #BCBAC6", | |||
| "d c #BCBAC5", | |||
| "e c #625C79", | |||
| "f c #2B2932", | |||
| "g c #191919", | |||
| "h c #CCCCCC", | |||
| "i c #807B91", | |||
| "j c #3B3556", | |||
| "k c #F2F2F4", | |||
| "l c #929292", | |||
| "m c #0E0E0E", | |||
| "n c #BFBFBF", | |||
| "o c #111111", | |||
| "p c #100E15", | |||
| "q c #868689", | |||
| "r c #FEFDFE", | |||
| "s c #D9D7DE", | |||
| "t c #9C98AA", | |||
| "u c #FDFCFD", | |||
| "v c #DDDDDD", | |||
| "w c #575755", | |||
| "x c #5E5E5E", | |||
| "y c #C4C2CD", | |||
| "z c #423C5C", | |||
| "A c #F0F0F2", | |||
| "B c #939393", | |||
| "C c #555555", | |||
| "D c #4A4A4A", | |||
| "E c #010101", | |||
| "F c #282828", | |||
| "G c #C2C2C2", | |||
| "H c #DBDAE0", | |||
| "I c #615C78", | |||
| "J c #F6F6F7", | |||
| "K c #DADADA", | |||
| "L c #545454", | |||
| "M c #0F0F0F", | |||
| "N c #B8B8B8", | |||
| "O c #48445C", | |||
| "P c #2B2B2C", | |||
| "Q c #181900", | |||
| "R c #D3D3D3", | |||
| "S c #C1BEC9", | |||
| "T c #474060", | |||
| "U c #31294D", | |||
| "V c #716C85", | |||
| "W c #65607A", | |||
| "X c #625D78", | |||
| "Y c #D5D4DB", | |||
| "Z c #F7F7F7", | |||
| "` c #8B8B8B", | |||
| " . c #161616", | |||
| ".. c #0C0C0C", | |||
| "+. c #111300", | |||
| "@. c #151600", | |||
| "#. c #050500", | |||
| "$. c #191A00", | |||
| "%. c #393643", | |||
| "&. c #47415F", | |||
| "*. c #9692A4", | |||
| "=. c #D9D8DE", | |||
| "-. c #F7F7F8", | |||
| ";. c #918DA0", | |||
| ">. c #B8B5C1", | |||
| ",. c #D1D1D1", | |||
| "'. c #252525", | |||
| "). c #0A0B00", | |||
| "!. c #101000", | |||
| "~. c #070800", | |||
| "{. c #FFFF00", | |||
| "]. c #727175", | |||
| "^. c #FEFEFF", | |||
| "/. c #9D99AA", | |||
| "(. c #DBD9E0", | |||
| "_. c #E9E9E9", | |||
| ":. c #CBCBCB", | |||
| "<. c #E0E0E0", | |||
| "[. c #6C6C6C", | |||
| "}. c #0B0B00", | |||
| "|. c #515151", | |||
| "1. c #A6A6A7", | |||
| "2. c #827E93", | |||
| "3. c #615C77", | |||
| "4. c #EAEAED", | |||
| "5. c #DFDFE1", | |||
| "6. c #060700", | |||
| "7. c #060600", | |||
| "8. c #1E1D24", | |||
| "9. c #9894A7", | |||
| "0. c #B1AEBB", | |||
| "a. c #69686F", | |||
| "b. c #000001", | |||
| "c. c #101100", | |||
| "d. c #615C76", | |||
| "e. c #5F5A75", | |||
| "f. c #413E4D", | |||
| "g. c #020203", | |||
| "h. c #050600", | |||
| "i. c #1A1A1C", | |||
| "j. c #C3C1CB", | |||
| "k. c #9D9D9D", | |||
| "l. c #202020", | |||
| "m. c #383838", | |||
| "n. c #4C4C4C", | |||
| "o. c #111112", | |||
| "p. c #C9C7D0", | |||
| "q. c #F1F1F1", | |||
| "r. c #F8F8F8", | |||
| "s. c #232323", | |||
| "t. c #050408", | |||
| "u. c #AEACB9", | |||
| "v. c #FEFEFE", | |||
| "w. c #1D1D1D", | |||
| "x. c #B7B5C1", | |||
| "y. c #9390A2", | |||
| "z. c #BBBBBB", | |||
| "A. c #414141", | |||
| "B. c #030303", | |||
| "C. c #28272A", | |||
| "D. c #F4F4F6", | |||
| "E. c #605B76", | |||
| "F. c #736E86", | |||
| "G. c #D8D8D8", | |||
| "H. c #727272", | |||
| "I. c #101010", | |||
| "J. c #848486", | |||
| "K. c #CCCBD3", | |||
| "L. c #747087", | |||
| "M. c #6D6881", | |||
| "N. c #1C1C1C", | |||
| "O. c #242424", | |||
| "P. c #656566", | |||
| "Q. c #F6F6F6", | |||
| "R. c #E8E6EA", | |||
| "S. c #706B84", | |||
| "T. c #E3E1E6", | |||
| "U. c #474746", | |||
| "V. c #151515", | |||
| "W. c #C8C8C8", | |||
| "X. c #AEAEAE", | |||
| "Y. c #080808", | |||
| "Z. c #373639", | |||
| "`. c #FDFCFE", | |||
| " + c #ABA8B7", | |||
| ".+ c #F1F0F3", | |||
| "++ c #6D6980", | |||
| "@+ c #0A090E", | |||
| "#+ c #95929E", | |||
| "$+ c #0A0810", | |||
| "%+ c #0D0D0D", | |||
| "&+ c #050505", | |||
| "*+ c #5B5A5C", | |||
| "=+ c #F7F6F7", | |||
| "-+ c #F4F3F5", | |||
| ";+ c #908C9F", | |||
| ">+ c #C8C6D0", | |||
| ",+ c #837E96", | |||
| "'+ c #86868A", | |||
| ")+ c #070608", | |||
| "!+ c #ECEBEE", | |||
| "~+ c #5B5571", | |||
| "{+ c #646078", | |||
| "]+ c #AFAFB0", | |||
| "^+ c #454545", | |||
| "/+ c #363636", | |||
| "(+ c #7A7A7A", | |||
| "_+ c #C8C8C9", | |||
| ":+ c #212025", | |||
| "<+ c #060607", | |||
| "[+ c #969699", | |||
| "}+ c #FAFAFA", | |||
| "|+ c #F8F8F9", | |||
| "1+ c #A29EAF", | |||
| "2+ c #F7F6F8", | |||
| "3+ c #F0F0F1", | |||
| "4+ c #B8B7B9", | |||
| "5+ c #E4E4E4", | |||
| "6+ c #FDFDFD", | |||
| "7+ c #A5A2B2", | |||
| "8+ c #3B3456", | |||
| "9+ c #A8A5B4", | |||
| "0+ c #525252", | |||
| "a+ c #848387", | |||
| "b+ c #CDCDCD", | |||
| "c+ c #8D899C", | |||
| "d+ c #494262", | |||
| "e+ c #68627C", | |||
| "f+ c #40395A", | |||
| "g+ c #ECECEC", | |||
| "h+ c #020202", | |||
| "i+ c #B4B5B5", | |||
| "j+ c #0B0B0B", | |||
| "k+ c #313232", | |||
| "l+ c #E3E3E3", | |||
| "m+ c #B1AEBC", | |||
| "n+ c #BDBBC6", | |||
| "o+ c #3C3556", | |||
| "p+ c #898599", | |||
| "q+ c #EDEDED", | |||
| "r+ c #39393A", | |||
| "s+ c #040404", | |||
| "t+ c #333333", | |||
| "u+ c #F5F5F5", | |||
| "v+ c #2B2B2B", | |||
| "w+ c #2D2A3D", | |||
| "x+ c #B6B4C1", | |||
| "y+ c #F5F5F6", | |||
| "z+ c #605A76", | |||
| "A+ c #DAD8DF", | |||
| "B+ c #F5F4F6", | |||
| "C+ c #615B76", | |||
| "D+ c #524D6A", | |||
| "E+ c #E4E3E8", | |||
| "F+ c #D5D5D5", | |||
| "G+ c #1B1B1B", | |||
| "H+ c #303030", | |||
| "I+ c #AAABAB", | |||
| "J+ c #585464", | |||
| "K+ c #B0AEBB", | |||
| "L+ c #A29FAF", | |||
| "M+ c #E9E8E9", | |||
| "N+ c #787779", | |||
| "O+ c #0F0E15", | |||
| "P+ c #2D2D2E", | |||
| "Q+ c #595959", | |||
| "R+ c #FAFAFB", | |||
| "S+ c #807B92", | |||
| "T+ c #B0ADBB", | |||
| "U+ c #E8E7EB", | |||
| "V+ c #3A3258", | |||
| "W+ c #E6E5EA", | |||
| "X+ c #DFDEE3", | |||
| "Y+ c #443E5E", | |||
| "Z+ c #BAB8C4", | |||
| "`+ c #C1BFCA", | |||
| " @ c #E0E0E5", | |||
| ".@ c #D0CED6", | |||
| "+@ c #362F52", | |||
| "@@ c #CECCD5", | |||
| "#@ c #413A5B", | |||
| "$@ c #6A657F", | |||
| "%@ c #9793A6", | |||
| " ", | |||
| " ", | |||
| " ", | |||
| " . + @ # $ % ", | |||
| " & * = * - ; > , ' ; ; ; ) ! ", | |||
| " ~ ; ; { ] ; ^ / ( _ ; : < [ ", | |||
| " } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", | |||
| " c : d e f g h i j k l 6 m ; n o 6 p q r s ", | |||
| " t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", | |||
| " I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", | |||
| " X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", | |||
| " >.; ; ; ; ; ; = ,.'.6 ).!.~.6 6 6 6 6 {.E ].^.; ; /. ", | |||
| " (.; ; _.R h :.<.[.6 }.~.6 6 6 6 6 6 {.{.{.E |.1.4 2. ", | |||
| " 3.4.; 5...6 6 6 6 6 6.7.6 {.{.{.{.6 {.6 {.6 {.6 8.9. ", | |||
| " V @ 0.a.b.6 6 6 6 6 c.6 6 {.6 6 6 6 6 6 {.6 6 6 ", | |||
| " d.e.f.6 g.6 6 6 6 h.6 6 {.{.{.{.6 6 6 {.6 6 6 i. ", | |||
| " j.; ; k.l.l.m.n.l.6 6 6 6 {.6 6 6 6 6 6 6 6 6 6 o. ", | |||
| " p.; ; q.r.; ; ; s.6 6 6 6 {.6 6 6 6 6 6 {.6 6 6 t. ", | |||
| " u.; ; ; ; v.; ; w.6 {.{.{.{.6 6 6 6 6 6 {.6 6 6 6 x., ", | |||
| " y.; ; v.; : z.A.B.{.{.{.{.{.6 6 6 6 {.6 {.6 {.6 C.v.D.E. ", | |||
| " F.; ; ; G.H.I.6 6 6 {.{.{.6 6 6 6 6 6 {.{.{.6 6 J.; ; K.L. ", | |||
| " M.J ; : N.6 6 6 6 O...6 6 6 6 6 6 6 6 6 {.6 6 6 P.Q.; ; R.S. ", | |||
| " T.; ; U.6 E 6 V.W.X.Y.6 6 6 6 6 6 6 6 6 6 6 6 6 Z.`.; ; > S. ", | |||
| " +; .+++@+6 6 X.v.; #+$+6 6 6 6 6 6 6 6 %+&+6 6 6 *+=+; ; -+;+ ", | |||
| " S.>+! ,+'+)+x ; ; !+~+{+]+l ^+6 6 6 /+(+_+:+6 6 6 <+[+}+; ; |+@ ", | |||
| " 1+2+3+4+5+6+; 7+8+9+; Q.^+6 6 E 0+; ; a+6 6 E 6 o b+; ; = c+ ", | |||
| " d+> ; ; ; ; ; ; e+f+; ; g+m.6 6 h+D ; ; i+j+6 6 6 k+l+; ; m+ ", | |||
| " > ; ; ; ; n+o+p+; ; q+r+6 6 s+t+; ; u+v+6 6 w+x+; y+3 ", | |||
| " z+A+= ; B+C+D+E+; ; F+G+6 6 h+H+; ; ; I+0+J+ ", | |||
| " K+4 L+ X ; ; ; M+N+H+O+P+Q+; ; ; v.R+S+ ", | |||
| " T+; ; ; ; ; U+V+W+; ; ; ; = X+Y+ ", | |||
| " Z+`+ @4 ; ; .@+@@@; ; ; s p+T ", | |||
| " #@ $@%@p+ ", | |||
| " ", | |||
| " ", | |||
| " "}; | |||
| @@ -0,0 +1,102 @@ | |||
| /* SpiralSound | |||
| * Copyleft (C) 2003 Andy Preston <andy@clublinux.co.uk> | |||
| * | |||
| * 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 | |||
| * the Free Software Foundation; either version 2 of the License, or | |||
| * (at your option) any later version. | |||
| * | |||
| * This program is distributed in the hope that it will be useful, | |||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| * GNU General Public License for more details. | |||
| * | |||
| * You should have received a copy of the GNU General Public License | |||
| * along with this program; if not, write to the Free Software | |||
| * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
| */ | |||
| #include "TransposePlugin.h" | |||
| #include "TransposePluginGUI.h" | |||
| #include "SpiralIcon.xpm" | |||
| #include "../../NoteTable.h" | |||
| extern "C" { | |||
| SpiralPlugin* CreateInstance () { | |||
| return new TransposePlugin; | |||
| } | |||
| char** GetIcon () { | |||
| return SpiralIcon_xpm; | |||
| } | |||
| int GetID () { | |||
| return 122; | |||
| } | |||
| string GetGroupName() { | |||
| return "Control"; | |||
| } | |||
| } | |||
| /////////////////////////////////////////////////////// | |||
| TransposePlugin::TransposePlugin () : | |||
| m_Amount(0), | |||
| m_Out(0.0) | |||
| { | |||
| m_PluginInfo.Name = "Transpose"; | |||
| m_PluginInfo.Width = 70; | |||
| m_PluginInfo.Height = 60; | |||
| m_PluginInfo.NumInputs = 2; | |||
| m_PluginInfo.NumOutputs = 1; | |||
| m_PluginInfo.PortTips.push_back ("Input"); | |||
| m_PluginInfo.PortTips.push_back ("Transpose CV"); | |||
| m_PluginInfo.PortTips.push_back ("Output"); | |||
| m_AudioCH->Register ("Amount", &m_Amount); | |||
| } | |||
| TransposePlugin::~TransposePlugin () { | |||
| } | |||
| PluginInfo &TransposePlugin::Initialise (const HostInfo *Host) { | |||
| return SpiralPlugin::Initialise (Host); | |||
| } | |||
| SpiralGUIType *TransposePlugin::CreateGUI() { | |||
| return new TransposePluginGUI (m_PluginInfo.Width, m_PluginInfo.Height, this, m_AudioCH, m_HostInfo); | |||
| } | |||
| void TransposePlugin::Execute () { | |||
| int Match [2]; | |||
| for (int n=0; n<m_HostInfo->BUFSIZE; n++) { | |||
| Match[0]=0; | |||
| Match[1]=0; | |||
| for (int i=0; i<2 && InputExists(i); i++) { | |||
| float Freq, Dif, MinDif = 30000; | |||
| Freq = GetInputPitch (i, n); | |||
| for (int c=0; c<131; c++) { | |||
| Dif = fabs (NoteTable[c] - Freq); | |||
| if (Dif > MinDif) break; | |||
| MinDif=Dif; | |||
| Match[i]=c; | |||
| } | |||
| } | |||
| if (! InputExists (1)) Match[1] = m_Amount; | |||
| m_Out = NoteTable [(Match[0] + Match[1]) % 132]; | |||
| SetOutputPitch (0, n, m_Out); | |||
| } | |||
| } | |||
| void TransposePlugin::StreamOut (ostream &s) { | |||
| s << m_Version << endl; | |||
| s << m_Amount; | |||
| } | |||
| void TransposePlugin::StreamIn (istream &s) { | |||
| int version; | |||
| s >> version; | |||
| s >> m_Amount; | |||
| } | |||
| @@ -0,0 +1,41 @@ | |||
| /* SpiralSound | |||
| * Copyleft (C) 2003 Andy Preston <andy@clublinux.co.uk> | |||
| * | |||
| * 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 | |||
| * the Free Software Foundation; either version 2 of the License, or | |||
| * (at your option) any later version. | |||
| * | |||
| * This program is distributed in the hope that it will be useful, | |||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| * GNU General Public License for more details. | |||
| * | |||
| * You should have received a copy of the GNU General Public License | |||
| * along with this program; if not, write to the Free Software | |||
| * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
| */ | |||
| #include "../SpiralPlugin.h" | |||
| #include <FL/Fl_Pixmap.H> | |||
| #ifndef TransposePLUGIN | |||
| #define TransposePLUGIN | |||
| class TransposePlugin : public SpiralPlugin { | |||
| public: | |||
| TransposePlugin(); | |||
| virtual ~TransposePlugin (); | |||
| virtual PluginInfo& Initialise (const HostInfo *Host); | |||
| virtual SpiralGUIType* CreateGUI (); | |||
| virtual void Execute (); | |||
| //virtual void ExecuteCommands (); | |||
| virtual void StreamOut (ostream &s); | |||
| virtual void StreamIn (istream &s); | |||
| int GetAmount () { return m_Amount; } | |||
| private: | |||
| int m_Amount; | |||
| float m_Out; | |||
| }; | |||
| #endif | |||
| @@ -0,0 +1,69 @@ | |||
| /* SpiralPlugin | |||
| * Copyleft (C) 2003 Andy Preston <andy@clublinux.co.uk> | |||
| * | |||
| * 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 | |||
| * the Free Software Foundation; either version 2 of the License, or | |||
| * (at your option) any later version. | |||
| * | |||
| * This program is distributed in the hope that it will be useful, | |||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| * GNU General Public License for more details. | |||
| * | |||
| * You should have received a copy of the GNU General Public License | |||
| * along with this program; if not, write to the Free Software | |||
| * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
| */ | |||
| #include "TransposePluginGUI.h" | |||
| #include <FL/fl_draw.h> | |||
| static const int GUI_COLOUR = 179; | |||
| static const int GUIBG_COLOUR = 144; | |||
| static const int GUIBG2_COLOUR = 145; | |||
| //////////////////////////////////////////// | |||
| TransposePluginGUI::TransposePluginGUI (int w, int h,TransposePlugin *o,ChannelHandler *ch,const HostInfo *Info) : | |||
| SpiralPluginGUI (w, h, o, ch) | |||
| { | |||
| m_Amount = new Fl_Counter (10, 20, 50, 20, "Amount"); | |||
| m_Amount->color (GUI_COLOUR); | |||
| m_Amount->type (FL_SIMPLE_COUNTER); | |||
| m_Amount->textsize (10); | |||
| m_Amount->labelsize (10); | |||
| m_Amount->step (1); | |||
| m_Amount->lstep (1); | |||
| m_Amount->minimum (-12); | |||
| m_Amount->maximum (12); | |||
| m_Amount->value (0); | |||
| m_Amount->callback ((Fl_Callback*) cb_Amount); | |||
| add (m_Amount); | |||
| end (); | |||
| } | |||
| void TransposePluginGUI::UpdateValues (SpiralPlugin *o) { | |||
| TransposePlugin *Plugin = (TransposePlugin *)o; | |||
| m_Amount->value (Plugin->GetAmount ()); | |||
| } | |||
| inline void TransposePluginGUI::cb_Amount_i (Fl_Counter* o, void* v) { | |||
| m_GUICH->Set ("Amount", int (o->value ())); | |||
| } | |||
| void TransposePluginGUI::cb_Amount (Fl_Counter* o, void* v) { | |||
| ((TransposePluginGUI*)(o->parent ()))->cb_Amount_i (o, v); | |||
| } | |||
| const string TransposePluginGUI::GetHelpText (const string &loc) { | |||
| return string("") | |||
| + "The first input connects to a note CV from (e.g.) a Matrix.\n" | |||
| + "The second input can be connected to (e.g.) a Keyboard, to\n" | |||
| + "transpose the sequence up by the number of notes indicated\n" | |||
| + "by the key.\n\n" | |||
| + "If you use both inputs the 'Amount' value is ignored.\n" | |||
| + "With only one input connected the 'Amount' value lets you\n" | |||
| + "transpose the input up or down by the indicated number of\n" | |||
| + "notes."; | |||
| } | |||
| @@ -0,0 +1,44 @@ | |||
| /* SpiralPlugin | |||
| * Copyleft (C) 2003 Andy Preston <andy@clublinux.co.uk> | |||
| * | |||
| * 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 | |||
| * the Free Software Foundation; either version 2 of the License, or | |||
| * (at your option) any later version. | |||
| * | |||
| * This program is distributed in the hope that it will be useful, | |||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
| * GNU General Public License for more details. | |||
| * | |||
| * You should have received a copy of the GNU General Public License | |||
| * along with this program; if not, write to the Free Software | |||
| * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |||
| */ | |||
| #include <FL/Fl.H> | |||
| #include <FL/Fl_Window.H> | |||
| #include <FL/Fl_Group.H> | |||
| #include <FL/Fl_Button.H> | |||
| #include <FL/Fl_Counter.H> | |||
| #include "../Widgets/Fl_DragBar.H" | |||
| #include "TransposePlugin.h" | |||
| #include "../SpiralPluginGUI.h" | |||
| #ifndef TransposeGUI | |||
| #define TransposeGUI | |||
| class TransposePluginGUI : public SpiralPluginGUI { | |||
| public: | |||
| TransposePluginGUI (int w, int h, TransposePlugin *o, ChannelHandler *ch, const HostInfo *Info); | |||
| virtual void UpdateValues (SpiralPlugin *o); | |||
| protected: | |||
| const string GetHelpText (const string &loc); | |||
| private: | |||
| Fl_Counter* m_Amount; | |||
| inline void cb_Amount_i (Fl_Counter* o, void* v); | |||
| static void cb_Amount (Fl_Counter* o, void* v); | |||
| }; | |||
| #endif | |||