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 extends ICommand> 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