Package org.emrick.project
Class MediaEditorGUI
java.lang.Object
java.awt.Component
org.emrick.project.MediaEditorGUI
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,DevModeHost,EffectListener,RFTriggerListener,FootballFieldListener,ImportListener,LEDConfigListener,ReplaceFilesListener,RequestCompleteListener,RFSignalListener,ScrubBarListener,SelectListener,SyncListener,TimelineListener,UserAuthListener
public class MediaEditorGUI
extends Component
implements ImportListener, ScrubBarListener, SyncListener, FootballFieldListener, EffectListener, SelectListener, UserAuthListener, RFTriggerListener, RFSignalListener, RequestCompleteListener, LEDConfigListener, ReplaceFilesListener, TimelineListener, DevModeHost
Main class of Emrick Designer.
Contains all GUI elements and logic for light show design and Emrick board interaction
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static final recordprivate classRunnable object used to split the load of packet export.private classTask used by the playback timer to repeatedly repaint the footballfieldpanel with new frames in fps mode.private static classHolds the ordered packet segments (and target strip) for one hardware preview run.private classObject used to track the progress of programming led strips using the web serverNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanfinal intprivate final Timerfinal intprivate Effectprivate Fileprivate Effectprivate intintfinal intprivate TimeManagerprivate Containerprivate DeveloperModeGUIprivate JMenuItemfinal intfinal intprivate EffectGUIprivate EffectManagerprivate JPanelprivate Filestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate final com.google.gson.Gsonprivate JMenuItemprivate FlowViewGUIprivate JPanelprivate FootballFieldBackgroundprivate FootballFieldPanelprivate final JFrameprivate SelectionGroupGUIprivate final com.google.gson.Gsonprivate HardwareStatusIndicatorprivate JSplitPanefinal intprivate longprivate LEDConfigurationGUIprivate LEDStripViewGUIfinal intprivate Stringprivate JPanelprivate static intprivate Timerprivate Stringprivate floatprivate Timerprivate intprivate SerialTransmitterprivate Timerfinal intprivate JProgressBar(package private) JLabelprivate Stringprivate RFTriggerGUIprivate JMenuItemprivate JMenuItemprivate Stringprivate ScrubBarGUIprivate JPanelprivate EffectListprivate HttpServerfinal intprivate booleanprivate JCheckBoxMenuItemprivate Stringprivate floatprivate JMenuItemprivate JMenuItemprivate final JLabelprivate TimelineGUIprivate JPanelprivate TimeManagerprivate ArrayList<SyncTimeGUI.Pair>private intfinal intfinal intprivate final Pathprivate booleanprivate Colorfinal intprivate JSplitPane(package private) JFrameprivate WindowListenerFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidApplies a default led configuration to all performersprivate voidprivate voidapplyImportedDrill(Drill importedDrill) private voidapplyLoadedProject(MediaEditorGUI.LoadedProjectData loadedProjectData) private voidapplyLoadedProjectPhaseOne(MediaEditorGUI.LoadedProjectData loadedProjectData) private voidprivate voidapplyLoadedProjectPhaseTwo(MediaEditorGUI.LoadedProjectData loadedProjectData) private voidprivate MediaEditorGUI.PreviewPlanbuildPreviewPlan(Effect effect) Builds the ordered list of packet segments for previewing the given effect on hardware.private ProjectFilebuildProjectFile(ArrayList<File> archivePaths) Builds the serializable project exactly as it is written to the .emrick file.private voidLoads the ScrubBarGUI Panel if it has not been created, or refreshes it if it already exists.private JPanelbuildWelcomePanel(MediaEditorGUI mediaEditorGUI) Build the welcome panel displayed when no project is loaded.comPortPrompt(String type) Used to get a Serial Transmitter object.private voidprivate voidconcatenateProject(File path) private voidBuilds all major GUI elements and adds them to the main frame.private org.apache.poi.ss.usermodel.CellStylecreateBorderStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle left, org.apache.poi.ss.usermodel.BorderStyle right, org.apache.poi.ss.usermodel.BorderStyle top, org.apache.poi.ss.usermodel.BorderStyle bottom) private org.apache.poi.ss.usermodel.CellStylecreateChecklistCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle left, org.apache.poi.ss.usermodel.BorderStyle right, org.apache.poi.ss.usermodel.BorderStyle top, org.apache.poi.ss.usermodel.BorderStyle bottom) private EffectcreateDefaultEffectForPreview(EffectList effectType) Builds a fresh default effect of the given type, anchored at the current timeline position.private voidcreateEffectAtCurrentTime(EffectList effectType) Helper method to create a 16-count effect of the given type at the current timeline positionprivate static com.google.gson.GsoncreateFingerprintGson(com.google.gson.Gson projectGson) Project serializer for change detection.voidctrlGroupSelection(LEDStrip[] ledStrips) private StringHashes the project's show content, streamed so large shows aren't held in memory.private booleandeleteDirectory(File directoryToBeDeleted) Recursively empties and deletes the specified file/directory.private static voidRecursively deletes everything inside dir.private voidShows Developer Mode in place of the designer view, under the same menu bar.voidprivate voidexportBoardChecklistWorkbook(File selectedFile) private voidexportCsvFileForPerformerDeviceIDs(File selectedFile) Builds and exports a csv file containing configuration data for led strips and performersprivate voidexportPackets(File path) Multithreaded export of firmware-readable packet data to a .pkt file.private LEDStripfindN1LedStrip(Drill drill) Get audio playerprivate JComponentInitializes the Effect Options button and the effects popup menu and returns the Effect Options button.private intgetEffectTriggerIndex(Effect e, Long[] timesMS) Calculates the index of the RF Trigger immediately before the relevant effect.getFrame()doubleprivate intprivate TimeManagerA synthetic 120bpm (0.5s/count) timeline, used only when previewing effects with no project loaded.private org.apache.poi.ss.usermodel.RowgetOrCreateRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowIndex) private longCalculates and returns the frame length in millisecondslonggetPrevAudioPlayerDurations(int index) private StringgetSectionFromBoardLabel(String boardLabel) private booleanprivate byte[]hexToRgbBytes(String hex) private booleanbooleanprivate booleanprivate voidloadProject(File path) Loads a new .emrick file to the viewport to be edited.private MediaEditorGUI.LoadedProjectDataloadProjectData(File projectPath, Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer) Load recent projects from user folder.static voidMain method of Emrick Designer.private voidRecords the current project content as the saved state.private SerialTransmitteroldComPortPrompt(String type) Legacy method for hardware detection - kept as fallbackvoidonAudioImport(ArrayList<File> audioFiles) voidvoidonChangeSelectionMode(boolean isInnerSelect, HashSet<LEDStrip> strips) voidonConcatAudioImport(ArrayList<File> audioFiles) voidonCreateEffect(Effect effect) voidonCreateRFTrigger(RFTrigger rfTrigger) voidonDeleteEffect(Effect effect) voidonDeleteRFTrigger(int count) voidonDrillImport(String drill) voidvoidonFileSelect(ArrayList<File> archivePaths, File csvFile) voidonGroupSelection(LEDStrip[] ledStrips) voidonImport()voidonMultiSelect(HashSet<Integer> labels, HashSet<String> symbols) booleanonNewFileSelect(File drill, File archive) booleanonPause()voidvoidbooleanonPlay()voidonPressEffect(Effect effect) voidonPressRFTrigger(RFTrigger rfTrigger) voidonPreviewColorOnHardware(Color color) Holds a solid color on a connected Receiver indefinitely, for quick verification while picking colors.voidonPreviewOnHardware(Effect effect) Sends the given effect to a connected Receiver board for a live, on-hardware preview.voidonRequestComplete(int id) voidvoidonRFSignal(int i) LEDStrip[]longonScrub()voidonSetChange(int setIndex) voidonSpeedChange(float playbackSpeed) voidReturns a connected Receiver's LEDs to idle and exits its preview mode, if it was previewing.voidonSync(ArrayList<SyncTimeGUI.Pair> times, float startDelay) voidonTimeChange(long time) voidonTimelineScrub(double count) Called when the timeline is scrubbed to a specific countvoidonUpdateEffect(Effect oldEffect, Effect newEffect) voidonUpdateEffectPanel(Effect effect, boolean isNew, int index) voidvoidonUpdateRFTrigger(RFTrigger rfTrigger, int count) voidonUserLoggedIn(String username) private voidOpens the Outlook-style "Preview Effect" window: a fixed list of effect types on the left, and the selected type's edit panel (with a timeline-box preview above it) filling the rest.private voidOpens a prompt for the user to select a project to open.voidLeaves Developer Mode, lets the user open a project, and comes back to Developer Mode once it's loaded.private voidparseCsvFileForPerformerDeviceIDs(File inputFile) Imports a configuration csv file and applies the config to an open project.private voidparseCsvFileForPerformerDeviceIDs(Drill drill, File inputFile) private voidBegin playing audio in sync with the drill playbackprivate voidplayPreviewSegment(MediaEditorGUI.PreviewPlan plan, int index) Sends one segment of a (possibly multi-segment, e.g.private Stringprivate voidprepareDrillForLoadedProject(Drill drill, Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer) private voidprepareLoadedProjectDataForUi(MediaEditorGUI.LoadedProjectData loadedProjectData, Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer) private voidpublishLoading(Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer, String title, String detail) private voidRebuilds the map of set labels to set start counts that is used in ScrubBarGUI.private voidprivate voidrecoverGridEffectState(Drill drill) private voidrecoverGridEffectState(Drill drill, Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer) private voidRemoves the flow viewer from the main content panel and restores the run menu to be used againprivate voidreplaceEffectView(JComponent center, JComponent south) Atomically replace the effect view center and south components so only the desired panels are visible.private voidreplaceMainView(JComponent center, JComponent south) Atomically replace the main content center and south components so only the desired panels are visible.private voidrunOnEdtAndWait(Runnable runnable) private voidPrompts the user for information and then starts a web server using this informationprivate voidPrompts the user for a location to save the current project.private voidsaveProject(File path, ArrayList<File> archivePaths) Save the current project to a .emrick file.private voidAttempts to save the project to a file.private voidsavePropertiesToFile(Properties props, File configFile, String dataDir, String packetsDir, String csvFile, String showToken, String verificationColor, String marcherLabel) private voidsaveRecentProjects(List<File> list) private voidsetupEffectView(ArrayList<Integer> ids) Initializes the effect panel and its dependenciesprivate static voidSets up the look and feel of the application based on the user's OS theme.private voidPuts the designer view back in place of Developer Mode (after Developer Mode has been shut down).private voidDisplay an error message to the user that indicates an RF Trigger has not been placed yet.private voidOpens a color-chooser dialog that holds a solid color on a connected Receiver indefinitely (until a new color is sent, or the dialog is closed), replacing the old one-shot Check Color.private voidstartPhasedProjectApply(MediaEditorGUI.LoadedProjectData loadedProjectData, ThemedLoadingDialog loadingDialog) private voidStops the currently running web server, restores the run menu to be used again, and cleans the filesystem of any files created by the web serverprivate voidprivate longtimeAfterEffect(int index, Effect e, ArrayList<Effect> effects, Long[] timesMS) Calculates the time between the end of the current effect and the start of the next effect/RF Trigger.private longtimeBeforeEffect(int index, Effect e, ArrayList<Effect> effects, Long[] timesMS) Calculates the time between the end of the previous effect/RF Trigger and the start of the current effect.private booleanChecks that a saved time sync has a duration for every set TimeManager will look up (all but the last).private static Stringprivate voidupdateEffectViewPanel(EffectList effectType, Effect effect) Update the effect panel to display the currently selected effectprivate voidShows the name of the currently open project file in the window title bar.private voidupdateProgressLabel(JLabel label, Set<Integer> newlyProgrammed, Set<Integer> previouslyProgrammed, int totalBoards) private voidUpdate the timeline panel to show data relevant to the currently selected performers.private voidwriteSysMsg(String msg) Writes a system message in the top right of the screenprivate voidRunning a show takes priority over Developer Mode: close it (its features let go of the transmitter and any other ports) and bring back the designer view before the show starts.Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
-
Field Details
-
FILE_MENU_CONCATENATE
- See Also:
-
FILE_MENU_NEW_PROJECT
- See Also:
-
FILE_MENU_OPEN_PROJECT
- See Also:
-
FILE_MENU_SAVE
- See Also:
-
FILE_MENU_SAVE_AS
- See Also:
-
frame
-
windowListener
-
mainContentPanel
-
footballField
-
footballFieldPanel
-
footballFieldBackground
-
ledConfigurationGUI
-
timelineGUI
-
effectGUI
-
groupsGUI
-
rfTriggerGUI
-
flowViewGUI
-
ledStripViewGUI
-
scrubBarGUI
-
scrubBarPanel
-
effectViewPanel
-
showAllEffects
private boolean showAllEffects -
timelinePanel
-
hSplitPane
-
vSplitPane
-
sysMsg
-
clearSysMsg
-
gson
private final com.google.gson.Gson gson -
fingerprintGson
private final com.google.gson.Gson fingerprintGson -
userHome
-
audioPlayers
-
currentAudioPlayer
-
canSeekAudio
private boolean canSeekAudio -
effectManager
-
currentEffect
-
copiedEffect
-
selectedEffectType
-
DEFAULT_FUNCTION
public final int DEFAULT_FUNCTION- See Also:
-
USE_DURATION
public final int USE_DURATION- See Also:
-
SET_TIMEOUT
public final int SET_TIMEOUT- See Also:
-
DO_DELAY
public final int DO_DELAY- See Also:
-
INSTANT_COLOR
public final int INSTANT_COLOR- See Also:
-
PROGRAMMING_MODE
public final int PROGRAMMING_MODE- See Also:
-
USE_COLORS
public final int USE_COLORS- See Also:
-
DIRECTION
public final int DIRECTION- See Also:
-
LIGHT_BOARD
public final int LIGHT_BOARD- See Also:
-
CONTINUOUS
public final int CONTINUOUS- See Also:
-
VERIFY
public final int VERIFY- See Also:
-
CHECK_LR
public final int CHECK_LR- See Also:
-
count2RFTrigger
-
timeManager
-
timeSync
-
projectLoadWarning
-
useStartDelay
private boolean useStartDelay -
startDelay
private float startDelay -
playbackSpeed
private float playbackSpeed -
playbackTimer
-
currentMovement
public int currentMovement -
server
-
ssid
-
password
-
port
private int port -
currentID
private int currentID -
MAX_CONNECTIONS
private static int MAX_CONNECTIONS -
lastRun
private long lastRun -
token
private int token -
verificationColor
-
noRequestTimer
-
requestIDs
-
runWebServer
-
stopWebServer
-
programmingTracker
-
programmingProgressBar
-
programmingProgressLabel
JLabel programmingProgressLabel -
runShowItem
-
flowViewerItem
-
stopShowItem
-
showIndividualView
-
archivePaths
-
emrickPath
-
savedProjectFingerprint
-
loggedInUsername
-
csvFile
-
hardwareStatusIndicator
-
developerModeGUI
-
designerContentPane
-
developerModeItem
-
previewReceiver
-
previewSequenceTimer
-
webServerFrame
JFrame webServerFrame -
defaultPreviewTimeManager
-
-
Constructor Details
-
MediaEditorGUI
Constructor for MediaEditorGUI- Parameters:
file- - Used when starting the application via opening a file via an associated type. Otherwise, this can be left as an empty string.
-
-
Method Details
-
main
Main method of Emrick Designer.- Parameters:
args- - Only used when opening the application via an associated file type rather than an executable
-
getPlaybackTimerTimeByCounts
private long getPlaybackTimerTimeByCounts()Calculates and returns the frame length in milliseconds- Returns:
- - Time in milliseconds the timer should wait between frames
-
deleteDirectoryContents
Recursively deletes everything inside dir. Files that can't be deleted (e.g. audio still held open by another running Emrick Designer) are skipped rather than retried, so this always finishes. -
setupLookAndFeel
private static void setupLookAndFeel()Sets up the look and feel of the application based on the user's OS theme. -
createAndShowGUI
private void createAndShowGUI()Builds all major GUI elements and adds them to the main frame. This method should be called on startup and on project loading when another project is already loaded. -
buildDesignerGUI
private void buildDesignerGUI() -
savePropertiesToFile
-
deleteDirectory
Recursively empties and deletes the specified file/directory.- Parameters:
directoryToBeDeleted- - File or directory that should be emptied and/or deleted- Returns:
- true - if the directory was deleted successfully. false - otherwise
-
getEffectOptionsButton
Initializes the Effect Options button and the effects popup menu and returns the Effect Options button.- Returns:
- JButton button that displays a popup menu with all the effect options when pressed
-
createEffectAtCurrentTime
Helper method to create a 16-count effect of the given type at the current timeline position -
openPreviewEffectWindow
private void openPreviewEffectWindow()Opens the Outlook-style "Preview Effect" window: a fixed list of effect types on the left, and the selected type's edit panel (with a timeline-box preview above it) filling the rest. Its built-in "Preview on Hardware" button sends live packets to a connected Receiver. Works even without a project loaded (falls back to a synthetic 120bpm timeline); Grid is excluded since it has no single-strip preview. -
createDefaultEffectForPreview
Builds a fresh default effect of the given type, anchored at the current timeline position. -
showPreviewColorDialog
private void showPreviewColorDialog()Opens a color-chooser dialog that holds a solid color on a connected Receiver indefinitely (until a new color is sent, or the dialog is closed), replacing the old one-shot Check Color. -
comPortPrompt
Used to get a Serial Transmitter object. Now uses the hardware status indicator instead of prompting the user each time.- Parameters:
type- The type of hardware that should be detected ("Transmitter" or "Receiver").- Returns:
- A SerialTransmitter object for the specified type. If no hardware of the requested type is available, this method returns null.
-
portsHeldByDeveloperMode
- Returns:
- a note naming any units Developer Mode currently has open, or "" if none
-
comPortPromptFlow
-
oldComPortPrompt
Legacy method for hardware detection - kept as fallback -
removeFlowViewer
private void removeFlowViewer()Removes the flow viewer from the main content panel and restores the run menu to be used again -
stopServer
private void stopServer()Stops the currently running web server, restores the run menu to be used again, and cleans the filesystem of any files created by the web server -
runServer
Prompts the user for information and then starts a web server using this information- Parameters:
path- A path to the .pkt file whose contents should be served by the web server.
-
updateProgressLabel
-
loadProject
Loads a new .emrick file to the viewport to be edited.- Parameters:
path- Path pointing to the intended .emrick file
-
loadProjectData
private MediaEditorGUI.LoadedProjectData loadProjectData(File projectPath, Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer) -
prepareLoadedProjectDataForUi
private void prepareLoadedProjectDataForUi(MediaEditorGUI.LoadedProjectData loadedProjectData, Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer) -
prepareDrillForLoadedProject
private void prepareDrillForLoadedProject(Drill drill, Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer) -
startPhasedProjectApply
private void startPhasedProjectApply(MediaEditorGUI.LoadedProjectData loadedProjectData, ThemedLoadingDialog loadingDialog) -
applyLoadedProject
-
applyLoadedProjectPhaseOne
-
applyLoadedProjectPhaseTwo
-
timeSyncCoversDrillSets
Checks that a saved time sync has a duration for every set TimeManager will look up (all but the last). A sync saved against a different drill would otherwise crash the load, so the project is opened un-synced instead and the user is told to re-sync. -
applyLoadedProjectPhaseThree
private void applyLoadedProjectPhaseThree() -
recoverGridEffectState
private void recoverGridEffectState() -
recoverGridEffectState
-
recoverGridEffectState
private void recoverGridEffectState(Drill drill, Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer) -
publishLoading
private void publishLoading(Consumer<ThemedLoadingDialog.StatusUpdate> progressConsumer, String title, String detail) -
concatenateProject
-
getMovementIndex
private int getMovementIndex() -
buildScrubBarPanel
private void buildScrubBarPanel()Loads the ScrubBarGUI Panel if it has not been created, or refreshes it if it already exists. -
onMultiSelect
- Specified by:
onMultiSelectin interfaceSelectListener
-
onGroupSelection
- Specified by:
onGroupSelectionin interfaceSelectListener
-
ctrlGroupSelection
- Specified by:
ctrlGroupSelectionin interfaceSelectListener
-
onSaveGroup
- Specified by:
onSaveGroupin interfaceSelectListener
-
onUpdateGroup
public void onUpdateGroup()- Specified by:
onUpdateGroupin interfaceSelectListener
-
exportCsvFileForPerformerDeviceIDs
Builds and exports a csv file containing configuration data for led strips and performersFormat:
The first line contains headers and the last element contains the expected number of led strips.
A new performer starts on a new line where its label (Ex. "R31") is written as the first element
Below each performer label will be a list of all of this performer's led strips, each line beginning with an empty element. The led strips lines will contain their label, id, and a set of configuration data.
Ex. ",226,R31L,50,12,6,-6,-6"
- Parameters:
selectedFile- The desired file location to write the csv file.
-
exportBoardChecklistWorkbook
-
getOrCreateRow
private org.apache.poi.ss.usermodel.Row getOrCreateRow(org.apache.poi.ss.usermodel.Sheet sheet, int rowIndex) -
getSectionFromBoardLabel
-
isGdsUnit
-
hexToRgbBytes
-
createChecklistCellStyle
private org.apache.poi.ss.usermodel.CellStyle createChecklistCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle left, org.apache.poi.ss.usermodel.BorderStyle right, org.apache.poi.ss.usermodel.BorderStyle top, org.apache.poi.ss.usermodel.BorderStyle bottom) -
createBorderStyle
private org.apache.poi.ss.usermodel.CellStyle createBorderStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.BorderStyle left, org.apache.poi.ss.usermodel.BorderStyle right, org.apache.poi.ss.usermodel.BorderStyle top, org.apache.poi.ss.usermodel.BorderStyle bottom) -
applyDefaultLEDConfiguration
private void applyDefaultLEDConfiguration()Applies a default led configuration to all performers -
applyDefaultLEDConfiguration
-
parseCsvFileForPerformerDeviceIDs
Imports a configuration csv file and applies the config to an open project.- Parameters:
inputFile- csv configuration file
-
parseCsvFileForPerformerDeviceIDs
-
openProjectDialog
private void openProjectDialog()Opens a prompt for the user to select a project to open. -
enterDeveloperMode
private void enterDeveloperMode()Shows Developer Mode in place of the designer view, under the same menu bar. The project stays loaded so its board list can be used for lookups, and File > Open still works while Developer Mode is showing. -
exitDeveloperMode
public void exitDeveloperMode()- Specified by:
exitDeveloperModein interfaceDevModeHost
-
isShowRunning
private boolean isShowRunning()- Returns:
- true while a show is being run from the Run menu
-
yieldDeveloperModeForShow
private void yieldDeveloperModeForShow()Running a show takes priority over Developer Mode: close it (its features let go of the transmitter and any other ports) and bring back the designer view before the show starts. Receivers being flashed keep flashing. -
showDesignerView
private void showDesignerView()Puts the designer view back in place of Developer Mode (after Developer Mode has been shut down). -
syncDeveloperModeItem
private void syncDeveloperModeItem() -
getFrame
- Specified by:
getFramein interfaceDevModeHost
-
getLedStrips
- Specified by:
getLedStripsin interfaceDevModeHost- Returns:
- the open project's LED strips (board ID, label, LED count), or an empty list if no project is open
-
openProjectForDevMode
public void openProjectForDevMode()Description copied from interface:DevModeHostLeaves Developer Mode, lets the user open a project, and comes back to Developer Mode once it's loaded.- Specified by:
openProjectForDevModein interfaceDevModeHost
-
concatenateDialog
private void concatenateDialog() -
hasUnsavedChanges
private boolean hasUnsavedChanges()- Returns:
- true if the open project differs from what was last saved or loaded, or has never been saved. Compares the actual project content, so edits that were undone, and changes outside the undo history (RF triggers, time sync, LED setup, groups), are judged correctly.
-
markProjectSaved
private void markProjectSaved()Records the current project content as the saved state. -
currentProjectFingerprint
Hashes the project's show content, streamed so large shows aren't held in memory. Uses fingerprintGson so viewing the show (scrubbing, exporting packets) doesn't count as a change. -
createFingerprintGson
private static com.google.gson.Gson createFingerprintGson(com.google.gson.Gson projectGson) Project serializer for change detection. It ignores state that changes just from viewing the show: performer positions (updated while scrubbing) and the order of each strip's effects (packet export sorts them in place; playback and export only depend on effect times). -
saveProjectDialog
private void saveProjectDialog()Attempts to save the project to a file. If the currently open project is a new project, the user will be prompted to specify a save location before the project is saved. -
saveAsProjectDialog
private void saveAsProjectDialog()Prompts the user for a location to save the current project. -
onBeginImport
public void onBeginImport()- Specified by:
onBeginImportin interfaceImportListener
-
onImport
public void onImport()- Specified by:
onImportin interfaceImportListener
-
onFileSelect
- Specified by:
onFileSelectin interfaceImportListener
-
onAudioImport
- Specified by:
onAudioImportin interfaceImportListener
-
onConcatAudioImport
- Specified by:
onConcatAudioImportin interfaceImportListener
-
onDrillImport
- Specified by:
onDrillImportin interfaceImportListener
-
applyImportedDrill
-
runOnEdtAndWait
-
rebuildPageTabCounts
private void rebuildPageTabCounts()Rebuilds the map of set labels to set start counts that is used in ScrubBarGUI. -
onSync
- Specified by:
onSyncin interfaceSyncListener
-
setupEffectView
Initializes the effect panel and its dependencies- Parameters:
ids- List of effect ids
-
onPlay
public boolean onPlay()- Specified by:
onPlayin interfaceScrubBarListener
-
onPause
public boolean onPause()- Specified by:
onPausein interfaceScrubBarListener
-
onScrub
public long onScrub()- Specified by:
onScrubin interfaceScrubBarListener
-
onTimeChange
public void onTimeChange(long time) - Specified by:
onTimeChangein interfaceScrubBarListener
-
onSetChange
public void onSetChange(int setIndex) - Specified by:
onSetChangein interfaceScrubBarListener
-
playAudioFromCorrectPosition
private void playAudioFromCorrectPosition()Begin playing audio in sync with the drill playback -
getPrevAudioPlayerDurations
public long getPrevAudioPlayerDurations(int index) -
onSpeedChange
public void onSpeedChange(float playbackSpeed) - Specified by:
onSpeedChangein interfaceScrubBarListener
-
onUserLoggedIn
- Specified by:
onUserLoggedInin interfaceUserAuthListener
-
updateFrameTitle
private void updateFrameTitle()Shows the name of the currently open project file in the window title bar. Call whenever emrickPath or the open project changes. -
showEffectBeforeFirstTriggerError
private void showEffectBeforeFirstTriggerError()Display an error message to the user that indicates an RF Trigger has not been placed yet. -
onCreateEffect
- Specified by:
onCreateEffectin interfaceEffectListener
-
onUpdateEffect
- Specified by:
onUpdateEffectin interfaceEffectListener
-
onDeleteEffect
- Specified by:
onDeleteEffectin interfaceEffectListener
-
onUpdateEffectPanel
- Specified by:
onUpdateEffectPanelin interfaceEffectListener
-
onChangeSelectionMode
- Specified by:
onChangeSelectionModein interfaceEffectListener
-
onInnerSelectionRequired
- Specified by:
onInnerSelectionRequiredin interfaceEffectListener
-
onSelectionRequired
- Specified by:
onSelectionRequiredin interfaceEffectListener
-
onTimeRequired
- Specified by:
onTimeRequiredin interfaceEffectListener
-
getOrCreateDefaultPreviewTimeManager
A synthetic 120bpm (0.5s/count) timeline, used only when previewing effects with no project loaded. -
onPerformerSelect
public void onPerformerSelect()- Specified by:
onPerformerSelectin interfaceFootballFieldListener
-
onPerformerDeselect
public void onPerformerDeselect()- Specified by:
onPerformerDeselectin interfaceFootballFieldListener
-
onTimelineScrub
public void onTimelineScrub(double count) Description copied from interface:TimelineListenerCalled when the timeline is scrubbed to a specific count- Specified by:
onTimelineScrubin interfaceTimelineListener- Parameters:
count- The count position that was scrubbed to
-
onCreateRFTrigger
- Specified by:
onCreateRFTriggerin interfaceRFTriggerListener
-
onUpdateRFTrigger
- Specified by:
onUpdateRFTriggerin interfaceRFTriggerListener
-
onDeleteRFTrigger
public void onDeleteRFTrigger(int count) - Specified by:
onDeleteRFTriggerin interfaceRFTriggerListener
-
onPressRFTrigger
- Specified by:
onPressRFTriggerin interfaceRFTriggerListener
-
onResizeBackground
public void onResizeBackground()- Specified by:
onResizeBackgroundin interfaceFootballFieldListener
-
getFrameRate
public double getFrameRate()- Specified by:
getFrameRatein interfaceFootballFieldListener
-
isPlaying
public boolean isPlaying()- Specified by:
isPlayingin interfaceFootballFieldListener
-
onPressEffect
- Specified by:
onPressEffectin interfaceEffectListener
-
onPreviewOnHardware
Description copied from interface:EffectListenerSends the given effect to a connected Receiver board for a live, on-hardware preview.- Specified by:
onPreviewOnHardwarein interfaceEffectListener
-
playPreviewSegment
Sends one segment of a (possibly multi-segment, e.g. Wave/Ripple) previewed effect, then schedules the next segment to fire once this one's own duration elapses. After the last segment, schedules an automatic stop instead of requiring the "Stop Preview" button. -
onStopHardwarePreview
public void onStopHardwarePreview()Description copied from interface:EffectListenerReturns a connected Receiver's LEDs to idle and exits its preview mode, if it was previewing.- Specified by:
onStopHardwarePreviewin interfaceEffectListener
-
onPreviewColorOnHardware
Description copied from interface:EffectListenerHolds a solid color on a connected Receiver indefinitely, for quick verification while picking colors.- Specified by:
onPreviewColorOnHardwarein interfaceEffectListener
-
buildPreviewPlan
Builds the ordered list of packet segments for previewing the given effect on hardware. Simple effect types generate exactly one segment; spatial/generated types (e.g. Wave) can decompose into several chained segments per strip, which are all collected here (sorted by start time) so the full animation plays instead of just its first slice. For spatial types, the drill's performer "1" (N1) in the first Set stands in for the connected Receiver. If no project/drill is loaded, spatial resolution is skipped and the effect is previewed directly, so hardware preview still works without a show open. -
findN1LedStrip
-
updateEffectViewPanel
Update the effect panel to display the currently selected effect- Parameters:
effectType- - The type of effect that is currently selected.
-
replaceEffectView
Atomically replace the effect view center and south components so only the desired panels are visible. Pass null for either argument to omit that region. -
replaceMainView
Atomically replace the main content center and south components so only the desired panels are visible. Pass null for either argument to omit that region. -
buildWelcomePanel
Build the welcome panel displayed when no project is loaded. Contains a clickable/open control and a list of recently opened projects. -
toHex
-
loadRecentProjects
Load recent projects from user folder. Only returns existing files. -
saveRecentProjects
-
addToRecentProjects
-
updateTimelinePanel
private void updateTimelinePanel()Update the timeline panel to show data relevant to the currently selected performers. -
saveProject
Save the current project to a .emrick file.- Parameters:
path- The file location to save the project.archivePaths- The locations of the .3dz files in user files when the project is loaded.
-
buildProjectFile
Builds the serializable project exactly as it is written to the .emrick file. -
timeBeforeEffect
Calculates the time between the end of the previous effect/RF Trigger and the start of the current effect.- Parameters:
index- Current RF Trigger indexe- Effect to find the time beforeeffects- List of effects on the relevant led striptimesMS- A list of times in milliseconds that RF Triggers occur- Returns:
- The time in milliseconds between the current effect and the previous effect/RF Trigger.
-
timeAfterEffect
Calculates the time between the end of the current effect and the start of the next effect/RF Trigger.- Parameters:
index- Current RF Trigger indexe- Effect to find the time beforeeffects- List of effects on the relevant led striptimesMS- A list of times in milliseconds that RF Triggers occur- Returns:
- The time in milliseconds between the current effect and the next effect/RF Trigger.
-
getEffectTriggerIndex
Calculates the index of the RF Trigger immediately before the relevant effect.- Parameters:
e- The relevant effect.timesMS- A list of times in milliseconds that RF Triggers occur- Returns:
- The index of the RF Trigger immediately before the relevant effect.
-
exportPackets
Multithreaded export of firmware-readable packet data to a .pkt file.- Parameters:
path- Location to write .pkt file.
-
writeSysMsg
Writes a system message in the top right of the screen- Parameters:
msg- Message to be written
-
onRFSignal
public void onRFSignal(int i) - Specified by:
onRFSignalin interfaceRFSignalListener
-
onRequestComplete
public void onRequestComplete(int id) - Specified by:
onRequestCompletein interfaceRequestCompleteListener
-
onExitConfig
public void onExitConfig()- Specified by:
onExitConfigin interfaceLEDConfigListener
-
onNewFileSelect
- Specified by:
onNewFileSelectin interfaceReplaceFilesListener
-
getAudioPlayers
Get audio player- Returns:
- AudioPlayer object
-