├── Caustk ├── libs │ ├── gson-2.2.4.jar │ ├── guava-16.0.jar │ ├── kryo-2.24.0.jar │ ├── minlog-1.2.jar │ ├── objenesis-1.2.jar │ ├── xstream-1.4.7.jar │ ├── aopalliance-1.0.jar │ ├── commons-io-2.4.jar │ ├── guice-3.0-no_aop.jar │ ├── javax.inject-1.jar │ └── android-support-v4.jar ├── libs-ext │ ├── gdx-1.5.2.jar │ ├── jna-4.1.0.jar │ └── gdx-1.5.2-sources.jar ├── res │ ├── values │ │ ├── strings.xml │ │ └── styles.xml │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── values-v11 │ │ └── styles.xml │ └── values-v14 │ │ └── styles.xml ├── src │ └── com │ │ ├── teotigraphix │ │ └── caustk │ │ │ ├── node │ │ │ ├── machine │ │ │ │ ├── patch │ │ │ │ │ ├── modular │ │ │ │ │ │ ├── IModularComponentControl.java │ │ │ │ │ │ ├── IModularComponent.java │ │ │ │ │ │ ├── IModularJack.java │ │ │ │ │ │ ├── TwoInputMixer.java │ │ │ │ │ │ ├── ThreeInputMixer.java │ │ │ │ │ │ ├── SixInputMixer.java │ │ │ │ │ │ ├── ModularControl.java │ │ │ │ │ │ └── ModularPanel.java │ │ │ │ │ ├── MixerType.java │ │ │ │ │ └── padsynth │ │ │ │ │ │ └── LFO2Component.java │ │ │ │ ├── MachineNodeFactory.java │ │ │ │ └── KSSynthMachine.java │ │ │ ├── effect │ │ │ │ ├── EffectNodeFactory.java │ │ │ │ └── EffectType.java │ │ │ └── ICaustkNode.java │ │ │ ├── core │ │ │ ├── osc │ │ │ │ ├── OSCControlKind.java │ │ │ │ ├── IMachineControl.java │ │ │ │ ├── IMixerControl.java │ │ │ │ ├── IEffectControl.java │ │ │ │ ├── IAutomatableControl.java │ │ │ │ ├── KSSynthMessage.java │ │ │ │ └── IOSCControl.java │ │ │ ├── ICaustkSerializer.java │ │ │ ├── IRackSequencerListener.java │ │ │ ├── CausticError.java │ │ │ ├── CausticException.java │ │ │ ├── factory │ │ │ │ └── CaustkFactoryChildBase.java │ │ │ ├── IRackEventBus.java │ │ │ ├── ICaustkLogger.java │ │ │ ├── ISoundGenerator.java │ │ │ ├── ICaustkFactory.java │ │ │ ├── ICaustkRuntime.java │ │ │ ├── internal │ │ │ │ ├── generator │ │ │ │ │ └── Caustic.java │ │ │ │ └── CausticLibrary.java │ │ │ └── ICausticEngine.java │ │ │ ├── gdx │ │ │ ├── app │ │ │ │ ├── model │ │ │ │ │ ├── ViewModelBase.java │ │ │ │ │ ├── machine │ │ │ │ │ │ └── SongFileMachine.java │ │ │ │ │ └── song │ │ │ │ │ │ ├── SongFileSource.java │ │ │ │ │ │ └── ISongFileCollection.java │ │ │ │ ├── api │ │ │ │ │ ├── LibraryAPI.java │ │ │ │ │ ├── RackAPI.java │ │ │ │ │ └── CommandAPI.java │ │ │ │ ├── IApplicationState.java │ │ │ │ ├── controller │ │ │ │ │ ├── view │ │ │ │ │ │ └── IDisplayOutput.java │ │ │ │ │ ├── IViewListener.java │ │ │ │ │ ├── IPreferenceManager.java │ │ │ │ │ ├── command │ │ │ │ │ │ ├── ICommand.java │ │ │ │ │ │ ├── AbortCommandException.java │ │ │ │ │ │ ├── CommandExecutionException.java │ │ │ │ │ │ ├── ICommandManager.java │ │ │ │ │ │ ├── CommandContext.java │ │ │ │ │ │ ├── CommandBase.java │ │ │ │ │ │ ├── IUndoCommand.java │ │ │ │ │ │ └── CommandUtils.java │ │ │ │ │ ├── IHelpManagerAware.java │ │ │ │ │ ├── IViewManager.java │ │ │ │ │ ├── PreferenceManager.java │ │ │ │ │ ├── IDialogManager.java │ │ │ │ │ ├── IFileManager.java │ │ │ │ │ └── FileRequest.java │ │ │ │ ├── IApplicationConfigurator.java │ │ │ │ ├── ui │ │ │ │ │ ├── IContainerKind.java │ │ │ │ │ ├── ICaustkScene.java │ │ │ │ │ └── ISceneComponent.java │ │ │ │ ├── IApplicationComponent.java │ │ │ │ ├── IProjectFactory.java │ │ │ │ ├── behavior │ │ │ │ │ └── SceneViewChildBehavior.java │ │ │ │ ├── IApplicationStateHandlers.java │ │ │ │ ├── AbstractProjectModelAPI.java │ │ │ │ └── ICaustkApplication.java │ │ │ └── scene2d │ │ │ │ └── ui │ │ │ │ ├── mixer │ │ │ │ └── MixerPanePropertyProvider.java │ │ │ │ ├── app │ │ │ │ ├── ActionBarListener.java │ │ │ │ ├── ViewStackPane.java │ │ │ │ ├── ActionBarBase.java │ │ │ │ ├── ModePaneListener.java │ │ │ │ ├── SoundSelectionListener.java │ │ │ │ └── TopBarListener.java │ │ │ │ ├── PopUp.java │ │ │ │ ├── auto │ │ │ │ ├── AutoTextKnob.java │ │ │ │ ├── AutoTextSlider.java │ │ │ │ └── AutomationItem.java │ │ │ │ ├── DialogBase.java │ │ │ │ ├── ContextMenu.java │ │ │ │ ├── PaneStackListener.java │ │ │ │ ├── ColorPickerListener.java │ │ │ │ └── ListDialog.java │ │ │ ├── groove │ │ │ ├── browser │ │ │ │ ├── BrowserBank.java │ │ │ │ └── BrowserModel.java │ │ │ ├── library │ │ │ │ ├── LibrarySample.java │ │ │ │ ├── LibraryProject.java │ │ │ │ └── LibraryItemFormat.java │ │ │ ├── manifest │ │ │ │ ├── LibraryProjectManifest.java │ │ │ │ ├── LibrarySoundManifest.java │ │ │ │ ├── LibraryGroupManifest.java │ │ │ │ └── LibraryPatternBankManifest.java │ │ │ ├── importer │ │ │ │ ├── CausticEffectType.java │ │ │ │ ├── LibraryProductImporter.java │ │ │ │ ├── CausticPatternBank.java │ │ │ │ ├── CausticInstrument.java │ │ │ │ ├── CausticItem.java │ │ │ │ └── CausticSound.java │ │ │ ├── session │ │ │ │ ├── ClipInfo.java │ │ │ │ └── SceneInfo.java │ │ │ ├── behavior │ │ │ │ └── GrooveBehavior.java │ │ │ └── app │ │ │ │ └── GrooveApplicationComponents.java │ │ │ └── utils │ │ │ ├── gdx │ │ │ └── StyleUtils.java │ │ │ ├── core │ │ │ ├── MathUtils.java │ │ │ ├── SerializeUtils.java │ │ │ └── ExceptionUtils.java │ │ │ ├── groove │ │ │ ├── LibraryManifestListUtils.java │ │ │ └── LibraryPatternBankUtils.java │ │ │ └── node │ │ │ └── PresetUtils.java │ │ └── badlogic │ │ └── gdx │ │ └── scenes │ │ └── scene2d │ │ └── ui │ │ └── ToggleButtonInternal.java ├── lint.xml ├── AndroidManifest.xml ├── project.properties ├── src-content │ └── com │ │ └── singlecellsoftware │ │ └── contentextractor │ │ └── NativeInterface.java └── proguard-project.txt ├── README.md ├── .gitignore └── .gitattributes /Caustk/libs/gson-2.2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/gson-2.2.4.jar -------------------------------------------------------------------------------- /Caustk/libs/guava-16.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/guava-16.0.jar -------------------------------------------------------------------------------- /Caustk/libs/kryo-2.24.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/kryo-2.24.0.jar -------------------------------------------------------------------------------- /Caustk/libs/minlog-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/minlog-1.2.jar -------------------------------------------------------------------------------- /Caustk/libs-ext/gdx-1.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs-ext/gdx-1.5.2.jar -------------------------------------------------------------------------------- /Caustk/libs-ext/jna-4.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs-ext/jna-4.1.0.jar -------------------------------------------------------------------------------- /Caustk/libs/objenesis-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/objenesis-1.2.jar -------------------------------------------------------------------------------- /Caustk/libs/xstream-1.4.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/xstream-1.4.7.jar -------------------------------------------------------------------------------- /Caustk/libs/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/aopalliance-1.0.jar -------------------------------------------------------------------------------- /Caustk/libs/commons-io-2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/commons-io-2.4.jar -------------------------------------------------------------------------------- /Caustk/libs/guice-3.0-no_aop.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/guice-3.0-no_aop.jar -------------------------------------------------------------------------------- /Caustk/libs/javax.inject-1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/javax.inject-1.jar -------------------------------------------------------------------------------- /Caustk/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Caustk 4 | 5 | 6 | -------------------------------------------------------------------------------- /Caustk/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs/android-support-v4.jar -------------------------------------------------------------------------------- /Caustk/libs-ext/gdx-1.5.2-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/libs-ext/gdx-1.5.2-sources.jar -------------------------------------------------------------------------------- /Caustk/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Caustk/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Caustk/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teotigraphix/CausticSDK/HEAD/Caustk/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CausticSDK 2 | ========== 3 | 4 | The full software development kit for the Android Caustic Core. 5 | 6 | - User interface framework using LibGDX OpenGL layer. -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/modular/IModularComponentControl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.node.machine.patch.modular; 3 | 4 | public interface IModularComponentControl { 5 | 6 | String name(); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Caustk/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/osc/OSCControlKind.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.core.osc; 3 | 4 | public enum OSCControlKind { 5 | Boolean, 6 | 7 | Float, 8 | 9 | Int, 10 | 11 | Enum_Float, 12 | 13 | Enum_Int, 14 | } 15 | -------------------------------------------------------------------------------- /Caustk/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | .settings/ 16 | 17 | # Local configuration file (sdk path, etc) 18 | local.properties 19 | 20 | # Eclipse project files 21 | .classpath 22 | .project 23 | 24 | doc/ 25 | CausticCore.dll 26 | CausticCore.lib 27 | fmodex.dll -------------------------------------------------------------------------------- /Caustk/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/model/ViewModelBase.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.app.model; 3 | 4 | import com.teotigraphix.caustk.gdx.app.ApplicationComponent; 5 | import com.teotigraphix.caustk.gdx.app.model.song.ISongFileCollection; 6 | 7 | public abstract class ViewModelBase extends ApplicationComponent { 8 | 9 | public ViewModelBase() { 10 | } 11 | 12 | public abstract void reset(); 13 | 14 | public abstract ISongFileCollection getCollection(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Caustk/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/api/LibraryAPI.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.app.api; 3 | 4 | import com.teotigraphix.caustk.gdx.app.AbstractProjectModelAPI; 5 | import com.teotigraphix.caustk.gdx.app.ProjectModel; 6 | import com.teotigraphix.caustk.gdx.app.ProjectState; 7 | 8 | public class LibraryAPI extends AbstractProjectModelAPI { 9 | 10 | public LibraryAPI(ProjectModel projectModel) { 11 | super(projectModel); 12 | } 13 | 14 | @Override 15 | public void restore(ProjectState state) { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /Caustk/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-21 15 | android.library=true 16 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/MixerType.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.node.machine.patch; 3 | 4 | public enum MixerType { 5 | 6 | Volume(0), Pan(1), Bass(2), Mid(3), High(4), Reverb(5), Delay(6), Width(7); 7 | 8 | private int index; 9 | 10 | public int getIndex() { 11 | return index; 12 | } 13 | 14 | MixerType(int index) { 15 | this.index = index; 16 | } 17 | 18 | public static MixerType fromInt(int index) { 19 | for (MixerType type : values()) { 20 | if (type.getIndex() == index) 21 | return type; 22 | } 23 | return null; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/modular/IModularComponent.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.node.machine.patch.modular; 3 | 4 | import java.util.Collection; 5 | 6 | import com.teotigraphix.caustk.core.osc.ModularMessage.ModularComponentType; 7 | import com.teotigraphix.caustk.node.ICaustkNode; 8 | 9 | public interface IModularComponent extends ICaustkNode { 10 | 11 | Collection getControls(); 12 | 13 | Collection getFrontControls(); 14 | 15 | Collection getRearControls(); 16 | 17 | int getBay(); 18 | 19 | ModularComponentType getType(); 20 | 21 | void connect(IModularJack out, IModularComponent destination, IModularJack in); 22 | 23 | int getMachineIndex(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Caustk/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/ICaustkSerializer.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.core; 3 | 4 | import java.io.File; 5 | import java.io.FileNotFoundException; 6 | import java.io.IOException; 7 | 8 | import com.esotericsoftware.kryo.Kryo; 9 | import com.teotigraphix.caustk.groove.importer.CausticFileImporter; 10 | 11 | public interface ICaustkSerializer { 12 | 13 | Kryo getKryo(); 14 | 15 | CausticFileImporter getImporter(); 16 | 17 | void serialize(File target, Object instance) throws IOException; 18 | 19 | T deserialize(File file, Class type) throws IOException; 20 | 21 | T fromXMLManifest(File manifestFile, Class clazz) throws FileNotFoundException; 22 | 23 | T fromXMLManifest(String manifestData, Class clazz) throws FileNotFoundException; 24 | } 25 | -------------------------------------------------------------------------------- /Caustk/src-content/com/singlecellsoftware/contentextractor/NativeInterface.java: -------------------------------------------------------------------------------- 1 | package com.singlecellsoftware.contentextractor; 2 | 3 | public class NativeInterface 4 | { 5 | public static native void InitGraphics(); 6 | public static native void Resize(int w, int h); 7 | public static native int Render(); 8 | public static native void TouchBegin(int idx, int x, int y); 9 | public static native void SetRootPath(String sPath); 10 | public static native void SetAPKPath(String sPath); 11 | public static native void SetProgressBarCoordinates(int x0, int y0, int x1, int y1); 12 | public static native void SetProgressBarColor(int red, int green, int blue); 13 | public static native void SetExitButtonCoordinates(int x0, int y0, int x1, int y1); 14 | public static native void SetWebpageCoordinates(int x0, int y0, int x1, int y1); 15 | } 16 | -------------------------------------------------------------------------------- /Caustk/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/browser/BrowserBank.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.browser; 21 | 22 | public enum BrowserBank { 23 | User, Factory; 24 | } 25 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/osc/IMachineControl.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core.osc; 21 | 22 | public interface IMachineControl extends IAutomatableControl { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/IApplicationState.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app; 21 | 22 | public interface IApplicationState extends IApplicationComponent { 23 | } 24 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/osc/IMixerControl.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core.osc; 21 | 22 | public interface IMixerControl extends IAutomatableControl, IOSCControl { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/osc/IEffectControl.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core.osc; 21 | 22 | public interface IEffectControl extends IOSCControl, IAutomatableControl { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/modular/IModularJack.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.machine.patch.modular; 21 | 22 | public interface IModularJack { 23 | int getValue(); 24 | } 25 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/view/IDisplayOutput.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller.view; 21 | 22 | public interface IDisplayOutput { 23 | void setText(int row, String text); 24 | } 25 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/IApplicationConfigurator.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app; 21 | 22 | import com.esotericsoftware.kryo.Kryo; 23 | 24 | public interface IApplicationConfigurator { 25 | void configure(Kryo kryo); 26 | } 27 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/model/machine/SongFileMachine.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.app.model.machine; 3 | 4 | import com.esotericsoftware.kryo.serializers.TaggedFieldSerializer.Tag; 5 | import com.teotigraphix.caustk.node.machine.MachineType; 6 | import com.teotigraphix.caustk.node.machine.sequencer.TrackChannel; 7 | 8 | public class SongFileMachine { 9 | 10 | @Tag(0) 11 | private int index; 12 | 13 | @Tag(1) 14 | private String name; 15 | 16 | @Tag(2) 17 | private MachineType type; 18 | 19 | @Tag(5) 20 | private TrackChannel track; 21 | 22 | public int getIndex() { 23 | return index; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public MachineType getType() { 31 | return type; 32 | } 33 | 34 | public TrackChannel getTrack() { 35 | return track; 36 | } 37 | 38 | SongFileMachine() { 39 | } 40 | 41 | public SongFileMachine(int index, String name, MachineType type, TrackChannel track) { 42 | this.index = index; 43 | this.name = name; 44 | this.type = type; 45 | this.track = track; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/ui/IContainerKind.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.ui; 21 | 22 | import com.badlogic.gdx.math.Rectangle; 23 | 24 | public interface IContainerKind { 25 | String getId(); 26 | 27 | Rectangle getBounds(); 28 | } 29 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/IViewListener.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller; 21 | 22 | public interface IViewListener { 23 | void updateArrows(); 24 | 25 | void onLeftArrow(boolean down); 26 | 27 | void onRightArrow(boolean down); 28 | } 29 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/IApplicationComponent.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app; 21 | 22 | /** 23 | * The {@link IApplicationComponent} is a high level data structure that posts 24 | * events. 25 | * 26 | * @author Michael Schmalle 27 | * @since 1.0 28 | */ 29 | public interface IApplicationComponent { 30 | } 31 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/model/song/SongFileSource.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.app.model.song; 3 | 4 | import java.io.File; 5 | import java.util.ArrayList; 6 | import java.util.Collection; 7 | 8 | import com.esotericsoftware.kryo.serializers.TaggedFieldSerializer.Tag; 9 | import com.google.common.io.Files; 10 | 11 | public class SongFileSource { 12 | 13 | @Tag(0) 14 | private File file; 15 | 16 | @Tag(1) 17 | private Collection files = new ArrayList(); 18 | 19 | @Tag(2) 20 | private boolean checked; 21 | 22 | public File getFile() { 23 | return file; 24 | } 25 | 26 | public Collection getFiles() { 27 | return files; 28 | } 29 | 30 | /** 31 | * Whether the item is checked in the UI. 32 | */ 33 | public boolean isChecked() { 34 | return checked; 35 | } 36 | 37 | public void setChecked(boolean checked) { 38 | this.checked = checked; 39 | } 40 | 41 | public String getName() { 42 | return Files.getNameWithoutExtension(file.getAbsolutePath()); 43 | } 44 | 45 | SongFileSource() { 46 | } 47 | 48 | public SongFileSource(File file) { 49 | this.file = file; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/api/RackAPI.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.app.api; 3 | 4 | import com.google.common.eventbus.EventBus; 5 | import com.teotigraphix.caustk.core.ICaustkRack; 6 | import com.teotigraphix.caustk.core.ICaustkRuntime; 7 | import com.teotigraphix.caustk.core.internal.CaustkRuntime; 8 | import com.teotigraphix.caustk.gdx.app.AbstractProjectModelAPI; 9 | import com.teotigraphix.caustk.gdx.app.ProjectModel; 10 | import com.teotigraphix.caustk.gdx.app.ProjectState; 11 | import com.teotigraphix.caustk.node.RackInstance; 12 | 13 | public class RackAPI extends AbstractProjectModelAPI { 14 | 15 | private ICaustkRuntime getRuntime() { 16 | return CaustkRuntime.getInstance(); 17 | } 18 | 19 | public ICaustkRack getRack() { 20 | return getRuntime().getRack(); 21 | } 22 | 23 | @Override 24 | public RackInstance getRackInstance() { 25 | return getRuntime().getRack().getRackInstance(); 26 | } 27 | 28 | public EventBus getRackEventBus() { 29 | return getRuntime().getRack().getEventBus(); 30 | } 31 | 32 | public RackAPI(ProjectModel projectModel) { 33 | super(projectModel); 34 | } 35 | 36 | @Override 37 | public void restore(ProjectState state) { 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/osc/IAutomatableControl.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core.osc; 21 | 22 | public interface IAutomatableControl { 23 | 24 | String getControl(); 25 | 26 | OSCControlKind getKind(); 27 | 28 | float getMin(); 29 | 30 | float getMax(); 31 | 32 | float getDefaultValue(); 33 | 34 | String getDisplayName(); 35 | } 36 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/utils/gdx/StyleUtils.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.utils.gdx; 21 | 22 | import com.teotigraphix.caustk.gdx.scene2d.ui.UITable; 23 | 24 | public class StyleUtils { 25 | public static T getStyle(UITable aware, Class styleClass) { 26 | return styleClass.cast(aware.getSkin().get(aware.getStyleName(), styleClass)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/api/CommandAPI.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.app.api; 3 | 4 | import com.teotigraphix.caustk.core.CausticException; 5 | import com.teotigraphix.caustk.gdx.app.AbstractProjectModelAPI; 6 | import com.teotigraphix.caustk.gdx.app.ProjectModel; 7 | import com.teotigraphix.caustk.gdx.app.ProjectState; 8 | import com.teotigraphix.caustk.gdx.app.controller.command.CommandExecutionException; 9 | import com.teotigraphix.caustk.gdx.app.controller.command.ICommand; 10 | 11 | public class CommandAPI extends AbstractProjectModelAPI { 12 | 13 | public void execute(String message, Object... args) throws CommandExecutionException { 14 | getCommandManager().execute(message, args); 15 | } 16 | 17 | public int undo() throws CausticException { 18 | return getCommandManager().undo(); 19 | } 20 | 21 | public int redo() throws CausticException { 22 | return getCommandManager().redo(); 23 | } 24 | 25 | public void put(String message, Class command) { 26 | getCommandManager().put(message, command); 27 | } 28 | 29 | public CommandAPI(ProjectModel projectModel) { 30 | super(projectModel); 31 | } 32 | 33 | @Override 34 | public void restore(ProjectState state) { 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/IPreferenceManager.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller; 21 | 22 | import com.badlogic.gdx.Preferences; 23 | import com.teotigraphix.caustk.gdx.app.IApplicationComponent; 24 | 25 | public interface IPreferenceManager extends IApplicationComponent { 26 | 27 | Preferences get(String name); 28 | 29 | void save(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/IProjectFactory.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app; 21 | 22 | import java.io.File; 23 | import java.io.IOException; 24 | 25 | public interface IProjectFactory { 26 | 27 | T createDefaultProject(String name, File projectFile); 28 | 29 | T readProject(File projectFile, boolean loadRack) throws IOException; 30 | } 31 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/library/LibrarySample.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.library; 21 | 22 | import com.teotigraphix.caustk.groove.manifest.LibraryItemManifest; 23 | 24 | public class LibrarySample extends LibraryProductItem { 25 | 26 | @Override 27 | public LibraryItemManifest getManifest() { 28 | return null; 29 | } 30 | 31 | public LibrarySample() { 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/command/ICommand.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller.command; 21 | 22 | public interface ICommand { 23 | 24 | CommandContext getContext(); 25 | 26 | /** 27 | * Perform an action 28 | * 29 | * @throws CommandExecutionException An exception occurred during execution. 30 | */ 31 | void execute() throws CommandExecutionException; 32 | } 33 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/IRackSequencerListener.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core; 21 | 22 | public interface IRackSequencerListener { 23 | 24 | void onBeatChange(int measure, float beat, int sixteenth, int thirtysecond); 25 | 26 | void onSixteenthChange(int measure, float beat, int sixteenth, int thirtysecond); 27 | 28 | void onThirtysecondChange(int measure, float beat, int sixteenth, int thirtysecond); 29 | } 30 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/manifest/LibraryProjectManifest.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.manifest; 21 | 22 | import com.teotigraphix.caustk.groove.library.LibraryItemFormat; 23 | 24 | public class LibraryProjectManifest extends LibraryItemManifest { 25 | 26 | public LibraryProjectManifest(String displayName, String relativePath) { 27 | super(LibraryItemFormat.Project, displayName, relativePath); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/osc/KSSynthMessage.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core.osc; 21 | 22 | /** 23 | * The {@link KSSynthMessage} holds all OSC messages associated with the 24 | * {@link KSSynthTone} API. 25 | * 26 | * @author Michael Schmalle 27 | * @since 3.1 28 | */ 29 | public class KSSynthMessage extends CausticMessage { 30 | 31 | // XXX Implement OSC KSSynthMessage 32 | 33 | KSSynthMessage(String message) { 34 | super(message); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/osc/IOSCControl.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core.osc; 21 | 22 | /** 23 | * The {@link IOSCControl} API is implemented by OSC control enums in the 24 | * com.teotigraphix.caustk.osc package. 25 | * 26 | * @author Michael Schmalle 27 | * @since 1.0 28 | */ 29 | public interface IOSCControl { 30 | 31 | /** 32 | * Returns the display name of the control. 33 | */ 34 | String name(); 35 | 36 | String getDisplayName(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/IHelpManagerAware.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller; 21 | 22 | /** 23 | * @author Michael Schmalle 24 | * @since 1.0 25 | */ 26 | public interface IHelpManagerAware { 27 | 28 | /** 29 | * Returns help text specifically formated by a user interface component. 30 | *

31 | * This API is usually implemented by components that will return real-time 32 | * values. 33 | */ 34 | String getHelpText(); 35 | } 36 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/utils/core/MathUtils.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.utils.core; 21 | 22 | /** 23 | * @author Michael Schmalle 24 | */ 25 | public final class MathUtils { 26 | 27 | public static float rounded(float number, float factor) { 28 | long integer = (long)number; 29 | float fraction = number - integer; 30 | float multiple = (fraction / factor); 31 | multiple = Math.round(multiple); 32 | return factor * multiple + integer; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/MachineNodeFactory.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.machine; 21 | 22 | import com.teotigraphix.caustk.core.factory.CaustkFactory; 23 | import com.teotigraphix.caustk.core.factory.CaustkFactoryChildBase; 24 | 25 | /** 26 | * Factory to create {@link Machine}s. 27 | * 28 | * @author Michael Schmalle 29 | * @since 1.0 30 | */ 31 | public class MachineNodeFactory extends CaustkFactoryChildBase { 32 | 33 | public MachineNodeFactory(CaustkFactory factory) { 34 | super(factory); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/effect/EffectNodeFactory.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.effect; 21 | 22 | import com.teotigraphix.caustk.core.factory.CaustkFactory; 23 | import com.teotigraphix.caustk.core.factory.CaustkFactoryChildBase; 24 | 25 | /** 26 | * The {@link EffectNodeFactory} for creating {@link EffectNode}s. 27 | * 28 | * @author Michael Schmalle 29 | * @since 1.0 30 | */ 31 | public class EffectNodeFactory extends CaustkFactoryChildBase { 32 | 33 | public EffectNodeFactory(CaustkFactory factory) { 34 | super(factory); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/mixer/MixerPanePropertyProvider.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui.mixer; 21 | 22 | import com.badlogic.gdx.graphics.Color; 23 | import com.teotigraphix.caustk.core.ICaustkRack; 24 | import com.teotigraphix.caustk.gdx.app.controller.view.AbstractDisplay; 25 | 26 | public interface MixerPanePropertyProvider { 27 | 28 | ICaustkRack getRack(); 29 | 30 | boolean hasMaster(); 31 | 32 | // StylesDefault.getMachineColor(machineNode.getType()) 33 | Color getItemColor(int index); 34 | 35 | AbstractDisplay getDisplay(); 36 | } 37 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/importer/CausticEffectType.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.importer; 21 | 22 | import com.teotigraphix.caustk.node.effect.EffectType; 23 | 24 | public class CausticEffectType { 25 | 26 | private int index; 27 | 28 | private EffectType type; 29 | 30 | public int getIndex() { 31 | return index; 32 | } 33 | 34 | public EffectType getType() { 35 | return type; 36 | } 37 | 38 | public boolean hasType() { 39 | return type != null; 40 | } 41 | 42 | public CausticEffectType(int index, EffectType type) { 43 | this.index = index; 44 | this.type = type; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/behavior/SceneViewChildBehavior.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | //Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | //Licensed under the Apache License, Version 2.0 (the "License"); 5 | //you may not use this file except in compliance with the License. 6 | //You may obtain a copy of the License at 7 | // 8 | //http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | //Unless required by applicable law or agreed to in writing, software 11 | //distributed under the License is distributed on an "AS IS" BASIS, 12 | //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | //See the License for the specific language governing permissions and 14 | //limitations under the License 15 | // 16 | //Author: Michael Schmalle, Principal Architect 17 | //mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.behavior; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.ui.Table; 23 | import com.teotigraphix.caustk.gdx.app.ui.CaustkBehavior; 24 | 25 | /** 26 | * A child of the Main scene's viewstack. 27 | */ 28 | public abstract class SceneViewChildBehavior extends CaustkBehavior { 29 | private SceneViewChildData data; 30 | 31 | public SceneViewChildData getData() { 32 | return data; 33 | } 34 | 35 | public void setData(SceneViewChildData data) { 36 | this.data = data; 37 | } 38 | 39 | public SceneViewChildBehavior() { 40 | } 41 | 42 | public abstract Table create(); 43 | } 44 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/command/AbortCommandException.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller.command; 21 | 22 | public class AbortCommandException extends CommandExecutionException { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | public AbortCommandException() { 27 | } 28 | 29 | public AbortCommandException(String detailMessage) { 30 | super(detailMessage); 31 | } 32 | 33 | public AbortCommandException(Throwable throwable) { 34 | super(throwable); 35 | } 36 | 37 | public AbortCommandException(String detailMessage, Throwable throwable) { 38 | super(detailMessage, throwable); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/command/CommandExecutionException.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller.command; 21 | 22 | public class CommandExecutionException extends Exception { 23 | 24 | private static final long serialVersionUID = -3602002464749099348L; 25 | 26 | public CommandExecutionException() { 27 | } 28 | 29 | public CommandExecutionException(String detailMessage) { 30 | super(detailMessage); 31 | } 32 | 33 | public CommandExecutionException(Throwable throwable) { 34 | super(throwable); 35 | } 36 | 37 | public CommandExecutionException(String detailMessage, Throwable throwable) { 38 | super(detailMessage, throwable); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/CausticError.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2012 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core; 21 | 22 | /** 23 | * A general Caustic runtime error. 24 | * 25 | * @author Michael Schmalle 26 | * @copyright Teoti Graphix, LLC 27 | * @since 1.0 28 | */ 29 | public class CausticError extends RuntimeException { 30 | 31 | private static final long serialVersionUID = -8282828241466601559L; 32 | 33 | public CausticError() { 34 | } 35 | 36 | public CausticError(String detailMessage) { 37 | super(detailMessage); 38 | } 39 | 40 | public CausticError(Throwable throwable) { 41 | super(throwable); 42 | } 43 | 44 | public CausticError(String detailMessage, Throwable throwable) { 45 | super(detailMessage, throwable); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/CausticException.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2011 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core; 21 | 22 | /** 23 | * General exception for Caustic Toolkit. 24 | * 25 | * @author Michael Schmalle 26 | * @copyright Teoti Graphix, LLC 27 | * @since 1.0 28 | */ 29 | public class CausticException extends Exception { 30 | 31 | private static final long serialVersionUID = -3570651638541363052L; 32 | 33 | public CausticException() { 34 | } 35 | 36 | public CausticException(String message) { 37 | super(message); 38 | } 39 | 40 | public CausticException(Throwable throwable) { 41 | super(throwable); 42 | } 43 | 44 | public CausticException(String message, Throwable throwable) { 45 | super(message, throwable); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/command/ICommandManager.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller.command; 21 | 22 | import com.badlogic.gdx.utils.Array; 23 | import com.teotigraphix.caustk.core.CausticException; 24 | 25 | public interface ICommandManager { 26 | 27 | int getCursor(); 28 | 29 | void execute(String message, Object... args) throws CommandExecutionException; 30 | 31 | int undo() throws CausticException;; 32 | 33 | int redo() throws CausticException;; 34 | 35 | void put(String message, Class command); 36 | 37 | void remove(String message); 38 | 39 | void clearHistory(); 40 | 41 | Array getCommands(); 42 | 43 | boolean canUndo(); 44 | 45 | boolean canRedo(); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/manifest/LibrarySoundManifest.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.manifest; 21 | 22 | import com.teotigraphix.caustk.groove.library.LibraryItemFormat; 23 | 24 | /** 25 | * @author Michael Schmalle 26 | * @since 1.0 27 | */ 28 | public class LibrarySoundManifest extends LibraryItemManifest { 29 | 30 | //-------------------------------------------------------------------------- 31 | // Constructors 32 | //-------------------------------------------------------------------------- 33 | 34 | /** 35 | * Serialized. 36 | */ 37 | LibrarySoundManifest() { 38 | } 39 | 40 | public LibrarySoundManifest(String name, String relativePath) { 41 | super(LibraryItemFormat.Sound, name, relativePath); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/factory/CaustkFactoryChildBase.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core.factory; 21 | 22 | 23 | /** 24 | * The {@link CaustkFactoryChildBase}, base factory class for sub factories in 25 | * the {@link CaustkFactory}. 26 | * 27 | * @author Michael Schmalle 28 | * @since 1.0 29 | */ 30 | public class CaustkFactoryChildBase { 31 | 32 | private CaustkFactory factory; 33 | 34 | protected CaustkFactory getFactory() { 35 | return factory; 36 | } 37 | 38 | //-------------------------------------------------------------------------- 39 | // Constructor 40 | //-------------------------------------------------------------------------- 41 | 42 | public CaustkFactoryChildBase(CaustkFactory factory) { 43 | this.factory = factory; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/manifest/LibraryGroupManifest.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.manifest; 21 | 22 | import com.teotigraphix.caustk.groove.library.LibraryItemFormat; 23 | 24 | /** 25 | * @author Michael Schmalle 26 | * @since 1.0 27 | */ 28 | public class LibraryGroupManifest extends LibraryItemManifest { 29 | 30 | //-------------------------------------------------------------------------- 31 | // Constructors 32 | //-------------------------------------------------------------------------- 33 | 34 | /** 35 | * Serialized. 36 | */ 37 | LibraryGroupManifest() { 38 | } 39 | 40 | public LibraryGroupManifest(String name, String relativePath) { 41 | super(LibraryItemFormat.Group, name, relativePath); 42 | setDisplayName(name); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/IRackEventBus.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core; 21 | 22 | /** 23 | * The {@link IRackEventBus} API allows subscription to the {@link ICaustkRack} 24 | * 's event buss. 25 | * 26 | * @author Michael Schmalle 27 | * @since 1.0 28 | */ 29 | public interface IRackEventBus { 30 | 31 | /** 32 | * Register a subscriber. 33 | * 34 | * @param subscriber The subscriber add. 35 | */ 36 | void register(Object subscriber); 37 | 38 | /** 39 | * Unegister a subscriber. 40 | * 41 | * @param subscriber The subscriber to remove. 42 | */ 43 | void unregister(Object subscriber); 44 | 45 | /** 46 | * Posts an event through the {@link ICaustkRack}. 47 | * 48 | * @param event The event object. 49 | */ 50 | void post(Object event); 51 | } 52 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/IViewManager.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller; 21 | 22 | import com.teotigraphix.caustk.gdx.app.controller.view.AbstractDisplay; 23 | 24 | public interface IViewManager { 25 | 26 | AbstractDisplay getSubDisplay(); 27 | 28 | AbstractDisplay getDisplay(); 29 | 30 | public enum ViewManagerEventKind { 31 | Start, 32 | 33 | ReStart 34 | } 35 | 36 | public static class ViewManagerEvent { 37 | 38 | private Object kind; 39 | 40 | public final Object getKind() { 41 | return kind; 42 | } 43 | 44 | public final boolean isAll() { 45 | return kind == null; 46 | } 47 | 48 | public ViewManagerEvent(Object kind) { 49 | this.kind = kind; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/library/LibraryProject.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.library; 21 | 22 | import com.esotericsoftware.kryo.serializers.TaggedFieldSerializer.Tag; 23 | import com.teotigraphix.caustk.groove.manifest.LibraryProjectManifest; 24 | 25 | public class LibraryProject extends LibraryProductItem { 26 | 27 | //-------------------------------------------------------------------------- 28 | // Serialized API 29 | //-------------------------------------------------------------------------- 30 | 31 | @Tag(50) 32 | private LibraryProjectManifest manifest; 33 | 34 | @Override 35 | public LibraryProjectManifest getManifest() { 36 | return manifest; 37 | } 38 | 39 | public LibraryProject(LibraryProjectManifest manifest) { 40 | this.manifest = manifest; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/modular/TwoInputMixer.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.machine.patch.modular; 21 | 22 | import com.teotigraphix.caustk.node.machine.Machine; 23 | 24 | /** 25 | * 2 gain input mixer. 26 | */ 27 | public class TwoInputMixer extends MixerBase { 28 | 29 | public TwoInputMixer() { 30 | } 31 | 32 | public TwoInputMixer(Machine machineNode, int bay) { 33 | super(machineNode, bay); 34 | setLabel("TwoInputMixer"); 35 | } 36 | 37 | @Override 38 | protected int getNumBays() { 39 | return 1; 40 | } 41 | 42 | @Override 43 | protected void restoreComponents() { 44 | super.restoreComponents(); 45 | setGain(MixerJack.In1Gain, getGain(MixerJack.In1Gain)); 46 | setGain(MixerJack.In2Gain, getGain(MixerJack.In2Gain)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/ICaustkLogger.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core; 21 | 22 | /** 23 | * @author Michael Schmalle 24 | * @since 1.0 25 | */ 26 | public interface ICaustkLogger { 27 | 28 | void setLogLevel(int level); 29 | 30 | void model(String tag, String message); 31 | 32 | void view(String tag, String message); 33 | 34 | void osc(String message); 35 | 36 | void log(String tag, String message); 37 | 38 | void log(String tag, String message, Exception exception); 39 | 40 | void debug(String tag, String message); 41 | 42 | void debug(String tag, String message, Throwable throwable); 43 | 44 | void warn(String tag, String message); 45 | 46 | void warn(String tag, String message, Throwable throwable); 47 | 48 | void err(String tag, String message); 49 | 50 | void err(String tag, String message, Throwable throwable); 51 | } 52 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/padsynth/LFO2Component.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.machine.patch.padsynth; 21 | 22 | import com.teotigraphix.caustk.node.machine.Machine; 23 | import com.teotigraphix.caustk.node.machine.PadSynthMachine; 24 | 25 | /** 26 | * The {@link PadSynthMachine} lfo2 component. 27 | * 28 | * @author Michael Schmalle 29 | * @since 1.0 30 | * @see PadSynthMachine#getLFO2() 31 | */ 32 | public class LFO2Component extends LFO1Component { 33 | 34 | //-------------------------------------------------------------------------- 35 | // Constructors 36 | //-------------------------------------------------------------------------- 37 | 38 | /** 39 | * Serialization 40 | */ 41 | public LFO2Component() { 42 | super(); 43 | } 44 | 45 | public LFO2Component(Machine machineNode) { 46 | super(machineNode); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/library/LibraryItemFormat.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.library; 21 | 22 | public enum LibraryItemFormat { 23 | 24 | Product("gprd"), 25 | 26 | Project("gprj"), 27 | 28 | PatternBank("gptbk"), 29 | 30 | Group("ggrp"), 31 | 32 | Sound("gsnd"), 33 | 34 | Instrument("ginst"), 35 | 36 | Effect("gfx"), 37 | 38 | Sample("wav"); 39 | 40 | private String extension; 41 | 42 | public String getExtension() { 43 | return extension; 44 | } 45 | 46 | LibraryItemFormat(String extension) { 47 | this.extension = extension; 48 | } 49 | 50 | public static LibraryItemFormat fromString(String extension) { 51 | for (LibraryItemFormat format : values()) { 52 | if (format.getExtension().equals(extension)) 53 | return format; 54 | } 55 | return null; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/modular/ThreeInputMixer.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.machine.patch.modular; 21 | 22 | import com.teotigraphix.caustk.node.machine.Machine; 23 | 24 | /** 25 | * 3 gain input mixer. 26 | */ 27 | public class ThreeInputMixer extends MixerBase { 28 | 29 | public ThreeInputMixer() { 30 | } 31 | 32 | public ThreeInputMixer(Machine machineNode, int bay) { 33 | super(machineNode, bay); 34 | setLabel("ThreeInputMixer"); 35 | } 36 | 37 | @Override 38 | protected int getNumBays() { 39 | return 1; 40 | } 41 | 42 | @Override 43 | protected void restoreComponents() { 44 | super.restoreComponents(); 45 | setGain(MixerJack.In1Gain, getGain(MixerJack.In1Gain)); 46 | setGain(MixerJack.In2Gain, getGain(MixerJack.In2Gain)); 47 | setGain(MixerJack.In3Gain, getGain(MixerJack.In3Gain)); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/app/ActionBarListener.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.scene2d.ui.app; 3 | 4 | import com.badlogic.gdx.scenes.scene2d.Event; 5 | import com.badlogic.gdx.scenes.scene2d.EventListener; 6 | 7 | public abstract class ActionBarListener implements EventListener { 8 | 9 | public ActionBarListener() { 10 | } 11 | 12 | @Override 13 | public boolean handle(Event event) { 14 | if (event instanceof ActionBarEvent) { 15 | ActionBarEvent e = (ActionBarEvent)event; 16 | switch (e.getKind()) { 17 | case ActionExecute: 18 | actionExecute(e); 19 | break; 20 | case BackTap: 21 | backTap(e); 22 | break; 23 | } 24 | } 25 | return false; 26 | } 27 | 28 | public abstract void actionExecute(ActionBarEvent event); 29 | 30 | public abstract void backTap(ActionBarEvent event); 31 | 32 | public enum ActionBarEventKind { 33 | ActionExecute, BackTap 34 | } 35 | 36 | public static class ActionBarEvent extends Event { 37 | 38 | private ActionBarEventKind kind; 39 | 40 | private Object data; 41 | 42 | public ActionBarEventKind getKind() { 43 | return kind; 44 | } 45 | 46 | public void setKind(ActionBarEventKind kind) { 47 | this.kind = kind; 48 | } 49 | 50 | public Object getData() { 51 | return data; 52 | } 53 | 54 | public void setData(Object data) { 55 | this.data = data; 56 | } 57 | 58 | public ActionBarEvent() { 59 | } 60 | 61 | @Override 62 | public void reset() { 63 | super.reset(); 64 | kind = null; 65 | data = null; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/ISoundGenerator.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core; 21 | 22 | import com.singlecellsoftware.causticcore.CausticCore; 23 | 24 | /** 25 | * The {@link ISoundGenerator} API wraps the Native {@link CausticCore} audio 26 | * loop and JNI interface. 27 | * 28 | * @author Michael Schmalle 29 | */ 30 | public interface ISoundGenerator extends ICausticEngine { 31 | 32 | /** 33 | * @see CausticCore#getCurrentBeat() 34 | */ 35 | float getCurrentBeat(); 36 | 37 | /** 38 | * @see CausticCore#getCurrentSongMeasure() 39 | */ 40 | float getCurrentSongMeasure(); 41 | 42 | /** 43 | * @see CausticCore#getVersion() 44 | */ 45 | int getVerison(); 46 | 47 | /** 48 | * Initializes the CausticCore event loop and sets up. 49 | */ 50 | void initialize(); 51 | 52 | /** 53 | * Closes the CausticCore event loop and cleans up. 54 | */ 55 | void close(); 56 | } 57 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/importer/LibraryProductImporter.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.importer; 21 | 22 | import java.io.File; 23 | import java.util.HashMap; 24 | import java.util.List; 25 | import java.util.Map; 26 | 27 | import com.teotigraphix.caustk.groove.browser.BrowserBank; 28 | import com.teotigraphix.caustk.groove.browser.BrowserModel; 29 | 30 | @SuppressWarnings("unused") 31 | public class LibraryProductImporter { 32 | 33 | private BrowserModel browserModel; 34 | 35 | private Map> locations = new HashMap>(); 36 | 37 | public LibraryProductImporter(BrowserModel browserModel) { 38 | this.browserModel = browserModel; 39 | } 40 | 41 | public void addLocation(BrowserBank bank, File location) { 42 | 43 | } 44 | 45 | public void removeLocation(BrowserBank bank, File location) { 46 | 47 | } 48 | 49 | public void rescan() { 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/utils/core/SerializeUtils.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.utils.core; 21 | 22 | import java.io.File; 23 | import java.io.IOException; 24 | 25 | import com.teotigraphix.caustk.core.internal.CaustkRuntime; 26 | 27 | public class SerializeUtils { 28 | 29 | public static void pack(File file, T instance) throws IOException { 30 | CaustkRuntime.getInstance().getFactory().getRuntime().getRack().getSerializer() 31 | .serialize(file, instance); 32 | } 33 | 34 | public static T unpack(File file, Class clazz) throws IOException { 35 | return clazz.cast(CaustkRuntime.getInstance().getFactory().getRuntime().getRack() 36 | .getSerializer().deserialize(file, clazz)); 37 | } 38 | 39 | // public static T unpack(String json, Class clazz) throws CausticException { 40 | // return CaustkRuntime.getInstance().getFactory().deserialize(json, clazz); 41 | // } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/command/CommandContext.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller.command; 21 | 22 | import com.google.common.eventbus.EventBus; 23 | import com.teotigraphix.caustk.core.ICaustkRack; 24 | import com.teotigraphix.caustk.core.internal.CaustkRuntime; 25 | import com.teotigraphix.caustk.gdx.app.IApplication; 26 | 27 | public class CommandContext { 28 | 29 | private final IApplication application; 30 | 31 | private final OSCMessage message; 32 | 33 | public final ICaustkRack getRack() { 34 | return CaustkRuntime.getInstance().getRack(); 35 | } 36 | 37 | public final OSCMessage getMessage() { 38 | return message; 39 | } 40 | 41 | protected final EventBus getDispatcher() { 42 | return application.getEventBus(); 43 | } 44 | 45 | public CommandContext(IApplication application, OSCMessage message) { 46 | this.application = application; 47 | this.message = message; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/ICaustkFactory.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core; 21 | 22 | import java.io.File; 23 | 24 | import com.teotigraphix.caustk.core.factory.LibraryFactory; 25 | import com.teotigraphix.caustk.core.factory.NodeFactory; 26 | import com.teotigraphix.caustk.core.internal.CaustkRuntime; 27 | 28 | /** 29 | * @author Michael Schmalle 30 | * @since 1.0 31 | */ 32 | public interface ICaustkFactory { 33 | 34 | /** 35 | * The {@link CaustkRuntime} that owns this factory. 36 | */ 37 | ICaustkRuntime getRuntime(); 38 | 39 | NodeFactory getNodeFactory(); 40 | 41 | LibraryFactory getLibraryFactory(); 42 | 43 | /** 44 | * Returns a sub directory in the application's cache 45 | * directory. 46 | * 47 | * @param reletivePath The path within the cache directory. 48 | * @throws java.io.IOException 49 | */ 50 | File getCacheDirectory(String relativePath); 51 | 52 | void initialize() throws CausticException; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/ICaustkRuntime.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core; 21 | 22 | import com.teotigraphix.caustk.gdx.app.ICaustkApplication; 23 | import com.teotigraphix.caustk.node.ICaustkNode; 24 | 25 | /** 26 | * @author Michael Schmalle 27 | * @since 1.0 28 | */ 29 | public interface ICaustkRuntime { 30 | 31 | /** 32 | * The main caustk application. 33 | */ 34 | ICaustkApplication getApplication(); 35 | 36 | /** 37 | * Returns the session {@link ICaustkLogger} instance. 38 | */ 39 | ICaustkLogger getLogger(); 40 | 41 | /** 42 | * Returns the session {@link ICaustkRack} instance. 43 | */ 44 | ICaustkRack getRack(); 45 | 46 | /** 47 | * Returns the session {@link ICaustkFactory} for created 48 | * {@link ICaustkNode} s. 49 | */ 50 | ICaustkFactory getFactory(); 51 | 52 | /** 53 | * Dispatches the event through the {@link ICaustkRack#post(Object)}.. 54 | * 55 | * @param event The event object. 56 | */ 57 | void post(Object post); 58 | } 59 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/internal/generator/Caustic.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2012 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core.internal.generator; 21 | 22 | import android.util.Log; 23 | 24 | import com.singlecellsoftware.causticcore.CausticCore; 25 | import com.teotigraphix.caustk.core.internal.CaustkEngine; 26 | 27 | /** 28 | * @author Michael Schmalle 29 | * @copyright Teoti Graphix, LLC 30 | * @since 1.0 31 | */ 32 | public class Caustic extends CausticCore { 33 | 34 | private static final String TAG = "Caustic"; 35 | 36 | public Caustic() { 37 | super(); 38 | } 39 | 40 | @Override 41 | public float SendOSCMessage(String message) { 42 | if (CaustkEngine.DEBUG_MESSAGES) { 43 | Log.d(TAG, "Message: " + message); 44 | } 45 | return super.SendOSCMessage(message); 46 | } 47 | 48 | @Override 49 | public String QueryOSC(String message) { 50 | if (!CaustkEngine.DEBUG_QUERIES) { 51 | Log.d(TAG, "Query: " + message); 52 | } 53 | return super.QueryOSC(message); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/importer/CausticPatternBank.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.importer; 21 | 22 | import java.util.ArrayList; 23 | import java.util.Collection; 24 | 25 | import com.teotigraphix.caustk.groove.library.LibraryPatternBank; 26 | import com.teotigraphix.caustk.groove.library.LibraryProductAccess; 27 | import com.teotigraphix.caustk.node.machine.sequencer.PatternNode; 28 | 29 | public class CausticPatternBank extends CausticItem { 30 | 31 | private transient Collection patterns = new ArrayList(); 32 | 33 | /** 34 | * Returns the patterns for this bank, only populated when deserialized with 35 | * {@link LibraryProductAccess#getSounds()}. 36 | */ 37 | public Collection getPatterns() { 38 | return patterns; 39 | } 40 | 41 | public void setPatterns(Collection patterns) { 42 | this.patterns = patterns; 43 | } 44 | 45 | public CausticPatternBank(LibraryPatternBank item) { 46 | super(item); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/utils/core/ExceptionUtils.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2012 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.utils.core; 21 | 22 | /** 23 | * @author Michael Schmalle 24 | * @copyright Teoti Graphix, LLC 25 | * @since 1.0 26 | */ 27 | public class ExceptionUtils { 28 | 29 | public static final float MIN_VALUE = -1000000.0f; 30 | 31 | /** 32 | * Returns a new {@link IllegalArgumentException} for an error in OSC range. 33 | * 34 | * @param control The OSC control involved. 35 | * @param range The accepted range. 36 | * @param value The value that is throwing the range exception. 37 | * @return A new {@link IllegalArgumentException}. 38 | */ 39 | public static final RuntimeException newRangeException(String control, String range, 40 | Object value) { 41 | if (value.equals(MIN_VALUE)) 42 | return new IllegalArgumentException("[" + control + "]" + " Min core value"); 43 | return new IllegalArgumentException(control + " range [ " + range + " ] value: [" + value 44 | + "]"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/internal/CausticLibrary.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core.internal; 21 | 22 | import com.sun.jna.Library; 23 | 24 | public interface CausticLibrary extends Library { 25 | void CausticCore_Init(int nBufferSize); 26 | 27 | void CausticCore_Deinit(); 28 | 29 | void CausticCore_SetStorageRootDir(String path); 30 | 31 | float CausticCore_OSCMessage(String message, byte[] response); 32 | 33 | float CausticCore_GetCurrentBeat(); 34 | 35 | int CausticCore_GetCurrentSongMeasure(); 36 | 37 | /** 38 | * return a 32 bit value where the version number is split into 4 parts, 8 39 | * bits each 40 | *

    41 | *
  • bits [24..31] are major version
  • 42 | *
  • bits [16..23] are minor version
  • 43 | *
  • bits [8..15] are release
  • 44 | *
  • bits [0..7] are build # (though I doubt you'll ever see that change 45 | * for OSC)
  • 46 | *
47 | *

48 | * For example right now it returns 0x03000000 for 3.0.0.0 49 | */ 50 | int CausticCore_GetVersion(); 51 | } 52 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/ui/ICaustkScene.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.ui; 21 | 22 | import com.teotigraphix.caustk.gdx.app.IProjectModel; 23 | import com.teotigraphix.caustk.gdx.app.controller.IViewManager; 24 | 25 | /** 26 | * The {@link ICaustkScene} API allows an application to display states as UI 27 | * screens. 28 | * 29 | * @author Michael Schmalle 30 | * @since 1.0 31 | */ 32 | public interface ICaustkScene extends IScene { 33 | 34 | int getId(); 35 | 36 | UIFactory getFactory(); 37 | 38 | IProjectModel getProjectModel(); 39 | 40 | IViewManager getViewManager(); 41 | 42 | void onPreCalculate(int measure, float beat, int sixteenth, int thirtysecond); 43 | 44 | void onBeatChange(int measure, float beat, int sixteenth, int thirtysecond); 45 | 46 | void onPreSixteenthChange(int measure, float beat, int sixteenth, int thirtysecond); 47 | 48 | void onSixteenthChange(int measure, float beat, int sixteenth, int thirtysecond); 49 | 50 | void onThirtysecondChange(int measure, float beat, int sixteenth, int thirtysecond); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/app/ViewStackPane.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui.app; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.Actor; 23 | import com.badlogic.gdx.scenes.scene2d.ui.Skin; 24 | import com.badlogic.gdx.utils.Array; 25 | import com.teotigraphix.caustk.gdx.app.ui.StylesDefault; 26 | import com.teotigraphix.caustk.gdx.scene2d.ui.UITable; 27 | 28 | public class ViewStackPane extends UITable { 29 | 30 | private ViewStack viewStack; 31 | 32 | private Array views; 33 | 34 | public void select(int index) { 35 | viewStack.setSelectedIndex(index); 36 | } 37 | 38 | public ViewStackPane(Skin skin, Array views) { 39 | super(skin); 40 | this.views = views; 41 | } 42 | 43 | @Override 44 | protected void createChildren() { 45 | viewStack = new ViewStack(getSkin()); 46 | for (Actor actor : views) { 47 | viewStack.addView(actor); // Mute 48 | } 49 | 50 | viewStack.create(StylesDefault.ViewStack); 51 | add(viewStack).expand().fill(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/command/CommandBase.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller.command; 21 | 22 | public abstract class CommandBase implements ICommand { 23 | 24 | private CommandContext context; 25 | 26 | @Override 27 | public CommandContext getContext() { 28 | return context; 29 | } 30 | 31 | public void setContext(CommandContext value) { 32 | context = value; 33 | } 34 | 35 | public final Boolean getBoolean(int index) { 36 | return CommandUtils.getBoolean(context, index); 37 | } 38 | 39 | public final Integer getInteger(int index) { 40 | return CommandUtils.getInteger(context, index); 41 | } 42 | 43 | public final Float getFloat(int index) { 44 | return CommandUtils.getFloat(context, index); 45 | } 46 | 47 | public final String getString(int index) { 48 | return CommandUtils.getString(context, index); 49 | } 50 | 51 | public CommandBase() { 52 | } 53 | 54 | @Override 55 | public abstract void execute() throws CommandExecutionException; 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/IApplicationStateHandlers.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app; 21 | 22 | import java.io.IOException; 23 | 24 | public interface IApplicationStateHandlers { 25 | 26 | /** 27 | * Loads the last project state. 28 | *

29 | * After the {@link com.teotigraphix.caustk.gdx.app.Project} is 30 | * deserialized, the 31 | * {@link com.teotigraphix.caustk.gdx.app.IApplicationModel#setProject(com.teotigraphix.caustk.gdx.app.Project)} 32 | * is called. 33 | * 34 | * @throws java.io.IOException Cannot reload or create a project in the 35 | * application's directory. 36 | */ 37 | void startup() throws IOException; 38 | 39 | /** 40 | * Called when Scene has been created and user interface behaviors can 41 | * listen to model changes to get the current view state. 42 | */ 43 | void startUI(); 44 | 45 | void onProjectCreate(Project project); 46 | 47 | void onProjectLoad(Project project); 48 | 49 | void onProjectSave(Project project); 50 | 51 | void onProjectClose(Project project); 52 | } 53 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/importer/CausticInstrument.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.importer; 21 | 22 | import com.teotigraphix.caustk.groove.library.LibraryInstrument; 23 | import com.teotigraphix.caustk.groove.library.LibraryProductAccess; 24 | import com.teotigraphix.caustk.node.machine.Machine; 25 | import com.teotigraphix.caustk.node.machine.MachineType; 26 | 27 | public class CausticInstrument extends CausticItem { 28 | 29 | private MachineType type; 30 | 31 | private transient Machine machine; 32 | 33 | public MachineType getType() { 34 | return type; 35 | } 36 | 37 | /** 38 | * Returns the {@link Machine}, only populated when deserialized with 39 | * {@link LibraryProductAccess#getSounds()}. 40 | */ 41 | public Machine getMachine() { 42 | return machine; 43 | } 44 | 45 | public void setMachine(Machine machine) { 46 | this.machine = machine; 47 | } 48 | 49 | public CausticInstrument(LibraryInstrument item) { 50 | super(item); 51 | this.type = item.getManifest().getMachineType(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/modular/SixInputMixer.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.machine.patch.modular; 21 | 22 | import com.teotigraphix.caustk.node.machine.Machine; 23 | 24 | /** 25 | * 6 gain input mixer. 26 | */ 27 | public class SixInputMixer extends MixerBase { 28 | 29 | public SixInputMixer() { 30 | } 31 | 32 | public SixInputMixer(Machine machineNode, int bay) { 33 | super(machineNode, bay); 34 | setLabel("SixInputMixer"); 35 | } 36 | 37 | @Override 38 | protected int getNumBays() { 39 | return 2; 40 | } 41 | 42 | @Override 43 | protected void restoreComponents() { 44 | super.restoreComponents(); 45 | setGain(MixerJack.In1Gain, getGain(MixerJack.In1Gain)); 46 | setGain(MixerJack.In2Gain, getGain(MixerJack.In2Gain)); 47 | setGain(MixerJack.In3Gain, getGain(MixerJack.In3Gain)); 48 | setGain(MixerJack.In4Gain, getGain(MixerJack.In4Gain)); 49 | setGain(MixerJack.In5Gain, getGain(MixerJack.In5Gain)); 50 | setGain(MixerJack.In6Gain, getGain(MixerJack.In6Gain)); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/modular/ModularControl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.node.machine.patch.modular; 3 | 4 | import com.teotigraphix.caustk.utils.node.ModularUtils; 5 | 6 | public class ModularControl { 7 | 8 | private String name; 9 | 10 | private String osc; 11 | 12 | private int type; // 0,1 13 | 14 | private float min; 15 | 16 | private float max; 17 | 18 | private float defaultValue; 19 | 20 | private IModularComponentControl control; 21 | 22 | public boolean isFront() { 23 | return control.name().contains("Front"); 24 | } 25 | 26 | public IModularComponentControl getControl() { 27 | return control; 28 | } 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public String getOsc() { 35 | return osc; 36 | } 37 | 38 | public int getType() { 39 | return type; 40 | } 41 | 42 | public float getMin() { 43 | return min; 44 | } 45 | 46 | public float getMax() { 47 | return max; 48 | } 49 | 50 | public float getDefaultValue() { 51 | return defaultValue; 52 | } 53 | 54 | public ModularControl(IModularComponentControl control, String name, String osc, int type, 55 | float min, float max, float defaultValue) { 56 | super(); 57 | this.control = control; 58 | this.name = name; 59 | this.osc = osc; 60 | this.type = type; 61 | this.min = min; 62 | this.max = max; 63 | this.defaultValue = defaultValue; 64 | } 65 | 66 | public float getValue(IModularComponent component) { 67 | return ModularUtils.getValue(component.getMachineIndex(), component.getBay(), osc); 68 | } 69 | 70 | public void setValue(IModularComponent component, String control, Number value) { 71 | ModularUtils.setValue(component.getMachineIndex(), component.getBay(), control, value); 72 | } 73 | 74 | @Override 75 | public String toString() { 76 | return name; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/patch/modular/ModularPanel.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.machine.patch.modular; 21 | 22 | import com.teotigraphix.caustk.node.machine.Machine; 23 | 24 | /** 25 | * @author Michael Schmalle 26 | */ 27 | public class ModularPanel extends ModularComponentBase { 28 | 29 | public ModularPanel(Machine machineNode, int bay) { 30 | super(machineNode, 16); 31 | } 32 | 33 | @Override 34 | protected int getNumBays() { 35 | return -1; 36 | } 37 | 38 | @Override 39 | protected void restoreComponents() { 40 | } 41 | 42 | public enum ModularPanelJack implements IModularJack { 43 | 44 | OutNoteCV(0), 45 | 46 | OutVelocity(1), 47 | 48 | OutModulation(2), 49 | 50 | InLeft(0), 51 | 52 | InRight(1), 53 | 54 | InVolumeModulation(2); 55 | 56 | private int value; 57 | 58 | @Override 59 | public final int getValue() { 60 | return value; 61 | } 62 | 63 | ModularPanelJack(int value) { 64 | this.value = value; 65 | } 66 | 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/PreferenceManager.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller; 21 | 22 | import java.util.HashMap; 23 | import java.util.Map; 24 | 25 | import com.badlogic.gdx.Gdx; 26 | import com.badlogic.gdx.Preferences; 27 | import com.google.inject.Singleton; 28 | import com.teotigraphix.caustk.gdx.app.ApplicationComponent; 29 | 30 | @Singleton 31 | public class PreferenceManager extends ApplicationComponent implements IPreferenceManager { 32 | 33 | private Map preferences = new HashMap(); 34 | 35 | public PreferenceManager() { 36 | } 37 | 38 | @Override 39 | public final Preferences get(String name) { 40 | Preferences instance = preferences.get(name); 41 | if (instance == null) { 42 | instance = Gdx.app.getPreferences(name); 43 | preferences.put(name, instance); 44 | } 45 | return instance; 46 | } 47 | 48 | @Override 49 | public final void save() { 50 | for (Preferences preference : preferences.values()) { 51 | preference.flush(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/app/ActionBarBase.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.scene2d.ui.app; 3 | 4 | import com.badlogic.gdx.scenes.scene2d.Actor; 5 | import com.badlogic.gdx.scenes.scene2d.InputEvent; 6 | import com.badlogic.gdx.scenes.scene2d.ui.Image; 7 | import com.badlogic.gdx.scenes.scene2d.ui.Skin; 8 | import com.badlogic.gdx.scenes.scene2d.ui.Table; 9 | import com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener; 10 | import com.badlogic.gdx.utils.Pools; 11 | import com.teotigraphix.caustk.gdx.app.ui.StylesDefault; 12 | import com.teotigraphix.caustk.gdx.scene2d.ui.UITable; 13 | import com.teotigraphix.caustk.gdx.scene2d.ui.app.ActionBarListener.ActionBarEvent; 14 | import com.teotigraphix.caustk.gdx.scene2d.ui.app.ActionBarListener.ActionBarEventKind; 15 | 16 | public abstract class ActionBarBase extends UITable { 17 | 18 | private Actor backButton; 19 | 20 | private Table toolBar; 21 | 22 | public ActionBarBase(Skin skin) { 23 | super(skin); 24 | } 25 | 26 | @Override 27 | protected void createChildren() { 28 | toolBar = createToolBar(); 29 | add(toolBar).expandX().fillX().height(80f); 30 | 31 | backButton = createBackButton(); 32 | add(backButton).size(80f, 80f); 33 | } 34 | 35 | protected abstract Table createToolBar(); 36 | 37 | protected Actor createBackButton() { 38 | Image button = new Image(getSkin().getDrawable(StylesDefault.BackButton_image)); 39 | button.addListener(new ActorGestureListener() { 40 | @Override 41 | public void tap(InputEvent event, float x, float y, int count, int button) { 42 | ActionBarEvent e = Pools.obtain(ActionBarEvent.class); 43 | e.setKind(ActionBarEventKind.BackTap); 44 | fire(e); 45 | Pools.free(e); 46 | } 47 | }); 48 | return button; 49 | } 50 | 51 | // public static interface IActionBarActionn { 52 | // void exectute(ProjectModelImpl projectModel) throws Exception; 53 | // } 54 | } 55 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/effect/EffectType.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.effect; 21 | 22 | /** 23 | * @author Michael Schmalle 24 | * @since 1.0 25 | */ 26 | public enum EffectType { 27 | 28 | Delay(0), 29 | 30 | Reverb(1), 31 | 32 | Distortion(2), 33 | 34 | Compressor(3), 35 | 36 | Bitcrusher(4), 37 | 38 | Flanger(5), 39 | 40 | Phaser(6), 41 | 42 | Chorus(7), 43 | 44 | Autowah(8), 45 | 46 | ParametricEQ(9), 47 | 48 | Limiter(10), 49 | 50 | VinylSimulator(11), 51 | 52 | CombFilter(12), 53 | 54 | // MasterDelay(13), // Not Insert 55 | 56 | CabinetSimulator(14), 57 | 58 | // TranceGate(15), // Not Insert 59 | 60 | StaticFlanger(16), 61 | 62 | MultiFilter(17); 63 | 64 | private int value; 65 | 66 | EffectType(int value) { 67 | this.value = value; 68 | } 69 | 70 | public int getValue() { 71 | return value; 72 | } 73 | 74 | public static EffectType fromInt(Integer type) { 75 | for (EffectType result : values()) { 76 | if (result.getValue() == type) 77 | return result; 78 | } 79 | return null; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/ui/ISceneComponent.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.ui; 21 | 22 | import com.teotigraphix.caustk.gdx.app.IApplication; 23 | 24 | /** 25 | * The {@link ISceneComponent} is registered with a 26 | * {@link com.teotigraphix.caustk.gdx.app.ui.Scene} to mediate its views. 27 | * 28 | * @author Michael Schmalle 29 | * @since 1.0 30 | */ 31 | public interface ISceneComponent { 32 | 33 | /** 34 | * Returns the component's 35 | * {@link com.teotigraphix.caustk.gdx.app.IApplication} application. 36 | */ 37 | IApplication getApplication(); 38 | 39 | /** 40 | * Returns the {@link com.teotigraphix.caustk.gdx.app.ui.IScene} this component 41 | * is attached to. 42 | */ 43 | IScene getScene(); 44 | 45 | /** 46 | * Awake is called when the behavior is being loaded. 47 | *

48 | * The {@link ISceneComponent#getScene()} is guaranteed to be non 49 | * null. 50 | *

51 | * Add global/application event listeners. 52 | */ 53 | void onAwake(); 54 | 55 | /** 56 | * Destroy is called when the component instance will be destroyed. 57 | */ 58 | void onDestroy(); 59 | } 60 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/PopUp.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.ui.Label; 23 | import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle; 24 | import com.badlogic.gdx.scenes.scene2d.ui.Skin; 25 | 26 | public class PopUp extends DialogBase { 27 | 28 | private String title; 29 | 30 | public PopUp(String title, Skin skin) { 31 | super("", skin); 32 | this.title = title; 33 | createChildren(); 34 | } 35 | 36 | public PopUp(String title, Skin skin, WindowStyle windowStyle) { 37 | super("", skin, windowStyle); 38 | this.title = title; 39 | createChildren(); 40 | } 41 | 42 | public PopUp(String title, Skin skin, String windowStyleName) { 43 | super("", skin, windowStyleName); 44 | this.title = title; 45 | createChildren(); 46 | } 47 | 48 | protected void createChildren() { 49 | debug(); 50 | Label label = new Label(title, new LabelStyle(getStyle().titleFont, 51 | getStyle().titleFontColor)); 52 | getContentTable().add(label).pad(4f).expandX().fillX(); 53 | getContentTable().row(); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/command/IUndoCommand.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller.command; 21 | 22 | public interface IUndoCommand extends ICommand { 23 | 24 | String getLabel(); 25 | 26 | /** 27 | * Reverse the performed action 28 | * 29 | * @throws CommandExecutionException An exception occurred during undo. 30 | */ 31 | void undo() throws CommandExecutionException; 32 | 33 | boolean isCanceled(); 34 | 35 | void cancel(); 36 | 37 | public static class CommandEvent { 38 | 39 | public IUndoCommand command; 40 | 41 | public CommandEvent(IUndoCommand command) { 42 | this.command = command; 43 | } 44 | } 45 | 46 | public static class OnExecuteComplete extends CommandEvent { 47 | public OnExecuteComplete(IUndoCommand command) { 48 | super(command); 49 | } 50 | } 51 | 52 | public static class OnUndoExecuteComplete extends CommandEvent { 53 | public OnUndoExecuteComplete(IUndoCommand command) { 54 | super(command); 55 | } 56 | } 57 | 58 | public static class OnExecuteCanceled extends CommandEvent { 59 | public OnExecuteCanceled(IUndoCommand command) { 60 | super(command); 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/importer/CausticItem.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.importer; 21 | 22 | import com.teotigraphix.caustk.groove.library.LibraryProductItem; 23 | import com.teotigraphix.caustk.groove.manifest.LibraryItemManifest; 24 | 25 | public abstract class CausticItem { 26 | 27 | private transient boolean export; 28 | 29 | private transient LibraryItemManifest manifest; 30 | 31 | private String path; 32 | 33 | private String displayName; 34 | 35 | public LibraryItemManifest getManifest() { 36 | return manifest; 37 | } 38 | 39 | public void setManifest(LibraryItemManifest manifest) { 40 | this.manifest = manifest; 41 | } 42 | 43 | public String getDisplayName() { 44 | return displayName; 45 | } 46 | 47 | public boolean isExport() { 48 | return export; 49 | } 50 | 51 | public String getPath() { 52 | return path; 53 | } 54 | 55 | public CausticItem(String path, String displayName) { 56 | this.path = path; 57 | this.displayName = displayName; 58 | } 59 | 60 | public CausticItem(LibraryProductItem item) { 61 | this.manifest = item.getManifest(); 62 | this.path = item.getRawRelativePath(); 63 | this.displayName = item.getDisplayName(); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/session/ClipInfo.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.session; 21 | 22 | import com.esotericsoftware.kryo.serializers.TaggedFieldSerializer.Tag; 23 | 24 | public class ClipInfo { 25 | 26 | //-------------------------------------------------------------------------- 27 | // Serialized :: Variables 28 | //-------------------------------------------------------------------------- 29 | 30 | @Tag(10) 31 | private String name; 32 | 33 | //-------------------------------------------------------------------------- 34 | // Public API :: Properties 35 | //-------------------------------------------------------------------------- 36 | 37 | //---------------------------------- 38 | // name 39 | //---------------------------------- 40 | 41 | public String getName() { 42 | return name; 43 | } 44 | 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | //-------------------------------------------------------------------------- 50 | // Constructor 51 | //-------------------------------------------------------------------------- 52 | 53 | /** 54 | * Serialized. 55 | */ 56 | ClipInfo() { 57 | } 58 | 59 | public ClipInfo(String name) { 60 | this.name = name; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/session/SceneInfo.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.session; 21 | 22 | import com.esotericsoftware.kryo.serializers.TaggedFieldSerializer.Tag; 23 | 24 | public class SceneInfo { 25 | 26 | //-------------------------------------------------------------------------- 27 | // Serialized :: Variables 28 | //-------------------------------------------------------------------------- 29 | 30 | @Tag(10) 31 | private String name; 32 | 33 | //-------------------------------------------------------------------------- 34 | // Public API :: Properties 35 | //-------------------------------------------------------------------------- 36 | 37 | //---------------------------------- 38 | // name 39 | //---------------------------------- 40 | 41 | public String getName() { 42 | return name; 43 | } 44 | 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | //-------------------------------------------------------------------------- 50 | // Constructor 51 | //-------------------------------------------------------------------------- 52 | 53 | /** 54 | * Serialized. 55 | */ 56 | SceneInfo() { 57 | } 58 | 59 | public SceneInfo(String name) { 60 | this.name = name; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/importer/CausticSound.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.importer; 21 | 22 | import com.teotigraphix.caustk.groove.library.LibrarySound; 23 | import com.teotigraphix.caustk.groove.manifest.LibrarySoundManifest; 24 | 25 | public class CausticSound extends CausticItem { 26 | 27 | private int index; 28 | 29 | private CausticEffect effect; 30 | 31 | private CausticInstrument instrument; 32 | 33 | private CausticPatternBank patternBank; 34 | 35 | @Override 36 | public LibrarySoundManifest getManifest() { 37 | return (LibrarySoundManifest)super.getManifest(); 38 | } 39 | 40 | public int getIndex() { 41 | return index; 42 | } 43 | 44 | public CausticEffect getEffect() { 45 | return effect; 46 | } 47 | 48 | public CausticInstrument getInstrument() { 49 | return instrument; 50 | } 51 | 52 | public CausticPatternBank getPatternBank() { 53 | return patternBank; 54 | } 55 | 56 | public CausticSound(LibrarySound item) { 57 | super(item); 58 | this.index = item.getIndex(); 59 | this.instrument = new CausticInstrument(item.getInstrument()); 60 | this.effect = new CausticEffect(item.getEffect()); 61 | this.patternBank = new CausticPatternBank(item.getPatternBank()); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /Caustk/src/com/badlogic/gdx/scenes/scene2d/ui/ToggleButtonInternal.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.badlogic.gdx.scenes.scene2d.ui; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent; 23 | import com.badlogic.gdx.utils.Pools; 24 | 25 | public class ToggleButtonInternal extends TextButton { 26 | 27 | @Override 28 | public void setChecked(boolean isChecked) { 29 | setChecked(isChecked, true); 30 | } 31 | 32 | @SuppressWarnings("unchecked") 33 | public void setChecked(boolean isChecked, boolean fireEvent) { 34 | if (this.isChecked == isChecked) 35 | return; 36 | if (buttonGroup != null && !buttonGroup.canCheck(this, isChecked)) 37 | return; 38 | this.isChecked = isChecked; 39 | if (fireEvent) { 40 | ChangeEvent changeEvent = Pools.obtain(ChangeEvent.class); 41 | if (fire(changeEvent)) 42 | this.isChecked = !isChecked; 43 | Pools.free(changeEvent); 44 | } 45 | } 46 | 47 | public ToggleButtonInternal(String text, Skin skin) { 48 | super(text, skin); 49 | } 50 | 51 | public ToggleButtonInternal(String text, TextButtonStyle style) { 52 | super(text, style); 53 | } 54 | 55 | public ToggleButtonInternal(String text, Skin skin, String styleName) { 56 | super(text, skin, styleName); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/command/CommandUtils.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller.command; 21 | 22 | public class CommandUtils { 23 | 24 | public static String getString(CommandContext context, int index) { 25 | final OSCMessage message = context.getMessage(); 26 | String result = message.getParameter(index); 27 | return result; 28 | } 29 | 30 | public static Integer getInteger(CommandContext context, int index) { 31 | final OSCMessage message = context.getMessage(); 32 | int result = Integer.valueOf(message.getParameter(index)); 33 | return result; 34 | } 35 | 36 | public static Float getFloat(CommandContext context, int index) { 37 | final OSCMessage message = context.getMessage(); 38 | float result = Float.valueOf(message.getParameter(index)); 39 | return result; 40 | } 41 | 42 | public static boolean getBoolean(CommandContext context, int index) { 43 | final OSCMessage message = context.getMessage(); 44 | String parameter = message.getParameter(index); 45 | if (parameter.equals("true") || parameter.equals("false")) 46 | return Boolean.valueOf(parameter); 47 | final int arg = Integer.valueOf(parameter); 48 | boolean result = (arg == 0) ? false : true; 49 | return result; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/auto/AutoTextKnob.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui.auto; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.Actor; 23 | import com.badlogic.gdx.scenes.scene2d.ui.Skin; 24 | import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; 25 | import com.teotigraphix.caustk.gdx.scene2d.ui.TextKnob; 26 | 27 | public class AutoTextKnob extends AutomationTableBase { 28 | 29 | private TextKnob knob; 30 | 31 | @Override 32 | public float getValue() { 33 | return knob.getValue(); 34 | } 35 | 36 | @Override 37 | public boolean setValue(float value) { 38 | knob.setValue(value); 39 | return true; 40 | } 41 | 42 | public AutoTextKnob(Skin skin, AutomationItem automationItem) { 43 | super(skin, automationItem); 44 | } 45 | 46 | @Override 47 | protected void createChildren() { 48 | super.createChildren(); 49 | AutomationItem item = getAutomationItem(); 50 | knob = new TextKnob(item.getMin(), item.getMax(), 0.01f, 51 | item.getControl().getDisplayName(), getSkin(), "default"); 52 | knob.create(); 53 | knob.addListener(new ChangeListener() { 54 | @Override 55 | public void changed(ChangeEvent event, Actor actor) { 56 | fireChange(); 57 | } 58 | }); 59 | add(knob).expand().fill(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/machine/KSSynthMachine.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node.machine; 21 | 22 | import com.teotigraphix.caustk.node.RackInstance; 23 | 24 | /** 25 | * The Caustic KSSynth OSC decorator. 26 | * 27 | * @author Michael Schmalle 28 | * @since 3.1 29 | */ 30 | public class KSSynthMachine extends Machine { 31 | 32 | //-------------------------------------------------------------------------- 33 | // Constructors 34 | //-------------------------------------------------------------------------- 35 | 36 | /** 37 | * Serialization 38 | */ 39 | public KSSynthMachine() { 40 | } 41 | 42 | public KSSynthMachine(RackInstance rackNode, int index, String name) { 43 | super(rackNode, index, MachineType.KSSynth, name); 44 | } 45 | 46 | //-------------------------------------------------------------------------- 47 | // Overridden Protected :: Methods 48 | //-------------------------------------------------------------------------- 49 | 50 | @Override 51 | protected void intialize() { 52 | super.intialize(); 53 | } 54 | 55 | @Override 56 | protected void createComponents() { 57 | super.createComponents(); 58 | } 59 | 60 | @Override 61 | protected void updateComponents() { 62 | super.updateComponents(); 63 | } 64 | 65 | @Override 66 | protected void restorePresetProperties() { 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/app/ModePaneListener.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui.app; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.Event; 23 | import com.badlogic.gdx.scenes.scene2d.EventListener; 24 | 25 | public abstract class ModePaneListener implements EventListener { 26 | 27 | public ModePaneListener() { 28 | } 29 | 30 | @Override 31 | public boolean handle(Event event) { 32 | if (event instanceof ModePaneEvent) { 33 | ModePaneEvent e = (ModePaneEvent)event; 34 | switch (e.getKind()) { 35 | case selectedIndexChange: 36 | selectedIndexChange(e, e.getIndex()); 37 | break; 38 | } 39 | } 40 | return false; 41 | } 42 | 43 | public abstract void selectedIndexChange(ModePaneEvent event, int index); 44 | 45 | public enum ModePaneEventKind { 46 | selectedIndexChange 47 | } 48 | 49 | public static class ModePaneEvent extends Event { 50 | 51 | private ModePaneEventKind kind; 52 | 53 | private int index; 54 | 55 | public ModePaneEventKind getKind() { 56 | return kind; 57 | } 58 | 59 | public int getIndex() { 60 | return index; 61 | } 62 | 63 | public ModePaneEvent(ModePaneEventKind kind, int index) { 64 | this.kind = kind; 65 | this.index = index; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/DialogBase.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.ui.Dialog; 23 | import com.badlogic.gdx.scenes.scene2d.ui.Skin; 24 | 25 | public abstract class DialogBase extends Dialog { 26 | 27 | private float explicitWidth = -1f; 28 | 29 | public float getExplicitWidth() { 30 | return explicitWidth; 31 | } 32 | 33 | private float explicitHeight = -1f; 34 | 35 | public float getExplicitHeight() { 36 | return explicitHeight; 37 | } 38 | 39 | public void setExplicitSize(float width, float height) { 40 | explicitWidth = width; 41 | explicitHeight = height; 42 | } 43 | 44 | @Override 45 | public float getPrefWidth() { 46 | if (explicitWidth != -1) 47 | return explicitWidth; 48 | return super.getPrefWidth(); 49 | } 50 | 51 | @Override 52 | public float getPrefHeight() { 53 | if (explicitHeight != -1) 54 | return explicitHeight; 55 | return super.getPrefHeight(); 56 | } 57 | 58 | public DialogBase(String title, Skin skin) { 59 | super(title, skin); 60 | } 61 | 62 | public DialogBase(String title, Skin skin, WindowStyle windowStyle) { 63 | super(title, windowStyle); 64 | setSkin(skin); 65 | } 66 | 67 | public DialogBase(String title, Skin skin, String windowStyleName) { 68 | super(title, skin, windowStyleName); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/ContextMenu.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.InputEvent; 23 | import com.badlogic.gdx.scenes.scene2d.InputListener; 24 | import com.badlogic.gdx.scenes.scene2d.Stage; 25 | import com.badlogic.gdx.scenes.scene2d.ui.Dialog; 26 | import com.badlogic.gdx.scenes.scene2d.ui.Skin; 27 | import com.badlogic.gdx.utils.Array; 28 | import com.teotigraphix.caustk.gdx.scene2d.ui.MenuBar.MenuItem; 29 | import com.teotigraphix.caustk.gdx.scene2d.ui.MenuRowRenderer.MenuRowRendererStyle; 30 | 31 | public class ContextMenu extends Menu { 32 | 33 | private InputListener stageListener = new InputListener() { 34 | @Override 35 | public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { 36 | hide(); 37 | return false; 38 | } 39 | }; 40 | 41 | public ContextMenu(Array menuItems, WindowStyle windowStyle, 42 | MenuRowRendererStyle menuRowRendererStyle, Skin skin) { 43 | super(menuItems, windowStyle, menuRowRendererStyle, skin); 44 | } 45 | 46 | @Override 47 | public Dialog show(Stage stage) { 48 | stage.addListener(stageListener); 49 | return super.show(stage); 50 | } 51 | 52 | @Override 53 | public void hide() { 54 | Stage stage = getStage(); 55 | if (stage != null) 56 | getStage().removeListener(stageListener); 57 | super.hide(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/AbstractProjectModelAPI.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.app; 3 | 4 | import com.teotigraphix.caustk.core.ICaustkLogger; 5 | import com.teotigraphix.caustk.core.ICaustkRack; 6 | import com.teotigraphix.caustk.core.internal.CaustkRuntime; 7 | import com.teotigraphix.caustk.gdx.app.controller.IFileManager; 8 | import com.teotigraphix.caustk.gdx.app.controller.IFileModel; 9 | import com.teotigraphix.caustk.gdx.app.controller.command.ICommandManager; 10 | import com.teotigraphix.caustk.node.RackInstance; 11 | 12 | public abstract class AbstractProjectModelAPI { 13 | 14 | private CaustkApplication application; 15 | 16 | private ProjectModel projectModel; 17 | 18 | protected ProjectModel getProjectModel() { 19 | return projectModel; 20 | } 21 | 22 | public AbstractProjectModelAPI(ProjectModel projectModel) { 23 | this.projectModel = projectModel; 24 | } 25 | 26 | protected final CaustkApplication getApplication() { 27 | if (application == null) 28 | application = (CaustkApplication)CaustkRuntime.getInstance().getApplication(); 29 | return application; 30 | } 31 | 32 | protected IApplicationStateHandlers getApplicationStates() { 33 | return getApplication().getApplicationStates(); 34 | } 35 | 36 | protected final ICaustkLogger getLogger() { 37 | return getApplication().getLogger(); 38 | } 39 | 40 | protected ICaustkRack getRack() { 41 | return projectModel.getProject().getRack(); 42 | } 43 | 44 | protected RackInstance getRackInstance() { 45 | return projectModel.getProject().getRackInstance(); 46 | } 47 | 48 | protected ProjectProperties getProperties() { 49 | return projectModel.getProperties(); 50 | } 51 | 52 | protected IFileManager getFileManager() { 53 | return getApplication().getFileManager(); 54 | } 55 | 56 | protected IFileModel getFileModel() { 57 | return getApplication().getFileModel(); 58 | } 59 | 60 | protected void post(Object event) { 61 | projectModel.getEventBus().post(event); 62 | } 63 | 64 | // protected Project getProject() { 65 | // return projectModel.getProject(); 66 | // } 67 | 68 | protected final ICommandManager getCommandManager() { 69 | return getApplication().getCommandManager(); 70 | } 71 | 72 | public abstract void restore(ProjectState state); 73 | } 74 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/app/SoundSelectionListener.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui.app; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.Event; 23 | import com.badlogic.gdx.scenes.scene2d.EventListener; 24 | 25 | public abstract class SoundSelectionListener implements EventListener { 26 | 27 | public SoundSelectionListener() { 28 | } 29 | 30 | @Override 31 | public boolean handle(Event event) { 32 | if (event instanceof SoundSelectionEvent) { 33 | SoundSelectionEvent e = (SoundSelectionEvent)event; 34 | switch (e.getKind()) { 35 | case selectedIndexChange: 36 | selectedIndexChange(e, e.getIndex()); 37 | break; 38 | } 39 | } 40 | return false; 41 | } 42 | 43 | public abstract void selectedIndexChange(SoundSelectionEvent event, int index); 44 | 45 | public enum SoundSelectionEventKind { 46 | selectedIndexChange 47 | } 48 | 49 | public static class SoundSelectionEvent extends Event { 50 | 51 | private SoundSelectionEventKind kind; 52 | 53 | private int index; 54 | 55 | public SoundSelectionEventKind getKind() { 56 | return kind; 57 | } 58 | 59 | public int getIndex() { 60 | return index; 61 | } 62 | 63 | public SoundSelectionEvent(SoundSelectionEventKind kind, int index) { 64 | this.kind = kind; 65 | this.index = index; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/app/TopBarListener.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui.app; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.Event; 23 | import com.badlogic.gdx.scenes.scene2d.EventListener; 24 | 25 | public abstract class TopBarListener implements EventListener { 26 | 27 | @Override 28 | public boolean handle(Event event) { 29 | if (event instanceof TopBarEvent) { 30 | TopBarEvent e = (TopBarEvent)event; 31 | switch (e.getKind()) { 32 | case ViewIndexChange: 33 | viewIndexChange(e, e.getIndex()); 34 | break; 35 | } 36 | } 37 | return false; 38 | } 39 | 40 | public abstract void viewIndexChange(TopBarEvent event, int index); 41 | 42 | public enum TopBarEventKind { 43 | ViewIndexChange 44 | } 45 | 46 | public static class TopBarEvent extends Event { 47 | 48 | private TopBarEventKind kind; 49 | 50 | private int index; 51 | 52 | public TopBarEventKind getKind() { 53 | return kind; 54 | } 55 | 56 | public int getIndex() { 57 | return index; 58 | } 59 | 60 | public TopBarEvent(TopBarEventKind kind, int index) { 61 | this.kind = kind; 62 | this.index = index; 63 | } 64 | 65 | @Override 66 | public void reset() { 67 | super.reset(); 68 | kind = null; 69 | index = -1; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/behavior/GrooveBehavior.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.behavior; 21 | 22 | import com.badlogic.gdx.Gdx; 23 | import com.google.common.eventbus.Subscribe; 24 | import com.teotigraphix.caustk.gdx.app.controller.IViewManager.ViewManagerEvent; 25 | import com.teotigraphix.caustk.gdx.app.ui.CaustkBehavior; 26 | 27 | public abstract class GrooveBehavior extends CaustkBehavior { 28 | 29 | public GrooveBehavior() { 30 | } 31 | 32 | @Subscribe 33 | public void onViewManagerEvent(final ViewManagerEvent event) { 34 | Gdx.app.postRunnable(new Runnable() { 35 | @Override 36 | public void run() { 37 | if (getScene() != null) { 38 | redrawView(event.getKind()); 39 | } else { 40 | // XXX This happens when a Scene is disposed and there are 41 | // still Runnable getting executed on the next frame AFTER 42 | // the scene has been deleted 43 | //err(getClass().getName(), event.getKind() 44 | // + "No Scene, Failed in GrooveBehavior.onViewManagerEvent(" 45 | // + "getScene() == null)"); 46 | } 47 | } 48 | }); 49 | } 50 | 51 | /** 52 | * Override in subclass and make kind concrete enum type. 53 | * 54 | * @param kind the project's redraw enum for all its behaviors. 55 | */ 56 | protected abstract void redrawView(Object kind); 57 | } 58 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/utils/groove/LibraryManifestListUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.utils.groove; 3 | 4 | import java.util.ArrayList; 5 | import java.util.Collections; 6 | import java.util.Comparator; 7 | import java.util.List; 8 | 9 | import com.teotigraphix.caustk.groove.manifest.LibraryItemManifest; 10 | 11 | public final class LibraryManifestListUtils { 12 | 13 | public static enum LibraryManifestSortOrder { 14 | DisplayName, Author; 15 | } 16 | 17 | public static void sort(List list, LibraryManifestSortOrder order) { 18 | switch (order) { 19 | case Author: 20 | sortByAuthor(list); 21 | break; 22 | 23 | case DisplayName: 24 | sortByDisplayName(list); 25 | break; 26 | } 27 | } 28 | 29 | public static List getItemsFromTag(List list, 30 | String tag) { 31 | List result = new ArrayList(); 32 | for (LibraryItemManifest manifest : list) { 33 | if (manifest.hasTags() && manifest.hasTag(tag)) 34 | result.add(manifest); 35 | } 36 | return result; 37 | } 38 | 39 | public static List getItemsFromTags(List list, 40 | List tags) { 41 | List result = new ArrayList(); 42 | for (LibraryItemManifest manifest : list) { 43 | if (manifest.hasTags() && manifest.hasTag(tags)) 44 | result.add(manifest); 45 | } 46 | return result; 47 | } 48 | 49 | static void sortByDisplayName(List list) { 50 | Collections.sort(list, new Comparator() { 51 | @Override 52 | public int compare(LibraryItemManifest lhs, LibraryItemManifest rhs) { 53 | return lhs.getDisplayName().compareTo(rhs.getDisplayName()); 54 | } 55 | }); 56 | } 57 | 58 | static void sortByAuthor(List list) { 59 | Collections.sort(list, new Comparator() { 60 | @Override 61 | public int compare(LibraryItemManifest lhs, LibraryItemManifest rhs) { 62 | return lhs.getAuthor().compareTo(rhs.getAuthor()); 63 | } 64 | }); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/node/ICaustkNode.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.node; 21 | 22 | /** 23 | * The base node API for all caustk node types in the nodes 24 | * package. 25 | * 26 | * @author Michael Schmalle 27 | * @since 1.0 28 | */ 29 | public interface ICaustkNode { 30 | 31 | //-------------------------------------------------------------------------- 32 | // Public API :: Properties 33 | //-------------------------------------------------------------------------- 34 | 35 | /** 36 | * The node's display label, this human readable name would be different 37 | * than a machine readable name. 38 | */ 39 | String getLabel(); 40 | 41 | //-------------------------------------------------------------------------- 42 | // Public API :: Methods 43 | //-------------------------------------------------------------------------- 44 | 45 | /** 46 | * Creates all node components. 47 | * 48 | * @see #createComponents() 49 | */ 50 | void create(); 51 | 52 | /** 53 | * Destroys all node components. 54 | * 55 | * @see #destroyComponents() 56 | */ 57 | void destroy(); 58 | 59 | /** 60 | * Updates the native rack state from the current state of the rack 61 | * instance. 62 | * 63 | * @see #updateComponents() 64 | */ 65 | void update(); 66 | 67 | /** 68 | * Restores all node component states from the native rack state. 69 | * 70 | * @see #restoreComponents() 71 | */ 72 | void restore(); 73 | } 74 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/manifest/LibraryPatternBankManifest.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.manifest; 21 | 22 | import com.esotericsoftware.kryo.serializers.TaggedFieldSerializer.Tag; 23 | import com.teotigraphix.caustk.groove.library.LibraryItemFormat; 24 | import com.teotigraphix.caustk.node.machine.MachineType; 25 | 26 | /** 27 | * @author Michael Schmalle 28 | * @since 1.0 29 | */ 30 | public class LibraryPatternBankManifest extends LibraryItemManifest { 31 | 32 | //-------------------------------------------------------------------------- 33 | // Serialized API 34 | //-------------------------------------------------------------------------- 35 | 36 | @Tag(100) 37 | private MachineType machineType; 38 | 39 | public MachineType getMachineType() { 40 | return machineType; 41 | } 42 | 43 | public void setMachineType(MachineType machineType) { 44 | this.machineType = machineType; 45 | } 46 | 47 | @Override 48 | public String getCalculatedPath() { 49 | return machineType.name() + "/" + super.getRelativePath(); 50 | } 51 | 52 | //-------------------------------------------------------------------------- 53 | // Constructors 54 | //-------------------------------------------------------------------------- 55 | 56 | /** 57 | * Serialization. 58 | */ 59 | LibraryPatternBankManifest() { 60 | } 61 | 62 | public LibraryPatternBankManifest(String name, String relativePath) { 63 | super(LibraryItemFormat.PatternBank, name, relativePath); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/PaneStackListener.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.Event; 23 | import com.badlogic.gdx.scenes.scene2d.EventListener; 24 | 25 | public abstract class PaneStackListener implements EventListener { 26 | 27 | public PaneStackListener() { 28 | } 29 | 30 | @Override 31 | public boolean handle(Event event) { 32 | if (event instanceof PaneStackEvent) { 33 | PaneStackEvent e = (PaneStackEvent)event; 34 | selecteIndexChange(e, e.getIndex()); 35 | } 36 | return false; 37 | } 38 | 39 | public abstract void selecteIndexChange(PaneStackEvent event, int index); 40 | 41 | public enum PaneStackEventKind { 42 | SelectedIndexChange 43 | } 44 | 45 | public static class PaneStackEvent extends Event { 46 | 47 | private PaneStackEventKind kind; 48 | 49 | private int index; 50 | 51 | @Override 52 | public PaneStack getTarget() { 53 | return (PaneStack)super.getTarget(); 54 | } 55 | 56 | public PaneStackEventKind getKind() { 57 | return kind; 58 | } 59 | 60 | public int getIndex() { 61 | return index; 62 | } 63 | 64 | public PaneStackEvent(PaneStackEventKind kind, int index) { 65 | this.kind = kind; 66 | this.index = index; 67 | } 68 | 69 | @Override 70 | public void reset() { 71 | super.reset(); 72 | kind = null; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/IDialogManager.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller; 21 | 22 | import com.badlogic.gdx.math.Vector2; 23 | import com.badlogic.gdx.scenes.scene2d.Actor; 24 | import com.badlogic.gdx.scenes.scene2d.ui.Dialog; 25 | import com.teotigraphix.caustk.gdx.app.ui.ICaustkScene; 26 | import com.teotigraphix.caustk.gdx.app.ui.IScene; 27 | import com.teotigraphix.caustk.gdx.scene2d.ui.AlertDialog; 28 | import com.teotigraphix.caustk.gdx.scene2d.ui.ListDialog; 29 | import com.teotigraphix.caustk.gdx.scene2d.ui.PopUp; 30 | 31 | public interface IDialogManager { 32 | 33 | AlertDialog createAlert(IScene scene, String title, Actor actor); 34 | 35 | // 36 | // ListDialog createListDialog(String title, Object[] items, float width, float height); 37 | 38 | ListDialog createListDialog(IScene scene, String title, Object[] items, float width, 39 | float height); 40 | 41 | // 42 | // ContextMenu createContextMenu(Object[] items); 43 | 44 | PopUp createPopUp(ICaustkScene scene, String title, Actor actor); 45 | 46 | PopUp createModalPopUp(ICaustkScene scene, String title, Actor actor); 47 | 48 | void createToast(ICaustkScene scene, String message, float duration); 49 | 50 | /** 51 | * @param scene 52 | * @param dialog 53 | * @param point 54 | */ 55 | void show(ICaustkScene scene, Dialog dialog, Vector2 point); 56 | 57 | /** 58 | * Shows the dialog centered on the Stage. 59 | * 60 | * @param dialog 61 | */ 62 | void show(ICaustkScene scene, Dialog dialog); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/ColorPickerListener.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.Event; 23 | import com.badlogic.gdx.scenes.scene2d.EventListener; 24 | import com.teotigraphix.caustk.gdx.app.controller.view.GrooveColor; 25 | 26 | public abstract class ColorPickerListener implements EventListener { 27 | 28 | public ColorPickerListener() { 29 | } 30 | 31 | @Override 32 | public boolean handle(Event event) { 33 | if (event instanceof ColorPickerEvent) { 34 | ColorPickerEvent e = (ColorPickerEvent)event; 35 | switch (e.getKind()) { 36 | case ColorChange: 37 | colorChange(e, e.getColor()); 38 | break; 39 | } 40 | return false; 41 | } 42 | return false; 43 | } 44 | 45 | public abstract void colorChange(ColorPickerEvent event, GrooveColor color); 46 | 47 | public enum ColorPickerEventKind { 48 | ColorChange 49 | } 50 | 51 | public static class ColorPickerEvent extends Event { 52 | 53 | private ColorPickerEventKind kind; 54 | 55 | private GrooveColor color; 56 | 57 | public ColorPickerEventKind getKind() { 58 | return kind; 59 | } 60 | 61 | public GrooveColor getColor() { 62 | return color; 63 | } 64 | 65 | public ColorPickerEvent(ColorPickerEventKind kind, GrooveColor colors) { 66 | this.kind = kind; 67 | this.color = colors; 68 | } 69 | 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/core/ICausticEngine.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2011 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.core; 21 | 22 | import com.singlecellsoftware.causticcore.CausticCore; 23 | 24 | /** 25 | * The {@link ICausticEngine} API is the basic interface that communicates with 26 | * the {@link CausticCore} using OSC String messages. 27 | *

28 | * Any core application must call the lifecycle event methods on the core 29 | * instance to enable, disable the audio thread. 30 | * 31 | * @author Michael Schmalle 32 | * @copyright Teoti Graphix, LLC 33 | * @since 1.0 34 | */ 35 | public interface ICausticEngine { 36 | 37 | /** 38 | * Sends an OSC message to the {@link CausticCore}. 39 | *

40 | * This method is the fastest way to send a message to the Caustic core. 41 | * 42 | * @param message The String OSC message. 43 | * @return A float value if the message returns a value, otherwise NaN. 44 | * @since 1.0 45 | */ 46 | float sendMessage(String message); 47 | 48 | /** 49 | * Queries an OSC message from the Caustic core. 50 | * 51 | * @param message The String OSC message. 52 | * @return A String message or null if the message returned and 53 | * never an empty String "". 54 | * @since 1.0 55 | */ 56 | String queryMessage(String message); 57 | 58 | // Lifesycle 59 | 60 | void onStart(); 61 | 62 | void onResume(); 63 | 64 | void onPause(); 65 | 66 | void onStop(); 67 | 68 | void onDestroy(); 69 | 70 | void onRestart(); 71 | 72 | void onDispose(); 73 | } 74 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/ListDialog.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui; 21 | 22 | import com.badlogic.gdx.scenes.scene2d.Actor; 23 | import com.badlogic.gdx.scenes.scene2d.ui.List; 24 | import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; 25 | import com.badlogic.gdx.scenes.scene2d.ui.Skin; 26 | import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; 27 | 28 | @SuppressWarnings({ 29 | "unchecked", "rawtypes" 30 | }) 31 | public class ListDialog extends AlertDialog { 32 | 33 | List list; 34 | 35 | Object[] items; 36 | 37 | public Object[] getItems() { 38 | return items; 39 | } 40 | 41 | public int getSelectedIndex() { 42 | return list.getSelectedIndex(); 43 | } 44 | 45 | public void setItems(Object[] items) { 46 | //debug(); 47 | this.items = items; 48 | list = new List(getSkin()); 49 | list.addListener(new ChangeListener() { 50 | @Override 51 | public void changed(ChangeEvent event, Actor actor) { 52 | } 53 | }); 54 | list.setItems(items); 55 | 56 | ScrollPane pane = new ScrollPane(list, getSkin()); 57 | pane.setOverscroll(false, false); 58 | setContent(pane); 59 | } 60 | 61 | public ListDialog(String title, Skin skin) { 62 | super(title, skin); 63 | } 64 | 65 | public ListDialog(String title, Skin skin, WindowStyle windowStyle) { 66 | super(title, skin, windowStyle); 67 | } 68 | 69 | @Override 70 | protected void createChildren() { 71 | super.createChildren(); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/ICaustkApplication.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2013 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app; 21 | 22 | import com.teotigraphix.caustk.core.ICaustkLogger; 23 | import com.teotigraphix.caustk.gdx.app.ui.ICaustkScene; 24 | 25 | /** 26 | * The {@link ICaustkApplication} API is the top level container for all user 27 | * interface and Caustic Core logic. 28 | * 29 | * @author Michael Schmalle 30 | * @since 1.0 31 | */ 32 | public interface ICaustkApplication extends IApplication { 33 | 34 | IProjectModel getProjectModel(); 35 | 36 | /** 37 | * Returns the application logger. 38 | */ 39 | ICaustkLogger getLogger(); 40 | 41 | /** 42 | * Returns the current scene. 43 | */ 44 | @Override 45 | ICaustkScene getScene(); 46 | 47 | /** 48 | * Sets the current scene. 49 | *

50 | * Will be created and shown on the next frame render. 51 | * 52 | * @param sceneId The scene id. 53 | */ 54 | @Override 55 | void setScene(int sceneId); 56 | 57 | /** 58 | * Starts the inital scene of the application. 59 | */ 60 | void startScene(); 61 | 62 | /** 63 | * Whether the current scene id matches the argument passed. 64 | * 65 | * @param sceneId The scene id to test against the current scene's id. 66 | */ 67 | @Override 68 | boolean isCurrentScene(int sceneId); 69 | 70 | //-------------------------------------------------------------------------- 71 | // Events 72 | //-------------------------------------------------------------------------- 73 | 74 | void onSceneChange(ICaustkScene scene); 75 | 76 | } 77 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/IFileManager.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller; 21 | 22 | import java.io.File; 23 | import java.io.IOException; 24 | 25 | import com.badlogic.gdx.utils.Array; 26 | import com.teotigraphix.caustk.gdx.app.Project; 27 | import com.teotigraphix.caustk.node.machine.sequencer.PatternNode; 28 | 29 | public interface IFileManager { 30 | 31 | void setupApplicationDirectory(); 32 | 33 | void setStartupProject(Project project); 34 | 35 | File getProjectsDirectory(); 36 | 37 | String getNextProjectName(); 38 | 39 | Project createOrLoadStartupProject() throws IOException; 40 | 41 | /** 42 | * Creates a new Project. 43 | * 44 | * @param projectLocation The directory location where the getName() is used 45 | * to create the base project directory. 46 | * @throws java.io.IOException 47 | */ 48 | Project createProject(File projectLocation) throws IOException; 49 | 50 | /** 51 | * Loads an existing Project. 52 | * 53 | * @param projectFile The .prj file held within the same named directory. 54 | * @throws java.io.IOException 55 | */ 56 | Project loadProject(File projectFile) throws IOException; 57 | 58 | /** 59 | * Reads a project file from a serialized state, no rack loading occurs. 60 | * 61 | * @param projectFile 62 | * @throws java.io.IOException 63 | */ 64 | Project readProject(File projectFile) throws IOException; 65 | 66 | Array exportPatternStems(String exportName, Array patterns) 67 | throws IOException; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/model/song/ISongFileCollection.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.gdx.app.model.song; 3 | 4 | import java.io.File; 5 | import java.util.Collection; 6 | 7 | import com.google.common.eventbus.EventBus; 8 | 9 | public interface ISongFileCollection { 10 | 11 | Collection getSources(); 12 | 13 | /** 14 | * Returns all files held in each {@link SongFileSource}, in no particular 15 | * order. 16 | */ 17 | Collection getFiles(); 18 | 19 | EventBus getEventBus(); 20 | 21 | SongFileSource addSourceDirectory(File sourceDirectory, boolean recursive); 22 | 23 | SongFileSource removeSourceDirectory(File sourceDirectory); 24 | 25 | void reset(); 26 | 27 | public static enum SongFileCollectionEventKind { 28 | 29 | SourceDirectoryChange, 30 | 31 | SelectedFilesChange, 32 | 33 | UI_FilesChange, 34 | 35 | Action_FileLoadStart, 36 | 37 | Action_FileLoadUpdate, 38 | 39 | /** 40 | * @see SongFileCollectionEvent#getSource() 41 | */ 42 | Action_SourceLoadComplete, 43 | 44 | SourceDirectoryAdd, 45 | 46 | SourceDirectoryRemove, 47 | } 48 | 49 | public static class SongFileCollectionEvent { 50 | 51 | private SongFileCollectionEventKind kind; 52 | 53 | private File file; 54 | 55 | private Collection songFiles; 56 | 57 | private SongFileSource source; 58 | 59 | public File getFile() { 60 | return file; 61 | } 62 | 63 | public Collection getSongFiles() { 64 | return songFiles; 65 | } 66 | 67 | public SongFileCollectionEventKind getKind() { 68 | return kind; 69 | } 70 | 71 | public SongFileSource getSource() { 72 | return source; 73 | } 74 | 75 | public SongFileCollectionEvent(SongFileCollectionEventKind kind) { 76 | this.kind = kind; 77 | } 78 | 79 | public SongFileCollectionEvent(SongFileCollectionEventKind kind, File file) { 80 | this.kind = kind; 81 | this.file = file; 82 | } 83 | 84 | public SongFileCollectionEvent(SongFileCollectionEventKind kind, 85 | Collection songFiles) { 86 | this.kind = kind; 87 | this.songFiles = songFiles; 88 | } 89 | 90 | public SongFileCollectionEvent(SongFileCollectionEventKind kind, SongFileSource source) { 91 | this.kind = kind; 92 | this.source = source; 93 | } 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/utils/groove/LibraryPatternBankUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.teotigraphix.caustk.utils.groove; 3 | 4 | import java.io.File; 5 | import java.io.IOException; 6 | 7 | import org.apache.commons.io.FileUtils; 8 | 9 | import com.teotigraphix.caustk.core.CausticException; 10 | import com.teotigraphix.caustk.core.ICaustkSerializer; 11 | import com.teotigraphix.caustk.core.internal.CaustkRuntime; 12 | import com.teotigraphix.caustk.groove.importer.CausticPatternBank; 13 | import com.teotigraphix.caustk.groove.library.LibraryPatternBank; 14 | import com.teotigraphix.caustk.groove.library.LibraryProduct; 15 | import com.teotigraphix.caustk.utils.core.SerializeUtils; 16 | import com.teotigraphix.caustk.utils.core.ZipUncompress; 17 | import com.thoughtworks.xstream.XStream; 18 | 19 | public final class LibraryPatternBankUtils { 20 | 21 | private static ICaustkSerializer getSerializer() { 22 | return CaustkRuntime.getInstance().getRack().getSerializer(); 23 | } 24 | 25 | public static void configureXStream(XStream xstream) { 26 | xstream.alias("patterns", CausticPatternBank.class); 27 | } 28 | 29 | public static void serialize(LibraryPatternBank item, LibraryProduct product, File tempDirectory) 30 | throws IOException { 31 | FileUtils.writeStringToFile(new File(tempDirectory, LibraryProductUtils.MANIFEST_XML), 32 | LibraryProductUtils.toPatternBankXML(item)); 33 | getSerializer().serialize(new File(tempDirectory, LibraryProductUtils.PATTERNS_BIN), item); 34 | } 35 | 36 | public static LibraryPatternBank importPatternBankFromSoundDirectory(File soundDirectory) 37 | throws CausticException, IOException { 38 | File uncompressDirectory = new File(soundDirectory, LibraryProductUtils.SOUND_PATTERNS_DIR); 39 | File patternsFile = new File(soundDirectory, LibraryProductUtils.SOUND_PATTERNS_ARCHIVE); 40 | return importPatternBank(uncompressDirectory, patternsFile); 41 | } 42 | 43 | public static LibraryPatternBank importPatternBank(File uncompressDirectory, File patternFile) 44 | throws CausticException, IOException { 45 | ZipUncompress uncompress = new ZipUncompress(patternFile); 46 | uncompress.unzip(uncompressDirectory); 47 | 48 | File manifest = new File(uncompressDirectory, LibraryProductUtils.PATTERNS_BIN); 49 | if (!manifest.exists()) 50 | throw new CausticException(LibraryProductUtils.PATTERNS_BIN + " does not exist"); 51 | 52 | LibraryPatternBank instance = SerializeUtils.unpack(manifest, LibraryPatternBank.class); 53 | return instance; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/browser/BrowserModel.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.browser; 21 | 22 | import java.util.Collection; 23 | 24 | import com.teotigraphix.caustk.groove.importer.LibraryProductImporter; 25 | import com.teotigraphix.caustk.groove.library.GrooveLibrary; 26 | import com.teotigraphix.caustk.groove.library.LibraryEffect; 27 | import com.teotigraphix.caustk.groove.library.LibraryGroup; 28 | import com.teotigraphix.caustk.groove.library.LibraryInstrument; 29 | import com.teotigraphix.caustk.groove.library.LibrarySample; 30 | import com.teotigraphix.caustk.groove.library.LibrarySound; 31 | 32 | @SuppressWarnings("unused") 33 | public class BrowserModel { 34 | 35 | private GrooveLibrary library; 36 | 37 | private LibraryProductImporter importer; 38 | 39 | private BrowserBank bank = BrowserBank.Factory; 40 | 41 | public BrowserModel(GrooveLibrary library, LibraryProductImporter importer) { 42 | this.library = library; 43 | this.importer = importer; 44 | } 45 | 46 | // public Collection getAllProjects() { 47 | // return library.getProjects(); 48 | // } 49 | 50 | public Collection getAllGroups() { 51 | return library.getGroups(); 52 | } 53 | 54 | public Collection getAllSounds() { 55 | return library.getSounds(); 56 | } 57 | 58 | public Collection getAllInstruments() { 59 | return library.getInstruments(); 60 | } 61 | 62 | public Collection getAllEffects() { 63 | return library.getEffects(); 64 | } 65 | 66 | public Collection getAllSamples() { 67 | return library.getSamples(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/groove/app/GrooveApplicationComponents.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.groove.app; 21 | 22 | import com.google.inject.Binder; 23 | import com.google.inject.Module; 24 | import com.google.inject.Singleton; 25 | import com.teotigraphix.caustk.gdx.app.controller.DialogManager; 26 | import com.teotigraphix.caustk.gdx.app.controller.FileManager; 27 | import com.teotigraphix.caustk.gdx.app.controller.FileModel; 28 | import com.teotigraphix.caustk.gdx.app.controller.IDialogManager; 29 | import com.teotigraphix.caustk.gdx.app.controller.IFileManager; 30 | import com.teotigraphix.caustk.gdx.app.controller.IFileModel; 31 | import com.teotigraphix.caustk.gdx.app.controller.IPreferenceManager; 32 | import com.teotigraphix.caustk.gdx.app.controller.PreferenceManager; 33 | import com.teotigraphix.caustk.gdx.app.controller.command.CommandManager; 34 | import com.teotigraphix.caustk.gdx.app.controller.command.ICommandManager; 35 | import com.teotigraphix.caustk.gdx.app.ui.ContainerMap; 36 | import com.teotigraphix.caustk.gdx.app.ui.IContainerMap; 37 | 38 | public class GrooveApplicationComponents implements Module { 39 | 40 | @Override 41 | public void configure(Binder binder) { 42 | binder.bind(ICommandManager.class).to(CommandManager.class).in(Singleton.class); 43 | binder.bind(IDialogManager.class).to(DialogManager.class).in(Singleton.class); 44 | binder.bind(IFileModel.class).to(FileModel.class).in(Singleton.class); 45 | binder.bind(IFileManager.class).to(FileManager.class).in(Singleton.class); 46 | binder.bind(IPreferenceManager.class).to(PreferenceManager.class).in(Singleton.class); 47 | binder.bind(IContainerMap.class).to(ContainerMap.class).in(Singleton.class); 48 | 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/auto/AutoTextSlider.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui.auto; 21 | 22 | import com.badlogic.gdx.graphics.g2d.Batch; 23 | import com.badlogic.gdx.scenes.scene2d.Actor; 24 | import com.badlogic.gdx.scenes.scene2d.ui.Skin; 25 | import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; 26 | import com.teotigraphix.caustk.gdx.app.ui.StylesDefault; 27 | import com.teotigraphix.caustk.gdx.scene2d.ui.TextSlider; 28 | 29 | public class AutoTextSlider extends AutomationTableBase { 30 | 31 | private TextSlider slider; 32 | 33 | @Override 34 | public float getValue() { 35 | return slider.getValue(); 36 | } 37 | 38 | @Override 39 | public boolean setValue(float value) { 40 | slider.setValue(value); 41 | return true; 42 | } 43 | 44 | public AutoTextSlider(Skin skin, AutomationItem automationItem) { 45 | super(skin, automationItem); 46 | } 47 | 48 | @Override 49 | protected void createChildren() { 50 | super.createChildren(); 51 | AutomationItem item = getAutomationItem(); 52 | slider = new TextSlider(item.getLabel(), item.getMin(), item.getMax(), item.getStep(), 53 | true, getSkin()); 54 | slider.create(StylesDefault.TextSlider_Veritical); 55 | slider.addListener(new ChangeListener() { 56 | @Override 57 | public void changed(ChangeEvent event, Actor actor) { 58 | fireChange(); 59 | } 60 | }); 61 | add(slider).expand().fill(); 62 | } 63 | 64 | @Override 65 | public void draw(Batch batch, float parentAlpha) { 66 | slider.setColor(getColor()); 67 | super.draw(batch, parentAlpha); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/app/controller/FileRequest.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.app.controller; 21 | 22 | import java.io.File; 23 | 24 | import com.badlogic.gdx.math.Rectangle; 25 | 26 | public class FileRequest { 27 | 28 | private Object id; 29 | 30 | private File root; 31 | 32 | private File location; 33 | 34 | private String[] filter; 35 | 36 | private Rectangle rectangle; 37 | 38 | private File file; 39 | 40 | private String title; 41 | 42 | private Object data; 43 | 44 | public Object getId() { 45 | return id; 46 | } 47 | 48 | public String getTitle() { 49 | return title; 50 | } 51 | 52 | public File getRoot() { 53 | return root; 54 | } 55 | 56 | public File getLocation() { 57 | return location; 58 | } 59 | 60 | public String[] getFilter() { 61 | return filter; 62 | } 63 | 64 | public Rectangle getRectangle() { 65 | return rectangle; 66 | } 67 | 68 | public File getFile() { 69 | return file; 70 | } 71 | 72 | public void setFile(File file) { 73 | this.file = file; 74 | } 75 | 76 | /** 77 | * Extra data needed for the operation (per call unique). 78 | */ 79 | public Object getData() { 80 | return data; 81 | } 82 | 83 | public void setData(Object data) { 84 | this.data = data; 85 | } 86 | 87 | public FileRequest(Object id, String title, File root, File location, String[] filter, 88 | Rectangle rectangle) { 89 | this.id = id; 90 | this.title = title; 91 | this.root = root; 92 | this.location = location; 93 | this.filter = filter; 94 | this.rectangle = rectangle; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/gdx/scene2d/ui/auto/AutomationItem.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.gdx.scene2d.ui.auto; 21 | 22 | import com.teotigraphix.caustk.core.osc.IAutomatableControl; 23 | import com.teotigraphix.caustk.core.osc.OSCUtils; 24 | 25 | public class AutomationItem { 26 | 27 | private IAutomatableControl control; 28 | 29 | private String label; 30 | 31 | private float min; 32 | 33 | private float max; 34 | 35 | private float value; 36 | 37 | private float step = 0.01f; 38 | 39 | public IAutomatableControl getControl() { 40 | return control; 41 | } 42 | 43 | public String getLabel() { 44 | return label; 45 | } 46 | 47 | public float getMin() { 48 | return min; 49 | } 50 | 51 | public float getMax() { 52 | return max; 53 | } 54 | 55 | public float getValue() { 56 | return value; 57 | } 58 | 59 | public void setValue(float value) { 60 | this.value = value; 61 | } 62 | 63 | public float getStep() { 64 | return step; 65 | } 66 | 67 | public AutomationItem(IAutomatableControl control) { 68 | this.control = control; 69 | this.label = OSCUtils.optimizeName(control.getDisplayName(), 7); 70 | this.min = control.getMin(); 71 | this.max = control.getMax(); 72 | this.value = control.getDefaultValue(); 73 | } 74 | 75 | public static AutomationItem create(IAutomatableControl control) { 76 | return new AutomationItem(control); 77 | } 78 | 79 | @Override 80 | public String toString() { 81 | return "AutomationItem [control=" + control + ", label=" + label + ", min=" + min 82 | + ", max=" + max + ", value=" + value + "]"; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /Caustk/src/com/teotigraphix/caustk/utils/node/PresetUtils.java: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | // Copyright 2014 Michael Schmalle - Teoti Graphix, LLC 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License 15 | // 16 | // Author: Michael Schmalle, Principal Architect 17 | // mschmalle at teotigraphix dot com 18 | //////////////////////////////////////////////////////////////////////////////// 19 | 20 | package com.teotigraphix.caustk.utils.node; 21 | 22 | import java.io.File; 23 | import java.io.IOException; 24 | 25 | import org.apache.commons.io.FileUtils; 26 | 27 | import com.teotigraphix.caustk.core.ICaustkRack; 28 | import com.teotigraphix.caustk.core.osc.SynthMessage; 29 | import com.teotigraphix.caustk.node.machine.MachineType; 30 | import com.teotigraphix.caustk.node.machine.patch.PresetChannel; 31 | import com.teotigraphix.caustk.utils.core.RuntimeUtils; 32 | 33 | /** 34 | * {@link PresetChannel} utilities. 35 | * 36 | * @author Michael Schmalle 37 | * @since 1.0 38 | */ 39 | public final class PresetUtils { 40 | 41 | public static byte[] readPresetBytes(ICaustkRack caustkRack, int machineIndex, 42 | MachineType machineType, String tempPresetName) { 43 | SynthMessage.SAVE_PRESET.send(caustkRack, machineIndex, tempPresetName); 44 | 45 | // get the preset file from the caustic presets directory 46 | File presetFile = PresetUtils.toPresetFile(machineType, tempPresetName); 47 | if (!presetFile.exists()) 48 | throw new RuntimeException("Error saving preset file to: " + presetFile); 49 | 50 | // read into the data byte array 51 | byte[] data = null; 52 | try { 53 | data = FileUtils.readFileToByteArray(presetFile); 54 | } catch (IOException e) { 55 | throw new RuntimeException(e); 56 | } 57 | 58 | // delete the temp preset file 59 | FileUtils.deleteQuietly(presetFile); 60 | return data; 61 | } 62 | 63 | public static File toPresetFile(MachineType machineType, String presetName) { 64 | return RuntimeUtils.getPresetsFile(machineType, presetName); 65 | } 66 | } 67 | --------------------------------------------------------------------------------