From 834ebcf0b5c0b8c500e87d7f45d8145418b20a4d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 22 Oct 2013 10:45:48 +0200 Subject: [PATCH] add new gui option to save a screenshot, rename screenshot name --- ChangeLog | 1 + .../java/com/neophob/sematrix/glue/Collector.java | 14 +++++++------- .../neophob/sematrix/output/gui/GeneratorGui.java | 8 ++++++++ .../neophob/sematrix/output/gui/GuiElement.java | 1 + .../sematrix/output/gui/P5EventListener.java | 4 ++++ .../sematrix/output/gui/messages.properties | 2 ++ 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14ff759c..277fe170 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ Changelog v1.4.1 to v1.5.0 -Add Textwriter option (PingPong scrolling, left scrolling) -Add new Minimum and Maximum Mixer -Add new keyboard shortcut to select tabs (arrow keys) +-Add new GUI option to save screenshot of all visuals -Add missing option 'snake cabling' and 'mapping' for TPM2.Net device -Add missing option 'snake cabling' and 'mapping' for Artnet/E1.31 devices -Add multipanel support for Artnet/E1.31 output diff --git a/src/main/java/com/neophob/sematrix/glue/Collector.java b/src/main/java/com/neophob/sematrix/glue/Collector.java index a9a62fad..a9400414 100644 --- a/src/main/java/com/neophob/sematrix/glue/Collector.java +++ b/src/main/java/com/neophob/sematrix/glue/Collector.java @@ -370,19 +370,19 @@ public int getNrOfScreens() { */ public void saveScreenshot() { int ofs=0; - String suffix = frames+".png"; + String suffix = ".png"; for (Visual v: allVisuals) { - String prefix = "screenshot/"+ofs; + String prefix = "screenshot/"+frames+"-"+ofs+"-"; PImage p = v.getGeneratorAsImage(0); - p.save(prefix+"-gen1-"+suffix); + p.save(prefix+"gen1"+suffix); p=v.getGeneratorAsImage(1); - p.save(prefix+"-gen2-"+suffix); + p.save(prefix+"gen2"+suffix); p=v.getEffectAsImage(0); - p.save(prefix+"-fx1-"+suffix); + p.save(prefix+"fx1"+suffix); p=v.getEffectAsImage(1); - p.save(prefix+"-fx2-"+suffix); + p.save(prefix+"fx2"+suffix); p=v.getMixerAsImage(); - p.save(prefix+"-mix-"+suffix); + p.save(prefix+"mix"+suffix); ofs++; } } diff --git a/src/main/java/com/neophob/sematrix/output/gui/GeneratorGui.java b/src/main/java/com/neophob/sematrix/output/gui/GeneratorGui.java index 45139635..afcc446e 100644 --- a/src/main/java/com/neophob/sematrix/output/gui/GeneratorGui.java +++ b/src/main/java/com/neophob/sematrix/output/gui/GeneratorGui.java @@ -665,6 +665,14 @@ public void setup() { int ibsX= col.getPixelControllerGenerator().getGenerator(0).getInternalBufferXSize(); int ibsY= col.getPixelControllerGenerator().getGenerator(0).getInternalBufferYSize(); cp5.addTextlabel("nfoInternalBuffer", Messages.getString("GeneratorGui.INFO_INTERNAL_BUFFERSIZE")+ibsX+"/"+ibsY, nfoXPos, nfoYPos).moveTo(infoTab).getValueLabel(); //$NON-NLS-1$ //$NON-NLS-2$ + nfoYPos+=yposAdd; + + Button saveScreenshot = cp5.addButton(GuiElement.SAVE_SCREENSHOT.guiText(), 0, + nfoXPos, nfoYPos, 110, 15); + saveScreenshot.setCaptionLabel(Messages.getString("GeneratorGui.SAVE_SCREENSHOT")); //$NON-NLS-1$ + saveScreenshot.moveTo(infoTab); + cp5.getTooltip().register(GuiElement.SAVE_SCREENSHOT.guiText(), Messages.getString("GeneratorGui.TOOLTIP_SAVE_SCREENSHOT")); //$NON-NLS-1$ + nfoXPos += xposAdd; nfoYPos = yPosStartDrowdown+20; diff --git a/src/main/java/com/neophob/sematrix/output/gui/GuiElement.java b/src/main/java/com/neophob/sematrix/output/gui/GuiElement.java index 6f775a2a..236031bd 100644 --- a/src/main/java/com/neophob/sematrix/output/gui/GuiElement.java +++ b/src/main/java/com/neophob/sematrix/output/gui/GuiElement.java @@ -72,6 +72,7 @@ public enum GuiElement { LOAD_PRESET, SAVE_PRESET, + SAVE_SCREENSHOT ; /** diff --git a/src/main/java/com/neophob/sematrix/output/gui/P5EventListener.java b/src/main/java/com/neophob/sematrix/output/gui/P5EventListener.java index 850caca7..1c331927 100644 --- a/src/main/java/com/neophob/sematrix/output/gui/P5EventListener.java +++ b/src/main/java/com/neophob/sematrix/output/gui/P5EventListener.java @@ -267,6 +267,10 @@ public void controlEvent(ControlEvent theEvent) { createMessage(ValidCommands.CHANGE_BRIGHTNESS, brightness); break; + case SAVE_SCREENSHOT: + createMessage(ValidCommands.SCREENSHOT, ""); + break; + default: LOG.log(Level.INFO, "Invalid Object: "+selection+", Value: "+value); break; diff --git a/src/main/java/com/neophob/sematrix/output/gui/messages.properties b/src/main/java/com/neophob/sematrix/output/gui/messages.properties index 4f8c8d07..2b2b15f8 100644 --- a/src/main/java/com/neophob/sematrix/output/gui/messages.properties +++ b/src/main/java/com/neophob/sematrix/output/gui/messages.properties @@ -106,3 +106,5 @@ GeneratorGui.TEXTWRITER_PINGPONG=PingPong GeneratorGui.TEXTWRITER_LEFT=Left GeneratorGui.INFO_WINDOW_HEIGHT=Window Height: GeneratorGui.INFO_INTERNAL_BUFFERSIZE=Internal Buffersize: +GeneratorGui.SAVE_SCREENSHOT=Save Screenshot +GeneratorGui.TOOLTIP_SAVE_SCREENSHOT=Save current Visuals into the Screenshot directory \ No newline at end of file